@metamask/snaps-execution-environments 0.38.0-flask.1 → 0.38.2-flask.1
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/CHANGELOG.md +21 -1
- package/dist/browserify/iframe/bundle.js +5 -5
- package/dist/browserify/iframe/index.html +45 -23
- package/dist/browserify/node-process/bundle.js +47 -25
- package/dist/browserify/node-thread/bundle.js +47 -25
- package/dist/browserify/offscreen/bundle.js +4 -4
- package/dist/browserify/offscreen/index.html +45 -23
- package/dist/browserify/worker-executor/bundle.js +50 -28
- package/dist/browserify/worker-pool/bundle.js +4 -4
- package/dist/browserify/worker-pool/index.html +45 -23
- package/dist/cjs/common/BaseSnapExecutor.js +1 -1
- package/dist/cjs/common/BaseSnapExecutor.js.map +1 -1
- package/dist/cjs/common/lockdown/lockdown-more.js +1 -1
- package/dist/cjs/common/lockdown/lockdown-more.js.map +1 -1
- package/dist/cjs/common/lockdown/lockdown.js +1 -1
- package/dist/cjs/common/lockdown/lockdown.js.map +1 -1
- package/dist/esm/common/BaseSnapExecutor.js +1 -1
- package/dist/esm/common/BaseSnapExecutor.js.map +1 -1
- package/dist/esm/common/lockdown/lockdown-more.js +1 -1
- package/dist/esm/common/lockdown/lockdown-more.js.map +1 -1
- package/dist/esm/common/lockdown/lockdown.js +1 -1
- package/dist/esm/common/lockdown/lockdown.js.map +1 -1
- package/package.json +15 -16
|
@@ -89,7 +89,6 @@
|
|
|
89
89
|
// security options are hard-coded at build time
|
|
90
90
|
const {
|
|
91
91
|
scuttleGlobalThis,
|
|
92
|
-
scuttleGlobalThisExceptions,
|
|
93
92
|
} = {}
|
|
94
93
|
|
|
95
94
|
function getGlobalRef () {
|
|
@@ -2519,7 +2518,7 @@ const evadeHtmlCommentTest= (src)=>{
|
|
|
2519
2518
|
// /////////////////////////////////////////////////////////////////////////////
|
|
2520
2519
|
$h_once.evadeHtmlCommentTest(evadeHtmlCommentTest);
|
|
2521
2520
|
const importPattern= new FERAL_REG_EXP(
|
|
2522
|
-
'(^|[^.])\\bimport(\\s*(?:\\(|/[/*]))',
|
|
2521
|
+
'(^|[^.]|\\.\\.\\.)\\bimport(\\s*(?:\\(|/[/*]))',
|
|
2523
2522
|
'g');
|
|
2524
2523
|
|
|
2525
2524
|
|
|
@@ -10957,7 +10956,6 @@ function observeImports(map, importName, importIndex) {
|
|
|
10957
10956
|
globalThisRefs,
|
|
10958
10957
|
// security options
|
|
10959
10958
|
scuttleGlobalThis,
|
|
10960
|
-
scuttleGlobalThisExceptions,
|
|
10961
10959
|
debugMode,
|
|
10962
10960
|
runWithPrecompiledModules,
|
|
10963
10961
|
reportStatsHook,
|
|
@@ -10985,7 +10983,6 @@ function observeImports(map, importName, importIndex) {
|
|
|
10985
10983
|
getExternalCompartment,
|
|
10986
10984
|
globalThisRefs,
|
|
10987
10985
|
scuttleGlobalThis,
|
|
10988
|
-
scuttleGlobalThisExceptions,
|
|
10989
10986
|
debugMode,
|
|
10990
10987
|
runWithPrecompiledModules,
|
|
10991
10988
|
reportStatsHook,
|
|
@@ -11004,8 +11001,7 @@ function observeImports(map, importName, importIndex) {
|
|
|
11004
11001
|
prepareModuleInitializerArgs,
|
|
11005
11002
|
getExternalCompartment,
|
|
11006
11003
|
globalThisRefs = ['globalThis'],
|
|
11007
|
-
scuttleGlobalThis =
|
|
11008
|
-
scuttleGlobalThisExceptions = [],
|
|
11004
|
+
scuttleGlobalThis = {},
|
|
11009
11005
|
debugMode = false,
|
|
11010
11006
|
runWithPrecompiledModules = false,
|
|
11011
11007
|
reportStatsHook = () => {},
|
|
@@ -11551,6 +11547,7 @@ module.exports = {
|
|
|
11551
11547
|
return module.exports
|
|
11552
11548
|
})()
|
|
11553
11549
|
|
|
11550
|
+
const scuttleOpts = generateScuttleOpts(scuttleGlobalThis)
|
|
11554
11551
|
const moduleCache = new Map()
|
|
11555
11552
|
const packageCompartmentCache = new Map()
|
|
11556
11553
|
const globalStore = new Map()
|
|
@@ -11559,22 +11556,11 @@ module.exports = {
|
|
|
11559
11556
|
const rootPackageCompartment = createRootPackageCompartment(globalRef)
|
|
11560
11557
|
|
|
11561
11558
|
// scuttle globalThis right after we used it to create the root package compartment
|
|
11562
|
-
if (
|
|
11563
|
-
if (!Array.isArray(
|
|
11564
|
-
throw new Error(`LavaMoat -
|
|
11559
|
+
if (scuttleOpts.enabled) {
|
|
11560
|
+
if (!Array.isArray(scuttleOpts.exceptions)) {
|
|
11561
|
+
throw new Error(`LavaMoat - scuttleGlobalThis.exceptions must be an array, got "${typeof scuttleOpts.exceptions}"`)
|
|
11565
11562
|
}
|
|
11566
|
-
|
|
11567
|
-
for (let i = 0; i < scuttleGlobalThisExceptions.length; i++) {
|
|
11568
|
-
const prop = scuttleGlobalThisExceptions[i]
|
|
11569
|
-
if (!prop.startsWith('/')) {
|
|
11570
|
-
continue
|
|
11571
|
-
}
|
|
11572
|
-
const parts = prop.split('/')
|
|
11573
|
-
const pattern = parts.slice(1, -1).join('/')
|
|
11574
|
-
const flags = parts[parts.length - 1]
|
|
11575
|
-
scuttleGlobalThisExceptions[i] = new RegExp(pattern, flags)
|
|
11576
|
-
}
|
|
11577
|
-
performScuttleGlobalThis(globalRef, scuttleGlobalThisExceptions)
|
|
11563
|
+
scuttleOpts.scuttlerFunc(globalRef, realm => performScuttleGlobalThis(realm, scuttleOpts.exceptions))
|
|
11578
11564
|
}
|
|
11579
11565
|
|
|
11580
11566
|
const kernel = {
|
|
@@ -11587,6 +11573,43 @@ module.exports = {
|
|
|
11587
11573
|
Object.freeze(kernel)
|
|
11588
11574
|
return kernel
|
|
11589
11575
|
|
|
11576
|
+
// generate final scuttling options (1) by taking default
|
|
11577
|
+
// options into consideration, (2) turning RE strings into
|
|
11578
|
+
// actual REs and (3) without mutating original opts object
|
|
11579
|
+
function generateScuttleOpts(originalOpts) {
|
|
11580
|
+
const defaultOpts = {
|
|
11581
|
+
enabled: true,
|
|
11582
|
+
exceptions: [],
|
|
11583
|
+
scuttlerName: '',
|
|
11584
|
+
}
|
|
11585
|
+
const opts = Object.assign({},
|
|
11586
|
+
originalOpts === true ? { ... defaultOpts } : { ...originalOpts },
|
|
11587
|
+
{ scuttlerFunc: (globalRef, scuttle) => scuttle(globalRef) },
|
|
11588
|
+
{ exceptions: (originalOpts.exceptions || defaultOpts.exceptions).map(e => toRE(e)) },
|
|
11589
|
+
)
|
|
11590
|
+
if (opts.scuttlerName) {
|
|
11591
|
+
if (!globalRef[opts.scuttlerName]) {
|
|
11592
|
+
throw new Error(
|
|
11593
|
+
`LavaMoat - 'scuttlerName' function "${opts.scuttlerName}" expected on globalRef.` +
|
|
11594
|
+
'To learn more visit https://github.com/LavaMoat/LavaMoat/pull/462.',
|
|
11595
|
+
)
|
|
11596
|
+
}
|
|
11597
|
+
opts.scuttlerFunc = globalRef[opts.scuttlerName]
|
|
11598
|
+
}
|
|
11599
|
+
return opts
|
|
11600
|
+
|
|
11601
|
+
function toRE(except) {
|
|
11602
|
+
// turn scuttleGlobalThis.exceptions regexes strings to actual regexes
|
|
11603
|
+
if (!except.startsWith('/')) {
|
|
11604
|
+
return except
|
|
11605
|
+
}
|
|
11606
|
+
const parts = except.split('/')
|
|
11607
|
+
const pattern = parts.slice(1, -1).join('/')
|
|
11608
|
+
const flags = parts[parts.length - 1]
|
|
11609
|
+
return new RegExp(pattern, flags)
|
|
11610
|
+
}
|
|
11611
|
+
}
|
|
11612
|
+
|
|
11590
11613
|
function performScuttleGlobalThis (globalRef, extraPropsToAvoid = new Array()) {
|
|
11591
11614
|
const props = new Array()
|
|
11592
11615
|
getPrototypeChain(globalRef)
|
|
@@ -11989,7 +12012,6 @@ module.exports = {
|
|
|
11989
12012
|
globalRef,
|
|
11990
12013
|
globalThisRefs,
|
|
11991
12014
|
scuttleGlobalThis,
|
|
11992
|
-
scuttleGlobalThisExceptions,
|
|
11993
12015
|
debugMode,
|
|
11994
12016
|
runWithPrecompiledModules,
|
|
11995
12017
|
reportStatsHook,
|
|
@@ -12117,13 +12139,13 @@ module.exports = {
|
|
|
12117
12139
|
|
|
12118
12140
|
})()
|
|
12119
12141
|
|
|
12120
|
-
LavaPack.loadBundle([[1,{"./Substream":2,"end-of-stream":102,once:138,"readable-stream":12},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.ObjectMultiplex=void 0;const s=e("readable-stream"),i=n(e("end-of-stream")),o=n(e("once")),a=e("./Substream"),c=Symbol("IGNORE_SUBSTREAM");class u extends s.Duplex{constructor(e={}){super(Object.assign(Object.assign({},e),{objectMode:!0})),this._substreams={}}createStream(e){if(this.destroyed)throw new Error(`ObjectMultiplex - parent stream for name "${e}" already destroyed`);if(this._readableState.ended||this._writableState.ended)throw new Error(`ObjectMultiplex - parent stream for name "${e}" already ended`);if(!e)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[e])throw new Error(`ObjectMultiplex - Substream for name "${e}" already exists`);const t=new a.Substream({parent:this,name:e});return this._substreams[e]=t,function(e,t){const r=o.default(t);i.default(e,{readable:!1},r),i.default(e,{writable:!1},r)}(this,(e=>t.destroy(e||undefined))),t}ignoreStream(e){if(!e)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[e])throw new Error(`ObjectMultiplex - Substream for name "${e}" already exists`);this._substreams[e]=c}_read(){return undefined}_write(e,t,r){const{name:n,data:s}=e;if(!n)return console.warn(`ObjectMultiplex - malformed chunk without name "${e}"`),r();const i=this._substreams[n];return i?(i!==c&&i.push(s),r()):(console.warn(`ObjectMultiplex - orphaned data for stream "${n}"`),r())}}r.ObjectMultiplex=u}}},{package:"@metamask/object-multiplex",file:"../../node_modules/@metamask/object-multiplex/dist/ObjectMultiplex.js"}],[2,{"readable-stream":12},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Substream=void 0;const n=e("readable-stream");class s extends n.Duplex{constructor({parent:e,name:t}){super({objectMode:!0}),this._parent=e,this._name=t}_read(){return undefined}_write(e,t,r){this._parent.push({name:this._name,data:e}),r()}}r.Substream=s}}},{package:"@metamask/object-multiplex",file:"../../node_modules/@metamask/object-multiplex/dist/Substream.js"}],[3,{"./ObjectMultiplex":1},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./ObjectMultiplex");t.exports=n.ObjectMultiplex}}},{package:"@metamask/object-multiplex",file:"../../node_modules/@metamask/object-multiplex/dist/index.js"}],[4,{"./_stream_readable":6,"./_stream_writable":8,"core-util-is":95,inherits:111,"process-nextick-args":139},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("process-nextick-args"),s=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=d;var i=Object.create(e("core-util-is"));i.inherits=e("inherits");var o=e("./_stream_readable"),a=e("./_stream_writable");i.inherits(d,o);for(var c=s(a.prototype),u=0;u<c.length;u++){var l=c[u];d.prototype[l]||(d.prototype[l]=a.prototype[l])}function d(e){if(!(this instanceof d))return new d(e);o.call(this,e),a.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||n.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(d.prototype,"destroyed",{get:function(){return this._readableState!==undefined&&this._writableState!==undefined&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){this._readableState!==undefined&&this._writableState!==undefined&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),d.prototype._destroy=function(e,t){this.push(null),this.end(),n.nextTick(t,e)}}}},{package:"@metamask/object-multiplex>readable-stream",file:"../../node_modules/@metamask/object-multiplex/node_modules/readable-stream/lib/_stream_duplex.js"}],[5,{"./_stream_transform":7,"core-util-is":95,inherits:111},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=i;var n=e("./_stream_transform"),s=Object.create(e("core-util-is"));function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}s.inherits=e("inherits"),s.inherits(i,n),i.prototype._transform=function(e,t,r){r(null,e)}}}},{package:"@metamask/object-multiplex>readable-stream",file:"../../node_modules/@metamask/object-multiplex/node_modules/readable-stream/lib/_stream_passthrough.js"}],[6,{"./_stream_duplex":4,"./internal/streams/BufferList":9,"./internal/streams/destroy":10,"./internal/streams/stream":11,"core-util-is":95,events:"events",inherits:111,isarray:115,"process-nextick-args":139,"safe-buffer":13,"string_decoder/":14,util:"util"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("process-nextick-args");t.exports=w;var s,i=e("isarray");w.ReadableState=b;e("events").EventEmitter;var o=function(e,t){return e.listeners(t).length},a=e("./internal/streams/stream"),c=e("safe-buffer").Buffer,u=global.Uint8Array||function(){};var l=Object.create(e("core-util-is"));l.inherits=e("inherits");var d=e("util"),h=void 0;h=d&&d.debuglog?d.debuglog("stream"):function(){};var f,p=e("./internal/streams/BufferList"),m=e("./internal/streams/destroy");l.inherits(w,a);var g=["error","close","destroy","pause","resume"];function b(t,r){t=t||{};var n=r instanceof(s=s||e("./_stream_duplex"));this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,o=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(o||0===o)?o:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new p,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.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(f||(f=e("string_decoder/").StringDecoder),this.decoder=new f(t.encoding),this.encoding=t.encoding)}function w(t){if(s=s||e("./_stream_duplex"),!(this instanceof w))return new w(t);this._readableState=new b(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function y(e,t,r,n,s){var i,o=e._readableState;null===t?(o.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,k(e)}(e,o)):(s||(i=function(e,t){var r;n=t,c.isBuffer(n)||n instanceof u||"string"==typeof t||t===undefined||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(o,t)),i?e.emit("error",i):o.objectMode||t&&t.length>0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):v(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?v(e,o,t,!1):T(e,o)):v(e,o,t,!1))):n||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(o)}function v(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&k(e)),T(e,t)}Object.defineProperty(w.prototype,"destroyed",{get:function(){return this._readableState!==undefined&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),w.prototype.destroy=m.destroy,w.prototype._undestroy=m.undestroy,w.prototype._destroy=function(e,t){this.push(null),t(e)},w.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=c.from(e,t),t=""),r=!0),y(this,e,t,!1,r)},w.prototype.unshift=function(e){return y(this,e,null,!0,!1)},w.prototype.isPaused=function(){return!1===this._readableState.flowing},w.prototype.setEncoding=function(t){return f||(f=e("string_decoder/").StringDecoder),this._readableState.decoder=new f(t),this._readableState.encoding=t,this};var _=8388608;function S(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>=_?e=_:(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 k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?n.nextTick(E,e):E(e))}function E(e){h("emit readable"),e.emit("readable"),M(e)}function T(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(x,e,t))}function x(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(h("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function R(e){h("readable nexttick read 0"),e.read(0)}function j(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),M(e),t.flowing&&!t.reading&&e.read(0)}function M(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&null!==e.read(););}function O(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,s=r.data;e-=s.length;for(;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(o===i.length?s+=i:s+=i.slice(0,e),0===(e-=o)){o===i.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(o));break}++n}return t.length-=n,s}(e,t):function(e,t){var r=c.allocUnsafe(e),n=t.head,s=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var i=n.data,o=e>i.length?i.length:e;if(i.copy(r,r.length-e,0,o),0===(e-=o)){o===i.length?(++s,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(o));break}++s}return t.length-=s,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function P(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,n.nextTick(C,t,e))}function C(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function I(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}w.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?P(this):k(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&P(this),null;var n,s=t.needReadable;return h("need readable",s),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",s=!0),t.ended||t.reading?h("reading or ended",s=!1):s&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=S(r,t))),null===(n=e>0?O(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&P(this)),null!==n&&this.emit("data",n),n},w.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},w.prototype.pipe=function(e,t){var r=this,s=this._readableState;switch(s.pipesCount){case 0:s.pipes=e;break;case 1:s.pipes=[s.pipes,e];break;default:s.pipes.push(e)}s.pipesCount+=1,h("pipe count=%d opts=%j",s.pipesCount,t);var a=(!t||!1!==t.end)&&e!==process.stdout&&e!==process.stderr?u:w;function c(t,n){h("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,h("cleanup"),e.removeListener("close",g),e.removeListener("finish",b),e.removeListener("drain",l),e.removeListener("error",m),e.removeListener("unpipe",c),r.removeListener("end",u),r.removeListener("end",w),r.removeListener("data",p),d=!0,!s.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function u(){h("onend"),e.end()}s.endEmitted?n.nextTick(a):r.once("end",a),e.on("unpipe",c);var l=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,M(e))}}(r);e.on("drain",l);var d=!1;var f=!1;function p(t){h("ondata"),f=!1,!1!==e.write(t)||f||((1===s.pipesCount&&s.pipes===e||s.pipesCount>1&&-1!==I(s.pipes,e))&&!d&&(h("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,f=!0),r.pause())}function m(t){h("onerror",t),w(),e.removeListener("error",m),0===o(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",b),w()}function b(){h("onfinish"),e.removeListener("close",g),w()}function w(){h("unpipe"),r.unpipe(e)}return r.on("data",p),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?i(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",m),e.once("close",g),e.once("finish",b),e.emit("pipe",r),s.flowing||(h("pipe resume"),r.resume()),e},w.prototype.unpipe=function(e){var t=this._readableState,r={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,r)),this;if(!e){var n=t.pipes,s=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<s;i++)n[i].emit("unpipe",this,r);return this}var o=I(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},w.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var s=this._readableState;s.endEmitted||s.readableListening||(s.readableListening=s.needReadable=!0,s.emittedReadable=!1,s.reading?s.length&&k(this):n.nextTick(R,this))}return r},w.prototype.addListener=w.prototype.on,w.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(j,e,t))}(this,e)),this},w.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this},w.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var s in e.on("end",(function(){if(h("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(s){(h("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!r.objectMode||null!==s&&s!==undefined)&&((r.objectMode||s&&s.length)&&(t.push(s)||(n=!0,e.pause())))})),e)this[s]===undefined&&"function"==typeof e[s]&&(this[s]=function(t){return function(){return e[t].apply(e,arguments)}}(s));for(var i=0;i<g.length;i++)e.on(g[i],this.emit.bind(this,g[i]));return this._read=function(t){h("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(w.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),w._fromList=O}}},{package:"@metamask/object-multiplex>readable-stream",file:"../../node_modules/@metamask/object-multiplex/node_modules/readable-stream/lib/_stream_readable.js"}],[7,{"./_stream_duplex":4,"core-util-is":95,inherits:111},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=o;var n=e("./_stream_duplex"),s=Object.create(e("core-util-is"));function i(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var s=this._readableState;s.reading=!1,(s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}function o(e){if(!(this instanceof o))return new o(e);n.call(this,e),this._transformState={afterTransform:i.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",a)}function a(){var e=this;"function"==typeof this._flush?this._flush((function(t,r){c(e,t,r)})):c(this,null,null)}function c(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}s.inherits=e("inherits"),s.inherits(o,n),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},o.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},o.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var s=this._readableState;(n.needTransform||s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}},o.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},o.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,(function(e){t(e),r.emit("close")}))}}}},{package:"@metamask/object-multiplex>readable-stream",file:"../../node_modules/@metamask/object-multiplex/node_modules/readable-stream/lib/_stream_transform.js"}],[8,{"./_stream_duplex":4,"./internal/streams/destroy":10,"./internal/streams/stream":11,"core-util-is":95,inherits:111,"process-nextick-args":139,"safe-buffer":13,timers:"timers","util-deprecate":187},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(r){(function(){var n=e("process-nextick-args");function s(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var s=n.callback;t.pendingcb--,s(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}t.exports=g;var i,o=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?r:n.nextTick;g.WritableState=m;var a=Object.create(e("core-util-is"));a.inherits=e("inherits");var c={deprecate:e("util-deprecate")},u=e("./internal/streams/stream"),l=e("safe-buffer").Buffer,d=global.Uint8Array||function(){};var h,f=e("./internal/streams/destroy");function p(){}function m(t,r){i=i||e("./_stream_duplex"),t=t||{};var a=r instanceof i;this.objectMode=!!t.objectMode,a&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var c=t.highWaterMark,u=t.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=c||0===c?c:a&&(u||0===u)?u:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var d=!1===t.decodeStrings;this.decodeStrings=!d,this.defaultEncoding=t.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 r=e._writableState,s=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,s,i){--t.pendingcb,r?(n.nextTick(i,s),n.nextTick(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",s)):(i(s),e._writableState.errorEmitted=!0,e.emit("error",s),S(e,t))}(e,r,s,t,i);else{var a=v(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||y(e,r),s?o(w,e,r,a,i):w(e,r,a,i)}}(r,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function g(t){if(i=i||e("./_stream_duplex"),!(h.call(g,this)||this instanceof i))return new g(t);this._writableState=new m(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),u.call(this)}function b(e,t,r,n,s,i,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(s,t.onwrite):e._write(s,i,t.onwrite),t.sync=!1}function w(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),S(e,t)}function y(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var a=0,c=!0;r;)i[a]=r,r.isBuf||(c=!1),r=r.next,a+=1;i.allBuffers=c,b(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new s(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,d=r.callback;if(b(e,t,!1,t.objectMode?1:u.length,u,l,d),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function v(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function _(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),S(e,t)}))}function S(e,t){var r=v(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,n.nextTick(_,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}a.inherits(g,u),m.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(m.prototype,"buffer",{get:c.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]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(e){return!!h.call(this,e)||this===g&&(e&&e._writableState instanceof m)}})):h=function(e){return e instanceof this},g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},g.prototype.write=function(e,t,r){var s,i=this._writableState,o=!1,a=!i.objectMode&&(s=e,l.isBuffer(s)||s instanceof d);return a&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=p),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),n.nextTick(t,r)}(this,r):(a||function(e,t,r,s){var i=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||r===undefined||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),n.nextTick(s,o),i=!1),i}(this,i,e,r))&&(i.pendingcb++,o=function(e,t,r,n,s,i){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,r));return t}(t,n,s);n!==o&&(r=!0,s="buffer",n=o)}var a=t.objectMode?1:n.length;t.length+=a;var c=t.length<t.highWaterMark;c||(t.needDrain=!0);if(t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:s,isBuf:r,callback:i,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else b(e,t,!1,a,n,s,i);return c}(this,i,a,e,t,r)),o},g.prototype.cork=function(){this._writableState.corked++},g.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||y(this,e))},g.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 TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),g.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(e,t,r){var s=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!==e&&e!==undefined&&this.write(e,t),s.corked&&(s.corked=1,this.uncork()),s.ending||s.finished||function(e,t,r){t.ending=!0,S(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,s,r)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return this._writableState!==undefined&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),g.prototype.destroy=f.destroy,g.prototype._undestroy=f.undestroy,g.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this)}).call(this,e("timers").setImmediate)}}},{package:"@metamask/object-multiplex>readable-stream",file:"../../node_modules/@metamask/object-multiplex/node_modules/readable-stream/lib/_stream_writable.js"}],[9,{"safe-buffer":13,util:"util"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("safe-buffer").Buffer,s=e("util");t.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}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=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}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t,r,s,i=n.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=i,s=a,t.copy(r,s),a+=o.data.length,o=o.next;return i},e}(),s&&s.inspect&&s.inspect.custom&&(t.exports.prototype[s.inspect.custom]=function(){var e=s.inspect({length:this.length});return this.constructor.name+" "+e})}}},{package:"@metamask/object-multiplex>readable-stream",file:"../../node_modules/@metamask/object-multiplex/node_modules/readable-stream/lib/internal/streams/BufferList.js"}],[10,{"process-nextick-args":139},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("process-nextick-args");function s(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return i||o?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n.nextTick(s,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(n.nextTick(s,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})),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.finished=!1,this._writableState.errorEmitted=!1)}}}}},{package:"@metamask/object-multiplex>readable-stream",file:"../../node_modules/@metamask/object-multiplex/node_modules/readable-stream/lib/internal/streams/destroy.js"}],[11,{stream:"stream"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=e("stream")}}},{package:"@metamask/object-multiplex>readable-stream",file:"../../node_modules/@metamask/object-multiplex/node_modules/readable-stream/lib/internal/streams/stream.js"}],[12,{"./lib/_stream_duplex.js":4,"./lib/_stream_passthrough.js":5,"./lib/_stream_readable.js":6,"./lib/_stream_transform.js":7,"./lib/_stream_writable.js":8,stream:"stream"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("stream");"disable"===process.env.READABLE_STREAM&&n?(t.exports=n,(r=t.exports=n.Readable).Readable=n.Readable,r.Writable=n.Writable,r.Duplex=n.Duplex,r.Transform=n.Transform,r.PassThrough=n.PassThrough,r.Stream=n):((r=t.exports=e("./lib/_stream_readable.js")).Stream=n||r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"))}}},{package:"@metamask/object-multiplex>readable-stream",file:"../../node_modules/@metamask/object-multiplex/node_modules/readable-stream/readable.js"}],[13,{buffer:"buffer"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("buffer"),s=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return s(e,t,r)}s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow?t.exports=n:(i(n,r),r.Buffer=o),i(s,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return s(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=s(e);return t!==undefined?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return s(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}}}},{package:"@metamask/object-multiplex>readable-stream>safe-buffer",file:"../../node_modules/@metamask/object-multiplex/node_modules/safe-buffer/index.js"}],[14,{"safe-buffer":13},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("safe-buffer").Buffer,s=n.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 i(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&&(n.isEncoding===s||!s(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=l,this.end=d,t=3;break;default:return this.write=h,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){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 r!==undefined?r: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 c(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?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-r))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}r.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if((t=this.fillLast(e))===undefined)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var s=o(t[n]);if(s>=0)return s>0&&(e.lastNeed=s-1),s;if(--n<r||-2===s)return 0;if(s=o(t[n]),s>=0)return s>0&&(e.lastNeed=s-2),s;if(--n<r||-2===s)return 0;if(s=o(t[n]),s>=0)return s>0&&(2===s?s=0:e.lastNeed=s-3),s;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},i.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}}}},{package:"@metamask/object-multiplex>readable-stream>string_decoder",file:"../../node_modules/@metamask/object-multiplex/node_modules/string_decoder/lib/string_decoder.js"}],[15,{"readable-stream":53},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.BasePostMessageStream=void 0;const n=e("readable-stream"),s=()=>undefined,i="ACK";class o extends n.Duplex{constructor(){super({objectMode:!0}),this._init=!1,this._haveSyn=!1}_handshake(){this._write("SYN",null,s),this.cork()}_onData(e){if(this._init)try{this.push(e)}catch(e){this.emit("error",e)}else"SYN"===e?(this._haveSyn=!0,this._write(i,null,s)):e===i&&(this._init=!0,this._haveSyn||this._write(i,null,s),this.uncork())}_read(){return undefined}_write(e,t,r){this._postMessage(e),r()}}r.BasePostMessageStream=o}}},{package:"@metamask/post-message-stream",file:"../../node_modules/@metamask/post-message-stream/dist/BasePostMessageStream.js"}],[16,{"../BasePostMessageStream":15,"../utils":24},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.WebWorkerParentPostMessageStream=void 0;const n=e("../BasePostMessageStream"),s=e("../utils");class i extends n.BasePostMessageStream{constructor({worker:e}){super(),this._target=s.DEDICATED_WORKER_NAME,this._worker=e,this._worker.onmessage=this._onMessage.bind(this),this._handshake()}_postMessage(e){this._worker.postMessage({target:this._target,data:e})}_onMessage(e){const t=e.data;(0,s.isValidStreamMessage)(t)&&this._onData(t.data)}_destroy(){this._worker.onmessage=null,this._worker=null}}r.WebWorkerParentPostMessageStream=i}}},{package:"@metamask/post-message-stream",file:"../../node_modules/@metamask/post-message-stream/dist/WebWorker/WebWorkerParentPostMessageStream.js"}],[17,{"../BasePostMessageStream":15,"../utils":24},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.WebWorkerPostMessageStream=void 0;const n=e("../BasePostMessageStream"),s=e("../utils");class i extends n.BasePostMessageStream{constructor(){if("undefined"==typeof self||"undefined"==typeof WorkerGlobalScope)throw new Error("WorkerGlobalScope not found. This class should only be instantiated in a WebWorker.");super(),this._name=s.DEDICATED_WORKER_NAME,self.addEventListener("message",this._onMessage.bind(this)),this._handshake()}_postMessage(e){self.postMessage({data:e})}_onMessage(e){const t=e.data;(0,s.isValidStreamMessage)(t)&&t.target===this._name&&this._onData(t.data)}_destroy(){return undefined}}r.WebWorkerPostMessageStream=i}}},{package:"@metamask/post-message-stream",file:"../../node_modules/@metamask/post-message-stream/dist/WebWorker/WebWorkerPostMessageStream.js"}],[18,{"./BasePostMessageStream":15,"./WebWorker/WebWorkerParentPostMessageStream":16,"./WebWorker/WebWorkerPostMessageStream":17,"./node-process/ProcessMessageStream":19,"./node-process/ProcessParentMessageStream":20,"./node-thread/ThreadMessageStream":21,"./node-thread/ThreadParentMessageStream":22,"./runtime/BrowserRuntimePostMessageStream":23,"./window/WindowPostMessageStream":25},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./window/WindowPostMessageStream"),r),s(e("./WebWorker/WebWorkerPostMessageStream"),r),s(e("./WebWorker/WebWorkerParentPostMessageStream"),r),s(e("./node-process/ProcessParentMessageStream"),r),s(e("./node-process/ProcessMessageStream"),r),s(e("./node-thread/ThreadParentMessageStream"),r),s(e("./node-thread/ThreadMessageStream"),r),s(e("./runtime/BrowserRuntimePostMessageStream"),r),s(e("./BasePostMessageStream"),r)}}},{package:"@metamask/post-message-stream",file:"../../node_modules/@metamask/post-message-stream/dist/index.js"}],[19,{"../BasePostMessageStream":15,"../utils":24},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ProcessMessageStream=void 0;const n=e("../BasePostMessageStream"),s=e("../utils");class i extends n.BasePostMessageStream{constructor(){if(super(),"function"!=typeof globalThis.process.send)throw new Error("Parent IPC channel not found. This class should only be instantiated in a Node.js child process.");this._onMessage=this._onMessage.bind(this),globalThis.process.on("message",this._onMessage),this._handshake()}_postMessage(e){globalThis.process.send({data:e})}_onMessage(e){(0,s.isValidStreamMessage)(e)&&this._onData(e.data)}_destroy(){globalThis.process.removeListener("message",this._onMessage)}}r.ProcessMessageStream=i}}},{package:"@metamask/post-message-stream",file:"../../node_modules/@metamask/post-message-stream/dist/node-process/ProcessMessageStream.js"}],[20,{"../BasePostMessageStream":15,"../utils":24},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ProcessParentMessageStream=void 0;const n=e("../BasePostMessageStream"),s=e("../utils");class i extends n.BasePostMessageStream{constructor({process:e}){super(),this._process=e,this._onMessage=this._onMessage.bind(this),this._process.on("message",this._onMessage),this._handshake()}_postMessage(e){this._process.send({data:e})}_onMessage(e){(0,s.isValidStreamMessage)(e)&&this._onData(e.data)}_destroy(){this._process.removeListener("message",this._onMessage)}}r.ProcessParentMessageStream=i}}},{package:"@metamask/post-message-stream",file:"../../node_modules/@metamask/post-message-stream/dist/node-process/ProcessParentMessageStream.js"}],[21,{"../BasePostMessageStream":15,"../utils":24,worker_threads:"worker_threads"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},i=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(r,"__esModule",{value:!0}),r.ThreadMessageStream=void 0;const o=e("worker_threads"),a=e("../BasePostMessageStream"),c=e("../utils");class u extends a.BasePostMessageStream{constructor(){if(super(),n.set(this,void 0),!o.parentPort)throw new Error("Parent port not found. This class should only be instantiated in a Node.js worker thread.");s(this,n,o.parentPort,"f"),this._onMessage=this._onMessage.bind(this),i(this,n,"f").on("message",this._onMessage),this._handshake()}_postMessage(e){i(this,n,"f").postMessage({data:e})}_onMessage(e){(0,c.isValidStreamMessage)(e)&&this._onData(e.data)}_destroy(){i(this,n,"f").removeListener("message",this._onMessage)}}r.ThreadMessageStream=u,n=new WeakMap}}},{package:"@metamask/post-message-stream",file:"../../node_modules/@metamask/post-message-stream/dist/node-thread/ThreadMessageStream.js"}],[22,{"../BasePostMessageStream":15,"../utils":24},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ThreadParentMessageStream=void 0;const n=e("../BasePostMessageStream"),s=e("../utils");class i extends n.BasePostMessageStream{constructor({thread:e}){super(),this._thread=e,this._onMessage=this._onMessage.bind(this),this._thread.on("message",this._onMessage),this._handshake()}_postMessage(e){this._thread.postMessage({data:e})}_onMessage(e){(0,s.isValidStreamMessage)(e)&&this._onData(e.data)}_destroy(){this._thread.removeListener("message",this._onMessage)}}r.ThreadParentMessageStream=i}}},{package:"@metamask/post-message-stream",file:"../../node_modules/@metamask/post-message-stream/dist/node-thread/ThreadParentMessageStream.js"}],[23,{"../BasePostMessageStream":15,"../utils":24},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s,i=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},o=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(r,"__esModule",{value:!0}),r.BrowserRuntimePostMessageStream=void 0;const a=e("../BasePostMessageStream"),c=e("../utils");class u extends a.BasePostMessageStream{constructor({name:e,target:t}){super(),n.set(this,void 0),s.set(this,void 0),i(this,n,e,"f"),i(this,s,t,"f"),this._onMessage=this._onMessage.bind(this),this._getRuntime().onMessage.addListener(this._onMessage),this._handshake()}_postMessage(e){this._getRuntime().sendMessage({target:o(this,s,"f"),data:e})}_onMessage(e){(0,c.isValidStreamMessage)(e)&&e.target===o(this,n,"f")&&this._onData(e.data)}_getRuntime(){var e,t;if("chrome"in globalThis&&"function"==typeof(null===(e=null===chrome||void 0===chrome?void 0:chrome.runtime)||void 0===e?void 0:e.sendMessage))return chrome.runtime;if("browser"in globalThis&&"function"==typeof(null===(t=null===browser||void 0===browser?void 0:browser.runtime)||void 0===t?void 0:t.sendMessage))return browser.runtime;throw new Error("browser.runtime.sendMessage is not a function. This class should only be instantiated in a web extension.")}_destroy(){this._getRuntime().onMessage.removeListener(this._onMessage)}}r.BrowserRuntimePostMessageStream=u,n=new WeakMap,s=new WeakMap}}},{package:"@metamask/post-message-stream",file:"../../node_modules/@metamask/post-message-stream/dist/runtime/BrowserRuntimePostMessageStream.js"}],[24,{"@metamask/utils":34},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.isValidStreamMessage=r.DEDICATED_WORKER_NAME=void 0;const n=e("@metamask/utils");r.DEDICATED_WORKER_NAME="dedicatedWorker",r.isValidStreamMessage=function(e){return(0,n.isObject)(e)&&Boolean(e.data)&&("number"==typeof e.data||"object"==typeof e.data||"string"==typeof e.data)}}}},{package:"@metamask/post-message-stream",file:"../../node_modules/@metamask/post-message-stream/dist/utils.js"}],[25,{"../BasePostMessageStream":15,"../utils":24,"@metamask/utils":34},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s;Object.defineProperty(r,"__esModule",{value:!0}),r.WindowPostMessageStream=void 0;const i=e("@metamask/utils"),o=e("../BasePostMessageStream"),a=e("../utils"),c=null===(n=Object.getOwnPropertyDescriptor(MessageEvent.prototype,"source"))||void 0===n?void 0:n.get;(0,i.assert)(c,"MessageEvent.prototype.source getter is not defined.");const u=null===(s=Object.getOwnPropertyDescriptor(MessageEvent.prototype,"origin"))||void 0===s?void 0:s.get;(0,i.assert)(u,"MessageEvent.prototype.origin getter is not defined.");class l extends o.BasePostMessageStream{constructor({name:e,target:t,targetOrigin:r=location.origin,targetWindow:n=window}){if(super(),"undefined"==typeof window||"function"!=typeof window.postMessage)throw new Error("window.postMessage is not a function. This class should only be instantiated in a Window.");this._name=e,this._target=t,this._targetOrigin=r,this._targetWindow=n,this._onMessage=this._onMessage.bind(this),window.addEventListener("message",this._onMessage,!1),this._handshake()}_postMessage(e){this._targetWindow.postMessage({target:this._target,data:e},this._targetOrigin)}_onMessage(e){const t=e.data;"*"!==this._targetOrigin&&u.call(e)!==this._targetOrigin||c.call(e)!==this._targetWindow||!(0,a.isValidStreamMessage)(t)||t.target!==this._name||this._onData(t.data)}_destroy(){window.removeEventListener("message",this._onMessage,!1)}}r.WindowPostMessageStream=l}}},{package:"@metamask/post-message-stream",file:"../../node_modules/@metamask/post-message-stream/dist/window/WindowPostMessageStream.js"}],[26,{superstruct:185},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.assertExhaustive=r.assertStruct=r.assert=r.AssertionError=void 0;const n=e("superstruct");function s(e,t){return r=e,Boolean("string"==typeof(null===(s=null===(n=null==r?void 0:r.prototype)||void 0===n?void 0:n.constructor)||void 0===s?void 0:s.name))?new e({message:t}):e({message:t});var r,n,s}class i extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}r.AssertionError=i,r.assert=function(e,t="Assertion failed.",r=i){if(!e){if(t instanceof Error)throw t;throw s(r,t)}},r.assertStruct=function(e,t,r="Assertion failed",o=i){try{(0,n.assert)(e,t)}catch(e){throw s(o,`${r}: ${function(e){const t=function(e){return"object"==typeof e&&null!==e&&"message"in e}(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}(e)}.`)}},r.assertExhaustive=function(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/assert.js"}],[27,{"./assert":26,superstruct:185},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.base64=void 0;const n=e("superstruct"),s=e("./assert");r.base64=(e,t={})=>{var r,i;const o=null!==(r=t.paddingRequired)&&void 0!==r&&r,a=null!==(i=t.characterSet)&&void 0!==i?i:"base64";let c,u;return"base64"===a?c=String.raw`[A-Za-z0-9+\/]`:((0,s.assert)("base64url"===a),c=String.raw`[-_A-Za-z0-9]`),u=o?new RegExp(`^(?:${c}{4})*(?:${c}{3}=|${c}{2}==)?$`,"u"):new RegExp(`^(?:${c}{4})*(?:${c}{2,3}|${c}{3}=|${c}{2}==)?$`,"u"),(0,n.pattern)(e,u)}}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/base64.js"}],[28,{"./assert":26,"./hex":33,buffer:"buffer"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.createDataView=r.concatBytes=r.valueToBytes=r.stringToBytes=r.numberToBytes=r.signedBigIntToBytes=r.bigIntToBytes=r.hexToBytes=r.bytesToString=r.bytesToNumber=r.bytesToSignedBigInt=r.bytesToBigInt=r.bytesToHex=r.assertIsBytes=r.isBytes=void 0;const n=e("./assert"),s=e("./hex"),i=48,o=58,a=87;const c=function(){const e=[];return()=>{if(0===e.length)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}();function u(e){return e instanceof Uint8Array}function l(e){(0,n.assert)(u(e),"Value must be a Uint8Array.")}function d(e){if(l(e),0===e.length)return"0x";const t=c(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,s.add0x)(r.join(""))}function h(e){l(e);const t=d(e);return BigInt(t)}function f(e){var t;if("0x"===(null===(t=null==e?void 0:e.toLowerCase)||void 0===t?void 0:t.call(e)))return new Uint8Array;(0,s.assertIsHexString)(e);const r=(0,s.remove0x)(e).toLowerCase(),n=r.length%2==0?r:`0${r}`,c=new Uint8Array(n.length/2);for(let e=0;e<c.length;e++){const t=n.charCodeAt(2*e),r=n.charCodeAt(2*e+1),s=t-(t<o?i:a),u=r-(r<o?i:a);c[e]=16*s+u}return c}function p(e){(0,n.assert)("bigint"==typeof e,"Value must be a bigint."),(0,n.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");return f(e.toString(16))}function m(e){(0,n.assert)("number"==typeof e,"Value must be a number."),(0,n.assert)(e>=0,"Value must be a non-negative number."),(0,n.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");return f(e.toString(16))}function g(e){return(0,n.assert)("string"==typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function b(e){if("bigint"==typeof e)return p(e);if("number"==typeof e)return m(e);if("string"==typeof e)return e.startsWith("0x")?f(e):g(e);if(u(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}r.isBytes=u,r.assertIsBytes=l,r.bytesToHex=d,r.bytesToBigInt=h,r.bytesToSignedBigInt=function(e){l(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(8*e.length,t)},r.bytesToNumber=function(e){l(e);const t=h(e);return(0,n.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)},r.bytesToString=function(e){return l(e),(new TextDecoder).decode(e)},r.hexToBytes=f,r.bigIntToBytes=p,r.signedBigIntToBytes=function(e,t){(0,n.assert)("bigint"==typeof e,"Value must be a bigint."),(0,n.assert)("number"==typeof t,"Byte length must be a number."),(0,n.assert)(t>0,"Byte length must be greater than 0."),(0,n.assert)(function(e,t){(0,n.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(8*t-1))}(e,t),"Byte length is too small to represent the given value.");let r=e;const s=new Uint8Array(t);for(let e=0;e<s.length;e++)s[e]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return s.reverse()},r.numberToBytes=m,r.stringToBytes=g,r.valueToBytes=b,r.concatBytes=function(e){const t=new Array(e.length);let r=0;for(let n=0;n<e.length;n++){const s=b(e[n]);t[n]=s,r+=s.length}const n=new Uint8Array(r);for(let e=0,r=0;e<t.length;e++)n.set(t[e],r),r+=t[e].length;return n},r.createDataView=function(e){if(void 0!==t&&e instanceof t){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/bytes.js"}],[29,{"./base64":27,superstruct:185},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ChecksumStruct=void 0;const n=e("superstruct"),s=e("./base64");r.ChecksumStruct=(0,n.size)((0,s.base64)((0,n.string)(),{paddingRequired:!0}),44,44)}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/checksum.js"}],[30,{"./assert":26,"./bytes":28,"./hex":33,superstruct:185},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createHex=r.createBytes=r.createBigInt=r.createNumber=void 0;const n=e("superstruct"),s=e("./assert"),i=e("./bytes"),o=e("./hex"),a=(0,n.union)([(0,n.number)(),(0,n.bigint)(),(0,n.string)(),o.StrictHexStruct]),c=(0,n.coerce)((0,n.number)(),a,Number),u=(0,n.coerce)((0,n.bigint)(),a,BigInt),l=((0,n.union)([o.StrictHexStruct,(0,n.instance)(Uint8Array)]),(0,n.coerce)((0,n.instance)(Uint8Array),(0,n.union)([o.StrictHexStruct]),i.hexToBytes)),d=(0,n.coerce)(o.StrictHexStruct,(0,n.instance)(Uint8Array),i.bytesToHex);r.createNumber=function(e){try{const t=(0,n.create)(e,c);return(0,s.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){if(t instanceof n.StructError)throw new Error(`Expected a number-like value, got "${e}".`);throw t}},r.createBigInt=function(e){try{return(0,n.create)(e,u)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a number-like value, got "${String(e.value)}".`);throw e}},r.createBytes=function(e){if("string"==typeof e&&"0x"===e.toLowerCase())return new Uint8Array;try{return(0,n.create)(e,l)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}},r.createHex=function(e){if(e instanceof Uint8Array&&0===e.length||"string"==typeof e&&"0x"===e.toLowerCase())return"0x";try{return(0,n.create)(e,d)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}}}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/coercers.js"}],[31,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s,i=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},o=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(r,"__esModule",{value:!0}),r.FrozenSet=r.FrozenMap=void 0;class a{constructor(e){n.set(this,void 0),i(this,n,new Map(e),"f"),Object.freeze(this)}get size(){return o(this,n,"f").size}[(n=new WeakMap,Symbol.iterator)](){return o(this,n,"f")[Symbol.iterator]()}entries(){return o(this,n,"f").entries()}forEach(e,t){return o(this,n,"f").forEach(((r,n,s)=>e.call(t,r,n,this)))}get(e){return o(this,n,"f").get(e)}has(e){return o(this,n,"f").has(e)}keys(){return o(this,n,"f").keys()}values(){return o(this,n,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([e,t])=>`${String(e)} => ${String(t)}`)).join(", ")} `:""}}`}}r.FrozenMap=a;class c{constructor(e){s.set(this,void 0),i(this,s,new Set(e),"f"),Object.freeze(this)}get size(){return o(this,s,"f").size}[(s=new WeakMap,Symbol.iterator)](){return o(this,s,"f")[Symbol.iterator]()}entries(){return o(this,s,"f").entries()}forEach(e,t){return o(this,s,"f").forEach(((r,n,s)=>e.call(t,r,n,this)))}has(e){return o(this,s,"f").has(e)}keys(){return o(this,s,"f").keys()}values(){return o(this,s,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((e=>String(e))).join(", ")} `:""}}`}}r.FrozenSet=c,Object.freeze(a),Object.freeze(a.prototype),Object.freeze(c),Object.freeze(c.prototype)}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/collections.js"}],[32,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/encryption-types.js"}],[33,{"./assert":26,superstruct:185},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.remove0x=r.add0x=r.assertIsStrictHexString=r.assertIsHexString=r.isStrictHexString=r.isHexString=r.StrictHexStruct=r.HexStruct=void 0;const n=e("superstruct"),s=e("./assert");function i(e){return(0,n.is)(e,r.HexStruct)}function o(e){return(0,n.is)(e,r.StrictHexStruct)}r.HexStruct=(0,n.pattern)((0,n.string)(),/^(?:0x)?[0-9a-f]+$/iu),r.StrictHexStruct=(0,n.pattern)((0,n.string)(),/^0x[0-9a-f]+$/iu),r.isHexString=i,r.isStrictHexString=o,r.assertIsHexString=function(e){(0,s.assert)(i(e),"Value must be a hexadecimal string.")},r.assertIsStrictHexString=function(e){(0,s.assert)(o(e),'Value must be a hexadecimal string, starting with "0x".')},r.add0x=function(e){return e.startsWith("0x")?e:e.startsWith("0X")?`0x${e.substring(2)}`:`0x${e}`},r.remove0x=function(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/hex.js"}],[34,{"./assert":26,"./base64":27,"./bytes":28,"./checksum":29,"./coercers":30,"./collections":31,"./encryption-types":32,"./hex":33,"./json":35,"./keyring":36,"./logging":37,"./misc":38,"./number":39,"./opaque":40,"./time":41,"./transaction-types":42,"./versions":43},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./assert"),r),s(e("./base64"),r),s(e("./bytes"),r),s(e("./checksum"),r),s(e("./coercers"),r),s(e("./collections"),r),s(e("./encryption-types"),r),s(e("./hex"),r),s(e("./json"),r),s(e("./keyring"),r),s(e("./logging"),r),s(e("./misc"),r),s(e("./number"),r),s(e("./opaque"),r),s(e("./time"),r),s(e("./transaction-types"),r),s(e("./versions"),r)}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/index.js"}],[35,{"./assert":26,superstruct:185},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getJsonRpcIdValidator=r.assertIsJsonRpcError=r.isJsonRpcError=r.assertIsJsonRpcFailure=r.isJsonRpcFailure=r.assertIsJsonRpcSuccess=r.isJsonRpcSuccess=r.assertIsJsonRpcResponse=r.isJsonRpcResponse=r.assertIsPendingJsonRpcResponse=r.isPendingJsonRpcResponse=r.JsonRpcResponseStruct=r.JsonRpcFailureStruct=r.JsonRpcSuccessStruct=r.PendingJsonRpcResponseStruct=r.assertIsJsonRpcRequest=r.isJsonRpcRequest=r.assertIsJsonRpcNotification=r.isJsonRpcNotification=r.JsonRpcNotificationStruct=r.JsonRpcRequestStruct=r.JsonRpcParamsStruct=r.JsonRpcErrorStruct=r.JsonRpcIdStruct=r.JsonRpcVersionStruct=r.jsonrpc2=r.getJsonSize=r.isValidJson=r.JsonStruct=r.UnsafeJsonStruct=void 0;const n=e("superstruct"),s=e("./assert");r.UnsafeJsonStruct=(0,n.union)([(0,n.literal)(null),(0,n.boolean)(),(0,n.define)("finite number",(e=>(0,n.is)(e,(0,n.number)())&&Number.isFinite(e))),(0,n.string)(),(0,n.array)((0,n.lazy)((()=>r.UnsafeJsonStruct))),(0,n.record)((0,n.string)(),(0,n.lazy)((()=>r.UnsafeJsonStruct)))]),r.JsonStruct=(0,n.define)("Json",((e,t)=>{function n(e,r){const n=[...r.validator(e,t)];return!(n.length>0)||n}try{const t=n(e,r.UnsafeJsonStruct);return!0!==t?t:n(JSON.parse(JSON.stringify(e)),r.UnsafeJsonStruct)}catch(e){return e instanceof RangeError&&"Circular reference detected"}})),r.isValidJson=function(e){return(0,n.is)(e,r.JsonStruct)},r.getJsonSize=function(e){(0,s.assertStruct)(e,r.JsonStruct,"Invalid JSON value");const t=JSON.stringify(e);return(new TextEncoder).encode(t).byteLength},r.jsonrpc2="2.0",r.JsonRpcVersionStruct=(0,n.literal)(r.jsonrpc2),r.JsonRpcIdStruct=(0,n.nullable)((0,n.union)([(0,n.number)(),(0,n.string)()])),r.JsonRpcErrorStruct=(0,n.object)({code:(0,n.integer)(),message:(0,n.string)(),data:(0,n.optional)(r.JsonStruct),stack:(0,n.optional)((0,n.string)())}),r.JsonRpcParamsStruct=(0,n.optional)((0,n.union)([(0,n.record)((0,n.string)(),r.JsonStruct),(0,n.array)(r.JsonStruct)])),r.JsonRpcRequestStruct=(0,n.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,method:(0,n.string)(),params:r.JsonRpcParamsStruct}),r.JsonRpcNotificationStruct=(0,n.omit)(r.JsonRpcRequestStruct,["id"]),r.isJsonRpcNotification=function(e){return(0,n.is)(e,r.JsonRpcNotificationStruct)},r.assertIsJsonRpcNotification=function(e,t){(0,s.assertStruct)(e,r.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",t)},r.isJsonRpcRequest=function(e){return(0,n.is)(e,r.JsonRpcRequestStruct)},r.assertIsJsonRpcRequest=function(e,t){(0,s.assertStruct)(e,r.JsonRpcRequestStruct,"Invalid JSON-RPC request",t)},r.PendingJsonRpcResponseStruct=(0,n.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,result:(0,n.optional)((0,n.unknown)()),error:(0,n.optional)(r.JsonRpcErrorStruct)}),r.JsonRpcSuccessStruct=(0,n.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,result:r.JsonStruct}),r.JsonRpcFailureStruct=(0,n.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,error:r.JsonRpcErrorStruct}),r.JsonRpcResponseStruct=(0,n.union)([r.JsonRpcSuccessStruct,r.JsonRpcFailureStruct]),r.isPendingJsonRpcResponse=function(e){return(0,n.is)(e,r.PendingJsonRpcResponseStruct)},r.assertIsPendingJsonRpcResponse=function(e,t){(0,s.assertStruct)(e,r.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",t)},r.isJsonRpcResponse=function(e){return(0,n.is)(e,r.JsonRpcResponseStruct)},r.assertIsJsonRpcResponse=function(e,t){(0,s.assertStruct)(e,r.JsonRpcResponseStruct,"Invalid JSON-RPC response",t)},r.isJsonRpcSuccess=function(e){return(0,n.is)(e,r.JsonRpcSuccessStruct)},r.assertIsJsonRpcSuccess=function(e,t){(0,s.assertStruct)(e,r.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",t)},r.isJsonRpcFailure=function(e){return(0,n.is)(e,r.JsonRpcFailureStruct)},r.assertIsJsonRpcFailure=function(e,t){(0,s.assertStruct)(e,r.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",t)},r.isJsonRpcError=function(e){return(0,n.is)(e,r.JsonRpcErrorStruct)},r.assertIsJsonRpcError=function(e,t){(0,s.assertStruct)(e,r.JsonRpcErrorStruct,"Invalid JSON-RPC error",t)},r.getJsonRpcIdValidator=function(e){const{permitEmptyString:t,permitFractions:r,permitNull:n}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},e);return e=>Boolean("number"==typeof e&&(r||Number.isInteger(e))||"string"==typeof e&&(t||e.length>0)||n&&null===e)}}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/json.js"}],[36,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/keyring.js"}],[37,{debug:99},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.createModuleLogger=r.createProjectLogger=void 0;const s=(0,n(e("debug")).default)("metamask");r.createProjectLogger=function(e){return s.extend(e)},r.createModuleLogger=function(e,t){return e.extend(t)}}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/logging.js"}],[38,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.calculateNumberSize=r.calculateStringSize=r.isASCII=r.isPlainObject=r.ESCAPE_CHARACTERS_REGEXP=r.JsonSize=r.hasProperty=r.isObject=r.isNullOrUndefined=r.isNonEmptyArray=void 0,r.isNonEmptyArray=function(e){return Array.isArray(e)&&e.length>0},r.isNullOrUndefined=function(e){return null===e||e===undefined},r.isObject=function(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)};function n(e){return e.charCodeAt(0)<=127}r.hasProperty=(e,t)=>Object.hasOwnProperty.call(e,t),function(e){e[e.Null=4]="Null",e[e.Comma=1]="Comma",e[e.Wrapper=1]="Wrapper",e[e.True=4]="True",e[e.False=5]="False",e[e.Quote=1]="Quote",e[e.Colon=1]="Colon",e[e.Date=24]="Date"}(r.JsonSize||(r.JsonSize={})),r.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,r.isPlainObject=function(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}},r.isASCII=n,r.calculateStringSize=function(e){var t;return e.split("").reduce(((e,t)=>n(t)?e+1:e+2),0)+(null!==(t=e.match(r.ESCAPE_CHARACTERS_REGEXP))&&void 0!==t?t:[]).length},r.calculateNumberSize=function(e){return e.toString().length}}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/misc.js"}],[39,{"./assert":26,"./hex":33},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.hexToBigInt=r.hexToNumber=r.bigIntToHex=r.numberToHex=void 0;const n=e("./assert"),s=e("./hex");r.numberToHex=e=>((0,n.assert)("number"==typeof e,"Value must be a number."),(0,n.assert)(e>=0,"Value must be a non-negative number."),(0,n.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,s.add0x)(e.toString(16)));r.bigIntToHex=e=>((0,n.assert)("bigint"==typeof e,"Value must be a bigint."),(0,n.assert)(e>=0,"Value must be a non-negative bigint."),(0,s.add0x)(e.toString(16)));r.hexToNumber=e=>{(0,s.assertIsHexString)(e);const t=parseInt(e,16);return(0,n.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};r.hexToBigInt=e=>((0,s.assertIsHexString)(e),BigInt((0,s.add0x)(e)))}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/number.js"}],[40,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/opaque.js"}],[41,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.timeSince=r.inMilliseconds=r.Duration=void 0,function(e){e[e.Millisecond=1]="Millisecond",e[e.Second=1e3]="Second",e[e.Minute=6e4]="Minute",e[e.Hour=36e5]="Hour",e[e.Day=864e5]="Day",e[e.Week=6048e5]="Week",e[e.Year=31536e6]="Year"}(r.Duration||(r.Duration={}));const n=(e,t)=>{if(!(e=>Number.isInteger(e)&&e>=0)(e))throw new Error(`"${t}" must be a non-negative integer. Received: "${e}".`)};r.inMilliseconds=function(e,t){return n(e,"count"),e*t},r.timeSince=function(e){return n(e,"timestamp"),Date.now()-e}}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/time.js"}],[42,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/transaction-types.js"}],[43,{"./assert":26,semver:168,superstruct:185},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.satisfiesVersionRange=r.gtRange=r.gtVersion=r.assertIsSemVerRange=r.assertIsSemVerVersion=r.isValidSemVerRange=r.isValidSemVerVersion=r.VersionRangeStruct=r.VersionStruct=void 0;const n=e("semver"),s=e("superstruct"),i=e("./assert");r.VersionStruct=(0,s.refine)((0,s.string)(),"Version",(e=>null!==(0,n.valid)(e)||`Expected SemVer version, got "${e}"`)),r.VersionRangeStruct=(0,s.refine)((0,s.string)(),"Version range",(e=>null!==(0,n.validRange)(e)||`Expected SemVer range, got "${e}"`)),r.isValidSemVerVersion=function(e){return(0,s.is)(e,r.VersionStruct)},r.isValidSemVerRange=function(e){return(0,s.is)(e,r.VersionRangeStruct)},r.assertIsSemVerVersion=function(e){(0,i.assertStruct)(e,r.VersionStruct)},r.assertIsSemVerRange=function(e){(0,i.assertStruct)(e,r.VersionRangeStruct)},r.gtVersion=function(e,t){return(0,n.gt)(e,t)},r.gtRange=function(e,t){return(0,n.gtr)(e,t)},r.satisfiesVersionRange=function(e,t){return(0,n.satisfies)(e,t,{includePrerelease:!0})}}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/versions.js"}],[44,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){!process.version||0===process.version.indexOf("v0.")||0===process.version.indexOf("v1.")&&0!==process.version.indexOf("v1.8.")?t.exports=function(e,t,r,n){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var s,i,o=arguments.length;switch(o){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick((function(){e.call(null,t)}));case 3:return process.nextTick((function(){e.call(null,t,r)}));case 4:return process.nextTick((function(){e.call(null,t,r,n)}));default:for(s=new Array(o-1),i=0;i<s.length;)s[i++]=arguments[i];return process.nextTick((function(){e.apply(null,s)}))}}:t.exports=process.nextTick}}},{package:"@metamask/post-message-stream>readable-stream>process-nextick-args",file:"../../node_modules/@metamask/post-message-stream/node_modules/process-nextick-args/index.js"}],[45,{"./_stream_readable":47,"./_stream_writable":49,"core-util-is":95,inherits:111,"process-nextick-args":44},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("process-nextick-args"),s=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=d;var i=e("core-util-is");i.inherits=e("inherits");var o=e("./_stream_readable"),a=e("./_stream_writable");i.inherits(d,o);for(var c=s(a.prototype),u=0;u<c.length;u++){var l=c[u];d.prototype[l]||(d.prototype[l]=a.prototype[l])}function d(e){if(!(this instanceof d))return new d(e);o.call(this,e),a.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||n(f,this)}function f(e){e.end()}Object.defineProperty(d.prototype,"destroyed",{get:function(){return this._readableState!==undefined&&this._writableState!==undefined&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){this._readableState!==undefined&&this._writableState!==undefined&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),d.prototype._destroy=function(e,t){this.push(null),this.end(),n(t,e)}}}},{package:"@metamask/post-message-stream>readable-stream",file:"../../node_modules/@metamask/post-message-stream/node_modules/readable-stream/lib/_stream_duplex.js"}],[46,{"./_stream_transform":48,"core-util-is":95,inherits:111},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=i;var n=e("./_stream_transform"),s=e("core-util-is");function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}s.inherits=e("inherits"),s.inherits(i,n),i.prototype._transform=function(e,t,r){r(null,e)}}}},{package:"@metamask/post-message-stream>readable-stream",file:"../../node_modules/@metamask/post-message-stream/node_modules/readable-stream/lib/_stream_passthrough.js"}],[47,{"./_stream_duplex":45,"./internal/streams/BufferList":50,"./internal/streams/destroy":51,"./internal/streams/stream":52,"core-util-is":95,events:"events",inherits:111,isarray:115,"process-nextick-args":44,"safe-buffer":54,"string_decoder/":55,util:"util"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("process-nextick-args");t.exports=w;var s,i=e("isarray");w.ReadableState=b;e("events").EventEmitter;var o=function(e,t){return e.listeners(t).length},a=e("./internal/streams/stream"),c=e("safe-buffer").Buffer,u=global.Uint8Array||function(){};var l=e("core-util-is");l.inherits=e("inherits");var d=e("util"),h=void 0;h=d&&d.debuglog?d.debuglog("stream"):function(){};var f,p=e("./internal/streams/BufferList"),m=e("./internal/streams/destroy");l.inherits(w,a);var g=["error","close","destroy","pause","resume"];function b(t,r){s=s||e("./_stream_duplex"),t=t||{},this.objectMode=!!t.objectMode,r instanceof s&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var n=t.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new p,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.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(f||(f=e("string_decoder/").StringDecoder),this.decoder=new f(t.encoding),this.encoding=t.encoding)}function w(t){if(s=s||e("./_stream_duplex"),!(this instanceof w))return new w(t);this._readableState=new b(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function y(e,t,r,n,s){var i,o=e._readableState;null===t?(o.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,k(e)}(e,o)):(s||(i=function(e,t){var r;n=t,c.isBuffer(n)||n instanceof u||"string"==typeof t||t===undefined||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(o,t)),i?e.emit("error",i):o.objectMode||t&&t.length>0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):v(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?v(e,o,t,!1):T(e,o)):v(e,o,t,!1))):n||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(o)}function v(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&k(e)),T(e,t)}Object.defineProperty(w.prototype,"destroyed",{get:function(){return this._readableState!==undefined&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),w.prototype.destroy=m.destroy,w.prototype._undestroy=m.undestroy,w.prototype._destroy=function(e,t){this.push(null),t(e)},w.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=c.from(e,t),t=""),r=!0),y(this,e,t,!1,r)},w.prototype.unshift=function(e){return y(this,e,null,!0,!1)},w.prototype.isPaused=function(){return!1===this._readableState.flowing},w.prototype.setEncoding=function(t){return f||(f=e("string_decoder/").StringDecoder),this._readableState.decoder=new f(t),this._readableState.encoding=t,this};var _=8388608;function S(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>=_?e=_:(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 k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?n(E,e):E(e))}function E(e){h("emit readable"),e.emit("readable"),M(e)}function T(e,t){t.readingMore||(t.readingMore=!0,n(x,e,t))}function x(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(h("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function R(e){h("readable nexttick read 0"),e.read(0)}function j(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),M(e),t.flowing&&!t.reading&&e.read(0)}function M(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&null!==e.read(););}function O(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,s=r.data;e-=s.length;for(;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(o===i.length?s+=i:s+=i.slice(0,e),0===(e-=o)){o===i.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(o));break}++n}return t.length-=n,s}(e,t):function(e,t){var r=c.allocUnsafe(e),n=t.head,s=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var i=n.data,o=e>i.length?i.length:e;if(i.copy(r,r.length-e,0,o),0===(e-=o)){o===i.length?(++s,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(o));break}++s}return t.length-=s,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function P(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,n(C,t,e))}function C(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function I(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}w.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?P(this):k(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&P(this),null;var n,s=t.needReadable;return h("need readable",s),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",s=!0),t.ended||t.reading?h("reading or ended",s=!1):s&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=S(r,t))),null===(n=e>0?O(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&P(this)),null!==n&&this.emit("data",n),n},w.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},w.prototype.pipe=function(e,t){var r=this,s=this._readableState;switch(s.pipesCount){case 0:s.pipes=e;break;case 1:s.pipes=[s.pipes,e];break;default:s.pipes.push(e)}s.pipesCount+=1,h("pipe count=%d opts=%j",s.pipesCount,t);var a=(!t||!1!==t.end)&&e!==process.stdout&&e!==process.stderr?u:w;function c(t,n){h("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,h("cleanup"),e.removeListener("close",g),e.removeListener("finish",b),e.removeListener("drain",l),e.removeListener("error",m),e.removeListener("unpipe",c),r.removeListener("end",u),r.removeListener("end",w),r.removeListener("data",p),d=!0,!s.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function u(){h("onend"),e.end()}s.endEmitted?n(a):r.once("end",a),e.on("unpipe",c);var l=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,M(e))}}(r);e.on("drain",l);var d=!1;var f=!1;function p(t){h("ondata"),f=!1,!1!==e.write(t)||f||((1===s.pipesCount&&s.pipes===e||s.pipesCount>1&&-1!==I(s.pipes,e))&&!d&&(h("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,f=!0),r.pause())}function m(t){h("onerror",t),w(),e.removeListener("error",m),0===o(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",b),w()}function b(){h("onfinish"),e.removeListener("close",g),w()}function w(){h("unpipe"),r.unpipe(e)}return r.on("data",p),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?i(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",m),e.once("close",g),e.once("finish",b),e.emit("pipe",r),s.flowing||(h("pipe resume"),r.resume()),e},w.prototype.unpipe=function(e){var t=this._readableState,r={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,r)),this;if(!e){var n=t.pipes,s=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<s;i++)n[i].emit("unpipe",this,r);return this}var o=I(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},w.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var s=this._readableState;s.endEmitted||s.readableListening||(s.readableListening=s.needReadable=!0,s.emittedReadable=!1,s.reading?s.length&&k(this):n(R,this))}return r},w.prototype.addListener=w.prototype.on,w.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n(j,e,t))}(this,e)),this},w.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this},w.prototype.wrap=function(e){var t=this._readableState,r=!1,n=this;for(var s in e.on("end",(function(){if(h("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&n.push(e)}n.push(null)})),e.on("data",(function(s){(h("wrapped data"),t.decoder&&(s=t.decoder.write(s)),!t.objectMode||null!==s&&s!==undefined)&&((t.objectMode||s&&s.length)&&(n.push(s)||(r=!0,e.pause())))})),e)this[s]===undefined&&"function"==typeof e[s]&&(this[s]=function(t){return function(){return e[t].apply(e,arguments)}}(s));for(var i=0;i<g.length;i++)e.on(g[i],n.emit.bind(n,g[i]));return n._read=function(t){h("wrapped _read",t),r&&(r=!1,e.resume())},n},w._fromList=O}}},{package:"@metamask/post-message-stream>readable-stream",file:"../../node_modules/@metamask/post-message-stream/node_modules/readable-stream/lib/_stream_readable.js"}],[48,{"./_stream_duplex":45,"core-util-is":95,inherits:111},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=o;var n=e("./_stream_duplex"),s=e("core-util-is");function i(e){this.afterTransform=function(t,r){return function(e,t,r){var n=e._transformState;n.transforming=!1;var s=n.writecb;if(!s)return e.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!==r&&r!==undefined&&e.push(r);s(t);var i=e._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&e._read(i.highWaterMark)}(e,t,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function o(e){if(!(this instanceof o))return new o(e);n.call(this,e),this._transformState=new i(this);var t=this;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.once("prefinish",(function(){"function"==typeof this._flush?this._flush((function(e,r){a(t,e,r)})):a(t)}))}function a(e,t,r){if(t)return e.emit("error",t);null!==r&&r!==undefined&&e.push(r);var n=e._writableState,s=e._transformState;if(n.length)throw new Error("Calling transform done when ws.length != 0");if(s.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}s.inherits=e("inherits"),s.inherits(o,n),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},o.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},o.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var s=this._readableState;(n.needTransform||s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}},o.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},o.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,(function(e){t(e),r.emit("close")}))}}}},{package:"@metamask/post-message-stream>readable-stream",file:"../../node_modules/@metamask/post-message-stream/node_modules/readable-stream/lib/_stream_transform.js"}],[49,{"./_stream_duplex":45,"./internal/streams/destroy":51,"./internal/streams/stream":52,"core-util-is":95,inherits:111,"process-nextick-args":44,"safe-buffer":54,timers:"timers","util-deprecate":187},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(r){(function(){var n=e("process-nextick-args");function s(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var s=n.callback;t.pendingcb--,s(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}t.exports=g;var i,o=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?r:n;g.WritableState=m;var a=e("core-util-is");a.inherits=e("inherits");var c={deprecate:e("util-deprecate")},u=e("./internal/streams/stream"),l=e("safe-buffer").Buffer,d=global.Uint8Array||function(){};var h,f=e("./internal/streams/destroy");function p(){}function m(t,r){i=i||e("./_stream_duplex"),t=t||{},this.objectMode=!!t.objectMode,r instanceof i&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var a=t.highWaterMark,c=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var u=!1===t.decodeStrings;this.decodeStrings=!u,this.defaultEncoding=t.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 r=e._writableState,s=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,s,i){--t.pendingcb,r?(n(i,s),n(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",s)):(i(s),e._writableState.errorEmitted=!0,e.emit("error",s),S(e,t))}(e,r,s,t,i);else{var a=v(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||y(e,r),s?o(w,e,r,a,i):w(e,r,a,i)}}(r,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function g(t){if(i=i||e("./_stream_duplex"),!(h.call(g,this)||this instanceof i))return new g(t);this._writableState=new m(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),u.call(this)}function b(e,t,r,n,s,i,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(s,t.onwrite):e._write(s,i,t.onwrite),t.sync=!1}function w(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),S(e,t)}function y(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var a=0,c=!0;r;)i[a]=r,r.isBuf||(c=!1),r=r.next,a+=1;i.allBuffers=c,b(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new s(t)}else{for(;r;){var u=r.chunk,l=r.encoding,d=r.callback;if(b(e,t,!1,t.objectMode?1:u.length,u,l,d),r=r.next,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=r,t.bufferProcessing=!1}function v(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function _(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),S(e,t)}))}function S(e,t){var r=v(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,n(_,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}a.inherits(g,u),m.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(m.prototype,"buffer",{get:c.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]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(e){return!!h.call(this,e)||e&&e._writableState instanceof m}})):h=function(e){return e instanceof this},g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},g.prototype.write=function(e,t,r){var s,i=this._writableState,o=!1,a=(s=e,(l.isBuffer(s)||s instanceof d)&&!i.objectMode);return a&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=p),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),n(t,r)}(this,r):(a||function(e,t,r,s){var i=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||r===undefined||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),n(s,o),i=!1),i}(this,i,e,r))&&(i.pendingcb++,o=function(e,t,r,n,s,i){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,r));return t}(t,n,s);n!==o&&(r=!0,s="buffer",n=o)}var a=t.objectMode?1:n.length;t.length+=a;var c=t.length<t.highWaterMark;c||(t.needDrain=!0);if(t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:s,isBuf:r,callback:i,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else b(e,t,!1,a,n,s,i);return c}(this,i,a,e,t,r)),o},g.prototype.cork=function(){this._writableState.corked++},g.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||y(this,e))},g.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 TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},g.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(e,t,r){var s=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!==e&&e!==undefined&&this.write(e,t),s.corked&&(s.corked=1,this.uncork()),s.ending||s.finished||function(e,t,r){t.ending=!0,S(e,t),r&&(t.finished?n(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,s,r)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return this._writableState!==undefined&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),g.prototype.destroy=f.destroy,g.prototype._undestroy=f.undestroy,g.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this)}).call(this,e("timers").setImmediate)}}},{package:"@metamask/post-message-stream>readable-stream",file:"../../node_modules/@metamask/post-message-stream/node_modules/readable-stream/lib/_stream_writable.js"}],[50,{"safe-buffer":54},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("safe-buffer").Buffer;t.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}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=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}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t,r,s,i=n.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=i,s=a,t.copy(r,s),a+=o.data.length,o=o.next;return i},e}()}}},{package:"@metamask/post-message-stream>readable-stream",file:"../../node_modules/@metamask/post-message-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js"}],[51,{"process-nextick-args":44},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("process-nextick-args");function s(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;i||o?t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n(s,this,e):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(n(s,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})))},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.finished=!1,this._writableState.errorEmitted=!1)}}}}},{package:"@metamask/post-message-stream>readable-stream",file:"../../node_modules/@metamask/post-message-stream/node_modules/readable-stream/lib/internal/streams/destroy.js"}],[52,{stream:"stream"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=e("stream")}}},{package:"@metamask/post-message-stream>readable-stream",file:"../../node_modules/@metamask/post-message-stream/node_modules/readable-stream/lib/internal/streams/stream.js"}],[53,{"./lib/_stream_duplex.js":45,"./lib/_stream_passthrough.js":46,"./lib/_stream_readable.js":47,"./lib/_stream_transform.js":48,"./lib/_stream_writable.js":49,stream:"stream"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("stream");"disable"===process.env.READABLE_STREAM&&n?(t.exports=n,(r=t.exports=n.Readable).Readable=n.Readable,r.Writable=n.Writable,r.Duplex=n.Duplex,r.Transform=n.Transform,r.PassThrough=n.PassThrough,r.Stream=n):((r=t.exports=e("./lib/_stream_readable.js")).Stream=n||r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"))}}},{package:"@metamask/post-message-stream>readable-stream",file:"../../node_modules/@metamask/post-message-stream/node_modules/readable-stream/readable.js"}],[54,{buffer:"buffer"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("buffer"),s=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return s(e,t,r)}s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow?t.exports=n:(i(n,r),r.Buffer=o),i(s,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return s(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=s(e);return t!==undefined?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return s(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}}}},{package:"@metamask/post-message-stream>readable-stream>safe-buffer",file:"../../node_modules/@metamask/post-message-stream/node_modules/safe-buffer/index.js"}],[55,{"safe-buffer":54},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("safe-buffer").Buffer,s=n.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 i(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&&(n.isEncoding===s||!s(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=l,this.end=d,t=3;break;default:return this.write=h,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:-1}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�".repeat(r);if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�".repeat(r+1);if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�".repeat(r+2)}}(this,e,t);return r!==undefined?r: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 c(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?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-r))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}r.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if((t=this.fillLast(e))===undefined)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�".repeat(this.lastTotal-this.lastNeed):t},i.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var s=o(t[n]);if(s>=0)return s>0&&(e.lastNeed=s-1),s;if(--n<r)return 0;if(s=o(t[n]),s>=0)return s>0&&(e.lastNeed=s-2),s;if(--n<r)return 0;if(s=o(t[n]),s>=0)return s>0&&(2===s?s=0:e.lastNeed=s-3),s;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},i.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}}}},{package:"@metamask/post-message-stream>readable-stream>string_decoder",file:"../../node_modules/@metamask/post-message-stream/node_modules/string_decoder/lib/string_decoder.js"}],[56,{"./messages":64,"./utils":68,"@metamask/safe-event-emitter":69,"eth-rpc-errors":106,"fast-deep-equal":70,"json-rpc-engine":121},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.BaseProvider=void 0;const s=n(e("@metamask/safe-event-emitter")),i=e("eth-rpc-errors"),o=n(e("fast-deep-equal")),a=e("json-rpc-engine"),c=n(e("./messages")),u=e("./utils");class l extends s.default{constructor({logger:e=console,maxEventListeners:t=100,rpcMiddleware:r=[]}={}){super(),this._log=e,this.setMaxListeners(t),this._state={...l._defaultState},this.selectedAddress=null,this.chainId=null,this._handleAccountsChanged=this._handleAccountsChanged.bind(this),this._handleConnect=this._handleConnect.bind(this),this._handleChainChanged=this._handleChainChanged.bind(this),this._handleDisconnect=this._handleDisconnect.bind(this),this._handleUnlockStateChanged=this._handleUnlockStateChanged.bind(this),this._rpcRequest=this._rpcRequest.bind(this),this.request=this.request.bind(this);const n=new a.JsonRpcEngine;r.forEach((e=>n.push(e))),this._rpcEngine=n}isConnected(){return this._state.isConnected}async request(e){if(!e||"object"!=typeof e||Array.isArray(e))throw i.ethErrors.rpc.invalidRequest({message:c.default.errors.invalidRequestArgs(),data:e});const{method:t,params:r}=e;if("string"!=typeof t||0===t.length)throw i.ethErrors.rpc.invalidRequest({message:c.default.errors.invalidRequestMethod(),data:e});if(r!==undefined&&!Array.isArray(r)&&("object"!=typeof r||null===r))throw i.ethErrors.rpc.invalidRequest({message:c.default.errors.invalidRequestParams(),data:e});return new Promise(((e,n)=>{this._rpcRequest({method:t,params:r},(0,u.getRpcPromiseCallback)(e,n))}))}_initializeState(e){if(this._state.initialized)throw new Error("Provider already initialized.");if(e){const{accounts:t,chainId:r,isUnlocked:n,networkVersion:s}=e;this._handleConnect(r),this._handleChainChanged({chainId:r,networkVersion:s}),this._handleUnlockStateChanged({accounts:t,isUnlocked:n}),this._handleAccountsChanged(t)}this._state.initialized=!0,this.emit("_initialized")}_rpcRequest(e,t){let r=t;return Array.isArray(e)||(e.jsonrpc||(e.jsonrpc="2.0"),"eth_accounts"!==e.method&&"eth_requestAccounts"!==e.method||(r=(r,n)=>{this._handleAccountsChanged(n.result??[],"eth_accounts"===e.method),t(r,n)})),this._rpcEngine.handle(e,r)}_handleConnect(e){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{chainId:e}),this._log.debug(c.default.info.connected(e)))}_handleDisconnect(e,t){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!e){let r;this._state.isConnected=!1,e?(r=new i.EthereumRpcError(1013,t??c.default.errors.disconnected()),this._log.debug(r)):(r=new i.EthereumRpcError(1011,t??c.default.errors.permanentlyDisconnected()),this._log.error(r),this.chainId=null,this._state.accounts=null,this.selectedAddress=null,this._state.isUnlocked=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",r)}}_handleChainChanged({chainId:e}={}){(0,u.isValidChainId)(e)?(this._handleConnect(e),e!==this.chainId&&(this.chainId=e,this._state.initialized&&this.emit("chainChanged",this.chainId))):this._log.error(c.default.errors.invalidNetworkParams(),{chainId:e})}_handleAccountsChanged(e,t=!1){let r=e;Array.isArray(e)||(this._log.error("MetaMask: Received invalid accounts parameter. Please report this bug.",e),r=[]);for(const t of e)if("string"!=typeof t){this._log.error("MetaMask: Received non-string account. Please report this bug.",e),r=[];break}if(!(0,o.default)(this._state.accounts,r)&&(t&&null!==this._state.accounts&&this._log.error("MetaMask: 'eth_accounts' unexpectedly updated accounts. Please report this bug.",r),this._state.accounts=r,this.selectedAddress!==r[0]&&(this.selectedAddress=r[0]||null),this._state.initialized)){const e=[...r];this.emit("accountsChanged",e)}}_handleUnlockStateChanged({accounts:e,isUnlocked:t}={}){"boolean"==typeof t?t!==this._state.isUnlocked&&(this._state.isUnlocked=t,this._handleAccountsChanged(e??[])):this._log.error("MetaMask: Received invalid isUnlocked parameter. Please report this bug.")}}r.BaseProvider=l,l._defaultState={accounts:null,isConnected:!1,isUnlocked:!1,initialized:!1,isPermanentlyDisconnected:!1}}}},{package:"@metamask/providers",file:"../../node_modules/@metamask/providers/dist/BaseProvider.js"}],[57,{"./StreamProvider":58,"./messages":64,"./siteMetadata":67,"./utils":68,"eth-rpc-errors":106},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.MetaMaskInpageProvider=r.MetaMaskInpageProviderStreamName=void 0;const s=e("eth-rpc-errors"),i=n(e("./messages")),o=e("./siteMetadata"),a=e("./StreamProvider"),c=e("./utils");r.MetaMaskInpageProviderStreamName="metamask-provider";class u extends a.AbstractStreamProvider{constructor(e,{jsonRpcStreamName:t=r.MetaMaskInpageProviderStreamName,logger:n=console,maxEventListeners:s=100,shouldSendMetadata:i}={}){if(super(e,{jsonRpcStreamName:t,logger:n,maxEventListeners:s,rpcMiddleware:(0,c.getDefaultExternalMiddleware)(n)}),this._sentWarnings={enable:!1,experimentalMethods:!1,send:!1,events:{close:!1,data:!1,networkChanged:!1,notification:!1}},this._initializeStateAsync(),this.networkVersion=null,this.isMetaMask=!0,this._sendSync=this._sendSync.bind(this),this.enable=this.enable.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this._warnOfDeprecation=this._warnOfDeprecation.bind(this),this._metamask=this._getExperimentalApi(),this._jsonRpcConnection.events.on("notification",(e=>{const{method:t}=e;c.EMITTED_NOTIFICATIONS.includes(t)&&(this.emit("data",e),this.emit("notification",e.params.result))})),i)if("complete"===document.readyState)(0,o.sendSiteMetadata)(this._rpcEngine,this._log);else{const e=()=>{(0,o.sendSiteMetadata)(this._rpcEngine,this._log),window.removeEventListener("DOMContentLoaded",e)};window.addEventListener("DOMContentLoaded",e)}}sendAsync(e,t){this._rpcRequest(e,t)}addListener(e,t){return this._warnOfDeprecation(e),super.addListener(e,t)}on(e,t){return this._warnOfDeprecation(e),super.on(e,t)}once(e,t){return this._warnOfDeprecation(e),super.once(e,t)}prependListener(e,t){return this._warnOfDeprecation(e),super.prependListener(e,t)}prependOnceListener(e,t){return this._warnOfDeprecation(e),super.prependOnceListener(e,t)}_handleDisconnect(e,t){super._handleDisconnect(e,t),this.networkVersion&&!e&&(this.networkVersion=null)}_warnOfDeprecation(e){!1===this._sentWarnings?.events[e]&&(this._log.warn(i.default.warnings.events[e]),this._sentWarnings.events[e]=!0)}async enable(){return this._sentWarnings.enable||(this._log.warn(i.default.warnings.enableDeprecation),this._sentWarnings.enable=!0),new Promise(((e,t)=>{try{this._rpcRequest({method:"eth_requestAccounts",params:[]},(0,c.getRpcPromiseCallback)(e,t))}catch(e){t(e)}}))}send(e,t){return this._sentWarnings.send||(this._log.warn(i.default.warnings.sendDeprecation),this._sentWarnings.send=!0),"string"!=typeof e||t&&!Array.isArray(t)?e&&"object"==typeof e&&"function"==typeof t?this._rpcRequest(e,t):this._sendSync(e):new Promise(((r,n)=>{try{this._rpcRequest({method:e,params:t},(0,c.getRpcPromiseCallback)(r,n,!1))}catch(e){n(e)}}))}_sendSync(e){let t;switch(e.method){case"eth_accounts":t=this.selectedAddress?[this.selectedAddress]:[];break;case"eth_coinbase":t=this.selectedAddress??null;break;case"eth_uninstallFilter":this._rpcRequest(e,c.NOOP),t=!0;break;case"net_version":t=this.networkVersion??null;break;default:throw new Error(i.default.errors.unsupportedSync(e.method))}return{id:e.id,jsonrpc:e.jsonrpc,result:t}}_getExperimentalApi(){return new Proxy({isUnlocked:async()=>(this._state.initialized||await new Promise((e=>{this.on("_initialized",(()=>e()))})),this._state.isUnlocked),requestBatch:async e=>{if(!Array.isArray(e))throw s.ethErrors.rpc.invalidRequest({message:"Batch requests must be made with an array of request objects.",data:e});return new Promise(((t,r)=>{this._rpcRequest(e,(0,c.getRpcPromiseCallback)(t,r))}))}},{get:(e,t,...r)=>(this._sentWarnings.experimentalMethods||(this._log.warn(i.default.warnings.experimentalMethods),this._sentWarnings.experimentalMethods=!0),Reflect.get(e,t,...r))})}_handleChainChanged({chainId:e,networkVersion:t}={}){super._handleChainChanged({chainId:e,networkVersion:t}),this._state.isConnected&&t!==this.networkVersion&&(this.networkVersion=t,this._state.initialized&&this.emit("networkChanged",this.networkVersion))}}r.MetaMaskInpageProvider=u}}},{package:"@metamask/providers",file:"../../node_modules/@metamask/providers/dist/MetaMaskInpageProvider.js"}],[58,{"./BaseProvider":56,"./messages":64,"./utils":68,"@metamask/object-multiplex":3,"is-stream":114,"json-rpc-middleware-stream":125,pump:140},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.StreamProvider=r.AbstractStreamProvider=void 0;const s=n(e("@metamask/object-multiplex")),i=e("is-stream"),o=e("json-rpc-middleware-stream"),a=n(e("pump")),c=e("./BaseProvider"),u=n(e("./messages")),l=e("./utils");class d extends c.BaseProvider{constructor(e,{jsonRpcStreamName:t,logger:r=console,maxEventListeners:n=100,rpcMiddleware:c=[]}){if(super({logger:r,maxEventListeners:n,rpcMiddleware:c}),!(0,i.duplex)(e))throw new Error(u.default.errors.invalidDuplexStream());this._handleStreamDisconnect=this._handleStreamDisconnect.bind(this);const d=new s.default;(0,a.default)(e,d,e,this._handleStreamDisconnect.bind(this,"MetaMask")),this._jsonRpcConnection=(0,o.createStreamMiddleware)({retryOnMessage:"METAMASK_EXTENSION_CONNECT_CAN_RETRY"}),(0,a.default)(this._jsonRpcConnection.stream,d.createStream(t),this._jsonRpcConnection.stream,this._handleStreamDisconnect.bind(this,"MetaMask RpcProvider")),this._rpcEngine.push(this._jsonRpcConnection.middleware),this._jsonRpcConnection.events.on("notification",(t=>{const{method:r,params:n}=t;"metamask_accountsChanged"===r?this._handleAccountsChanged(n):"metamask_unlockStateChanged"===r?this._handleUnlockStateChanged(n):"metamask_chainChanged"===r?this._handleChainChanged(n):l.EMITTED_NOTIFICATIONS.includes(r)?this.emit("message",{type:r,data:n}):"METAMASK_STREAM_FAILURE"===r&&e.destroy(new Error(u.default.errors.permanentlyDisconnected()))}))}async _initializeStateAsync(){let e;try{e=await this.request({method:"metamask_getProviderState"})}catch(e){this._log.error("MetaMask: Failed to get initial state. Please report this bug.",e)}this._initializeState(e)}_handleStreamDisconnect(e,t){let r=`MetaMask: Lost connection to "${e}".`;t?.stack&&(r+=`\n${t.stack}`),this._log.warn(r),this.listenerCount("error")>0&&this.emit("error",r),this._handleDisconnect(!1,t?t.message:undefined)}_handleChainChanged({chainId:e,networkVersion:t}={}){(0,l.isValidChainId)(e)&&(0,l.isValidNetworkVersion)(t)?"loading"===t?this._handleDisconnect(!0):super._handleChainChanged({chainId:e}):this._log.error(u.default.errors.invalidNetworkParams(),{chainId:e,networkVersion:t})}}r.AbstractStreamProvider=d;r.StreamProvider=class extends d{async initialize(){return this._initializeStateAsync()}}}}},{package:"@metamask/providers",file:"../../node_modules/@metamask/providers/dist/StreamProvider.js"}],[59,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ERC20=r.ERC1155=r.ERC721=void 0,r.ERC721="ERC721",r.ERC1155="ERC1155",r.ERC20="ERC20"}}},{package:"@metamask/providers",file:"../../node_modules/@metamask/providers/dist/constants.js"}],[60,{"../MetaMaskInpageProvider":57,"../StreamProvider":58,"../utils":68,"./external-extension-config.json":61,"detect-browser":101,"extension-port-stream":108},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.createExternalExtensionProvider=void 0;const s=e("detect-browser"),i=n(e("extension-port-stream")),o=n(e("./external-extension-config.json")),a=e("../MetaMaskInpageProvider"),c=e("../StreamProvider"),u=e("../utils"),l=(0,s.detect)();r.createExternalExtensionProvider=function(e="stable"){let t;try{const r=function(e){return("firefox"===l?.name?o.default.firefoxIds:o.default.chromeIds)[e]??e}(e),n=chrome.runtime.connect(r),s=new i.default(n);t=new c.StreamProvider(s,{jsonRpcStreamName:a.MetaMaskInpageProviderStreamName,logger:console,rpcMiddleware:(0,u.getDefaultExternalMiddleware)(console)}),t.initialize()}catch(e){throw console.dir("MetaMask connect error.",e),e}return t}}}},{package:"@metamask/providers",file:"../../node_modules/@metamask/providers/dist/extension-provider/createExternalExtensionProvider.js"}],[61,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports={chromeIds:{stable:"nkbihfbeogaeaoehlefnkodbefgpgknn",beta:"pbbkamfgmaedccnfkmjcofcecjhfgldn",flask:"ljfoeinjpaedjfecbmggjgodbgkmjkjk"},firefoxIds:{stable:"webextension@metamask.io",beta:"webextension-beta@metamask.io",flask:"webextension-flask@metamask.io"}}}}},{package:"@metamask/providers",file:"../../node_modules/@metamask/providers/dist/extension-provider/external-extension-config.json"}],[62,{"./BaseProvider":56,"./MetaMaskInpageProvider":57,"./StreamProvider":58,"./extension-provider/createExternalExtensionProvider":60,"./initializeInpageProvider":63,"./shimWeb3":66},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.StreamProvider=r.shimWeb3=r.setGlobalProvider=r.MetaMaskInpageProvider=r.MetaMaskInpageProviderStreamName=r.initializeProvider=r.createExternalExtensionProvider=r.BaseProvider=void 0;const n=e("./BaseProvider");Object.defineProperty(r,"BaseProvider",{enumerable:!0,get:function(){return n.BaseProvider}});const s=e("./extension-provider/createExternalExtensionProvider");Object.defineProperty(r,"createExternalExtensionProvider",{enumerable:!0,get:function(){return s.createExternalExtensionProvider}});const i=e("./initializeInpageProvider");Object.defineProperty(r,"initializeProvider",{enumerable:!0,get:function(){return i.initializeProvider}}),Object.defineProperty(r,"setGlobalProvider",{enumerable:!0,get:function(){return i.setGlobalProvider}});const o=e("./MetaMaskInpageProvider");Object.defineProperty(r,"MetaMaskInpageProvider",{enumerable:!0,get:function(){return o.MetaMaskInpageProvider}}),Object.defineProperty(r,"MetaMaskInpageProviderStreamName",{enumerable:!0,get:function(){return o.MetaMaskInpageProviderStreamName}});const a=e("./shimWeb3");Object.defineProperty(r,"shimWeb3",{enumerable:!0,get:function(){return a.shimWeb3}});const c=e("./StreamProvider");Object.defineProperty(r,"StreamProvider",{enumerable:!0,get:function(){return c.StreamProvider}})}}},{package:"@metamask/providers",file:"../../node_modules/@metamask/providers/dist/index.js"}],[63,{"./MetaMaskInpageProvider":57,"./shimWeb3":66},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.setGlobalProvider=r.initializeProvider=void 0;const n=e("./MetaMaskInpageProvider"),s=e("./shimWeb3");function i(e){window.ethereum=e,window.dispatchEvent(new Event("ethereum#initialized"))}r.initializeProvider=function({connectionStream:e,jsonRpcStreamName:t,logger:r=console,maxEventListeners:o=100,shouldSendMetadata:a=!0,shouldSetOnWindow:c=!0,shouldShimWeb3:u=!1}){const l=new n.MetaMaskInpageProvider(e,{jsonRpcStreamName:t,logger:r,maxEventListeners:o,shouldSendMetadata:a}),d=new Proxy(l,{deleteProperty:()=>!0});return c&&i(d),u&&(0,s.shimWeb3)(d,r),d},r.setGlobalProvider=i}}},{package:"@metamask/providers",file:"../../node_modules/@metamask/providers/dist/initializeInpageProvider.js"}],[64,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});const n={errors:{disconnected:()=>"MetaMask: Disconnected from chain. Attempting to connect.",permanentlyDisconnected:()=>"MetaMask: Disconnected from MetaMask background. Page reload required.",sendSiteMetadata:()=>"MetaMask: Failed to send site metadata. This is an internal error, please report this bug.",unsupportedSync:e=>`MetaMask: The MetaMask Ethereum provider does not support synchronous methods like ${e} without a callback parameter.`,invalidDuplexStream:()=>"Must provide a Node.js-style duplex stream.",invalidNetworkParams:()=>"MetaMask: Received invalid network parameters. Please report this bug.",invalidRequestArgs:()=>"Expected a single, non-array, object argument.",invalidRequestMethod:()=>"'args.method' must be a non-empty string.",invalidRequestParams:()=>"'args.params' must be an object or array if provided.",invalidLoggerObject:()=>"'args.logger' must be an object if provided.",invalidLoggerMethod:e=>`'args.logger' must include required method '${e}'.`},info:{connected:e=>`MetaMask: Connected to chain with ID "${e}".`},warnings:{enableDeprecation:"MetaMask: 'ethereum.enable()' is deprecated and may be removed in the future. Please use the 'eth_requestAccounts' RPC method instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1102",sendDeprecation:"MetaMask: 'ethereum.send(...)' is deprecated and may be removed in the future. Please use 'ethereum.sendAsync(...)' or 'ethereum.request(...)' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193",events:{close:"MetaMask: The event 'close' is deprecated and may be removed in the future. Please use 'disconnect' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#disconnect",data:"MetaMask: The event 'data' is deprecated and will be removed in the future. Use 'message' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message",networkChanged:"MetaMask: The event 'networkChanged' is deprecated and may be removed in the future. Use 'chainChanged' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#chainchanged",notification:"MetaMask: The event 'notification' is deprecated and may be removed in the future. Use 'message' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message"},rpc:{ethDecryptDeprecation:"MetaMask: The RPC method 'eth_decrypt' is deprecated and may be removed in the future.\nFor more information, see: https://medium.com/metamask/metamask-api-method-deprecation-2b0564a84686",ethGetEncryptionPublicKeyDeprecation:"MetaMask: The RPC method 'eth_getEncryptionPublicKey' is deprecated and may be removed in the future.\nFor more information, see: https://medium.com/metamask/metamask-api-method-deprecation-2b0564a84686",walletWatchAssetNFTExperimental:"MetaMask: The RPC method 'wallet_watchAsset' is experimental for ERC721/ERC1155 assets and may change in the future.\nFor more information, see: https://github.com/MetaMask/metamask-improvement-proposals/blob/main/MIPs/mip-1.md and https://github.com/MetaMask/metamask-improvement-proposals/blob/main/PROCESS-GUIDE.md#proposal-lifecycle"},experimentalMethods:"MetaMask: 'ethereum._metamask' exposes non-standard, experimental methods. They may be removed or changed without warning."}};r.default=n}}},{package:"@metamask/providers",file:"../../node_modules/@metamask/providers/dist/messages.js"}],[65,{"../constants":59,"../messages":64},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.createRpcWarningMiddleware=void 0;const s=e("../constants"),i=n(e("../messages"));r.createRpcWarningMiddleware=function(e){const t={ethDecryptDeprecation:!1,ethGetEncryptionPublicKeyDeprecation:!1,walletWatchAssetNFTExperimental:!1};return(r,n,o)=>{t.ethDecryptDeprecation||"eth_decrypt"!==r.method?t.ethGetEncryptionPublicKeyDeprecation||"eth_getEncryptionPublicKey"!==r.method?!t.walletWatchAssetNFTExperimental&&"wallet_watchAsset"===r.method&&[s.ERC721,s.ERC1155].includes(r.params?.type||"")&&(e.warn(i.default.warnings.rpc.walletWatchAssetNFTExperimental),t.walletWatchAssetNFTExperimental=!0):(e.warn(i.default.warnings.rpc.ethGetEncryptionPublicKeyDeprecation),t.ethGetEncryptionPublicKeyDeprecation=!0):(e.warn(i.default.warnings.rpc.ethDecryptDeprecation),t.ethDecryptDeprecation=!0),o()}}}}},{package:"@metamask/providers",file:"../../node_modules/@metamask/providers/dist/middleware/createRpcWarningMiddleware.js"}],[66,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.shimWeb3=void 0,r.shimWeb3=function(e,t=console){let r=!1,n=!1;if(!window.web3){const s="__isMetaMaskShim__";let i={currentProvider:e};Object.defineProperty(i,s,{value:!0,enumerable:!0,configurable:!1,writable:!1}),i=new Proxy(i,{get:(i,o,...a)=>("currentProvider"!==o||r?"currentProvider"===o||o===s||n||(n=!0,t.error("MetaMask no longer injects web3. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3"),e.request({method:"metamask_logWeb3ShimUsage"}).catch((e=>{t.debug("MetaMask: Failed to log web3 shim usage.",e)}))):(r=!0,t.warn("You are accessing the MetaMask window.web3.currentProvider shim. This property is deprecated; use window.ethereum instead. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3")),Reflect.get(i,o,...a)),set:(...e)=>(t.warn("You are accessing the MetaMask window.web3 shim. This object is deprecated; use window.ethereum instead. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3"),Reflect.set(...e))}),Object.defineProperty(window,"web3",{value:i,enumerable:!1,configurable:!0,writable:!0})}}}}},{package:"@metamask/providers",file:"../../node_modules/@metamask/providers/dist/shimWeb3.js"}],[67,{"./messages":64,"./utils":68},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.sendSiteMetadata=void 0;const s=n(e("./messages")),i=e("./utils");function o(e){const{document:t}=e,r=t.querySelector('head > meta[property="og:site_name"]');if(r)return r.content;const n=t.querySelector('head > meta[name="title"]');return n?n.content:t.title&&t.title.length>0?t.title:window.location.hostname}async function a(e){const{document:t}=e,r=t.querySelectorAll('head > link[rel~="icon"]');for(const e of Array.from(r))if(e&&await c(e.href))return e.href;return null}async function c(e){return new Promise(((t,r)=>{try{const r=document.createElement("img");r.onload=()=>t(!0),r.onerror=()=>t(!1),r.src=e}catch(e){r(e)}}))}r.sendSiteMetadata=async function(e,t){try{const t=await async function(){return{name:o(window),icon:await a(window)}}();e.handle({jsonrpc:"2.0",id:1,method:"metamask_sendDomainMetadata",params:t},i.NOOP)}catch(e){t.error({message:s.default.errors.sendSiteMetadata(),originalError:e})}}}}},{package:"@metamask/providers",file:"../../node_modules/@metamask/providers/dist/siteMetadata.js"}],[68,{"./middleware/createRpcWarningMiddleware":65,"eth-rpc-errors":106,"json-rpc-engine":121},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.NOOP=r.isValidNetworkVersion=r.isValidChainId=r.getRpcPromiseCallback=r.getDefaultExternalMiddleware=r.EMITTED_NOTIFICATIONS=void 0;const n=e("eth-rpc-errors"),s=e("json-rpc-engine"),i=e("./middleware/createRpcWarningMiddleware");r.EMITTED_NOTIFICATIONS=Object.freeze(["eth_subscription"]);r.getDefaultExternalMiddleware=(e=console)=>{return[(0,s.createIdRemapMiddleware)(),(t=e,(e,r,s)=>{"string"==typeof e.method&&e.method||(r.error=n.ethErrors.rpc.invalidRequest({message:"The request 'method' must be a non-empty string.",data:e})),s((e=>{const{error:n}=r;return n?(t.error(`MetaMask - RPC Error: ${n.message}`,n),e()):e()}))}),(0,i.createRpcWarningMiddleware)(e)];var t};r.getRpcPromiseCallback=(e,t,r=!0)=>(n,s)=>{n||s.error?t(n||s.error):!r||Array.isArray(s)?e(s):e(s.result)};r.isValidChainId=e=>Boolean(e)&&"string"==typeof e&&e.startsWith("0x");r.isValidNetworkVersion=e=>Boolean(e)&&"string"==typeof e;r.NOOP=()=>undefined}}},{package:"@metamask/providers",file:"../../node_modules/@metamask/providers/dist/utils.js"}],[69,{events:"events"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});const n=e("events");function s(e,t,r){try{Reflect.apply(e,t,r)}catch(e){setTimeout((()=>{throw e}))}}class i extends n.EventEmitter{emit(e,...t){let r="error"===e;const n=this._events;if(n!==undefined)r=r&&n.error===undefined;else if(!r)return!1;if(r){let e;if(t.length>0&&([e]=t),e instanceof Error)throw e;const r=new Error("Unhandled error."+(e?` (${e.message})`:""));throw r.context=e,r}const i=n[e];if(i===undefined)return!1;if("function"==typeof i)s(i,this,t);else{const e=i.length,r=function(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}(i);for(let n=0;n<e;n+=1)s(r[n],this,t)}return!0}}r.default=i}}},{package:"@metamask/providers>@metamask/safe-event-emitter",file:"../../node_modules/@metamask/providers/node_modules/@metamask/safe-event-emitter/index.js"}],[70,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=Array.isArray,s=Object.keys,i=Object.prototype.hasOwnProperty;t.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){var o,a,c,u=n(t),l=n(r);if(u&&l){if((a=t.length)!=r.length)return!1;for(o=a;0!=o--;)if(!e(t[o],r[o]))return!1;return!0}if(u!=l)return!1;var d=t instanceof Date,h=r instanceof Date;if(d!=h)return!1;if(d&&h)return t.getTime()==r.getTime();var f=t instanceof RegExp,p=r instanceof RegExp;if(f!=p)return!1;if(f&&p)return t.toString()==r.toString();var m=s(t);if((a=m.length)!==s(r).length)return!1;for(o=a;0!=o--;)if(!i.call(r,m[o]))return!1;for(o=a;0!=o--;)if(!e(t[c=m[o]],r[c]))return!1;return!0}return t!=t&&r!=r}}}},{package:"@metamask/providers>fast-deep-equal",file:"../../node_modules/@metamask/providers/node_modules/fast-deep-equal/index.js"}],[71,{events:"events"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});const n=e("events");function s(e,t,r){try{Reflect.apply(e,t,r)}catch(e){setTimeout((()=>{throw e}))}}class i extends n.EventEmitter{emit(e,...t){let r="error"===e;const n=this._events;if(n!==undefined)r=r&&n.error===undefined;else if(!r)return!1;if(r){let e;if(t.length>0&&([e]=t),e instanceof Error)throw e;const r=new Error("Unhandled error."+(e?` (${e.message})`:""));throw r.context=e,r}const i=n[e];if(i===undefined)return!1;if("function"==typeof i)s(i,this,t);else{const e=i.length,r=function(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}(i);for(let n=0;n<e;n+=1)s(r[n],this,t)}return!0}}r.default=i}}},{package:"json-rpc-engine>@metamask/safe-event-emitter",file:"../../node_modules/@metamask/safe-event-emitter/index.js"}],[72,{superstruct:185},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.assertExhaustive=r.assertStruct=r.assert=r.AssertionError=void 0;const n=e("superstruct");function s(e,t){return r=e,Boolean("string"==typeof r?.prototype?.constructor?.name)?new e({message:t}):e({message:t});var r}class i extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}r.AssertionError=i,r.assert=function(e,t="Assertion failed.",r=i){if(!e){if(t instanceof Error)throw t;throw s(r,t)}},r.assertStruct=function(e,t,r="Assertion failed",o=i){try{(0,n.assert)(e,t)}catch(e){throw s(o,`${r}: ${function(e){const t=function(e){return"object"==typeof e&&null!==e&&"message"in e}(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}(e)}.`)}},r.assertExhaustive=function(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/assert.js"}],[73,{"./assert":72,superstruct:185},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.base64=void 0;const n=e("superstruct"),s=e("./assert");r.base64=(e,t={})=>{const r=t.paddingRequired??!1,i=t.characterSet??"base64";let o,a;return"base64"===i?o=String.raw`[A-Za-z0-9+\/]`:((0,s.assert)("base64url"===i),o=String.raw`[-_A-Za-z0-9]`),a=r?new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,n.pattern)(e,a)}}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/base64.js"}],[74,{"./assert":72,"./hex":79,buffer:"buffer"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.createDataView=r.concatBytes=r.valueToBytes=r.stringToBytes=r.numberToBytes=r.signedBigIntToBytes=r.bigIntToBytes=r.hexToBytes=r.bytesToString=r.bytesToNumber=r.bytesToSignedBigInt=r.bytesToBigInt=r.bytesToHex=r.assertIsBytes=r.isBytes=void 0;const n=e("./assert"),s=e("./hex"),i=48,o=58,a=87;const c=function(){const e=[];return()=>{if(0===e.length)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}();function u(e){return e instanceof Uint8Array}function l(e){(0,n.assert)(u(e),"Value must be a Uint8Array.")}function d(e){if(l(e),0===e.length)return"0x";const t=c(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,s.add0x)(r.join(""))}function h(e){l(e);const t=d(e);return BigInt(t)}function f(e){if("0x"===e?.toLowerCase?.())return new Uint8Array;(0,s.assertIsHexString)(e);const t=(0,s.remove0x)(e).toLowerCase(),r=t.length%2==0?t:`0${t}`,n=new Uint8Array(r.length/2);for(let e=0;e<n.length;e++){const t=r.charCodeAt(2*e),s=r.charCodeAt(2*e+1),c=t-(t<o?i:a),u=s-(s<o?i:a);n[e]=16*c+u}return n}function p(e){(0,n.assert)("bigint"==typeof e,"Value must be a bigint."),(0,n.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");return f(e.toString(16))}function m(e){(0,n.assert)("number"==typeof e,"Value must be a number."),(0,n.assert)(e>=0,"Value must be a non-negative number."),(0,n.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");return f(e.toString(16))}function g(e){return(0,n.assert)("string"==typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function b(e){if("bigint"==typeof e)return p(e);if("number"==typeof e)return m(e);if("string"==typeof e)return e.startsWith("0x")?f(e):g(e);if(u(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}r.isBytes=u,r.assertIsBytes=l,r.bytesToHex=d,r.bytesToBigInt=h,r.bytesToSignedBigInt=function(e){l(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(8*e.length,t)},r.bytesToNumber=function(e){l(e);const t=h(e);return(0,n.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)},r.bytesToString=function(e){return l(e),(new TextDecoder).decode(e)},r.hexToBytes=f,r.bigIntToBytes=p,r.signedBigIntToBytes=function(e,t){(0,n.assert)("bigint"==typeof e,"Value must be a bigint."),(0,n.assert)("number"==typeof t,"Byte length must be a number."),(0,n.assert)(t>0,"Byte length must be greater than 0."),(0,n.assert)(function(e,t){(0,n.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(8*t-1))}(e,t),"Byte length is too small to represent the given value.");let r=e;const s=new Uint8Array(t);for(let e=0;e<s.length;e++)s[e]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return s.reverse()},r.numberToBytes=m,r.stringToBytes=g,r.valueToBytes=b,r.concatBytes=function(e){const t=new Array(e.length);let r=0;for(let n=0;n<e.length;n++){const s=b(e[n]);t[n]=s,r+=s.length}const n=new Uint8Array(r);for(let e=0,r=0;e<t.length;e++)n.set(t[e],r),r+=t[e].length;return n},r.createDataView=function(e){if(void 0!==t&&e instanceof t){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/bytes.js"}],[75,{"./base64":73,superstruct:185},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ChecksumStruct=void 0;const n=e("superstruct"),s=e("./base64");r.ChecksumStruct=(0,n.size)((0,s.base64)((0,n.string)(),{paddingRequired:!0}),44,44)}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/checksum.js"}],[76,{"./assert":72,"./bytes":74,"./hex":79,superstruct:185},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createHex=r.createBytes=r.createBigInt=r.createNumber=void 0;const n=e("superstruct"),s=e("./assert"),i=e("./bytes"),o=e("./hex"),a=(0,n.union)([(0,n.number)(),(0,n.bigint)(),(0,n.string)(),o.StrictHexStruct]),c=(0,n.coerce)((0,n.number)(),a,Number),u=(0,n.coerce)((0,n.bigint)(),a,BigInt),l=((0,n.union)([o.StrictHexStruct,(0,n.instance)(Uint8Array)]),(0,n.coerce)((0,n.instance)(Uint8Array),(0,n.union)([o.StrictHexStruct]),i.hexToBytes)),d=(0,n.coerce)(o.StrictHexStruct,(0,n.instance)(Uint8Array),i.bytesToHex);r.createNumber=function(e){try{const t=(0,n.create)(e,c);return(0,s.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){if(t instanceof n.StructError)throw new Error(`Expected a number-like value, got "${e}".`);throw t}},r.createBigInt=function(e){try{return(0,n.create)(e,u)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a number-like value, got "${String(e.value)}".`);throw e}},r.createBytes=function(e){if("string"==typeof e&&"0x"===e.toLowerCase())return new Uint8Array;try{return(0,n.create)(e,l)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}},r.createHex=function(e){if(e instanceof Uint8Array&&0===e.length||"string"==typeof e&&"0x"===e.toLowerCase())return"0x";try{return(0,n.create)(e,d)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}}}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/coercers.js"}],[77,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s,i=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},o=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(r,"__esModule",{value:!0}),r.FrozenSet=r.FrozenMap=void 0;class a{constructor(e){n.set(this,void 0),i(this,n,new Map(e),"f"),Object.freeze(this)}get size(){return o(this,n,"f").size}[(n=new WeakMap,Symbol.iterator)](){return o(this,n,"f")[Symbol.iterator]()}entries(){return o(this,n,"f").entries()}forEach(e,t){return o(this,n,"f").forEach(((r,n,s)=>e.call(t,r,n,this)))}get(e){return o(this,n,"f").get(e)}has(e){return o(this,n,"f").has(e)}keys(){return o(this,n,"f").keys()}values(){return o(this,n,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([e,t])=>`${String(e)} => ${String(t)}`)).join(", ")} `:""}}`}}r.FrozenMap=a;class c{constructor(e){s.set(this,void 0),i(this,s,new Set(e),"f"),Object.freeze(this)}get size(){return o(this,s,"f").size}[(s=new WeakMap,Symbol.iterator)](){return o(this,s,"f")[Symbol.iterator]()}entries(){return o(this,s,"f").entries()}forEach(e,t){return o(this,s,"f").forEach(((r,n,s)=>e.call(t,r,n,this)))}has(e){return o(this,s,"f").has(e)}keys(){return o(this,s,"f").keys()}values(){return o(this,s,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((e=>String(e))).join(", ")} `:""}}`}}r.FrozenSet=c,Object.freeze(a),Object.freeze(a.prototype),Object.freeze(c),Object.freeze(c.prototype)}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/collections.js"}],[78,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/encryption-types.js"}],[79,{"./assert":72,"./bytes":74,"@noble/hashes/sha3":93,superstruct:185},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.remove0x=r.add0x=r.isValidChecksumAddress=r.getChecksumAddress=r.isValidHexAddress=r.assertIsStrictHexString=r.assertIsHexString=r.isStrictHexString=r.isHexString=r.HexChecksumAddressStruct=r.HexAddressStruct=r.StrictHexStruct=r.HexStruct=void 0;const n=e("@noble/hashes/sha3"),s=e("superstruct"),i=e("./assert"),o=e("./bytes");function a(e){return(0,s.is)(e,r.HexStruct)}function c(e){return(0,s.is)(e,r.StrictHexStruct)}function u(e){(0,i.assert)((0,s.is)(e,r.HexChecksumAddressStruct),"Invalid hex address.");const t=d(e.toLowerCase()),a=d((0,o.bytesToHex)((0,n.keccak_256)(t)));return`0x${t.split("").map(((e,t)=>{const r=a[t];return(0,i.assert)((0,s.is)(r,(0,s.string)()),"Hash shorter than address."),parseInt(r,16)>7?e.toUpperCase():e})).join("")}`}function l(e){return!!(0,s.is)(e,r.HexChecksumAddressStruct)&&u(e)===e}function d(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}r.HexStruct=(0,s.pattern)((0,s.string)(),/^(?:0x)?[0-9a-f]+$/iu),r.StrictHexStruct=(0,s.pattern)((0,s.string)(),/^0x[0-9a-f]+$/iu),r.HexAddressStruct=(0,s.pattern)((0,s.string)(),/^0x[0-9a-f]{40}$/u),r.HexChecksumAddressStruct=(0,s.pattern)((0,s.string)(),/^0x[0-9a-fA-F]{40}$/u),r.isHexString=a,r.isStrictHexString=c,r.assertIsHexString=function(e){(0,i.assert)(a(e),"Value must be a hexadecimal string.")},r.assertIsStrictHexString=function(e){(0,i.assert)(c(e),'Value must be a hexadecimal string, starting with "0x".')},r.isValidHexAddress=function(e){return(0,s.is)(e,r.HexAddressStruct)||l(e)},r.getChecksumAddress=u,r.isValidChecksumAddress=l,r.add0x=function(e){return e.startsWith("0x")?e:e.startsWith("0X")?`0x${e.substring(2)}`:`0x${e}`},r.remove0x=d}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/hex.js"}],[80,{"./assert":72,"./base64":73,"./bytes":74,"./checksum":75,"./coercers":76,"./collections":77,"./encryption-types":78,"./hex":79,"./json":81,"./keyring":82,"./logging":83,"./misc":84,"./number":85,"./opaque":86,"./time":87,"./transaction-types":88,"./versions":89},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./assert"),r),s(e("./base64"),r),s(e("./bytes"),r),s(e("./checksum"),r),s(e("./coercers"),r),s(e("./collections"),r),s(e("./encryption-types"),r),s(e("./hex"),r),s(e("./json"),r),s(e("./keyring"),r),s(e("./logging"),r),s(e("./misc"),r),s(e("./number"),r),s(e("./opaque"),r),s(e("./time"),r),s(e("./transaction-types"),r),s(e("./versions"),r)}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/index.js"}],[81,{"./assert":72,superstruct:185},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getJsonRpcIdValidator=r.assertIsJsonRpcError=r.isJsonRpcError=r.assertIsJsonRpcFailure=r.isJsonRpcFailure=r.assertIsJsonRpcSuccess=r.isJsonRpcSuccess=r.assertIsJsonRpcResponse=r.isJsonRpcResponse=r.assertIsPendingJsonRpcResponse=r.isPendingJsonRpcResponse=r.JsonRpcResponseStruct=r.JsonRpcFailureStruct=r.JsonRpcSuccessStruct=r.PendingJsonRpcResponseStruct=r.assertIsJsonRpcRequest=r.isJsonRpcRequest=r.assertIsJsonRpcNotification=r.isJsonRpcNotification=r.JsonRpcNotificationStruct=r.JsonRpcRequestStruct=r.JsonRpcParamsStruct=r.JsonRpcErrorStruct=r.JsonRpcIdStruct=r.JsonRpcVersionStruct=r.jsonrpc2=r.getJsonSize=r.getSafeJson=r.isValidJson=r.JsonStruct=r.UnsafeJsonStruct=void 0;const n=e("superstruct"),s=e("./assert");function i(e){return(0,n.create)(e,r.JsonStruct)}r.UnsafeJsonStruct=(0,n.union)([(0,n.literal)(null),(0,n.boolean)(),(0,n.define)("finite number",(e=>(0,n.is)(e,(0,n.number)())&&Number.isFinite(e))),(0,n.string)(),(0,n.array)((0,n.lazy)((()=>r.UnsafeJsonStruct))),(0,n.record)((0,n.string)(),(0,n.lazy)((()=>r.UnsafeJsonStruct)))]),r.JsonStruct=(0,n.coerce)(r.UnsafeJsonStruct,(0,n.any)(),(e=>((0,s.assertStruct)(e,r.UnsafeJsonStruct),JSON.parse(JSON.stringify(e,((e,t)=>"__proto__"===e||"constructor"===e?undefined:t)))))),r.isValidJson=function(e){try{return i(e),!0}catch{return!1}},r.getSafeJson=i,r.getJsonSize=function(e){(0,s.assertStruct)(e,r.JsonStruct,"Invalid JSON value");const t=JSON.stringify(e);return(new TextEncoder).encode(t).byteLength},r.jsonrpc2="2.0",r.JsonRpcVersionStruct=(0,n.literal)(r.jsonrpc2),r.JsonRpcIdStruct=(0,n.nullable)((0,n.union)([(0,n.number)(),(0,n.string)()])),r.JsonRpcErrorStruct=(0,n.object)({code:(0,n.integer)(),message:(0,n.string)(),data:(0,n.optional)(r.JsonStruct),stack:(0,n.optional)((0,n.string)())}),r.JsonRpcParamsStruct=(0,n.optional)((0,n.union)([(0,n.record)((0,n.string)(),r.JsonStruct),(0,n.array)(r.JsonStruct)])),r.JsonRpcRequestStruct=(0,n.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,method:(0,n.string)(),params:r.JsonRpcParamsStruct}),r.JsonRpcNotificationStruct=(0,n.omit)(r.JsonRpcRequestStruct,["id"]),r.isJsonRpcNotification=function(e){return(0,n.is)(e,r.JsonRpcNotificationStruct)},r.assertIsJsonRpcNotification=function(e,t){(0,s.assertStruct)(e,r.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",t)},r.isJsonRpcRequest=function(e){return(0,n.is)(e,r.JsonRpcRequestStruct)},r.assertIsJsonRpcRequest=function(e,t){(0,s.assertStruct)(e,r.JsonRpcRequestStruct,"Invalid JSON-RPC request",t)},r.PendingJsonRpcResponseStruct=(0,n.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,result:(0,n.optional)((0,n.unknown)()),error:(0,n.optional)(r.JsonRpcErrorStruct)}),r.JsonRpcSuccessStruct=(0,n.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,result:r.JsonStruct}),r.JsonRpcFailureStruct=(0,n.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,error:r.JsonRpcErrorStruct}),r.JsonRpcResponseStruct=(0,n.union)([r.JsonRpcSuccessStruct,r.JsonRpcFailureStruct]),r.isPendingJsonRpcResponse=function(e){return(0,n.is)(e,r.PendingJsonRpcResponseStruct)},r.assertIsPendingJsonRpcResponse=function(e,t){(0,s.assertStruct)(e,r.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",t)},r.isJsonRpcResponse=function(e){return(0,n.is)(e,r.JsonRpcResponseStruct)},r.assertIsJsonRpcResponse=function(e,t){(0,s.assertStruct)(e,r.JsonRpcResponseStruct,"Invalid JSON-RPC response",t)},r.isJsonRpcSuccess=function(e){return(0,n.is)(e,r.JsonRpcSuccessStruct)},r.assertIsJsonRpcSuccess=function(e,t){(0,s.assertStruct)(e,r.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",t)},r.isJsonRpcFailure=function(e){return(0,n.is)(e,r.JsonRpcFailureStruct)},r.assertIsJsonRpcFailure=function(e,t){(0,s.assertStruct)(e,r.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",t)},r.isJsonRpcError=function(e){return(0,n.is)(e,r.JsonRpcErrorStruct)},r.assertIsJsonRpcError=function(e,t){(0,s.assertStruct)(e,r.JsonRpcErrorStruct,"Invalid JSON-RPC error",t)},r.getJsonRpcIdValidator=function(e){const{permitEmptyString:t,permitFractions:r,permitNull:n}={permitEmptyString:!0,permitFractions:!1,permitNull:!0,...e};return e=>Boolean("number"==typeof e&&(r||Number.isInteger(e))||"string"==typeof e&&(t||e.length>0)||n&&null===e)}}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/json.js"}],[82,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/keyring.js"}],[83,{debug:99},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.createModuleLogger=r.createProjectLogger=void 0;const s=(0,n(e("debug")).default)("metamask");r.createProjectLogger=function(e){return s.extend(e)},r.createModuleLogger=function(e,t){return e.extend(t)}}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/logging.js"}],[84,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.calculateNumberSize=r.calculateStringSize=r.isASCII=r.isPlainObject=r.ESCAPE_CHARACTERS_REGEXP=r.JsonSize=r.hasProperty=r.isObject=r.isNullOrUndefined=r.isNonEmptyArray=void 0,r.isNonEmptyArray=function(e){return Array.isArray(e)&&e.length>0},r.isNullOrUndefined=function(e){return null===e||e===undefined},r.isObject=function(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)};function n(e){return e.charCodeAt(0)<=127}r.hasProperty=(e,t)=>Object.hasOwnProperty.call(e,t),function(e){e[e.Null=4]="Null",e[e.Comma=1]="Comma",e[e.Wrapper=1]="Wrapper",e[e.True=4]="True",e[e.False=5]="False",e[e.Quote=1]="Quote",e[e.Colon=1]="Colon",e[e.Date=24]="Date"}(r.JsonSize||(r.JsonSize={})),r.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,r.isPlainObject=function(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}},r.isASCII=n,r.calculateStringSize=function(e){return e.split("").reduce(((e,t)=>n(t)?e+1:e+2),0)+(e.match(r.ESCAPE_CHARACTERS_REGEXP)??[]).length},r.calculateNumberSize=function(e){return e.toString().length}}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/misc.js"}],[85,{"./assert":72,"./hex":79},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.hexToBigInt=r.hexToNumber=r.bigIntToHex=r.numberToHex=void 0;const n=e("./assert"),s=e("./hex");r.numberToHex=e=>((0,n.assert)("number"==typeof e,"Value must be a number."),(0,n.assert)(e>=0,"Value must be a non-negative number."),(0,n.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,s.add0x)(e.toString(16)));r.bigIntToHex=e=>((0,n.assert)("bigint"==typeof e,"Value must be a bigint."),(0,n.assert)(e>=0,"Value must be a non-negative bigint."),(0,s.add0x)(e.toString(16)));r.hexToNumber=e=>{(0,s.assertIsHexString)(e);const t=parseInt(e,16);return(0,n.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};r.hexToBigInt=e=>((0,s.assertIsHexString)(e),BigInt((0,s.add0x)(e)))}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/number.js"}],[86,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/opaque.js"}],[87,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.timeSince=r.inMilliseconds=r.Duration=void 0,function(e){e[e.Millisecond=1]="Millisecond",e[e.Second=1e3]="Second",e[e.Minute=6e4]="Minute",e[e.Hour=36e5]="Hour",e[e.Day=864e5]="Day",e[e.Week=6048e5]="Week",e[e.Year=31536e6]="Year"}(r.Duration||(r.Duration={}));const n=(e,t)=>{if(!(e=>Number.isInteger(e)&&e>=0)(e))throw new Error(`"${t}" must be a non-negative integer. Received: "${e}".`)};r.inMilliseconds=function(e,t){return n(e,"count"),e*t},r.timeSince=function(e){return n(e,"timestamp"),Date.now()-e}}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/time.js"}],[88,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/transaction-types.js"}],[89,{"./assert":72,semver:168,superstruct:185},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.satisfiesVersionRange=r.gtRange=r.gtVersion=r.assertIsSemVerRange=r.assertIsSemVerVersion=r.isValidSemVerRange=r.isValidSemVerVersion=r.VersionRangeStruct=r.VersionStruct=void 0;const n=e("semver"),s=e("superstruct"),i=e("./assert");r.VersionStruct=(0,s.refine)((0,s.string)(),"Version",(e=>null!==(0,n.valid)(e)||`Expected SemVer version, got "${e}"`)),r.VersionRangeStruct=(0,s.refine)((0,s.string)(),"Version range",(e=>null!==(0,n.validRange)(e)||`Expected SemVer range, got "${e}"`)),r.isValidSemVerVersion=function(e){return(0,s.is)(e,r.VersionStruct)},r.isValidSemVerRange=function(e){return(0,s.is)(e,r.VersionRangeStruct)},r.assertIsSemVerVersion=function(e){(0,i.assertStruct)(e,r.VersionStruct)},r.assertIsSemVerRange=function(e){(0,i.assertStruct)(e,r.VersionRangeStruct)},r.gtVersion=function(e,t){return(0,n.gt)(e,t)},r.gtRange=function(e,t){return(0,n.gtr)(e,t)},r.satisfiesVersionRange=function(e,t){return(0,n.satisfies)(e,t,{includePrerelease:!0})}}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/versions.js"}],[90,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){function n(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function s(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)}function i(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function o(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");n(e.outputLen),n(e.blockLen)}function a(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function c(e,t){i(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(r,"__esModule",{value:!0}),r.output=r.exists=r.hash=r.bytes=r.bool=r.number=void 0,r.number=n,r.bool=s,r.bytes=i,r.hash=o,r.exists=a,r.output=c;const u={number:n,bool:s,bytes:i,hash:o,exists:a,output:c};r.default=u}}},{package:"@metamask/utils>@noble/hashes",file:"../../node_modules/@noble/hashes/_assert.js"}],[91,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.add=r.toBig=r.split=r.fromBig=void 0;const n=BigInt(2**32-1),s=BigInt(32);function i(e,t=!1){return t?{h:Number(e&n),l:Number(e>>s&n)}:{h:0|Number(e>>s&n),l:0|Number(e&n)}}function o(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:o,l:a}=i(e[s],t);[r[s],n[s]]=[o,a]}return[r,n]}r.fromBig=i,r.split=o;r.toBig=(e,t)=>BigInt(e>>>0)<<s|BigInt(t>>>0);function a(e,t,r,n){const s=(t>>>0)+(n>>>0);return{h:e+r+(s/2**32|0)|0,l:0|s}}r.add=a;const c={fromBig:i,split:o,toBig:r.toBig,shrSH:(e,t,r)=>e>>>r,shrSL:(e,t,r)=>e<<32-r|t>>>r,rotrSH:(e,t,r)=>e>>>r|t<<32-r,rotrSL:(e,t,r)=>e<<32-r|t>>>r,rotrBH:(e,t,r)=>e<<64-r|t>>>r-32,rotrBL:(e,t,r)=>e>>>r-32|t<<64-r,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:(e,t,r)=>e<<r|t>>>32-r,rotlSL:(e,t,r)=>t<<r|e>>>32-r,rotlBH:(e,t,r)=>t<<r-32|e>>>64-r,rotlBL:(e,t,r)=>e<<r-32|t>>>64-r,add:a,add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/2**32|0)|0,add4L:(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H:(e,t,r,n,s)=>t+r+n+s+(e/2**32|0)|0,add5H:(e,t,r,n,s,i)=>t+r+n+s+i+(e/2**32|0)|0,add5L:(e,t,r,n,s)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(s>>>0)};r.default=c}}},{package:"@metamask/utils>@noble/hashes",file:"../../node_modules/@noble/hashes/_u64.js"}],[92,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.crypto=void 0,r.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:undefined}}},{package:"@metamask/utils>@noble/hashes",file:"../../node_modules/@noble/hashes/crypto.js"}],[93,{"./_assert.js":90,"./_u64.js":91,"./utils.js":94},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.shake256=r.shake128=r.keccak_512=r.keccak_384=r.keccak_256=r.keccak_224=r.sha3_512=r.sha3_384=r.sha3_256=r.sha3_224=r.Keccak=r.keccakP=void 0;const n=e("./_assert.js"),s=e("./_u64.js"),i=e("./utils.js"),[o,a,c]=[[],[],[]],u=BigInt(0),l=BigInt(1),d=BigInt(2),h=BigInt(7),f=BigInt(256),p=BigInt(113);for(let e=0,t=l,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],o.push(2*(5*n+r)),a.push((e+1)*(e+2)/2%64);let s=u;for(let e=0;e<7;e++)t=(t<<l^(t>>h)*p)%f,t&d&&(s^=l<<(l<<BigInt(e))-l);c.push(s)}const[m,g]=s.default.split(c,!0),b=(e,t,r)=>r>32?s.default.rotlBH(e,t,r):s.default.rotlSH(e,t,r),w=(e,t,r)=>r>32?s.default.rotlBL(e,t,r):s.default.rotlSL(e,t,r);function y(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,s=(t+2)%10,i=r[s],o=r[s+1],a=b(i,o,1)^r[n],c=w(i,o,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=c}let t=e[2],s=e[3];for(let r=0;r<24;r++){const n=a[r],i=b(t,s,n),c=w(t,s,n),u=o[r];t=e[u],s=e[u+1],e[u]=i,e[u+1]=c}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=m[n],e[1]^=g[n]}r.fill(0)}r.keccakP=y;class v extends i.Hash{constructor(e,t,r,s=!1,o=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=s,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,n.default.number(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,i.u32)(this.state)}keccak(){y(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){n.default.exists(this);const{blockLen:t,state:r}=this,s=(e=(0,i.toBytes)(e)).length;for(let n=0;n<s;){const i=Math.min(t-this.pos,s-n);for(let t=0;t<i;t++)r[this.pos++]^=e[n++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,0!=(128&t)&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){n.default.exists(this,!1),n.default.bytes(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,s=e.length;n<s;){this.posOut>=r&&this.keccak();const i=Math.min(r-this.posOut,s-n);e.set(t.subarray(this.posOut,this.posOut+i),n),this.posOut+=i,n+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return n.default.number(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(n.default.output(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:s,enableXOF:i}=this;return e||(e=new v(t,r,n,i,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=r,e.outputLen=n,e.enableXOF=i,e.destroyed=this.destroyed,e}}r.Keccak=v;const _=(e,t,r)=>(0,i.wrapConstructor)((()=>new v(t,e,r)));r.sha3_224=_(6,144,28),r.sha3_256=_(6,136,32),r.sha3_384=_(6,104,48),r.sha3_512=_(6,72,64),r.keccak_224=_(1,144,28),r.keccak_256=_(1,136,32),r.keccak_384=_(1,104,48),r.keccak_512=_(1,72,64);const S=(e,t,r)=>(0,i.wrapXOFConstructorWithOpts)(((n={})=>new v(t,e,n.dkLen===undefined?r:n.dkLen,!0)));r.shake128=S(31,168,16),r.shake256=S(31,136,32)}}},{package:"@metamask/utils>@noble/hashes",file:"../../node_modules/@noble/hashes/sha3.js"}],[94,{"@noble/hashes/crypto":92},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){
|
|
12142
|
+
LavaPack.loadBundle([[1,{"./Substream":2,"end-of-stream":101,once:139,"readable-stream":13},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.ObjectMultiplex=void 0;const s=e("readable-stream"),i=n(e("end-of-stream")),o=n(e("once")),a=e("./Substream"),c=Symbol("IGNORE_SUBSTREAM");class u extends s.Duplex{constructor(e={}){super(Object.assign(Object.assign({},e),{objectMode:!0})),this._substreams={}}createStream(e){if(this.destroyed)throw new Error(`ObjectMultiplex - parent stream for name "${e}" already destroyed`);if(this._readableState.ended||this._writableState.ended)throw new Error(`ObjectMultiplex - parent stream for name "${e}" already ended`);if(!e)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[e])throw new Error(`ObjectMultiplex - Substream for name "${e}" already exists`);const t=new a.Substream({parent:this,name:e});return this._substreams[e]=t,function(e,t){const r=o.default(t);i.default(e,{readable:!1},r),i.default(e,{writable:!1},r)}(this,(e=>t.destroy(e||undefined))),t}ignoreStream(e){if(!e)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[e])throw new Error(`ObjectMultiplex - Substream for name "${e}" already exists`);this._substreams[e]=c}_read(){return undefined}_write(e,t,r){const{name:n,data:s}=e;if(!n)return console.warn(`ObjectMultiplex - malformed chunk without name "${e}"`),r();const i=this._substreams[n];return i?(i!==c&&i.push(s),r()):(console.warn(`ObjectMultiplex - orphaned data for stream "${n}"`),r())}}r.ObjectMultiplex=u}}},{package:"@metamask/object-multiplex",file:"../../node_modules/@metamask/object-multiplex/dist/ObjectMultiplex.js"}],[2,{"readable-stream":13},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Substream=void 0;const n=e("readable-stream");class s extends n.Duplex{constructor({parent:e,name:t}){super({objectMode:!0}),this._parent=e,this._name=t}_read(){return undefined}_write(e,t,r){this._parent.push({name:this._name,data:e}),r()}}r.Substream=s}}},{package:"@metamask/object-multiplex",file:"../../node_modules/@metamask/object-multiplex/dist/Substream.js"}],[3,{"./ObjectMultiplex":1},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./ObjectMultiplex");t.exports=n.ObjectMultiplex}}},{package:"@metamask/object-multiplex",file:"../../node_modules/@metamask/object-multiplex/dist/index.js"}],[4,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){"undefined"==typeof process||!process.version||0===process.version.indexOf("v0.")||0===process.version.indexOf("v1.")&&0!==process.version.indexOf("v1.8.")?t.exports={nextTick:function(e,t,r,n){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var s,i,o=arguments.length;switch(o){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick((function(){e.call(null,t)}));case 3:return process.nextTick((function(){e.call(null,t,r)}));case 4:return process.nextTick((function(){e.call(null,t,r,n)}));default:for(s=new Array(o-1),i=0;i<s.length;)s[i++]=arguments[i];return process.nextTick((function(){e.apply(null,s)}))}}}:t.exports=process}}},{package:"@metamask/object-multiplex>readable-stream>process-nextick-args",file:"../../node_modules/@metamask/object-multiplex/node_modules/process-nextick-args/index.js"}],[5,{"./_stream_readable":7,"./_stream_writable":9,"core-util-is":94,inherits:111,"process-nextick-args":4},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("process-nextick-args"),s=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=d;var i=Object.create(e("core-util-is"));i.inherits=e("inherits");var o=e("./_stream_readable"),a=e("./_stream_writable");i.inherits(d,o);for(var c=s(a.prototype),u=0;u<c.length;u++){var l=c[u];d.prototype[l]||(d.prototype[l]=a.prototype[l])}function d(e){if(!(this instanceof d))return new d(e);o.call(this,e),a.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||n.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(d.prototype,"destroyed",{get:function(){return this._readableState!==undefined&&this._writableState!==undefined&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){this._readableState!==undefined&&this._writableState!==undefined&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),d.prototype._destroy=function(e,t){this.push(null),this.end(),n.nextTick(t,e)}}}},{package:"@metamask/object-multiplex>readable-stream",file:"../../node_modules/@metamask/object-multiplex/node_modules/readable-stream/lib/_stream_duplex.js"}],[6,{"./_stream_transform":8,"core-util-is":94,inherits:111},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=i;var n=e("./_stream_transform"),s=Object.create(e("core-util-is"));function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}s.inherits=e("inherits"),s.inherits(i,n),i.prototype._transform=function(e,t,r){r(null,e)}}}},{package:"@metamask/object-multiplex>readable-stream",file:"../../node_modules/@metamask/object-multiplex/node_modules/readable-stream/lib/_stream_passthrough.js"}],[7,{"./_stream_duplex":5,"./internal/streams/BufferList":10,"./internal/streams/destroy":11,"./internal/streams/stream":12,"core-util-is":94,events:"events",inherits:111,isarray:115,"process-nextick-args":4,"safe-buffer":14,"string_decoder/":15,util:"util"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("process-nextick-args");t.exports=w;var s,i=e("isarray");w.ReadableState=b;e("events").EventEmitter;var o=function(e,t){return e.listeners(t).length},a=e("./internal/streams/stream"),c=e("safe-buffer").Buffer,u=global.Uint8Array||function(){};var l=Object.create(e("core-util-is"));l.inherits=e("inherits");var d=e("util"),h=void 0;h=d&&d.debuglog?d.debuglog("stream"):function(){};var f,p=e("./internal/streams/BufferList"),m=e("./internal/streams/destroy");l.inherits(w,a);var g=["error","close","destroy","pause","resume"];function b(t,r){t=t||{};var n=r instanceof(s=s||e("./_stream_duplex"));this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,o=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(o||0===o)?o:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new p,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.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(f||(f=e("string_decoder/").StringDecoder),this.decoder=new f(t.encoding),this.encoding=t.encoding)}function w(t){if(s=s||e("./_stream_duplex"),!(this instanceof w))return new w(t);this._readableState=new b(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function y(e,t,r,n,s){var i,o=e._readableState;null===t?(o.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,k(e)}(e,o)):(s||(i=function(e,t){var r;n=t,c.isBuffer(n)||n instanceof u||"string"==typeof t||t===undefined||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(o,t)),i?e.emit("error",i):o.objectMode||t&&t.length>0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):v(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?v(e,o,t,!1):T(e,o)):v(e,o,t,!1))):n||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(o)}function v(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&k(e)),T(e,t)}Object.defineProperty(w.prototype,"destroyed",{get:function(){return this._readableState!==undefined&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),w.prototype.destroy=m.destroy,w.prototype._undestroy=m.undestroy,w.prototype._destroy=function(e,t){this.push(null),t(e)},w.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=c.from(e,t),t=""),r=!0),y(this,e,t,!1,r)},w.prototype.unshift=function(e){return y(this,e,null,!0,!1)},w.prototype.isPaused=function(){return!1===this._readableState.flowing},w.prototype.setEncoding=function(t){return f||(f=e("string_decoder/").StringDecoder),this._readableState.decoder=new f(t),this._readableState.encoding=t,this};var _=8388608;function S(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>=_?e=_:(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 k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?n.nextTick(E,e):E(e))}function E(e){h("emit readable"),e.emit("readable"),M(e)}function T(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(x,e,t))}function x(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(h("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function R(e){h("readable nexttick read 0"),e.read(0)}function j(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),M(e),t.flowing&&!t.reading&&e.read(0)}function M(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&null!==e.read(););}function O(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,s=r.data;e-=s.length;for(;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(o===i.length?s+=i:s+=i.slice(0,e),0===(e-=o)){o===i.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(o));break}++n}return t.length-=n,s}(e,t):function(e,t){var r=c.allocUnsafe(e),n=t.head,s=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var i=n.data,o=e>i.length?i.length:e;if(i.copy(r,r.length-e,0,o),0===(e-=o)){o===i.length?(++s,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(o));break}++s}return t.length-=s,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function P(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,n.nextTick(C,t,e))}function C(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function I(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}w.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?P(this):k(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&P(this),null;var n,s=t.needReadable;return h("need readable",s),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",s=!0),t.ended||t.reading?h("reading or ended",s=!1):s&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=S(r,t))),null===(n=e>0?O(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&P(this)),null!==n&&this.emit("data",n),n},w.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},w.prototype.pipe=function(e,t){var r=this,s=this._readableState;switch(s.pipesCount){case 0:s.pipes=e;break;case 1:s.pipes=[s.pipes,e];break;default:s.pipes.push(e)}s.pipesCount+=1,h("pipe count=%d opts=%j",s.pipesCount,t);var a=(!t||!1!==t.end)&&e!==process.stdout&&e!==process.stderr?u:w;function c(t,n){h("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,h("cleanup"),e.removeListener("close",g),e.removeListener("finish",b),e.removeListener("drain",l),e.removeListener("error",m),e.removeListener("unpipe",c),r.removeListener("end",u),r.removeListener("end",w),r.removeListener("data",p),d=!0,!s.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function u(){h("onend"),e.end()}s.endEmitted?n.nextTick(a):r.once("end",a),e.on("unpipe",c);var l=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,M(e))}}(r);e.on("drain",l);var d=!1;var f=!1;function p(t){h("ondata"),f=!1,!1!==e.write(t)||f||((1===s.pipesCount&&s.pipes===e||s.pipesCount>1&&-1!==I(s.pipes,e))&&!d&&(h("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,f=!0),r.pause())}function m(t){h("onerror",t),w(),e.removeListener("error",m),0===o(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",b),w()}function b(){h("onfinish"),e.removeListener("close",g),w()}function w(){h("unpipe"),r.unpipe(e)}return r.on("data",p),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?i(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",m),e.once("close",g),e.once("finish",b),e.emit("pipe",r),s.flowing||(h("pipe resume"),r.resume()),e},w.prototype.unpipe=function(e){var t=this._readableState,r={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,r)),this;if(!e){var n=t.pipes,s=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<s;i++)n[i].emit("unpipe",this,r);return this}var o=I(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},w.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var s=this._readableState;s.endEmitted||s.readableListening||(s.readableListening=s.needReadable=!0,s.emittedReadable=!1,s.reading?s.length&&k(this):n.nextTick(R,this))}return r},w.prototype.addListener=w.prototype.on,w.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(j,e,t))}(this,e)),this},w.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this},w.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var s in e.on("end",(function(){if(h("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(s){(h("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!r.objectMode||null!==s&&s!==undefined)&&((r.objectMode||s&&s.length)&&(t.push(s)||(n=!0,e.pause())))})),e)this[s]===undefined&&"function"==typeof e[s]&&(this[s]=function(t){return function(){return e[t].apply(e,arguments)}}(s));for(var i=0;i<g.length;i++)e.on(g[i],this.emit.bind(this,g[i]));return this._read=function(t){h("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(w.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),w._fromList=O}}},{package:"@metamask/object-multiplex>readable-stream",file:"../../node_modules/@metamask/object-multiplex/node_modules/readable-stream/lib/_stream_readable.js"}],[8,{"./_stream_duplex":5,"core-util-is":94,inherits:111},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=o;var n=e("./_stream_duplex"),s=Object.create(e("core-util-is"));function i(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var s=this._readableState;s.reading=!1,(s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}function o(e){if(!(this instanceof o))return new o(e);n.call(this,e),this._transformState={afterTransform:i.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",a)}function a(){var e=this;"function"==typeof this._flush?this._flush((function(t,r){c(e,t,r)})):c(this,null,null)}function c(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}s.inherits=e("inherits"),s.inherits(o,n),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},o.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},o.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var s=this._readableState;(n.needTransform||s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}},o.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},o.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,(function(e){t(e),r.emit("close")}))}}}},{package:"@metamask/object-multiplex>readable-stream",file:"../../node_modules/@metamask/object-multiplex/node_modules/readable-stream/lib/_stream_transform.js"}],[9,{"./_stream_duplex":5,"./internal/streams/destroy":11,"./internal/streams/stream":12,"core-util-is":94,inherits:111,"process-nextick-args":4,"safe-buffer":14,timers:"timers","util-deprecate":188},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(r){(function(){var n=e("process-nextick-args");function s(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var s=n.callback;t.pendingcb--,s(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}t.exports=g;var i,o=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?r:n.nextTick;g.WritableState=m;var a=Object.create(e("core-util-is"));a.inherits=e("inherits");var c={deprecate:e("util-deprecate")},u=e("./internal/streams/stream"),l=e("safe-buffer").Buffer,d=global.Uint8Array||function(){};var h,f=e("./internal/streams/destroy");function p(){}function m(t,r){i=i||e("./_stream_duplex"),t=t||{};var a=r instanceof i;this.objectMode=!!t.objectMode,a&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var c=t.highWaterMark,u=t.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=c||0===c?c:a&&(u||0===u)?u:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var d=!1===t.decodeStrings;this.decodeStrings=!d,this.defaultEncoding=t.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 r=e._writableState,s=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,s,i){--t.pendingcb,r?(n.nextTick(i,s),n.nextTick(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",s)):(i(s),e._writableState.errorEmitted=!0,e.emit("error",s),S(e,t))}(e,r,s,t,i);else{var a=v(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||y(e,r),s?o(w,e,r,a,i):w(e,r,a,i)}}(r,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function g(t){if(i=i||e("./_stream_duplex"),!(h.call(g,this)||this instanceof i))return new g(t);this._writableState=new m(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),u.call(this)}function b(e,t,r,n,s,i,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(s,t.onwrite):e._write(s,i,t.onwrite),t.sync=!1}function w(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),S(e,t)}function y(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var a=0,c=!0;r;)i[a]=r,r.isBuf||(c=!1),r=r.next,a+=1;i.allBuffers=c,b(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new s(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,d=r.callback;if(b(e,t,!1,t.objectMode?1:u.length,u,l,d),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function v(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function _(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),S(e,t)}))}function S(e,t){var r=v(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,n.nextTick(_,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}a.inherits(g,u),m.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(m.prototype,"buffer",{get:c.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]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(e){return!!h.call(this,e)||this===g&&(e&&e._writableState instanceof m)}})):h=function(e){return e instanceof this},g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},g.prototype.write=function(e,t,r){var s,i=this._writableState,o=!1,a=!i.objectMode&&(s=e,l.isBuffer(s)||s instanceof d);return a&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=p),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),n.nextTick(t,r)}(this,r):(a||function(e,t,r,s){var i=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||r===undefined||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),n.nextTick(s,o),i=!1),i}(this,i,e,r))&&(i.pendingcb++,o=function(e,t,r,n,s,i){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,r));return t}(t,n,s);n!==o&&(r=!0,s="buffer",n=o)}var a=t.objectMode?1:n.length;t.length+=a;var c=t.length<t.highWaterMark;c||(t.needDrain=!0);if(t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:s,isBuf:r,callback:i,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else b(e,t,!1,a,n,s,i);return c}(this,i,a,e,t,r)),o},g.prototype.cork=function(){this._writableState.corked++},g.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||y(this,e))},g.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 TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),g.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(e,t,r){var s=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!==e&&e!==undefined&&this.write(e,t),s.corked&&(s.corked=1,this.uncork()),s.ending||s.finished||function(e,t,r){t.ending=!0,S(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,s,r)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return this._writableState!==undefined&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),g.prototype.destroy=f.destroy,g.prototype._undestroy=f.undestroy,g.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this)}).call(this,e("timers").setImmediate)}}},{package:"@metamask/object-multiplex>readable-stream",file:"../../node_modules/@metamask/object-multiplex/node_modules/readable-stream/lib/_stream_writable.js"}],[10,{"safe-buffer":14,util:"util"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("safe-buffer").Buffer,s=e("util");t.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}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=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}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t,r,s,i=n.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=i,s=a,t.copy(r,s),a+=o.data.length,o=o.next;return i},e}(),s&&s.inspect&&s.inspect.custom&&(t.exports.prototype[s.inspect.custom]=function(){var e=s.inspect({length:this.length});return this.constructor.name+" "+e})}}},{package:"@metamask/object-multiplex>readable-stream",file:"../../node_modules/@metamask/object-multiplex/node_modules/readable-stream/lib/internal/streams/BufferList.js"}],[11,{"process-nextick-args":4},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("process-nextick-args");function s(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return i||o?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n.nextTick(s,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(n.nextTick(s,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})),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.finished=!1,this._writableState.errorEmitted=!1)}}}}},{package:"@metamask/object-multiplex>readable-stream",file:"../../node_modules/@metamask/object-multiplex/node_modules/readable-stream/lib/internal/streams/destroy.js"}],[12,{stream:"stream"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=e("stream")}}},{package:"@metamask/object-multiplex>readable-stream",file:"../../node_modules/@metamask/object-multiplex/node_modules/readable-stream/lib/internal/streams/stream.js"}],[13,{"./lib/_stream_duplex.js":5,"./lib/_stream_passthrough.js":6,"./lib/_stream_readable.js":7,"./lib/_stream_transform.js":8,"./lib/_stream_writable.js":9,stream:"stream"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("stream");"disable"===process.env.READABLE_STREAM&&n?(t.exports=n,(r=t.exports=n.Readable).Readable=n.Readable,r.Writable=n.Writable,r.Duplex=n.Duplex,r.Transform=n.Transform,r.PassThrough=n.PassThrough,r.Stream=n):((r=t.exports=e("./lib/_stream_readable.js")).Stream=n||r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"))}}},{package:"@metamask/object-multiplex>readable-stream",file:"../../node_modules/@metamask/object-multiplex/node_modules/readable-stream/readable.js"}],[14,{buffer:"buffer"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("buffer"),s=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return s(e,t,r)}s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow?t.exports=n:(i(n,r),r.Buffer=o),i(s,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return s(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=s(e);return t!==undefined?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return s(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}}}},{package:"@metamask/object-multiplex>readable-stream>safe-buffer",file:"../../node_modules/@metamask/object-multiplex/node_modules/safe-buffer/index.js"}],[15,{"safe-buffer":14},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("safe-buffer").Buffer,s=n.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 i(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&&(n.isEncoding===s||!s(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=l,this.end=d,t=3;break;default:return this.write=h,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){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 r!==undefined?r: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 c(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?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-r))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}r.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if((t=this.fillLast(e))===undefined)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var s=o(t[n]);if(s>=0)return s>0&&(e.lastNeed=s-1),s;if(--n<r||-2===s)return 0;if(s=o(t[n]),s>=0)return s>0&&(e.lastNeed=s-2),s;if(--n<r||-2===s)return 0;if(s=o(t[n]),s>=0)return s>0&&(2===s?s=0:e.lastNeed=s-3),s;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},i.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}}}},{package:"@metamask/object-multiplex>readable-stream>string_decoder",file:"../../node_modules/@metamask/object-multiplex/node_modules/string_decoder/lib/string_decoder.js"}],[16,{"readable-stream":53},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.BasePostMessageStream=void 0;const n=e("readable-stream"),s=()=>undefined,i="ACK";class o extends n.Duplex{constructor(){super({objectMode:!0}),this._init=!1,this._haveSyn=!1}_handshake(){this._write("SYN",null,s),this.cork()}_onData(e){if(this._init)try{this.push(e)}catch(e){this.emit("error",e)}else"SYN"===e?(this._haveSyn=!0,this._write(i,null,s)):e===i&&(this._init=!0,this._haveSyn||this._write(i,null,s),this.uncork())}_read(){return undefined}_write(e,t,r){this._postMessage(e),r()}}r.BasePostMessageStream=o}}},{package:"@metamask/post-message-stream",file:"../../node_modules/@metamask/post-message-stream/dist/BasePostMessageStream.js"}],[17,{"../BasePostMessageStream":16,"../utils":25},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.WebWorkerParentPostMessageStream=void 0;const n=e("../BasePostMessageStream"),s=e("../utils");class i extends n.BasePostMessageStream{constructor({worker:e}){super(),this._target=s.DEDICATED_WORKER_NAME,this._worker=e,this._worker.onmessage=this._onMessage.bind(this),this._handshake()}_postMessage(e){this._worker.postMessage({target:this._target,data:e})}_onMessage(e){const t=e.data;(0,s.isValidStreamMessage)(t)&&this._onData(t.data)}_destroy(){this._worker.onmessage=null,this._worker=null}}r.WebWorkerParentPostMessageStream=i}}},{package:"@metamask/post-message-stream",file:"../../node_modules/@metamask/post-message-stream/dist/WebWorker/WebWorkerParentPostMessageStream.js"}],[18,{"../BasePostMessageStream":16,"../utils":25},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.WebWorkerPostMessageStream=void 0;const n=e("../BasePostMessageStream"),s=e("../utils");class i extends n.BasePostMessageStream{constructor(){if("undefined"==typeof self||"undefined"==typeof WorkerGlobalScope)throw new Error("WorkerGlobalScope not found. This class should only be instantiated in a WebWorker.");super(),this._name=s.DEDICATED_WORKER_NAME,self.addEventListener("message",this._onMessage.bind(this)),this._handshake()}_postMessage(e){self.postMessage({data:e})}_onMessage(e){const t=e.data;(0,s.isValidStreamMessage)(t)&&t.target===this._name&&this._onData(t.data)}_destroy(){return undefined}}r.WebWorkerPostMessageStream=i}}},{package:"@metamask/post-message-stream",file:"../../node_modules/@metamask/post-message-stream/dist/WebWorker/WebWorkerPostMessageStream.js"}],[19,{"./BasePostMessageStream":16,"./WebWorker/WebWorkerParentPostMessageStream":17,"./WebWorker/WebWorkerPostMessageStream":18,"./node-process/ProcessMessageStream":20,"./node-process/ProcessParentMessageStream":21,"./node-thread/ThreadMessageStream":22,"./node-thread/ThreadParentMessageStream":23,"./runtime/BrowserRuntimePostMessageStream":24,"./window/WindowPostMessageStream":26},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./window/WindowPostMessageStream"),r),s(e("./WebWorker/WebWorkerPostMessageStream"),r),s(e("./WebWorker/WebWorkerParentPostMessageStream"),r),s(e("./node-process/ProcessParentMessageStream"),r),s(e("./node-process/ProcessMessageStream"),r),s(e("./node-thread/ThreadParentMessageStream"),r),s(e("./node-thread/ThreadMessageStream"),r),s(e("./runtime/BrowserRuntimePostMessageStream"),r),s(e("./BasePostMessageStream"),r)}}},{package:"@metamask/post-message-stream",file:"../../node_modules/@metamask/post-message-stream/dist/index.js"}],[20,{"../BasePostMessageStream":16,"../utils":25},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ProcessMessageStream=void 0;const n=e("../BasePostMessageStream"),s=e("../utils");class i extends n.BasePostMessageStream{constructor(){if(super(),"function"!=typeof globalThis.process.send)throw new Error("Parent IPC channel not found. This class should only be instantiated in a Node.js child process.");this._onMessage=this._onMessage.bind(this),globalThis.process.on("message",this._onMessage),this._handshake()}_postMessage(e){globalThis.process.send({data:e})}_onMessage(e){(0,s.isValidStreamMessage)(e)&&this._onData(e.data)}_destroy(){globalThis.process.removeListener("message",this._onMessage)}}r.ProcessMessageStream=i}}},{package:"@metamask/post-message-stream",file:"../../node_modules/@metamask/post-message-stream/dist/node-process/ProcessMessageStream.js"}],[21,{"../BasePostMessageStream":16,"../utils":25},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ProcessParentMessageStream=void 0;const n=e("../BasePostMessageStream"),s=e("../utils");class i extends n.BasePostMessageStream{constructor({process:e}){super(),this._process=e,this._onMessage=this._onMessage.bind(this),this._process.on("message",this._onMessage),this._handshake()}_postMessage(e){this._process.send({data:e})}_onMessage(e){(0,s.isValidStreamMessage)(e)&&this._onData(e.data)}_destroy(){this._process.removeListener("message",this._onMessage)}}r.ProcessParentMessageStream=i}}},{package:"@metamask/post-message-stream",file:"../../node_modules/@metamask/post-message-stream/dist/node-process/ProcessParentMessageStream.js"}],[22,{"../BasePostMessageStream":16,"../utils":25,worker_threads:"worker_threads"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},i=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(r,"__esModule",{value:!0}),r.ThreadMessageStream=void 0;const o=e("worker_threads"),a=e("../BasePostMessageStream"),c=e("../utils");class u extends a.BasePostMessageStream{constructor(){if(super(),n.set(this,void 0),!o.parentPort)throw new Error("Parent port not found. This class should only be instantiated in a Node.js worker thread.");s(this,n,o.parentPort,"f"),this._onMessage=this._onMessage.bind(this),i(this,n,"f").on("message",this._onMessage),this._handshake()}_postMessage(e){i(this,n,"f").postMessage({data:e})}_onMessage(e){(0,c.isValidStreamMessage)(e)&&this._onData(e.data)}_destroy(){i(this,n,"f").removeListener("message",this._onMessage)}}r.ThreadMessageStream=u,n=new WeakMap}}},{package:"@metamask/post-message-stream",file:"../../node_modules/@metamask/post-message-stream/dist/node-thread/ThreadMessageStream.js"}],[23,{"../BasePostMessageStream":16,"../utils":25},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ThreadParentMessageStream=void 0;const n=e("../BasePostMessageStream"),s=e("../utils");class i extends n.BasePostMessageStream{constructor({thread:e}){super(),this._thread=e,this._onMessage=this._onMessage.bind(this),this._thread.on("message",this._onMessage),this._handshake()}_postMessage(e){this._thread.postMessage({data:e})}_onMessage(e){(0,s.isValidStreamMessage)(e)&&this._onData(e.data)}_destroy(){this._thread.removeListener("message",this._onMessage)}}r.ThreadParentMessageStream=i}}},{package:"@metamask/post-message-stream",file:"../../node_modules/@metamask/post-message-stream/dist/node-thread/ThreadParentMessageStream.js"}],[24,{"../BasePostMessageStream":16,"../utils":25},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s,i=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},o=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(r,"__esModule",{value:!0}),r.BrowserRuntimePostMessageStream=void 0;const a=e("../BasePostMessageStream"),c=e("../utils");class u extends a.BasePostMessageStream{constructor({name:e,target:t}){super(),n.set(this,void 0),s.set(this,void 0),i(this,n,e,"f"),i(this,s,t,"f"),this._onMessage=this._onMessage.bind(this),this._getRuntime().onMessage.addListener(this._onMessage),this._handshake()}_postMessage(e){this._getRuntime().sendMessage({target:o(this,s,"f"),data:e})}_onMessage(e){(0,c.isValidStreamMessage)(e)&&e.target===o(this,n,"f")&&this._onData(e.data)}_getRuntime(){var e,t;if("chrome"in globalThis&&"function"==typeof(null===(e=null===chrome||void 0===chrome?void 0:chrome.runtime)||void 0===e?void 0:e.sendMessage))return chrome.runtime;if("browser"in globalThis&&"function"==typeof(null===(t=null===browser||void 0===browser?void 0:browser.runtime)||void 0===t?void 0:t.sendMessage))return browser.runtime;throw new Error("browser.runtime.sendMessage is not a function. This class should only be instantiated in a web extension.")}_destroy(){this._getRuntime().onMessage.removeListener(this._onMessage)}}r.BrowserRuntimePostMessageStream=u,n=new WeakMap,s=new WeakMap}}},{package:"@metamask/post-message-stream",file:"../../node_modules/@metamask/post-message-stream/dist/runtime/BrowserRuntimePostMessageStream.js"}],[25,{"@metamask/utils":35},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.isValidStreamMessage=r.DEDICATED_WORKER_NAME=void 0;const n=e("@metamask/utils");r.DEDICATED_WORKER_NAME="dedicatedWorker",r.isValidStreamMessage=function(e){return(0,n.isObject)(e)&&Boolean(e.data)&&("number"==typeof e.data||"object"==typeof e.data||"string"==typeof e.data)}}}},{package:"@metamask/post-message-stream",file:"../../node_modules/@metamask/post-message-stream/dist/utils.js"}],[26,{"../BasePostMessageStream":16,"../utils":25,"@metamask/utils":35},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s;Object.defineProperty(r,"__esModule",{value:!0}),r.WindowPostMessageStream=void 0;const i=e("@metamask/utils"),o=e("../BasePostMessageStream"),a=e("../utils"),c=null===(n=Object.getOwnPropertyDescriptor(MessageEvent.prototype,"source"))||void 0===n?void 0:n.get;(0,i.assert)(c,"MessageEvent.prototype.source getter is not defined.");const u=null===(s=Object.getOwnPropertyDescriptor(MessageEvent.prototype,"origin"))||void 0===s?void 0:s.get;(0,i.assert)(u,"MessageEvent.prototype.origin getter is not defined.");class l extends o.BasePostMessageStream{constructor({name:e,target:t,targetOrigin:r=location.origin,targetWindow:n=window}){if(super(),"undefined"==typeof window||"function"!=typeof window.postMessage)throw new Error("window.postMessage is not a function. This class should only be instantiated in a Window.");this._name=e,this._target=t,this._targetOrigin=r,this._targetWindow=n,this._onMessage=this._onMessage.bind(this),window.addEventListener("message",this._onMessage,!1),this._handshake()}_postMessage(e){this._targetWindow.postMessage({target:this._target,data:e},this._targetOrigin)}_onMessage(e){const t=e.data;"*"!==this._targetOrigin&&u.call(e)!==this._targetOrigin||c.call(e)!==this._targetWindow||!(0,a.isValidStreamMessage)(t)||t.target!==this._name||this._onData(t.data)}_destroy(){window.removeEventListener("message",this._onMessage,!1)}}r.WindowPostMessageStream=l}}},{package:"@metamask/post-message-stream",file:"../../node_modules/@metamask/post-message-stream/dist/window/WindowPostMessageStream.js"}],[27,{superstruct:186},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.assertExhaustive=r.assertStruct=r.assert=r.AssertionError=void 0;const n=e("superstruct");function s(e,t){return r=e,Boolean("string"==typeof(null===(s=null===(n=null==r?void 0:r.prototype)||void 0===n?void 0:n.constructor)||void 0===s?void 0:s.name))?new e({message:t}):e({message:t});var r,n,s}class i extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}r.AssertionError=i,r.assert=function(e,t="Assertion failed.",r=i){if(!e){if(t instanceof Error)throw t;throw s(r,t)}},r.assertStruct=function(e,t,r="Assertion failed",o=i){try{(0,n.assert)(e,t)}catch(e){throw s(o,`${r}: ${function(e){const t=function(e){return"object"==typeof e&&null!==e&&"message"in e}(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}(e)}.`)}},r.assertExhaustive=function(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/assert.js"}],[28,{"./assert":27,superstruct:186},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.base64=void 0;const n=e("superstruct"),s=e("./assert");r.base64=(e,t={})=>{var r,i;const o=null!==(r=t.paddingRequired)&&void 0!==r&&r,a=null!==(i=t.characterSet)&&void 0!==i?i:"base64";let c,u;return"base64"===a?c=String.raw`[A-Za-z0-9+\/]`:((0,s.assert)("base64url"===a),c=String.raw`[-_A-Za-z0-9]`),u=o?new RegExp(`^(?:${c}{4})*(?:${c}{3}=|${c}{2}==)?$`,"u"):new RegExp(`^(?:${c}{4})*(?:${c}{2,3}|${c}{3}=|${c}{2}==)?$`,"u"),(0,n.pattern)(e,u)}}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/base64.js"}],[29,{"./assert":27,"./hex":34,buffer:"buffer"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.createDataView=r.concatBytes=r.valueToBytes=r.stringToBytes=r.numberToBytes=r.signedBigIntToBytes=r.bigIntToBytes=r.hexToBytes=r.bytesToString=r.bytesToNumber=r.bytesToSignedBigInt=r.bytesToBigInt=r.bytesToHex=r.assertIsBytes=r.isBytes=void 0;const n=e("./assert"),s=e("./hex"),i=48,o=58,a=87;const c=function(){const e=[];return()=>{if(0===e.length)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}();function u(e){return e instanceof Uint8Array}function l(e){(0,n.assert)(u(e),"Value must be a Uint8Array.")}function d(e){if(l(e),0===e.length)return"0x";const t=c(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,s.add0x)(r.join(""))}function h(e){l(e);const t=d(e);return BigInt(t)}function f(e){var t;if("0x"===(null===(t=null==e?void 0:e.toLowerCase)||void 0===t?void 0:t.call(e)))return new Uint8Array;(0,s.assertIsHexString)(e);const r=(0,s.remove0x)(e).toLowerCase(),n=r.length%2==0?r:`0${r}`,c=new Uint8Array(n.length/2);for(let e=0;e<c.length;e++){const t=n.charCodeAt(2*e),r=n.charCodeAt(2*e+1),s=t-(t<o?i:a),u=r-(r<o?i:a);c[e]=16*s+u}return c}function p(e){(0,n.assert)("bigint"==typeof e,"Value must be a bigint."),(0,n.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");return f(e.toString(16))}function m(e){(0,n.assert)("number"==typeof e,"Value must be a number."),(0,n.assert)(e>=0,"Value must be a non-negative number."),(0,n.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");return f(e.toString(16))}function g(e){return(0,n.assert)("string"==typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function b(e){if("bigint"==typeof e)return p(e);if("number"==typeof e)return m(e);if("string"==typeof e)return e.startsWith("0x")?f(e):g(e);if(u(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}r.isBytes=u,r.assertIsBytes=l,r.bytesToHex=d,r.bytesToBigInt=h,r.bytesToSignedBigInt=function(e){l(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(8*e.length,t)},r.bytesToNumber=function(e){l(e);const t=h(e);return(0,n.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)},r.bytesToString=function(e){return l(e),(new TextDecoder).decode(e)},r.hexToBytes=f,r.bigIntToBytes=p,r.signedBigIntToBytes=function(e,t){(0,n.assert)("bigint"==typeof e,"Value must be a bigint."),(0,n.assert)("number"==typeof t,"Byte length must be a number."),(0,n.assert)(t>0,"Byte length must be greater than 0."),(0,n.assert)(function(e,t){(0,n.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(8*t-1))}(e,t),"Byte length is too small to represent the given value.");let r=e;const s=new Uint8Array(t);for(let e=0;e<s.length;e++)s[e]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return s.reverse()},r.numberToBytes=m,r.stringToBytes=g,r.valueToBytes=b,r.concatBytes=function(e){const t=new Array(e.length);let r=0;for(let n=0;n<e.length;n++){const s=b(e[n]);t[n]=s,r+=s.length}const n=new Uint8Array(r);for(let e=0,r=0;e<t.length;e++)n.set(t[e],r),r+=t[e].length;return n},r.createDataView=function(e){if(void 0!==t&&e instanceof t){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/bytes.js"}],[30,{"./base64":28,superstruct:186},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ChecksumStruct=void 0;const n=e("superstruct"),s=e("./base64");r.ChecksumStruct=(0,n.size)((0,s.base64)((0,n.string)(),{paddingRequired:!0}),44,44)}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/checksum.js"}],[31,{"./assert":27,"./bytes":29,"./hex":34,superstruct:186},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createHex=r.createBytes=r.createBigInt=r.createNumber=void 0;const n=e("superstruct"),s=e("./assert"),i=e("./bytes"),o=e("./hex"),a=(0,n.union)([(0,n.number)(),(0,n.bigint)(),(0,n.string)(),o.StrictHexStruct]),c=(0,n.coerce)((0,n.number)(),a,Number),u=(0,n.coerce)((0,n.bigint)(),a,BigInt),l=((0,n.union)([o.StrictHexStruct,(0,n.instance)(Uint8Array)]),(0,n.coerce)((0,n.instance)(Uint8Array),(0,n.union)([o.StrictHexStruct]),i.hexToBytes)),d=(0,n.coerce)(o.StrictHexStruct,(0,n.instance)(Uint8Array),i.bytesToHex);r.createNumber=function(e){try{const t=(0,n.create)(e,c);return(0,s.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){if(t instanceof n.StructError)throw new Error(`Expected a number-like value, got "${e}".`);throw t}},r.createBigInt=function(e){try{return(0,n.create)(e,u)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a number-like value, got "${String(e.value)}".`);throw e}},r.createBytes=function(e){if("string"==typeof e&&"0x"===e.toLowerCase())return new Uint8Array;try{return(0,n.create)(e,l)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}},r.createHex=function(e){if(e instanceof Uint8Array&&0===e.length||"string"==typeof e&&"0x"===e.toLowerCase())return"0x";try{return(0,n.create)(e,d)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}}}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/coercers.js"}],[32,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s,i=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},o=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(r,"__esModule",{value:!0}),r.FrozenSet=r.FrozenMap=void 0;class a{constructor(e){n.set(this,void 0),i(this,n,new Map(e),"f"),Object.freeze(this)}get size(){return o(this,n,"f").size}[(n=new WeakMap,Symbol.iterator)](){return o(this,n,"f")[Symbol.iterator]()}entries(){return o(this,n,"f").entries()}forEach(e,t){return o(this,n,"f").forEach(((r,n,s)=>e.call(t,r,n,this)))}get(e){return o(this,n,"f").get(e)}has(e){return o(this,n,"f").has(e)}keys(){return o(this,n,"f").keys()}values(){return o(this,n,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([e,t])=>`${String(e)} => ${String(t)}`)).join(", ")} `:""}}`}}r.FrozenMap=a;class c{constructor(e){s.set(this,void 0),i(this,s,new Set(e),"f"),Object.freeze(this)}get size(){return o(this,s,"f").size}[(s=new WeakMap,Symbol.iterator)](){return o(this,s,"f")[Symbol.iterator]()}entries(){return o(this,s,"f").entries()}forEach(e,t){return o(this,s,"f").forEach(((r,n,s)=>e.call(t,r,n,this)))}has(e){return o(this,s,"f").has(e)}keys(){return o(this,s,"f").keys()}values(){return o(this,s,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((e=>String(e))).join(", ")} `:""}}`}}r.FrozenSet=c,Object.freeze(a),Object.freeze(a.prototype),Object.freeze(c),Object.freeze(c.prototype)}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/collections.js"}],[33,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/encryption-types.js"}],[34,{"./assert":27,superstruct:186},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.remove0x=r.add0x=r.assertIsStrictHexString=r.assertIsHexString=r.isStrictHexString=r.isHexString=r.StrictHexStruct=r.HexStruct=void 0;const n=e("superstruct"),s=e("./assert");function i(e){return(0,n.is)(e,r.HexStruct)}function o(e){return(0,n.is)(e,r.StrictHexStruct)}r.HexStruct=(0,n.pattern)((0,n.string)(),/^(?:0x)?[0-9a-f]+$/iu),r.StrictHexStruct=(0,n.pattern)((0,n.string)(),/^0x[0-9a-f]+$/iu),r.isHexString=i,r.isStrictHexString=o,r.assertIsHexString=function(e){(0,s.assert)(i(e),"Value must be a hexadecimal string.")},r.assertIsStrictHexString=function(e){(0,s.assert)(o(e),'Value must be a hexadecimal string, starting with "0x".')},r.add0x=function(e){return e.startsWith("0x")?e:e.startsWith("0X")?`0x${e.substring(2)}`:`0x${e}`},r.remove0x=function(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/hex.js"}],[35,{"./assert":27,"./base64":28,"./bytes":29,"./checksum":30,"./coercers":31,"./collections":32,"./encryption-types":33,"./hex":34,"./json":36,"./keyring":37,"./logging":38,"./misc":39,"./number":40,"./opaque":41,"./time":42,"./transaction-types":43,"./versions":44},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./assert"),r),s(e("./base64"),r),s(e("./bytes"),r),s(e("./checksum"),r),s(e("./coercers"),r),s(e("./collections"),r),s(e("./encryption-types"),r),s(e("./hex"),r),s(e("./json"),r),s(e("./keyring"),r),s(e("./logging"),r),s(e("./misc"),r),s(e("./number"),r),s(e("./opaque"),r),s(e("./time"),r),s(e("./transaction-types"),r),s(e("./versions"),r)}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/index.js"}],[36,{"./assert":27,superstruct:186},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getJsonRpcIdValidator=r.assertIsJsonRpcError=r.isJsonRpcError=r.assertIsJsonRpcFailure=r.isJsonRpcFailure=r.assertIsJsonRpcSuccess=r.isJsonRpcSuccess=r.assertIsJsonRpcResponse=r.isJsonRpcResponse=r.assertIsPendingJsonRpcResponse=r.isPendingJsonRpcResponse=r.JsonRpcResponseStruct=r.JsonRpcFailureStruct=r.JsonRpcSuccessStruct=r.PendingJsonRpcResponseStruct=r.assertIsJsonRpcRequest=r.isJsonRpcRequest=r.assertIsJsonRpcNotification=r.isJsonRpcNotification=r.JsonRpcNotificationStruct=r.JsonRpcRequestStruct=r.JsonRpcParamsStruct=r.JsonRpcErrorStruct=r.JsonRpcIdStruct=r.JsonRpcVersionStruct=r.jsonrpc2=r.getJsonSize=r.isValidJson=r.JsonStruct=r.UnsafeJsonStruct=void 0;const n=e("superstruct"),s=e("./assert");r.UnsafeJsonStruct=(0,n.union)([(0,n.literal)(null),(0,n.boolean)(),(0,n.define)("finite number",(e=>(0,n.is)(e,(0,n.number)())&&Number.isFinite(e))),(0,n.string)(),(0,n.array)((0,n.lazy)((()=>r.UnsafeJsonStruct))),(0,n.record)((0,n.string)(),(0,n.lazy)((()=>r.UnsafeJsonStruct)))]),r.JsonStruct=(0,n.define)("Json",((e,t)=>{function n(e,r){const n=[...r.validator(e,t)];return!(n.length>0)||n}try{const t=n(e,r.UnsafeJsonStruct);return!0!==t?t:n(JSON.parse(JSON.stringify(e)),r.UnsafeJsonStruct)}catch(e){return e instanceof RangeError&&"Circular reference detected"}})),r.isValidJson=function(e){return(0,n.is)(e,r.JsonStruct)},r.getJsonSize=function(e){(0,s.assertStruct)(e,r.JsonStruct,"Invalid JSON value");const t=JSON.stringify(e);return(new TextEncoder).encode(t).byteLength},r.jsonrpc2="2.0",r.JsonRpcVersionStruct=(0,n.literal)(r.jsonrpc2),r.JsonRpcIdStruct=(0,n.nullable)((0,n.union)([(0,n.number)(),(0,n.string)()])),r.JsonRpcErrorStruct=(0,n.object)({code:(0,n.integer)(),message:(0,n.string)(),data:(0,n.optional)(r.JsonStruct),stack:(0,n.optional)((0,n.string)())}),r.JsonRpcParamsStruct=(0,n.optional)((0,n.union)([(0,n.record)((0,n.string)(),r.JsonStruct),(0,n.array)(r.JsonStruct)])),r.JsonRpcRequestStruct=(0,n.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,method:(0,n.string)(),params:r.JsonRpcParamsStruct}),r.JsonRpcNotificationStruct=(0,n.omit)(r.JsonRpcRequestStruct,["id"]),r.isJsonRpcNotification=function(e){return(0,n.is)(e,r.JsonRpcNotificationStruct)},r.assertIsJsonRpcNotification=function(e,t){(0,s.assertStruct)(e,r.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",t)},r.isJsonRpcRequest=function(e){return(0,n.is)(e,r.JsonRpcRequestStruct)},r.assertIsJsonRpcRequest=function(e,t){(0,s.assertStruct)(e,r.JsonRpcRequestStruct,"Invalid JSON-RPC request",t)},r.PendingJsonRpcResponseStruct=(0,n.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,result:(0,n.optional)((0,n.unknown)()),error:(0,n.optional)(r.JsonRpcErrorStruct)}),r.JsonRpcSuccessStruct=(0,n.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,result:r.JsonStruct}),r.JsonRpcFailureStruct=(0,n.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,error:r.JsonRpcErrorStruct}),r.JsonRpcResponseStruct=(0,n.union)([r.JsonRpcSuccessStruct,r.JsonRpcFailureStruct]),r.isPendingJsonRpcResponse=function(e){return(0,n.is)(e,r.PendingJsonRpcResponseStruct)},r.assertIsPendingJsonRpcResponse=function(e,t){(0,s.assertStruct)(e,r.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",t)},r.isJsonRpcResponse=function(e){return(0,n.is)(e,r.JsonRpcResponseStruct)},r.assertIsJsonRpcResponse=function(e,t){(0,s.assertStruct)(e,r.JsonRpcResponseStruct,"Invalid JSON-RPC response",t)},r.isJsonRpcSuccess=function(e){return(0,n.is)(e,r.JsonRpcSuccessStruct)},r.assertIsJsonRpcSuccess=function(e,t){(0,s.assertStruct)(e,r.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",t)},r.isJsonRpcFailure=function(e){return(0,n.is)(e,r.JsonRpcFailureStruct)},r.assertIsJsonRpcFailure=function(e,t){(0,s.assertStruct)(e,r.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",t)},r.isJsonRpcError=function(e){return(0,n.is)(e,r.JsonRpcErrorStruct)},r.assertIsJsonRpcError=function(e,t){(0,s.assertStruct)(e,r.JsonRpcErrorStruct,"Invalid JSON-RPC error",t)},r.getJsonRpcIdValidator=function(e){const{permitEmptyString:t,permitFractions:r,permitNull:n}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},e);return e=>Boolean("number"==typeof e&&(r||Number.isInteger(e))||"string"==typeof e&&(t||e.length>0)||n&&null===e)}}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/json.js"}],[37,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/keyring.js"}],[38,{debug:98},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.createModuleLogger=r.createProjectLogger=void 0;const s=(0,n(e("debug")).default)("metamask");r.createProjectLogger=function(e){return s.extend(e)},r.createModuleLogger=function(e,t){return e.extend(t)}}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/logging.js"}],[39,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.calculateNumberSize=r.calculateStringSize=r.isASCII=r.isPlainObject=r.ESCAPE_CHARACTERS_REGEXP=r.JsonSize=r.hasProperty=r.isObject=r.isNullOrUndefined=r.isNonEmptyArray=void 0,r.isNonEmptyArray=function(e){return Array.isArray(e)&&e.length>0},r.isNullOrUndefined=function(e){return null===e||e===undefined},r.isObject=function(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)};function n(e){return e.charCodeAt(0)<=127}r.hasProperty=(e,t)=>Object.hasOwnProperty.call(e,t),function(e){e[e.Null=4]="Null",e[e.Comma=1]="Comma",e[e.Wrapper=1]="Wrapper",e[e.True=4]="True",e[e.False=5]="False",e[e.Quote=1]="Quote",e[e.Colon=1]="Colon",e[e.Date=24]="Date"}(r.JsonSize||(r.JsonSize={})),r.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,r.isPlainObject=function(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}},r.isASCII=n,r.calculateStringSize=function(e){var t;return e.split("").reduce(((e,t)=>n(t)?e+1:e+2),0)+(null!==(t=e.match(r.ESCAPE_CHARACTERS_REGEXP))&&void 0!==t?t:[]).length},r.calculateNumberSize=function(e){return e.toString().length}}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/misc.js"}],[40,{"./assert":27,"./hex":34},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.hexToBigInt=r.hexToNumber=r.bigIntToHex=r.numberToHex=void 0;const n=e("./assert"),s=e("./hex");r.numberToHex=e=>((0,n.assert)("number"==typeof e,"Value must be a number."),(0,n.assert)(e>=0,"Value must be a non-negative number."),(0,n.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,s.add0x)(e.toString(16)));r.bigIntToHex=e=>((0,n.assert)("bigint"==typeof e,"Value must be a bigint."),(0,n.assert)(e>=0,"Value must be a non-negative bigint."),(0,s.add0x)(e.toString(16)));r.hexToNumber=e=>{(0,s.assertIsHexString)(e);const t=parseInt(e,16);return(0,n.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};r.hexToBigInt=e=>((0,s.assertIsHexString)(e),BigInt((0,s.add0x)(e)))}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/number.js"}],[41,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/opaque.js"}],[42,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.timeSince=r.inMilliseconds=r.Duration=void 0,function(e){e[e.Millisecond=1]="Millisecond",e[e.Second=1e3]="Second",e[e.Minute=6e4]="Minute",e[e.Hour=36e5]="Hour",e[e.Day=864e5]="Day",e[e.Week=6048e5]="Week",e[e.Year=31536e6]="Year"}(r.Duration||(r.Duration={}));const n=(e,t)=>{if(!(e=>Number.isInteger(e)&&e>=0)(e))throw new Error(`"${t}" must be a non-negative integer. Received: "${e}".`)};r.inMilliseconds=function(e,t){return n(e,"count"),e*t},r.timeSince=function(e){return n(e,"timestamp"),Date.now()-e}}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/time.js"}],[43,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/transaction-types.js"}],[44,{"./assert":27,semver:169,superstruct:186},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.satisfiesVersionRange=r.gtRange=r.gtVersion=r.assertIsSemVerRange=r.assertIsSemVerVersion=r.isValidSemVerRange=r.isValidSemVerVersion=r.VersionRangeStruct=r.VersionStruct=void 0;const n=e("semver"),s=e("superstruct"),i=e("./assert");r.VersionStruct=(0,s.refine)((0,s.string)(),"Version",(e=>null!==(0,n.valid)(e)||`Expected SemVer version, got "${e}"`)),r.VersionRangeStruct=(0,s.refine)((0,s.string)(),"Version range",(e=>null!==(0,n.validRange)(e)||`Expected SemVer range, got "${e}"`)),r.isValidSemVerVersion=function(e){return(0,s.is)(e,r.VersionStruct)},r.isValidSemVerRange=function(e){return(0,s.is)(e,r.VersionRangeStruct)},r.assertIsSemVerVersion=function(e){(0,i.assertStruct)(e,r.VersionStruct)},r.assertIsSemVerRange=function(e){(0,i.assertStruct)(e,r.VersionRangeStruct)},r.gtVersion=function(e,t){return(0,n.gt)(e,t)},r.gtRange=function(e,t){return(0,n.gtr)(e,t)},r.satisfiesVersionRange=function(e,t){return(0,n.satisfies)(e,t,{includePrerelease:!0})}}}},{package:"@metamask/post-message-stream>@metamask/utils",file:"../../node_modules/@metamask/post-message-stream/node_modules/@metamask/utils/dist/versions.js"}],[45,{"./_stream_readable":47,"./_stream_writable":49,"core-util-is":94,inherits:111,"process-nextick-args":140},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("process-nextick-args"),s=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=d;var i=e("core-util-is");i.inherits=e("inherits");var o=e("./_stream_readable"),a=e("./_stream_writable");i.inherits(d,o);for(var c=s(a.prototype),u=0;u<c.length;u++){var l=c[u];d.prototype[l]||(d.prototype[l]=a.prototype[l])}function d(e){if(!(this instanceof d))return new d(e);o.call(this,e),a.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||n(f,this)}function f(e){e.end()}Object.defineProperty(d.prototype,"destroyed",{get:function(){return this._readableState!==undefined&&this._writableState!==undefined&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){this._readableState!==undefined&&this._writableState!==undefined&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),d.prototype._destroy=function(e,t){this.push(null),this.end(),n(t,e)}}}},{package:"@metamask/post-message-stream>readable-stream",file:"../../node_modules/@metamask/post-message-stream/node_modules/readable-stream/lib/_stream_duplex.js"}],[46,{"./_stream_transform":48,"core-util-is":94,inherits:111},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=i;var n=e("./_stream_transform"),s=e("core-util-is");function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}s.inherits=e("inherits"),s.inherits(i,n),i.prototype._transform=function(e,t,r){r(null,e)}}}},{package:"@metamask/post-message-stream>readable-stream",file:"../../node_modules/@metamask/post-message-stream/node_modules/readable-stream/lib/_stream_passthrough.js"}],[47,{"./_stream_duplex":45,"./internal/streams/BufferList":50,"./internal/streams/destroy":51,"./internal/streams/stream":52,"core-util-is":94,events:"events",inherits:111,isarray:115,"process-nextick-args":140,"safe-buffer":54,"string_decoder/":55,util:"util"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("process-nextick-args");t.exports=w;var s,i=e("isarray");w.ReadableState=b;e("events").EventEmitter;var o=function(e,t){return e.listeners(t).length},a=e("./internal/streams/stream"),c=e("safe-buffer").Buffer,u=global.Uint8Array||function(){};var l=e("core-util-is");l.inherits=e("inherits");var d=e("util"),h=void 0;h=d&&d.debuglog?d.debuglog("stream"):function(){};var f,p=e("./internal/streams/BufferList"),m=e("./internal/streams/destroy");l.inherits(w,a);var g=["error","close","destroy","pause","resume"];function b(t,r){s=s||e("./_stream_duplex"),t=t||{},this.objectMode=!!t.objectMode,r instanceof s&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var n=t.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new p,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.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(f||(f=e("string_decoder/").StringDecoder),this.decoder=new f(t.encoding),this.encoding=t.encoding)}function w(t){if(s=s||e("./_stream_duplex"),!(this instanceof w))return new w(t);this._readableState=new b(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function y(e,t,r,n,s){var i,o=e._readableState;null===t?(o.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,k(e)}(e,o)):(s||(i=function(e,t){var r;n=t,c.isBuffer(n)||n instanceof u||"string"==typeof t||t===undefined||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(o,t)),i?e.emit("error",i):o.objectMode||t&&t.length>0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):v(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?v(e,o,t,!1):T(e,o)):v(e,o,t,!1))):n||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(o)}function v(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&k(e)),T(e,t)}Object.defineProperty(w.prototype,"destroyed",{get:function(){return this._readableState!==undefined&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),w.prototype.destroy=m.destroy,w.prototype._undestroy=m.undestroy,w.prototype._destroy=function(e,t){this.push(null),t(e)},w.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=c.from(e,t),t=""),r=!0),y(this,e,t,!1,r)},w.prototype.unshift=function(e){return y(this,e,null,!0,!1)},w.prototype.isPaused=function(){return!1===this._readableState.flowing},w.prototype.setEncoding=function(t){return f||(f=e("string_decoder/").StringDecoder),this._readableState.decoder=new f(t),this._readableState.encoding=t,this};var _=8388608;function S(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>=_?e=_:(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 k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?n(E,e):E(e))}function E(e){h("emit readable"),e.emit("readable"),M(e)}function T(e,t){t.readingMore||(t.readingMore=!0,n(x,e,t))}function x(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(h("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function R(e){h("readable nexttick read 0"),e.read(0)}function j(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),M(e),t.flowing&&!t.reading&&e.read(0)}function M(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&null!==e.read(););}function O(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,s=r.data;e-=s.length;for(;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(o===i.length?s+=i:s+=i.slice(0,e),0===(e-=o)){o===i.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(o));break}++n}return t.length-=n,s}(e,t):function(e,t){var r=c.allocUnsafe(e),n=t.head,s=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var i=n.data,o=e>i.length?i.length:e;if(i.copy(r,r.length-e,0,o),0===(e-=o)){o===i.length?(++s,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(o));break}++s}return t.length-=s,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function P(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,n(C,t,e))}function C(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function I(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}w.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?P(this):k(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&P(this),null;var n,s=t.needReadable;return h("need readable",s),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",s=!0),t.ended||t.reading?h("reading or ended",s=!1):s&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=S(r,t))),null===(n=e>0?O(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&P(this)),null!==n&&this.emit("data",n),n},w.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},w.prototype.pipe=function(e,t){var r=this,s=this._readableState;switch(s.pipesCount){case 0:s.pipes=e;break;case 1:s.pipes=[s.pipes,e];break;default:s.pipes.push(e)}s.pipesCount+=1,h("pipe count=%d opts=%j",s.pipesCount,t);var a=(!t||!1!==t.end)&&e!==process.stdout&&e!==process.stderr?u:w;function c(t,n){h("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,h("cleanup"),e.removeListener("close",g),e.removeListener("finish",b),e.removeListener("drain",l),e.removeListener("error",m),e.removeListener("unpipe",c),r.removeListener("end",u),r.removeListener("end",w),r.removeListener("data",p),d=!0,!s.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function u(){h("onend"),e.end()}s.endEmitted?n(a):r.once("end",a),e.on("unpipe",c);var l=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,M(e))}}(r);e.on("drain",l);var d=!1;var f=!1;function p(t){h("ondata"),f=!1,!1!==e.write(t)||f||((1===s.pipesCount&&s.pipes===e||s.pipesCount>1&&-1!==I(s.pipes,e))&&!d&&(h("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,f=!0),r.pause())}function m(t){h("onerror",t),w(),e.removeListener("error",m),0===o(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",b),w()}function b(){h("onfinish"),e.removeListener("close",g),w()}function w(){h("unpipe"),r.unpipe(e)}return r.on("data",p),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?i(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",m),e.once("close",g),e.once("finish",b),e.emit("pipe",r),s.flowing||(h("pipe resume"),r.resume()),e},w.prototype.unpipe=function(e){var t=this._readableState,r={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,r)),this;if(!e){var n=t.pipes,s=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<s;i++)n[i].emit("unpipe",this,r);return this}var o=I(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},w.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var s=this._readableState;s.endEmitted||s.readableListening||(s.readableListening=s.needReadable=!0,s.emittedReadable=!1,s.reading?s.length&&k(this):n(R,this))}return r},w.prototype.addListener=w.prototype.on,w.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n(j,e,t))}(this,e)),this},w.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this},w.prototype.wrap=function(e){var t=this._readableState,r=!1,n=this;for(var s in e.on("end",(function(){if(h("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&n.push(e)}n.push(null)})),e.on("data",(function(s){(h("wrapped data"),t.decoder&&(s=t.decoder.write(s)),!t.objectMode||null!==s&&s!==undefined)&&((t.objectMode||s&&s.length)&&(n.push(s)||(r=!0,e.pause())))})),e)this[s]===undefined&&"function"==typeof e[s]&&(this[s]=function(t){return function(){return e[t].apply(e,arguments)}}(s));for(var i=0;i<g.length;i++)e.on(g[i],n.emit.bind(n,g[i]));return n._read=function(t){h("wrapped _read",t),r&&(r=!1,e.resume())},n},w._fromList=O}}},{package:"@metamask/post-message-stream>readable-stream",file:"../../node_modules/@metamask/post-message-stream/node_modules/readable-stream/lib/_stream_readable.js"}],[48,{"./_stream_duplex":45,"core-util-is":94,inherits:111},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=o;var n=e("./_stream_duplex"),s=e("core-util-is");function i(e){this.afterTransform=function(t,r){return function(e,t,r){var n=e._transformState;n.transforming=!1;var s=n.writecb;if(!s)return e.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!==r&&r!==undefined&&e.push(r);s(t);var i=e._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&e._read(i.highWaterMark)}(e,t,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function o(e){if(!(this instanceof o))return new o(e);n.call(this,e),this._transformState=new i(this);var t=this;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.once("prefinish",(function(){"function"==typeof this._flush?this._flush((function(e,r){a(t,e,r)})):a(t)}))}function a(e,t,r){if(t)return e.emit("error",t);null!==r&&r!==undefined&&e.push(r);var n=e._writableState,s=e._transformState;if(n.length)throw new Error("Calling transform done when ws.length != 0");if(s.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}s.inherits=e("inherits"),s.inherits(o,n),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},o.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},o.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var s=this._readableState;(n.needTransform||s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}},o.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},o.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,(function(e){t(e),r.emit("close")}))}}}},{package:"@metamask/post-message-stream>readable-stream",file:"../../node_modules/@metamask/post-message-stream/node_modules/readable-stream/lib/_stream_transform.js"}],[49,{"./_stream_duplex":45,"./internal/streams/destroy":51,"./internal/streams/stream":52,"core-util-is":94,inherits:111,"process-nextick-args":140,"safe-buffer":54,timers:"timers","util-deprecate":188},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(r){(function(){var n=e("process-nextick-args");function s(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var s=n.callback;t.pendingcb--,s(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}t.exports=g;var i,o=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?r:n;g.WritableState=m;var a=e("core-util-is");a.inherits=e("inherits");var c={deprecate:e("util-deprecate")},u=e("./internal/streams/stream"),l=e("safe-buffer").Buffer,d=global.Uint8Array||function(){};var h,f=e("./internal/streams/destroy");function p(){}function m(t,r){i=i||e("./_stream_duplex"),t=t||{},this.objectMode=!!t.objectMode,r instanceof i&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var a=t.highWaterMark,c=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var u=!1===t.decodeStrings;this.decodeStrings=!u,this.defaultEncoding=t.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 r=e._writableState,s=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,s,i){--t.pendingcb,r?(n(i,s),n(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",s)):(i(s),e._writableState.errorEmitted=!0,e.emit("error",s),S(e,t))}(e,r,s,t,i);else{var a=v(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||y(e,r),s?o(w,e,r,a,i):w(e,r,a,i)}}(r,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function g(t){if(i=i||e("./_stream_duplex"),!(h.call(g,this)||this instanceof i))return new g(t);this._writableState=new m(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),u.call(this)}function b(e,t,r,n,s,i,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(s,t.onwrite):e._write(s,i,t.onwrite),t.sync=!1}function w(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),S(e,t)}function y(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var a=0,c=!0;r;)i[a]=r,r.isBuf||(c=!1),r=r.next,a+=1;i.allBuffers=c,b(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new s(t)}else{for(;r;){var u=r.chunk,l=r.encoding,d=r.callback;if(b(e,t,!1,t.objectMode?1:u.length,u,l,d),r=r.next,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=r,t.bufferProcessing=!1}function v(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function _(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),S(e,t)}))}function S(e,t){var r=v(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,n(_,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}a.inherits(g,u),m.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(m.prototype,"buffer",{get:c.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]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(e){return!!h.call(this,e)||e&&e._writableState instanceof m}})):h=function(e){return e instanceof this},g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},g.prototype.write=function(e,t,r){var s,i=this._writableState,o=!1,a=(s=e,(l.isBuffer(s)||s instanceof d)&&!i.objectMode);return a&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=p),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),n(t,r)}(this,r):(a||function(e,t,r,s){var i=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||r===undefined||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),n(s,o),i=!1),i}(this,i,e,r))&&(i.pendingcb++,o=function(e,t,r,n,s,i){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,r));return t}(t,n,s);n!==o&&(r=!0,s="buffer",n=o)}var a=t.objectMode?1:n.length;t.length+=a;var c=t.length<t.highWaterMark;c||(t.needDrain=!0);if(t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:s,isBuf:r,callback:i,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else b(e,t,!1,a,n,s,i);return c}(this,i,a,e,t,r)),o},g.prototype.cork=function(){this._writableState.corked++},g.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||y(this,e))},g.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 TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},g.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(e,t,r){var s=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!==e&&e!==undefined&&this.write(e,t),s.corked&&(s.corked=1,this.uncork()),s.ending||s.finished||function(e,t,r){t.ending=!0,S(e,t),r&&(t.finished?n(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,s,r)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return this._writableState!==undefined&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),g.prototype.destroy=f.destroy,g.prototype._undestroy=f.undestroy,g.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this)}).call(this,e("timers").setImmediate)}}},{package:"@metamask/post-message-stream>readable-stream",file:"../../node_modules/@metamask/post-message-stream/node_modules/readable-stream/lib/_stream_writable.js"}],[50,{"safe-buffer":54},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("safe-buffer").Buffer;t.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}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=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}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t,r,s,i=n.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=i,s=a,t.copy(r,s),a+=o.data.length,o=o.next;return i},e}()}}},{package:"@metamask/post-message-stream>readable-stream",file:"../../node_modules/@metamask/post-message-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js"}],[51,{"process-nextick-args":140},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("process-nextick-args");function s(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;i||o?t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n(s,this,e):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(n(s,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})))},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.finished=!1,this._writableState.errorEmitted=!1)}}}}},{package:"@metamask/post-message-stream>readable-stream",file:"../../node_modules/@metamask/post-message-stream/node_modules/readable-stream/lib/internal/streams/destroy.js"}],[52,{stream:"stream"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=e("stream")}}},{package:"@metamask/post-message-stream>readable-stream",file:"../../node_modules/@metamask/post-message-stream/node_modules/readable-stream/lib/internal/streams/stream.js"}],[53,{"./lib/_stream_duplex.js":45,"./lib/_stream_passthrough.js":46,"./lib/_stream_readable.js":47,"./lib/_stream_transform.js":48,"./lib/_stream_writable.js":49,stream:"stream"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("stream");"disable"===process.env.READABLE_STREAM&&n?(t.exports=n,(r=t.exports=n.Readable).Readable=n.Readable,r.Writable=n.Writable,r.Duplex=n.Duplex,r.Transform=n.Transform,r.PassThrough=n.PassThrough,r.Stream=n):((r=t.exports=e("./lib/_stream_readable.js")).Stream=n||r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"))}}},{package:"@metamask/post-message-stream>readable-stream",file:"../../node_modules/@metamask/post-message-stream/node_modules/readable-stream/readable.js"}],[54,{buffer:"buffer"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("buffer"),s=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return s(e,t,r)}s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow?t.exports=n:(i(n,r),r.Buffer=o),i(s,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return s(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=s(e);return t!==undefined?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return s(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}}}},{package:"@metamask/post-message-stream>readable-stream>safe-buffer",file:"../../node_modules/@metamask/post-message-stream/node_modules/safe-buffer/index.js"}],[55,{"safe-buffer":54},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("safe-buffer").Buffer,s=n.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 i(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&&(n.isEncoding===s||!s(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=l,this.end=d,t=3;break;default:return this.write=h,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:-1}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�".repeat(r);if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�".repeat(r+1);if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�".repeat(r+2)}}(this,e,t);return r!==undefined?r: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 c(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?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-r))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}r.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if((t=this.fillLast(e))===undefined)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�".repeat(this.lastTotal-this.lastNeed):t},i.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var s=o(t[n]);if(s>=0)return s>0&&(e.lastNeed=s-1),s;if(--n<r)return 0;if(s=o(t[n]),s>=0)return s>0&&(e.lastNeed=s-2),s;if(--n<r)return 0;if(s=o(t[n]),s>=0)return s>0&&(2===s?s=0:e.lastNeed=s-3),s;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},i.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}}}},{package:"@metamask/post-message-stream>readable-stream>string_decoder",file:"../../node_modules/@metamask/post-message-stream/node_modules/string_decoder/lib/string_decoder.js"}],[56,{"./messages":64,"./utils":68,"@metamask/safe-event-emitter":69,"eth-rpc-errors":105,"fast-deep-equal":108,"json-rpc-engine":121},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.BaseProvider=void 0;const s=n(e("@metamask/safe-event-emitter")),i=e("eth-rpc-errors"),o=n(e("fast-deep-equal")),a=e("json-rpc-engine"),c=n(e("./messages")),u=e("./utils");class l extends s.default{constructor({logger:e=console,maxEventListeners:t=100,rpcMiddleware:r=[]}={}){super(),this._log=e,this.setMaxListeners(t),this._state={...l._defaultState},this.selectedAddress=null,this.chainId=null,this._handleAccountsChanged=this._handleAccountsChanged.bind(this),this._handleConnect=this._handleConnect.bind(this),this._handleChainChanged=this._handleChainChanged.bind(this),this._handleDisconnect=this._handleDisconnect.bind(this),this._handleUnlockStateChanged=this._handleUnlockStateChanged.bind(this),this._rpcRequest=this._rpcRequest.bind(this),this.request=this.request.bind(this);const n=new a.JsonRpcEngine;r.forEach((e=>n.push(e))),this._rpcEngine=n}isConnected(){return this._state.isConnected}async request(e){if(!e||"object"!=typeof e||Array.isArray(e))throw i.ethErrors.rpc.invalidRequest({message:c.default.errors.invalidRequestArgs(),data:e});const{method:t,params:r}=e;if("string"!=typeof t||0===t.length)throw i.ethErrors.rpc.invalidRequest({message:c.default.errors.invalidRequestMethod(),data:e});if(r!==undefined&&!Array.isArray(r)&&("object"!=typeof r||null===r))throw i.ethErrors.rpc.invalidRequest({message:c.default.errors.invalidRequestParams(),data:e});return new Promise(((e,n)=>{this._rpcRequest({method:t,params:r},(0,u.getRpcPromiseCallback)(e,n))}))}_initializeState(e){if(this._state.initialized)throw new Error("Provider already initialized.");if(e){const{accounts:t,chainId:r,isUnlocked:n,networkVersion:s}=e;this._handleConnect(r),this._handleChainChanged({chainId:r,networkVersion:s}),this._handleUnlockStateChanged({accounts:t,isUnlocked:n}),this._handleAccountsChanged(t)}this._state.initialized=!0,this.emit("_initialized")}_rpcRequest(e,t){let r=t;return Array.isArray(e)||(e.jsonrpc||(e.jsonrpc="2.0"),"eth_accounts"!==e.method&&"eth_requestAccounts"!==e.method||(r=(r,n)=>{this._handleAccountsChanged(n.result??[],"eth_accounts"===e.method),t(r,n)})),this._rpcEngine.handle(e,r)}_handleConnect(e){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{chainId:e}),this._log.debug(c.default.info.connected(e)))}_handleDisconnect(e,t){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!e){let r;this._state.isConnected=!1,e?(r=new i.EthereumRpcError(1013,t??c.default.errors.disconnected()),this._log.debug(r)):(r=new i.EthereumRpcError(1011,t??c.default.errors.permanentlyDisconnected()),this._log.error(r),this.chainId=null,this._state.accounts=null,this.selectedAddress=null,this._state.isUnlocked=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",r)}}_handleChainChanged({chainId:e}={}){(0,u.isValidChainId)(e)?(this._handleConnect(e),e!==this.chainId&&(this.chainId=e,this._state.initialized&&this.emit("chainChanged",this.chainId))):this._log.error(c.default.errors.invalidNetworkParams(),{chainId:e})}_handleAccountsChanged(e,t=!1){let r=e;Array.isArray(e)||(this._log.error("MetaMask: Received invalid accounts parameter. Please report this bug.",e),r=[]);for(const t of e)if("string"!=typeof t){this._log.error("MetaMask: Received non-string account. Please report this bug.",e),r=[];break}if(!(0,o.default)(this._state.accounts,r)&&(t&&null!==this._state.accounts&&this._log.error("MetaMask: 'eth_accounts' unexpectedly updated accounts. Please report this bug.",r),this._state.accounts=r,this.selectedAddress!==r[0]&&(this.selectedAddress=r[0]||null),this._state.initialized)){const e=[...r];this.emit("accountsChanged",e)}}_handleUnlockStateChanged({accounts:e,isUnlocked:t}={}){"boolean"==typeof t?t!==this._state.isUnlocked&&(this._state.isUnlocked=t,this._handleAccountsChanged(e??[])):this._log.error("MetaMask: Received invalid isUnlocked parameter. Please report this bug.")}}r.BaseProvider=l,l._defaultState={accounts:null,isConnected:!1,isUnlocked:!1,initialized:!1,isPermanentlyDisconnected:!1}}}},{package:"@metamask/providers",file:"../../node_modules/@metamask/providers/dist/BaseProvider.js"}],[57,{"./StreamProvider":58,"./messages":64,"./siteMetadata":67,"./utils":68,"eth-rpc-errors":105},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.MetaMaskInpageProvider=r.MetaMaskInpageProviderStreamName=void 0;const s=e("eth-rpc-errors"),i=n(e("./messages")),o=e("./siteMetadata"),a=e("./StreamProvider"),c=e("./utils");r.MetaMaskInpageProviderStreamName="metamask-provider";class u extends a.AbstractStreamProvider{constructor(e,{jsonRpcStreamName:t=r.MetaMaskInpageProviderStreamName,logger:n=console,maxEventListeners:s=100,shouldSendMetadata:i}={}){if(super(e,{jsonRpcStreamName:t,logger:n,maxEventListeners:s,rpcMiddleware:(0,c.getDefaultExternalMiddleware)(n)}),this._sentWarnings={enable:!1,experimentalMethods:!1,send:!1,events:{close:!1,data:!1,networkChanged:!1,notification:!1}},this._initializeStateAsync(),this.networkVersion=null,this.isMetaMask=!0,this._sendSync=this._sendSync.bind(this),this.enable=this.enable.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this._warnOfDeprecation=this._warnOfDeprecation.bind(this),this._metamask=this._getExperimentalApi(),this._jsonRpcConnection.events.on("notification",(e=>{const{method:t}=e;c.EMITTED_NOTIFICATIONS.includes(t)&&(this.emit("data",e),this.emit("notification",e.params.result))})),i)if("complete"===document.readyState)(0,o.sendSiteMetadata)(this._rpcEngine,this._log);else{const e=()=>{(0,o.sendSiteMetadata)(this._rpcEngine,this._log),window.removeEventListener("DOMContentLoaded",e)};window.addEventListener("DOMContentLoaded",e)}}sendAsync(e,t){this._rpcRequest(e,t)}addListener(e,t){return this._warnOfDeprecation(e),super.addListener(e,t)}on(e,t){return this._warnOfDeprecation(e),super.on(e,t)}once(e,t){return this._warnOfDeprecation(e),super.once(e,t)}prependListener(e,t){return this._warnOfDeprecation(e),super.prependListener(e,t)}prependOnceListener(e,t){return this._warnOfDeprecation(e),super.prependOnceListener(e,t)}_handleDisconnect(e,t){super._handleDisconnect(e,t),this.networkVersion&&!e&&(this.networkVersion=null)}_warnOfDeprecation(e){!1===this._sentWarnings?.events[e]&&(this._log.warn(i.default.warnings.events[e]),this._sentWarnings.events[e]=!0)}async enable(){return this._sentWarnings.enable||(this._log.warn(i.default.warnings.enableDeprecation),this._sentWarnings.enable=!0),new Promise(((e,t)=>{try{this._rpcRequest({method:"eth_requestAccounts",params:[]},(0,c.getRpcPromiseCallback)(e,t))}catch(e){t(e)}}))}send(e,t){return this._sentWarnings.send||(this._log.warn(i.default.warnings.sendDeprecation),this._sentWarnings.send=!0),"string"!=typeof e||t&&!Array.isArray(t)?e&&"object"==typeof e&&"function"==typeof t?this._rpcRequest(e,t):this._sendSync(e):new Promise(((r,n)=>{try{this._rpcRequest({method:e,params:t},(0,c.getRpcPromiseCallback)(r,n,!1))}catch(e){n(e)}}))}_sendSync(e){let t;switch(e.method){case"eth_accounts":t=this.selectedAddress?[this.selectedAddress]:[];break;case"eth_coinbase":t=this.selectedAddress??null;break;case"eth_uninstallFilter":this._rpcRequest(e,c.NOOP),t=!0;break;case"net_version":t=this.networkVersion??null;break;default:throw new Error(i.default.errors.unsupportedSync(e.method))}return{id:e.id,jsonrpc:e.jsonrpc,result:t}}_getExperimentalApi(){return new Proxy({isUnlocked:async()=>(this._state.initialized||await new Promise((e=>{this.on("_initialized",(()=>e()))})),this._state.isUnlocked),requestBatch:async e=>{if(!Array.isArray(e))throw s.ethErrors.rpc.invalidRequest({message:"Batch requests must be made with an array of request objects.",data:e});return new Promise(((t,r)=>{this._rpcRequest(e,(0,c.getRpcPromiseCallback)(t,r))}))}},{get:(e,t,...r)=>(this._sentWarnings.experimentalMethods||(this._log.warn(i.default.warnings.experimentalMethods),this._sentWarnings.experimentalMethods=!0),Reflect.get(e,t,...r))})}_handleChainChanged({chainId:e,networkVersion:t}={}){super._handleChainChanged({chainId:e,networkVersion:t}),this._state.isConnected&&t!==this.networkVersion&&(this.networkVersion=t,this._state.initialized&&this.emit("networkChanged",this.networkVersion))}}r.MetaMaskInpageProvider=u}}},{package:"@metamask/providers",file:"../../node_modules/@metamask/providers/dist/MetaMaskInpageProvider.js"}],[58,{"./BaseProvider":56,"./messages":64,"./utils":68,"@metamask/object-multiplex":3,"is-stream":114,"json-rpc-middleware-stream":125,pump:141},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.StreamProvider=r.AbstractStreamProvider=void 0;const s=n(e("@metamask/object-multiplex")),i=e("is-stream"),o=e("json-rpc-middleware-stream"),a=n(e("pump")),c=e("./BaseProvider"),u=n(e("./messages")),l=e("./utils");class d extends c.BaseProvider{constructor(e,{jsonRpcStreamName:t,logger:r=console,maxEventListeners:n=100,rpcMiddleware:c=[]}){if(super({logger:r,maxEventListeners:n,rpcMiddleware:c}),!(0,i.duplex)(e))throw new Error(u.default.errors.invalidDuplexStream());this._handleStreamDisconnect=this._handleStreamDisconnect.bind(this);const d=new s.default;(0,a.default)(e,d,e,this._handleStreamDisconnect.bind(this,"MetaMask")),this._jsonRpcConnection=(0,o.createStreamMiddleware)({retryOnMessage:"METAMASK_EXTENSION_CONNECT_CAN_RETRY"}),(0,a.default)(this._jsonRpcConnection.stream,d.createStream(t),this._jsonRpcConnection.stream,this._handleStreamDisconnect.bind(this,"MetaMask RpcProvider")),this._rpcEngine.push(this._jsonRpcConnection.middleware),this._jsonRpcConnection.events.on("notification",(t=>{const{method:r,params:n}=t;"metamask_accountsChanged"===r?this._handleAccountsChanged(n):"metamask_unlockStateChanged"===r?this._handleUnlockStateChanged(n):"metamask_chainChanged"===r?this._handleChainChanged(n):l.EMITTED_NOTIFICATIONS.includes(r)?this.emit("message",{type:r,data:n}):"METAMASK_STREAM_FAILURE"===r&&e.destroy(new Error(u.default.errors.permanentlyDisconnected()))}))}async _initializeStateAsync(){let e;try{e=await this.request({method:"metamask_getProviderState"})}catch(e){this._log.error("MetaMask: Failed to get initial state. Please report this bug.",e)}this._initializeState(e)}_handleStreamDisconnect(e,t){let r=`MetaMask: Lost connection to "${e}".`;t?.stack&&(r+=`\n${t.stack}`),this._log.warn(r),this.listenerCount("error")>0&&this.emit("error",r),this._handleDisconnect(!1,t?t.message:undefined)}_handleChainChanged({chainId:e,networkVersion:t}={}){(0,l.isValidChainId)(e)&&(0,l.isValidNetworkVersion)(t)?"loading"===t?this._handleDisconnect(!0):super._handleChainChanged({chainId:e}):this._log.error(u.default.errors.invalidNetworkParams(),{chainId:e,networkVersion:t})}}r.AbstractStreamProvider=d;r.StreamProvider=class extends d{async initialize(){return this._initializeStateAsync()}}}}},{package:"@metamask/providers",file:"../../node_modules/@metamask/providers/dist/StreamProvider.js"}],[59,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ERC20=r.ERC1155=r.ERC721=void 0,r.ERC721="ERC721",r.ERC1155="ERC1155",r.ERC20="ERC20"}}},{package:"@metamask/providers",file:"../../node_modules/@metamask/providers/dist/constants.js"}],[60,{"../MetaMaskInpageProvider":57,"../StreamProvider":58,"../utils":68,"./external-extension-config.json":61,"detect-browser":100,"extension-port-stream":107},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.createExternalExtensionProvider=void 0;const s=e("detect-browser"),i=n(e("extension-port-stream")),o=n(e("./external-extension-config.json")),a=e("../MetaMaskInpageProvider"),c=e("../StreamProvider"),u=e("../utils"),l=(0,s.detect)();r.createExternalExtensionProvider=function(e="stable"){let t;try{const r=function(e){return("firefox"===l?.name?o.default.firefoxIds:o.default.chromeIds)[e]??e}(e),n=chrome.runtime.connect(r),s=new i.default(n);t=new c.StreamProvider(s,{jsonRpcStreamName:a.MetaMaskInpageProviderStreamName,logger:console,rpcMiddleware:(0,u.getDefaultExternalMiddleware)(console)}),t.initialize()}catch(e){throw console.dir("MetaMask connect error.",e),e}return t}}}},{package:"@metamask/providers",file:"../../node_modules/@metamask/providers/dist/extension-provider/createExternalExtensionProvider.js"}],[61,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports={chromeIds:{stable:"nkbihfbeogaeaoehlefnkodbefgpgknn",beta:"pbbkamfgmaedccnfkmjcofcecjhfgldn",flask:"ljfoeinjpaedjfecbmggjgodbgkmjkjk"},firefoxIds:{stable:"webextension@metamask.io",beta:"webextension-beta@metamask.io",flask:"webextension-flask@metamask.io"}}}}},{package:"@metamask/providers",file:"../../node_modules/@metamask/providers/dist/extension-provider/external-extension-config.json"}],[62,{"./BaseProvider":56,"./MetaMaskInpageProvider":57,"./StreamProvider":58,"./extension-provider/createExternalExtensionProvider":60,"./initializeInpageProvider":63,"./shimWeb3":66},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.StreamProvider=r.shimWeb3=r.setGlobalProvider=r.MetaMaskInpageProvider=r.MetaMaskInpageProviderStreamName=r.initializeProvider=r.createExternalExtensionProvider=r.BaseProvider=void 0;const n=e("./BaseProvider");Object.defineProperty(r,"BaseProvider",{enumerable:!0,get:function(){return n.BaseProvider}});const s=e("./extension-provider/createExternalExtensionProvider");Object.defineProperty(r,"createExternalExtensionProvider",{enumerable:!0,get:function(){return s.createExternalExtensionProvider}});const i=e("./initializeInpageProvider");Object.defineProperty(r,"initializeProvider",{enumerable:!0,get:function(){return i.initializeProvider}}),Object.defineProperty(r,"setGlobalProvider",{enumerable:!0,get:function(){return i.setGlobalProvider}});const o=e("./MetaMaskInpageProvider");Object.defineProperty(r,"MetaMaskInpageProvider",{enumerable:!0,get:function(){return o.MetaMaskInpageProvider}}),Object.defineProperty(r,"MetaMaskInpageProviderStreamName",{enumerable:!0,get:function(){return o.MetaMaskInpageProviderStreamName}});const a=e("./shimWeb3");Object.defineProperty(r,"shimWeb3",{enumerable:!0,get:function(){return a.shimWeb3}});const c=e("./StreamProvider");Object.defineProperty(r,"StreamProvider",{enumerable:!0,get:function(){return c.StreamProvider}})}}},{package:"@metamask/providers",file:"../../node_modules/@metamask/providers/dist/index.js"}],[63,{"./MetaMaskInpageProvider":57,"./shimWeb3":66},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.setGlobalProvider=r.initializeProvider=void 0;const n=e("./MetaMaskInpageProvider"),s=e("./shimWeb3");function i(e){window.ethereum=e,window.dispatchEvent(new Event("ethereum#initialized"))}r.initializeProvider=function({connectionStream:e,jsonRpcStreamName:t,logger:r=console,maxEventListeners:o=100,shouldSendMetadata:a=!0,shouldSetOnWindow:c=!0,shouldShimWeb3:u=!1}){const l=new n.MetaMaskInpageProvider(e,{jsonRpcStreamName:t,logger:r,maxEventListeners:o,shouldSendMetadata:a}),d=new Proxy(l,{deleteProperty:()=>!0});return c&&i(d),u&&(0,s.shimWeb3)(d,r),d},r.setGlobalProvider=i}}},{package:"@metamask/providers",file:"../../node_modules/@metamask/providers/dist/initializeInpageProvider.js"}],[64,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});const n={errors:{disconnected:()=>"MetaMask: Disconnected from chain. Attempting to connect.",permanentlyDisconnected:()=>"MetaMask: Disconnected from MetaMask background. Page reload required.",sendSiteMetadata:()=>"MetaMask: Failed to send site metadata. This is an internal error, please report this bug.",unsupportedSync:e=>`MetaMask: The MetaMask Ethereum provider does not support synchronous methods like ${e} without a callback parameter.`,invalidDuplexStream:()=>"Must provide a Node.js-style duplex stream.",invalidNetworkParams:()=>"MetaMask: Received invalid network parameters. Please report this bug.",invalidRequestArgs:()=>"Expected a single, non-array, object argument.",invalidRequestMethod:()=>"'args.method' must be a non-empty string.",invalidRequestParams:()=>"'args.params' must be an object or array if provided.",invalidLoggerObject:()=>"'args.logger' must be an object if provided.",invalidLoggerMethod:e=>`'args.logger' must include required method '${e}'.`},info:{connected:e=>`MetaMask: Connected to chain with ID "${e}".`},warnings:{enableDeprecation:"MetaMask: 'ethereum.enable()' is deprecated and may be removed in the future. Please use the 'eth_requestAccounts' RPC method instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1102",sendDeprecation:"MetaMask: 'ethereum.send(...)' is deprecated and may be removed in the future. Please use 'ethereum.sendAsync(...)' or 'ethereum.request(...)' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193",events:{close:"MetaMask: The event 'close' is deprecated and may be removed in the future. Please use 'disconnect' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#disconnect",data:"MetaMask: The event 'data' is deprecated and will be removed in the future. Use 'message' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message",networkChanged:"MetaMask: The event 'networkChanged' is deprecated and may be removed in the future. Use 'chainChanged' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#chainchanged",notification:"MetaMask: The event 'notification' is deprecated and may be removed in the future. Use 'message' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message"},rpc:{ethDecryptDeprecation:"MetaMask: The RPC method 'eth_decrypt' is deprecated and may be removed in the future.\nFor more information, see: https://medium.com/metamask/metamask-api-method-deprecation-2b0564a84686",ethGetEncryptionPublicKeyDeprecation:"MetaMask: The RPC method 'eth_getEncryptionPublicKey' is deprecated and may be removed in the future.\nFor more information, see: https://medium.com/metamask/metamask-api-method-deprecation-2b0564a84686",walletWatchAssetNFTExperimental:"MetaMask: The RPC method 'wallet_watchAsset' is experimental for ERC721/ERC1155 assets and may change in the future.\nFor more information, see: https://github.com/MetaMask/metamask-improvement-proposals/blob/main/MIPs/mip-1.md and https://github.com/MetaMask/metamask-improvement-proposals/blob/main/PROCESS-GUIDE.md#proposal-lifecycle"},experimentalMethods:"MetaMask: 'ethereum._metamask' exposes non-standard, experimental methods. They may be removed or changed without warning."}};r.default=n}}},{package:"@metamask/providers",file:"../../node_modules/@metamask/providers/dist/messages.js"}],[65,{"../constants":59,"../messages":64},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.createRpcWarningMiddleware=void 0;const s=e("../constants"),i=n(e("../messages"));r.createRpcWarningMiddleware=function(e){const t={ethDecryptDeprecation:!1,ethGetEncryptionPublicKeyDeprecation:!1,walletWatchAssetNFTExperimental:!1};return(r,n,o)=>{t.ethDecryptDeprecation||"eth_decrypt"!==r.method?t.ethGetEncryptionPublicKeyDeprecation||"eth_getEncryptionPublicKey"!==r.method?!t.walletWatchAssetNFTExperimental&&"wallet_watchAsset"===r.method&&[s.ERC721,s.ERC1155].includes(r.params?.type||"")&&(e.warn(i.default.warnings.rpc.walletWatchAssetNFTExperimental),t.walletWatchAssetNFTExperimental=!0):(e.warn(i.default.warnings.rpc.ethGetEncryptionPublicKeyDeprecation),t.ethGetEncryptionPublicKeyDeprecation=!0):(e.warn(i.default.warnings.rpc.ethDecryptDeprecation),t.ethDecryptDeprecation=!0),o()}}}}},{package:"@metamask/providers",file:"../../node_modules/@metamask/providers/dist/middleware/createRpcWarningMiddleware.js"}],[66,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.shimWeb3=void 0,r.shimWeb3=function(e,t=console){let r=!1,n=!1;if(!window.web3){const s="__isMetaMaskShim__";let i={currentProvider:e};Object.defineProperty(i,s,{value:!0,enumerable:!0,configurable:!1,writable:!1}),i=new Proxy(i,{get:(i,o,...a)=>("currentProvider"!==o||r?"currentProvider"===o||o===s||n||(n=!0,t.error("MetaMask no longer injects web3. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3"),e.request({method:"metamask_logWeb3ShimUsage"}).catch((e=>{t.debug("MetaMask: Failed to log web3 shim usage.",e)}))):(r=!0,t.warn("You are accessing the MetaMask window.web3.currentProvider shim. This property is deprecated; use window.ethereum instead. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3")),Reflect.get(i,o,...a)),set:(...e)=>(t.warn("You are accessing the MetaMask window.web3 shim. This object is deprecated; use window.ethereum instead. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3"),Reflect.set(...e))}),Object.defineProperty(window,"web3",{value:i,enumerable:!1,configurable:!0,writable:!0})}}}}},{package:"@metamask/providers",file:"../../node_modules/@metamask/providers/dist/shimWeb3.js"}],[67,{"./messages":64,"./utils":68},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.sendSiteMetadata=void 0;const s=n(e("./messages")),i=e("./utils");function o(e){const{document:t}=e,r=t.querySelector('head > meta[property="og:site_name"]');if(r)return r.content;const n=t.querySelector('head > meta[name="title"]');return n?n.content:t.title&&t.title.length>0?t.title:window.location.hostname}async function a(e){const{document:t}=e,r=t.querySelectorAll('head > link[rel~="icon"]');for(const e of Array.from(r))if(e&&await c(e.href))return e.href;return null}async function c(e){return new Promise(((t,r)=>{try{const r=document.createElement("img");r.onload=()=>t(!0),r.onerror=()=>t(!1),r.src=e}catch(e){r(e)}}))}r.sendSiteMetadata=async function(e,t){try{const t=await async function(){return{name:o(window),icon:await a(window)}}();e.handle({jsonrpc:"2.0",id:1,method:"metamask_sendDomainMetadata",params:t},i.NOOP)}catch(e){t.error({message:s.default.errors.sendSiteMetadata(),originalError:e})}}}}},{package:"@metamask/providers",file:"../../node_modules/@metamask/providers/dist/siteMetadata.js"}],[68,{"./middleware/createRpcWarningMiddleware":65,"eth-rpc-errors":105,"json-rpc-engine":121},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.NOOP=r.isValidNetworkVersion=r.isValidChainId=r.getRpcPromiseCallback=r.getDefaultExternalMiddleware=r.EMITTED_NOTIFICATIONS=void 0;const n=e("eth-rpc-errors"),s=e("json-rpc-engine"),i=e("./middleware/createRpcWarningMiddleware");r.EMITTED_NOTIFICATIONS=Object.freeze(["eth_subscription"]);r.getDefaultExternalMiddleware=(e=console)=>{return[(0,s.createIdRemapMiddleware)(),(t=e,(e,r,s)=>{"string"==typeof e.method&&e.method||(r.error=n.ethErrors.rpc.invalidRequest({message:"The request 'method' must be a non-empty string.",data:e})),s((e=>{const{error:n}=r;return n?(t.error(`MetaMask - RPC Error: ${n.message}`,n),e()):e()}))}),(0,i.createRpcWarningMiddleware)(e)];var t};r.getRpcPromiseCallback=(e,t,r=!0)=>(n,s)=>{n||s.error?t(n||s.error):!r||Array.isArray(s)?e(s):e(s.result)};r.isValidChainId=e=>Boolean(e)&&"string"==typeof e&&e.startsWith("0x");r.isValidNetworkVersion=e=>Boolean(e)&&"string"==typeof e;r.NOOP=()=>undefined}}},{package:"@metamask/providers",file:"../../node_modules/@metamask/providers/dist/utils.js"}],[69,{events:"events"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});const n=e("events");function s(e,t,r){try{Reflect.apply(e,t,r)}catch(e){setTimeout((()=>{throw e}))}}class i extends n.EventEmitter{emit(e,...t){let r="error"===e;const n=this._events;if(n!==undefined)r=r&&n.error===undefined;else if(!r)return!1;if(r){let e;if(t.length>0&&([e]=t),e instanceof Error)throw e;const r=new Error("Unhandled error."+(e?` (${e.message})`:""));throw r.context=e,r}const i=n[e];if(i===undefined)return!1;if("function"==typeof i)s(i,this,t);else{const e=i.length,r=function(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}(i);for(let n=0;n<e;n+=1)s(r[n],this,t)}return!0}}r.default=i}}},{package:"@metamask/providers>@metamask/safe-event-emitter",file:"../../node_modules/@metamask/providers/node_modules/@metamask/safe-event-emitter/index.js"}],[70,{events:"events"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});const n=e("events");function s(e,t,r){try{Reflect.apply(e,t,r)}catch(e){setTimeout((()=>{throw e}))}}class i extends n.EventEmitter{emit(e,...t){let r="error"===e;const n=this._events;if(n!==undefined)r=r&&n.error===undefined;else if(!r)return!1;if(r){let e;if(t.length>0&&([e]=t),e instanceof Error)throw e;const r=new Error("Unhandled error."+(e?` (${e.message})`:""));throw r.context=e,r}const i=n[e];if(i===undefined)return!1;if("function"==typeof i)s(i,this,t);else{const e=i.length,r=function(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}(i);for(let n=0;n<e;n+=1)s(r[n],this,t)}return!0}}r.default=i}}},{package:"json-rpc-engine>@metamask/safe-event-emitter",file:"../../node_modules/@metamask/safe-event-emitter/index.js"}],[71,{superstruct:186},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.assertExhaustive=r.assertStruct=r.assert=r.AssertionError=void 0;const n=e("superstruct");function s(e,t){return r=e,Boolean("string"==typeof r?.prototype?.constructor?.name)?new e({message:t}):e({message:t});var r}class i extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}r.AssertionError=i,r.assert=function(e,t="Assertion failed.",r=i){if(!e){if(t instanceof Error)throw t;throw s(r,t)}},r.assertStruct=function(e,t,r="Assertion failed",o=i){try{(0,n.assert)(e,t)}catch(e){throw s(o,`${r}: ${function(e){const t=function(e){return"object"==typeof e&&null!==e&&"message"in e}(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}(e)}.`)}},r.assertExhaustive=function(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/assert.js"}],[72,{"./assert":71,superstruct:186},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.base64=void 0;const n=e("superstruct"),s=e("./assert");r.base64=(e,t={})=>{const r=t.paddingRequired??!1,i=t.characterSet??"base64";let o,a;return"base64"===i?o=String.raw`[A-Za-z0-9+\/]`:((0,s.assert)("base64url"===i),o=String.raw`[-_A-Za-z0-9]`),a=r?new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,n.pattern)(e,a)}}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/base64.js"}],[73,{"./assert":71,"./hex":78,buffer:"buffer"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.createDataView=r.concatBytes=r.valueToBytes=r.stringToBytes=r.numberToBytes=r.signedBigIntToBytes=r.bigIntToBytes=r.hexToBytes=r.bytesToString=r.bytesToNumber=r.bytesToSignedBigInt=r.bytesToBigInt=r.bytesToHex=r.assertIsBytes=r.isBytes=void 0;const n=e("./assert"),s=e("./hex"),i=48,o=58,a=87;const c=function(){const e=[];return()=>{if(0===e.length)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}();function u(e){return e instanceof Uint8Array}function l(e){(0,n.assert)(u(e),"Value must be a Uint8Array.")}function d(e){if(l(e),0===e.length)return"0x";const t=c(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,s.add0x)(r.join(""))}function h(e){l(e);const t=d(e);return BigInt(t)}function f(e){if("0x"===e?.toLowerCase?.())return new Uint8Array;(0,s.assertIsHexString)(e);const t=(0,s.remove0x)(e).toLowerCase(),r=t.length%2==0?t:`0${t}`,n=new Uint8Array(r.length/2);for(let e=0;e<n.length;e++){const t=r.charCodeAt(2*e),s=r.charCodeAt(2*e+1),c=t-(t<o?i:a),u=s-(s<o?i:a);n[e]=16*c+u}return n}function p(e){(0,n.assert)("bigint"==typeof e,"Value must be a bigint."),(0,n.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");return f(e.toString(16))}function m(e){(0,n.assert)("number"==typeof e,"Value must be a number."),(0,n.assert)(e>=0,"Value must be a non-negative number."),(0,n.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");return f(e.toString(16))}function g(e){return(0,n.assert)("string"==typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function b(e){if("bigint"==typeof e)return p(e);if("number"==typeof e)return m(e);if("string"==typeof e)return e.startsWith("0x")?f(e):g(e);if(u(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}r.isBytes=u,r.assertIsBytes=l,r.bytesToHex=d,r.bytesToBigInt=h,r.bytesToSignedBigInt=function(e){l(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(8*e.length,t)},r.bytesToNumber=function(e){l(e);const t=h(e);return(0,n.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)},r.bytesToString=function(e){return l(e),(new TextDecoder).decode(e)},r.hexToBytes=f,r.bigIntToBytes=p,r.signedBigIntToBytes=function(e,t){(0,n.assert)("bigint"==typeof e,"Value must be a bigint."),(0,n.assert)("number"==typeof t,"Byte length must be a number."),(0,n.assert)(t>0,"Byte length must be greater than 0."),(0,n.assert)(function(e,t){(0,n.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(8*t-1))}(e,t),"Byte length is too small to represent the given value.");let r=e;const s=new Uint8Array(t);for(let e=0;e<s.length;e++)s[e]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return s.reverse()},r.numberToBytes=m,r.stringToBytes=g,r.valueToBytes=b,r.concatBytes=function(e){const t=new Array(e.length);let r=0;for(let n=0;n<e.length;n++){const s=b(e[n]);t[n]=s,r+=s.length}const n=new Uint8Array(r);for(let e=0,r=0;e<t.length;e++)n.set(t[e],r),r+=t[e].length;return n},r.createDataView=function(e){if(void 0!==t&&e instanceof t){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/bytes.js"}],[74,{"./base64":72,superstruct:186},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ChecksumStruct=void 0;const n=e("superstruct"),s=e("./base64");r.ChecksumStruct=(0,n.size)((0,s.base64)((0,n.string)(),{paddingRequired:!0}),44,44)}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/checksum.js"}],[75,{"./assert":71,"./bytes":73,"./hex":78,superstruct:186},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createHex=r.createBytes=r.createBigInt=r.createNumber=void 0;const n=e("superstruct"),s=e("./assert"),i=e("./bytes"),o=e("./hex"),a=(0,n.union)([(0,n.number)(),(0,n.bigint)(),(0,n.string)(),o.StrictHexStruct]),c=(0,n.coerce)((0,n.number)(),a,Number),u=(0,n.coerce)((0,n.bigint)(),a,BigInt),l=((0,n.union)([o.StrictHexStruct,(0,n.instance)(Uint8Array)]),(0,n.coerce)((0,n.instance)(Uint8Array),(0,n.union)([o.StrictHexStruct]),i.hexToBytes)),d=(0,n.coerce)(o.StrictHexStruct,(0,n.instance)(Uint8Array),i.bytesToHex);r.createNumber=function(e){try{const t=(0,n.create)(e,c);return(0,s.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){if(t instanceof n.StructError)throw new Error(`Expected a number-like value, got "${e}".`);throw t}},r.createBigInt=function(e){try{return(0,n.create)(e,u)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a number-like value, got "${String(e.value)}".`);throw e}},r.createBytes=function(e){if("string"==typeof e&&"0x"===e.toLowerCase())return new Uint8Array;try{return(0,n.create)(e,l)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}},r.createHex=function(e){if(e instanceof Uint8Array&&0===e.length||"string"==typeof e&&"0x"===e.toLowerCase())return"0x";try{return(0,n.create)(e,d)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}}}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/coercers.js"}],[76,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s,i=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},o=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(r,"__esModule",{value:!0}),r.FrozenSet=r.FrozenMap=void 0;class a{constructor(e){n.set(this,void 0),i(this,n,new Map(e),"f"),Object.freeze(this)}get size(){return o(this,n,"f").size}[(n=new WeakMap,Symbol.iterator)](){return o(this,n,"f")[Symbol.iterator]()}entries(){return o(this,n,"f").entries()}forEach(e,t){return o(this,n,"f").forEach(((r,n,s)=>e.call(t,r,n,this)))}get(e){return o(this,n,"f").get(e)}has(e){return o(this,n,"f").has(e)}keys(){return o(this,n,"f").keys()}values(){return o(this,n,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([e,t])=>`${String(e)} => ${String(t)}`)).join(", ")} `:""}}`}}r.FrozenMap=a;class c{constructor(e){s.set(this,void 0),i(this,s,new Set(e),"f"),Object.freeze(this)}get size(){return o(this,s,"f").size}[(s=new WeakMap,Symbol.iterator)](){return o(this,s,"f")[Symbol.iterator]()}entries(){return o(this,s,"f").entries()}forEach(e,t){return o(this,s,"f").forEach(((r,n,s)=>e.call(t,r,n,this)))}has(e){return o(this,s,"f").has(e)}keys(){return o(this,s,"f").keys()}values(){return o(this,s,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((e=>String(e))).join(", ")} `:""}}`}}r.FrozenSet=c,Object.freeze(a),Object.freeze(a.prototype),Object.freeze(c),Object.freeze(c.prototype)}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/collections.js"}],[77,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/encryption-types.js"}],[78,{"./assert":71,"./bytes":73,"@noble/hashes/sha3":92,superstruct:186},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.remove0x=r.add0x=r.isValidChecksumAddress=r.getChecksumAddress=r.isValidHexAddress=r.assertIsStrictHexString=r.assertIsHexString=r.isStrictHexString=r.isHexString=r.HexChecksumAddressStruct=r.HexAddressStruct=r.StrictHexStruct=r.HexStruct=void 0;const n=e("@noble/hashes/sha3"),s=e("superstruct"),i=e("./assert"),o=e("./bytes");function a(e){return(0,s.is)(e,r.HexStruct)}function c(e){return(0,s.is)(e,r.StrictHexStruct)}function u(e){(0,i.assert)((0,s.is)(e,r.HexChecksumAddressStruct),"Invalid hex address.");const t=d(e.toLowerCase()),a=d((0,o.bytesToHex)((0,n.keccak_256)(t)));return`0x${t.split("").map(((e,t)=>{const r=a[t];return(0,i.assert)((0,s.is)(r,(0,s.string)()),"Hash shorter than address."),parseInt(r,16)>7?e.toUpperCase():e})).join("")}`}function l(e){return!!(0,s.is)(e,r.HexChecksumAddressStruct)&&u(e)===e}function d(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}r.HexStruct=(0,s.pattern)((0,s.string)(),/^(?:0x)?[0-9a-f]+$/iu),r.StrictHexStruct=(0,s.pattern)((0,s.string)(),/^0x[0-9a-f]+$/iu),r.HexAddressStruct=(0,s.pattern)((0,s.string)(),/^0x[0-9a-f]{40}$/u),r.HexChecksumAddressStruct=(0,s.pattern)((0,s.string)(),/^0x[0-9a-fA-F]{40}$/u),r.isHexString=a,r.isStrictHexString=c,r.assertIsHexString=function(e){(0,i.assert)(a(e),"Value must be a hexadecimal string.")},r.assertIsStrictHexString=function(e){(0,i.assert)(c(e),'Value must be a hexadecimal string, starting with "0x".')},r.isValidHexAddress=function(e){return(0,s.is)(e,r.HexAddressStruct)||l(e)},r.getChecksumAddress=u,r.isValidChecksumAddress=l,r.add0x=function(e){return e.startsWith("0x")?e:e.startsWith("0X")?`0x${e.substring(2)}`:`0x${e}`},r.remove0x=d}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/hex.js"}],[79,{"./assert":71,"./base64":72,"./bytes":73,"./checksum":74,"./coercers":75,"./collections":76,"./encryption-types":77,"./hex":78,"./json":80,"./keyring":81,"./logging":82,"./misc":83,"./number":84,"./opaque":85,"./time":86,"./transaction-types":87,"./versions":88},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./assert"),r),s(e("./base64"),r),s(e("./bytes"),r),s(e("./checksum"),r),s(e("./coercers"),r),s(e("./collections"),r),s(e("./encryption-types"),r),s(e("./hex"),r),s(e("./json"),r),s(e("./keyring"),r),s(e("./logging"),r),s(e("./misc"),r),s(e("./number"),r),s(e("./opaque"),r),s(e("./time"),r),s(e("./transaction-types"),r),s(e("./versions"),r)}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/index.js"}],[80,{"./assert":71,superstruct:186},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getJsonRpcIdValidator=r.assertIsJsonRpcError=r.isJsonRpcError=r.assertIsJsonRpcFailure=r.isJsonRpcFailure=r.assertIsJsonRpcSuccess=r.isJsonRpcSuccess=r.assertIsJsonRpcResponse=r.isJsonRpcResponse=r.assertIsPendingJsonRpcResponse=r.isPendingJsonRpcResponse=r.JsonRpcResponseStruct=r.JsonRpcFailureStruct=r.JsonRpcSuccessStruct=r.PendingJsonRpcResponseStruct=r.assertIsJsonRpcRequest=r.isJsonRpcRequest=r.assertIsJsonRpcNotification=r.isJsonRpcNotification=r.JsonRpcNotificationStruct=r.JsonRpcRequestStruct=r.JsonRpcParamsStruct=r.JsonRpcErrorStruct=r.JsonRpcIdStruct=r.JsonRpcVersionStruct=r.jsonrpc2=r.getJsonSize=r.getSafeJson=r.isValidJson=r.JsonStruct=r.UnsafeJsonStruct=void 0;const n=e("superstruct"),s=e("./assert");function i(e){return(0,n.create)(e,r.JsonStruct)}r.UnsafeJsonStruct=(0,n.union)([(0,n.literal)(null),(0,n.boolean)(),(0,n.define)("finite number",(e=>(0,n.is)(e,(0,n.number)())&&Number.isFinite(e))),(0,n.string)(),(0,n.array)((0,n.lazy)((()=>r.UnsafeJsonStruct))),(0,n.record)((0,n.string)(),(0,n.lazy)((()=>r.UnsafeJsonStruct)))]),r.JsonStruct=(0,n.coerce)(r.UnsafeJsonStruct,(0,n.any)(),(e=>((0,s.assertStruct)(e,r.UnsafeJsonStruct),JSON.parse(JSON.stringify(e,((e,t)=>"__proto__"===e||"constructor"===e?undefined:t)))))),r.isValidJson=function(e){try{return i(e),!0}catch{return!1}},r.getSafeJson=i,r.getJsonSize=function(e){(0,s.assertStruct)(e,r.JsonStruct,"Invalid JSON value");const t=JSON.stringify(e);return(new TextEncoder).encode(t).byteLength},r.jsonrpc2="2.0",r.JsonRpcVersionStruct=(0,n.literal)(r.jsonrpc2),r.JsonRpcIdStruct=(0,n.nullable)((0,n.union)([(0,n.number)(),(0,n.string)()])),r.JsonRpcErrorStruct=(0,n.object)({code:(0,n.integer)(),message:(0,n.string)(),data:(0,n.optional)(r.JsonStruct),stack:(0,n.optional)((0,n.string)())}),r.JsonRpcParamsStruct=(0,n.optional)((0,n.union)([(0,n.record)((0,n.string)(),r.JsonStruct),(0,n.array)(r.JsonStruct)])),r.JsonRpcRequestStruct=(0,n.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,method:(0,n.string)(),params:r.JsonRpcParamsStruct}),r.JsonRpcNotificationStruct=(0,n.omit)(r.JsonRpcRequestStruct,["id"]),r.isJsonRpcNotification=function(e){return(0,n.is)(e,r.JsonRpcNotificationStruct)},r.assertIsJsonRpcNotification=function(e,t){(0,s.assertStruct)(e,r.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",t)},r.isJsonRpcRequest=function(e){return(0,n.is)(e,r.JsonRpcRequestStruct)},r.assertIsJsonRpcRequest=function(e,t){(0,s.assertStruct)(e,r.JsonRpcRequestStruct,"Invalid JSON-RPC request",t)},r.PendingJsonRpcResponseStruct=(0,n.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,result:(0,n.optional)((0,n.unknown)()),error:(0,n.optional)(r.JsonRpcErrorStruct)}),r.JsonRpcSuccessStruct=(0,n.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,result:r.JsonStruct}),r.JsonRpcFailureStruct=(0,n.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,error:r.JsonRpcErrorStruct}),r.JsonRpcResponseStruct=(0,n.union)([r.JsonRpcSuccessStruct,r.JsonRpcFailureStruct]),r.isPendingJsonRpcResponse=function(e){return(0,n.is)(e,r.PendingJsonRpcResponseStruct)},r.assertIsPendingJsonRpcResponse=function(e,t){(0,s.assertStruct)(e,r.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",t)},r.isJsonRpcResponse=function(e){return(0,n.is)(e,r.JsonRpcResponseStruct)},r.assertIsJsonRpcResponse=function(e,t){(0,s.assertStruct)(e,r.JsonRpcResponseStruct,"Invalid JSON-RPC response",t)},r.isJsonRpcSuccess=function(e){return(0,n.is)(e,r.JsonRpcSuccessStruct)},r.assertIsJsonRpcSuccess=function(e,t){(0,s.assertStruct)(e,r.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",t)},r.isJsonRpcFailure=function(e){return(0,n.is)(e,r.JsonRpcFailureStruct)},r.assertIsJsonRpcFailure=function(e,t){(0,s.assertStruct)(e,r.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",t)},r.isJsonRpcError=function(e){return(0,n.is)(e,r.JsonRpcErrorStruct)},r.assertIsJsonRpcError=function(e,t){(0,s.assertStruct)(e,r.JsonRpcErrorStruct,"Invalid JSON-RPC error",t)},r.getJsonRpcIdValidator=function(e){const{permitEmptyString:t,permitFractions:r,permitNull:n}={permitEmptyString:!0,permitFractions:!1,permitNull:!0,...e};return e=>Boolean("number"==typeof e&&(r||Number.isInteger(e))||"string"==typeof e&&(t||e.length>0)||n&&null===e)}}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/json.js"}],[81,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/keyring.js"}],[82,{debug:98},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.createModuleLogger=r.createProjectLogger=void 0;const s=(0,n(e("debug")).default)("metamask");r.createProjectLogger=function(e){return s.extend(e)},r.createModuleLogger=function(e,t){return e.extend(t)}}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/logging.js"}],[83,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.calculateNumberSize=r.calculateStringSize=r.isASCII=r.isPlainObject=r.ESCAPE_CHARACTERS_REGEXP=r.JsonSize=r.hasProperty=r.isObject=r.isNullOrUndefined=r.isNonEmptyArray=void 0,r.isNonEmptyArray=function(e){return Array.isArray(e)&&e.length>0},r.isNullOrUndefined=function(e){return null===e||e===undefined},r.isObject=function(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)};function n(e){return e.charCodeAt(0)<=127}r.hasProperty=(e,t)=>Object.hasOwnProperty.call(e,t),function(e){e[e.Null=4]="Null",e[e.Comma=1]="Comma",e[e.Wrapper=1]="Wrapper",e[e.True=4]="True",e[e.False=5]="False",e[e.Quote=1]="Quote",e[e.Colon=1]="Colon",e[e.Date=24]="Date"}(r.JsonSize||(r.JsonSize={})),r.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,r.isPlainObject=function(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}},r.isASCII=n,r.calculateStringSize=function(e){return e.split("").reduce(((e,t)=>n(t)?e+1:e+2),0)+(e.match(r.ESCAPE_CHARACTERS_REGEXP)??[]).length},r.calculateNumberSize=function(e){return e.toString().length}}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/misc.js"}],[84,{"./assert":71,"./hex":78},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.hexToBigInt=r.hexToNumber=r.bigIntToHex=r.numberToHex=void 0;const n=e("./assert"),s=e("./hex");r.numberToHex=e=>((0,n.assert)("number"==typeof e,"Value must be a number."),(0,n.assert)(e>=0,"Value must be a non-negative number."),(0,n.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,s.add0x)(e.toString(16)));r.bigIntToHex=e=>((0,n.assert)("bigint"==typeof e,"Value must be a bigint."),(0,n.assert)(e>=0,"Value must be a non-negative bigint."),(0,s.add0x)(e.toString(16)));r.hexToNumber=e=>{(0,s.assertIsHexString)(e);const t=parseInt(e,16);return(0,n.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};r.hexToBigInt=e=>((0,s.assertIsHexString)(e),BigInt((0,s.add0x)(e)))}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/number.js"}],[85,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/opaque.js"}],[86,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.timeSince=r.inMilliseconds=r.Duration=void 0,function(e){e[e.Millisecond=1]="Millisecond",e[e.Second=1e3]="Second",e[e.Minute=6e4]="Minute",e[e.Hour=36e5]="Hour",e[e.Day=864e5]="Day",e[e.Week=6048e5]="Week",e[e.Year=31536e6]="Year"}(r.Duration||(r.Duration={}));const n=(e,t)=>{if(!(e=>Number.isInteger(e)&&e>=0)(e))throw new Error(`"${t}" must be a non-negative integer. Received: "${e}".`)};r.inMilliseconds=function(e,t){return n(e,"count"),e*t},r.timeSince=function(e){return n(e,"timestamp"),Date.now()-e}}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/time.js"}],[87,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/transaction-types.js"}],[88,{"./assert":71,semver:169,superstruct:186},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.satisfiesVersionRange=r.gtRange=r.gtVersion=r.assertIsSemVerRange=r.assertIsSemVerVersion=r.isValidSemVerRange=r.isValidSemVerVersion=r.VersionRangeStruct=r.VersionStruct=void 0;const n=e("semver"),s=e("superstruct"),i=e("./assert");r.VersionStruct=(0,s.refine)((0,s.string)(),"Version",(e=>null!==(0,n.valid)(e)||`Expected SemVer version, got "${e}"`)),r.VersionRangeStruct=(0,s.refine)((0,s.string)(),"Version range",(e=>null!==(0,n.validRange)(e)||`Expected SemVer range, got "${e}"`)),r.isValidSemVerVersion=function(e){return(0,s.is)(e,r.VersionStruct)},r.isValidSemVerRange=function(e){return(0,s.is)(e,r.VersionRangeStruct)},r.assertIsSemVerVersion=function(e){(0,i.assertStruct)(e,r.VersionStruct)},r.assertIsSemVerRange=function(e){(0,i.assertStruct)(e,r.VersionRangeStruct)},r.gtVersion=function(e,t){return(0,n.gt)(e,t)},r.gtRange=function(e,t){return(0,n.gtr)(e,t)},r.satisfiesVersionRange=function(e,t){return(0,n.satisfies)(e,t,{includePrerelease:!0})}}}},{package:"@metamask/utils",file:"../../node_modules/@metamask/utils/dist/versions.js"}],[89,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){function n(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function s(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)}function i(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function o(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");n(e.outputLen),n(e.blockLen)}function a(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function c(e,t){i(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(r,"__esModule",{value:!0}),r.output=r.exists=r.hash=r.bytes=r.bool=r.number=void 0,r.number=n,r.bool=s,r.bytes=i,r.hash=o,r.exists=a,r.output=c;const u={number:n,bool:s,bytes:i,hash:o,exists:a,output:c};r.default=u}}},{package:"@metamask/utils>@noble/hashes",file:"../../node_modules/@noble/hashes/_assert.js"}],[90,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.add=r.toBig=r.split=r.fromBig=void 0;const n=BigInt(2**32-1),s=BigInt(32);function i(e,t=!1){return t?{h:Number(e&n),l:Number(e>>s&n)}:{h:0|Number(e>>s&n),l:0|Number(e&n)}}function o(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:o,l:a}=i(e[s],t);[r[s],n[s]]=[o,a]}return[r,n]}r.fromBig=i,r.split=o;r.toBig=(e,t)=>BigInt(e>>>0)<<s|BigInt(t>>>0);function a(e,t,r,n){const s=(t>>>0)+(n>>>0);return{h:e+r+(s/2**32|0)|0,l:0|s}}r.add=a;const c={fromBig:i,split:o,toBig:r.toBig,shrSH:(e,t,r)=>e>>>r,shrSL:(e,t,r)=>e<<32-r|t>>>r,rotrSH:(e,t,r)=>e>>>r|t<<32-r,rotrSL:(e,t,r)=>e<<32-r|t>>>r,rotrBH:(e,t,r)=>e<<64-r|t>>>r-32,rotrBL:(e,t,r)=>e>>>r-32|t<<64-r,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:(e,t,r)=>e<<r|t>>>32-r,rotlSL:(e,t,r)=>t<<r|e>>>32-r,rotlBH:(e,t,r)=>t<<r-32|e>>>64-r,rotlBL:(e,t,r)=>e<<r-32|t>>>64-r,add:a,add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/2**32|0)|0,add4L:(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H:(e,t,r,n,s)=>t+r+n+s+(e/2**32|0)|0,add5H:(e,t,r,n,s,i)=>t+r+n+s+i+(e/2**32|0)|0,add5L:(e,t,r,n,s)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(s>>>0)};r.default=c}}},{package:"@metamask/utils>@noble/hashes",file:"../../node_modules/@noble/hashes/_u64.js"}],[91,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.crypto=void 0,r.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:undefined}}},{package:"@metamask/utils>@noble/hashes",file:"../../node_modules/@noble/hashes/crypto.js"}],[92,{"./_assert.js":89,"./_u64.js":90,"./utils.js":93},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.shake256=r.shake128=r.keccak_512=r.keccak_384=r.keccak_256=r.keccak_224=r.sha3_512=r.sha3_384=r.sha3_256=r.sha3_224=r.Keccak=r.keccakP=void 0;const n=e("./_assert.js"),s=e("./_u64.js"),i=e("./utils.js"),[o,a,c]=[[],[],[]],u=BigInt(0),l=BigInt(1),d=BigInt(2),h=BigInt(7),f=BigInt(256),p=BigInt(113);for(let e=0,t=l,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],o.push(2*(5*n+r)),a.push((e+1)*(e+2)/2%64);let s=u;for(let e=0;e<7;e++)t=(t<<l^(t>>h)*p)%f,t&d&&(s^=l<<(l<<BigInt(e))-l);c.push(s)}const[m,g]=s.default.split(c,!0),b=(e,t,r)=>r>32?s.default.rotlBH(e,t,r):s.default.rotlSH(e,t,r),w=(e,t,r)=>r>32?s.default.rotlBL(e,t,r):s.default.rotlSL(e,t,r);function y(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,s=(t+2)%10,i=r[s],o=r[s+1],a=b(i,o,1)^r[n],c=w(i,o,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=c}let t=e[2],s=e[3];for(let r=0;r<24;r++){const n=a[r],i=b(t,s,n),c=w(t,s,n),u=o[r];t=e[u],s=e[u+1],e[u]=i,e[u+1]=c}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=m[n],e[1]^=g[n]}r.fill(0)}r.keccakP=y;class v extends i.Hash{constructor(e,t,r,s=!1,o=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=s,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,n.default.number(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,i.u32)(this.state)}keccak(){y(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){n.default.exists(this);const{blockLen:t,state:r}=this,s=(e=(0,i.toBytes)(e)).length;for(let n=0;n<s;){const i=Math.min(t-this.pos,s-n);for(let t=0;t<i;t++)r[this.pos++]^=e[n++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,0!=(128&t)&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){n.default.exists(this,!1),n.default.bytes(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,s=e.length;n<s;){this.posOut>=r&&this.keccak();const i=Math.min(r-this.posOut,s-n);e.set(t.subarray(this.posOut,this.posOut+i),n),this.posOut+=i,n+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return n.default.number(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(n.default.output(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:s,enableXOF:i}=this;return e||(e=new v(t,r,n,i,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=r,e.outputLen=n,e.enableXOF=i,e.destroyed=this.destroyed,e}}r.Keccak=v;const _=(e,t,r)=>(0,i.wrapConstructor)((()=>new v(t,e,r)));r.sha3_224=_(6,144,28),r.sha3_256=_(6,136,32),r.sha3_384=_(6,104,48),r.sha3_512=_(6,72,64),r.keccak_224=_(1,144,28),r.keccak_256=_(1,136,32),r.keccak_384=_(1,104,48),r.keccak_512=_(1,72,64);const S=(e,t,r)=>(0,i.wrapXOFConstructorWithOpts)(((n={})=>new v(t,e,n.dkLen===undefined?r:n.dkLen,!0)));r.shake128=S(31,168,16),r.shake256=S(31,136,32)}}},{package:"@metamask/utils>@noble/hashes",file:"../../node_modules/@noble/hashes/sha3.js"}],[93,{"@noble/hashes/crypto":91},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){
|
|
12121
12143
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
12122
|
-
Object.defineProperty(r,"__esModule",{value:!0}),r.randomBytes=r.wrapXOFConstructorWithOpts=r.wrapConstructorWithOpts=r.wrapConstructor=r.checkOpts=r.Hash=r.concatBytes=r.toBytes=r.utf8ToBytes=r.asyncLoop=r.nextTick=r.hexToBytes=r.bytesToHex=r.isLE=r.rotr=r.createView=r.u32=r.u8=void 0;const n=e("@noble/hashes/crypto"),s=e=>e instanceof Uint8Array;r.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);r.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));r.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);if(r.rotr=(e,t)=>e<<32-t|e>>>t,r.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!r.isLE)throw new Error("Non little-endian hardware is not supported");const i=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));r.bytesToHex=function(e){if(!s(e))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=i[e[r]];return t},r.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(t/2);for(let t=0;t<r.length;t++){const n=2*t,s=e.slice(n,n+2),i=Number.parseInt(s,16);if(Number.isNaN(i)||i<0)throw new Error("Invalid byte sequence");r[t]=i}return r};function o(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function a(e){if("string"==typeof e&&(e=o(e)),!s(e))throw new Error("expected Uint8Array, got "+typeof e);return e}r.nextTick=async()=>{},r.asyncLoop=async function(e,t,n){let s=Date.now();for(let i=0;i<e;i++){n(i);const e=Date.now()-s;e>=0&&e<t||(await(0,r.nextTick)(),s+=e)}},r.utf8ToBytes=o,r.toBytes=a,r.concatBytes=function(...e){const t=new Uint8Array(e.reduce(((e,t)=>e+t.length),0));let r=0;return e.forEach((e=>{if(!s(e))throw new Error("Uint8Array expected");t.set(e,r),r+=e.length})),t};r.Hash=class{clone(){return this._cloneInto()}};r.checkOpts=function(e,t){if(t!==undefined&&("object"!=typeof t||(r=t,"[object Object]"!==Object.prototype.toString.call(r)||r.constructor!==Object)))throw new Error("Options should be object or undefined");var r;return Object.assign(e,t)},r.wrapConstructor=function(e){const t=t=>e().update(a(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},r.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(a(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},r.wrapXOFConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(a(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},r.randomBytes=function(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}}}},{package:"@metamask/utils>@noble/hashes",file:"../../node_modules/@noble/hashes/utils.js"}],[95,{"../../is-buffer/index.js":113},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(e){(function(){function t(e){return Object.prototype.toString.call(e)}r.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===t(e)},r.isBoolean=function(e){return"boolean"==typeof e},r.isNull=function(e){return null===e},r.isNullOrUndefined=function(e){return null==e},r.isNumber=function(e){return"number"==typeof e},r.isString=function(e){return"string"==typeof e},r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=function(e){return void 0===e},r.isRegExp=function(e){return"[object RegExp]"===t(e)},r.isObject=function(e){return"object"==typeof e&&null!==e},r.isDate=function(e){return"[object Date]"===t(e)},r.isError=function(e){return"[object Error]"===t(e)||e instanceof Error},r.isFunction=function(e){return"function"==typeof e},r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e.isBuffer}).call(this)}).call(this,{isBuffer:e("../../is-buffer/index.js")})}}},{package:"browserify>readable-stream>core-util-is",file:"../../node_modules/core-util-is/lib/util.js"}],[96,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=1e3,s=60*n,i=60*s,o=24*i,a=7*o,c=365.25*o;function u(e,t,r,n){var s=t>=1.5*r;return Math.round(e/r)+" "+n+(s?"s":"")}t.exports=function(e,t){t=t||{};var r=typeof e;if("string"===r&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*c;case"weeks":case"week":case"w":return r*a;case"days":case"day":case"d":return r*o;case"hours":case"hour":case"hrs":case"hr":case"h":return r*i;case"minutes":case"minute":case"mins":case"min":case"m":return r*s;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return undefined}}(e);if("number"===r&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=o)return u(e,t,o,"day");if(t>=i)return u(e,t,i,"hour");if(t>=s)return u(e,t,s,"minute");if(t>=n)return u(e,t,n,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=o)return Math.round(e/o)+"d";if(t>=i)return Math.round(e/i)+"h";if(t>=s)return Math.round(e/s)+"m";if(t>=n)return Math.round(e/n)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}}},{package:"eslint>debug>ms",file:"../../node_modules/debug/node_modules/ms/index.js"}],[97,{"./common":98},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){r.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;e.splice(1,0,r,"color: inherit");let n=0,s=0;e[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(s=n))})),e.splice(s,0,r)},r.save=function(e){try{e?r.storage.setItem("debug",e):r.storage.removeItem("debug")}catch(e){}},r.load=function(){let e;try{e=r.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},r.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},r.storage=function(){try{return localStorage}catch(e){}}(),r.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),r.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],r.log=console.debug||console.log||(()=>{}),t.exports=e("./common")(r);const{formatters:n}=t.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}}},{package:"eslint>debug",file:"../../node_modules/debug/src/browser.js"}],[98,{ms:96},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=function(t){function r(e){let t,s,i,o=null;function a(...e){if(!a.enabled)return;const n=a,s=Number(new Date),i=s-(t||s);n.diff=i,n.prev=t,n.curr=s,t=s,e[0]=r.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((t,s)=>{if("%%"===t)return"%";o++;const i=r.formatters[s];if("function"==typeof i){const r=e[o];t=i.call(n,r),e.splice(o,1),o--}return t})),r.formatArgs.call(n,e);(n.log||r.log).apply(n,e)}return a.namespace=e,a.useColors=r.useColors(),a.color=r.selectColor(e),a.extend=n,a.destroy=r.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(s!==r.namespaces&&(s=r.namespaces,i=r.enabled(e)),i),set:e=>{o=e}}),"function"==typeof r.init&&r.init(a),a}function n(e,t){const n=r(this.namespace+(void 0===t?":":t)+e);return n.log=this.log,n}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return r.debug=r,r.default=r,r.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},r.disable=function(){const e=[...r.names.map(s),...r.skips.map(s).map((e=>"-"+e))].join(",");return r.enable(""),e},r.enable=function(e){let t;r.save(e),r.namespaces=e,r.names=[],r.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),s=n.length;for(t=0;t<s;t++)n[t]&&("-"===(e=n[t].replace(/\*/g,".*?"))[0]?r.skips.push(new RegExp("^"+e.slice(1)+"$")):r.names.push(new RegExp("^"+e+"$")))},r.enabled=function(e){if("*"===e[e.length-1])return!0;let t,n;for(t=0,n=r.skips.length;t<n;t++)if(r.skips[t].test(e))return!1;for(t=0,n=r.names.length;t<n;t++)if(r.names[t].test(e))return!0;return!1},r.humanize=e("ms"),r.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((e=>{r[e]=t[e]})),r.names=[],r.skips=[],r.formatters={},r.selectColor=function(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return r.colors[Math.abs(t)%r.colors.length]},r.enable(r.load()),r}}}},{package:"eslint>debug",file:"../../node_modules/debug/src/common.js"}],[99,{"./browser.js":97,"./node.js":100},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?t.exports=e("./browser.js"):t.exports=e("./node.js")}}},{package:"eslint>debug",file:"../../node_modules/debug/src/index.js"}],[100,{"./common":98,"supports-color":186,tty:"tty",util:"util"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("tty"),s=e("util");r.init=function(e){e.inspectOpts={};const t=Object.keys(r.inspectOpts);for(let n=0;n<t.length;n++)e.inspectOpts[t[n]]=r.inspectOpts[t[n]]},r.log=function(...e){return process.stderr.write(s.format(...e)+"\n")},r.formatArgs=function(e){const{namespace:n,useColors:s}=this;if(s){const r=this.color,s="[3"+(r<8?r:"8;5;"+r),i=` ${s};1m${n} [0m`;e[0]=i+e[0].split("\n").join("\n"+i),e.push(s+"m+"+t.exports.humanize(this.diff)+"[0m")}else e[0]=function(){if(r.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+n+" "+e[0]},r.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},r.load=function(){return process.env.DEBUG},r.useColors=function(){return"colors"in r.inspectOpts?Boolean(r.inspectOpts.colors):n.isatty(process.stderr.fd)},r.destroy=s.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),r.colors=[6,2,3,4,5,1];try{const t=e("supports-color");t&&(t.stderr||t).level>=2&&(r.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}r.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const r=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let n=process.env[t];return n=!!/^(yes|on|true|enabled)$/i.test(n)||!/^(no|off|false|disabled)$/i.test(n)&&("null"===n?null:Number(n)),e[r]=n,e}),{}),t.exports=e("./common")(r);const{formatters:i}=t.exports;i.o=function(e){return this.inspectOpts.colors=this.useColors,s.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},i.O=function(e){return this.inspectOpts.colors=this.useColors,s.inspect(e,this.inspectOpts)}}}},{package:"eslint>debug",file:"../../node_modules/debug/src/node.js"}],[101,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,s=0,i=t.length;s<i;s++)!n&&s in t||(n||(n=Array.prototype.slice.call(t,0,s)),n[s]=t[s]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(r,"__esModule",{value:!0}),r.getNodeVersion=r.detectOS=r.parseUserAgent=r.browserName=r.detect=r.ReactNativeInfo=r.BotInfo=r.SearchBotDeviceInfo=r.NodeInfo=r.BrowserInfo=void 0;var s=function(e,t,r){this.name=e,this.version=t,this.os=r,this.type="browser"};r.BrowserInfo=s;var i=function(e){this.version=e,this.type="node",this.name="node",this.os=process.platform};r.NodeInfo=i;var o=function(e,t,r,n){this.name=e,this.version=t,this.os=r,this.bot=n,this.type="bot-device"};r.SearchBotDeviceInfo=o;var a=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null};r.BotInfo=a;var c=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null};r.ReactNativeInfo=c;var u=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,l=3,d=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],h=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function f(e){return""!==e&&d.reduce((function(t,r){var n=r[0],s=r[1];if(t)return t;var i=s.exec(e);return!!i&&[n,i]}),!1)}function p(e){var t=f(e);if(!t)return null;var r=t[0],i=t[1];if("searchbot"===r)return new a;var c=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);c?c.length<l&&(c=n(n([],c,!0),function(e){for(var t=[],r=0;r<e;r++)t.push("0");return t}(l-c.length),!0)):c=[];var d=c.join("."),h=m(e),p=u.exec(e);return p&&p[1]?new o(r,d,h,p[1]):new s(r,d,h)}function m(e){for(var t=0,r=h.length;t<r;t++){var n=h[t],s=n[0];if(n[1].exec(e))return s}return null}function g(){return"undefined"!=typeof process&&process.version?new i(process.version.slice(1)):null}r.detect=function(e){return e?p(e):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new c:"undefined"!=typeof navigator?p(navigator.userAgent):g()},r.browserName=function(e){var t=f(e);return t?t[0]:null},r.parseUserAgent=p,r.detectOS=m,r.getNodeVersion=g}}},{package:"@metamask/providers>detect-browser",file:"../../node_modules/detect-browser/index.js"}],[102,{once:138},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("once"),s=function(){},i=function(e,t,r){if("function"==typeof t)return i(e,null,t);t||(t={}),r=n(r||s);var o=e._writableState,a=e._readableState,c=t.readable||!1!==t.readable&&e.readable,u=t.writable||!1!==t.writable&&e.writable,l=!1,d=function(){e.writable||h()},h=function(){u=!1,c||r.call(e)},f=function(){c=!1,u||r.call(e)},p=function(t){r.call(e,t?new Error("exited with error code: "+t):null)},m=function(t){r.call(e,t)},g=function(){process.nextTick(b)},b=function(){if(!l)return(!c||a&&a.ended&&!a.destroyed)&&(!u||o&&o.ended&&!o.destroyed)?void 0:r.call(e,new Error("premature close"))},w=function(){e.req.on("finish",h)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?u&&!o&&(e.on("end",d),e.on("close",d)):(e.on("complete",h),e.on("abort",g),e.req?w():e.on("request",w)),function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length}(e)&&e.on("exit",p),e.on("end",f),e.on("finish",h),!1!==t.error&&e.on("error",m),e.on("close",g),function(){l=!0,e.removeListener("complete",h),e.removeListener("abort",g),e.removeListener("request",w),e.req&&e.req.removeListener("finish",h),e.removeListener("end",d),e.removeListener("close",d),e.removeListener("finish",h),e.removeListener("exit",p),e.removeListener("end",f),e.removeListener("error",m),e.removeListener("close",g)}};t.exports=i}}},{package:"pump>end-of-stream",file:"../../node_modules/end-of-stream/index.js"}],[103,{"fast-safe-stringify":109},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.EthereumProviderError=r.EthereumRpcError=void 0;const n=e("fast-safe-stringify");class s extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,r!==undefined&&(this.data=r)}serialize(){const e={code:this.code,message:this.message};return this.data!==undefined&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return n.default(this.serialize(),i,2)}}r.EthereumRpcError=s;function i(e,t){return"[Circular]"===t?undefined:t}r.EthereumProviderError=class extends s{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}}}},{package:"eth-rpc-errors",file:"../../node_modules/eth-rpc-errors/dist/classes.js"}],[104,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.errorValues=r.errorCodes=void 0,r.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},r.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}}}},{package:"eth-rpc-errors",file:"../../node_modules/eth-rpc-errors/dist/error-constants.js"}],[105,{"./classes":103,"./error-constants":104,"./utils":107},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ethErrors=void 0;const n=e("./classes"),s=e("./utils"),i=e("./error-constants");function o(e,t){const[r,i]=c(t);return new n.EthereumRpcError(e,r||s.getMessageFromCode(e),i)}function a(e,t){const[r,i]=c(t);return new n.EthereumProviderError(e,r||s.getMessageFromCode(e),i)}function c(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t||undefined,r]}}return[]}r.ethErrors={rpc:{parse:e=>o(i.errorCodes.rpc.parse,e),invalidRequest:e=>o(i.errorCodes.rpc.invalidRequest,e),invalidParams:e=>o(i.errorCodes.rpc.invalidParams,e),methodNotFound:e=>o(i.errorCodes.rpc.methodNotFound,e),internal:e=>o(i.errorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return o(t,e)},invalidInput:e=>o(i.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>o(i.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>o(i.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>o(i.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>o(i.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>o(i.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>a(i.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>a(i.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>a(i.errorCodes.provider.unsupportedMethod,e),disconnected:e=>a(i.errorCodes.provider.disconnected,e),chainDisconnected:e=>a(i.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:s}=e;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new n.EthereumProviderError(t,r,s)}}}}}},{package:"eth-rpc-errors",file:"../../node_modules/eth-rpc-errors/dist/errors.js"}],[106,{"./classes":103,"./error-constants":104,"./errors":105,"./utils":107},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getMessageFromCode=r.serializeError=r.EthereumProviderError=r.EthereumRpcError=r.ethErrors=r.errorCodes=void 0;const n=e("./classes");Object.defineProperty(r,"EthereumRpcError",{enumerable:!0,get:function(){return n.EthereumRpcError}}),Object.defineProperty(r,"EthereumProviderError",{enumerable:!0,get:function(){return n.EthereumProviderError}});const s=e("./utils");Object.defineProperty(r,"serializeError",{enumerable:!0,get:function(){return s.serializeError}}),Object.defineProperty(r,"getMessageFromCode",{enumerable:!0,get:function(){return s.getMessageFromCode}});const i=e("./errors");Object.defineProperty(r,"ethErrors",{enumerable:!0,get:function(){return i.ethErrors}});const o=e("./error-constants");Object.defineProperty(r,"errorCodes",{enumerable:!0,get:function(){return o.errorCodes}})}}},{package:"eth-rpc-errors",file:"../../node_modules/eth-rpc-errors/dist/index.js"}],[107,{"./classes":103,"./error-constants":104},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.serializeError=r.isValidCode=r.getMessageFromCode=r.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const n=e("./error-constants"),s=e("./classes"),i=n.errorCodes.rpc.internal,o="Unspecified error message. This is a bug, please report it.",a={code:i,message:c(i)};function c(e,t=o){if(Number.isInteger(e)){const t=e.toString();if(h(n.errorValues,t))return n.errorValues[t].message;if(l(e))return r.JSON_RPC_SERVER_ERROR_MESSAGE}return t}function u(e){if(!Number.isInteger(e))return!1;const t=e.toString();return!!n.errorValues[t]||!!l(e)}function l(e){return e>=-32099&&e<=-32e3}function d(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function h(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",r.getMessageFromCode=c,r.isValidCode=u,r.serializeError=function(e,{fallbackError:t=a,shouldIncludeStack:r=!1}={}){var n,i;if(!t||!Number.isInteger(t.code)||"string"!=typeof t.message)throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof s.EthereumRpcError)return e.serialize();const o={};if(e&&"object"==typeof e&&!Array.isArray(e)&&h(e,"code")&&u(e.code)){const t=e;o.code=t.code,t.message&&"string"==typeof t.message?(o.message=t.message,h(t,"data")&&(o.data=t.data)):(o.message=c(o.code),o.data={originalError:d(e)})}else{o.code=t.code;const r=null===(n=e)||void 0===n?void 0:n.message;o.message=r&&"string"==typeof r?r:t.message,o.data={originalError:d(e)}}const l=null===(i=e)||void 0===i?void 0:i.stack;return r&&e&&l&&"string"==typeof l&&(o.stack=l),o}}}},{package:"eth-rpc-errors",file:"../../node_modules/eth-rpc-errors/dist/utils.js"}],[108,{buffer:"buffer",stream:"stream"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(r){(function(){const n=e("stream");t.exports=class extends n.Duplex{constructor(e){super({objectMode:!0}),this._port=e,this._port.onMessage.addListener((e=>this._onMessage(e))),this._port.onDisconnect.addListener((()=>this._onDisconnect()))}_onMessage(e){if(r.isBuffer(e)){const t=r.from(e);this.push(t)}else this.push(e)}_onDisconnect(){this.destroy()}_read(){return undefined}_write(e,t,n){try{if(r.isBuffer(e)){const t=e.toJSON();t._isBuffer=!0,this._port.postMessage(t)}else this._port.postMessage(e)}catch(e){return n(new Error("PortDuplexStream - disconnected"))}return n()}}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/providers>extension-port-stream",file:"../../node_modules/extension-port-stream/dist/index.js"}],[109,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=c,c.default=c,c.stable=h,c.stableStringify=h;var n="[...]",s="[Circular]",i=[],o=[];function a(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function c(e,t,r,n){var s;void 0===n&&(n=a()),l(e,"",0,[],undefined,0,n);try{s=0===o.length?JSON.stringify(e,t,r):JSON.stringify(e,p(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==i.length;){var c=i.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return s}function u(e,t,r,n){var s=Object.getOwnPropertyDescriptor(n,r);s.get!==undefined?s.configurable?(Object.defineProperty(n,r,{value:e}),i.push([n,r,t,s])):o.push([t,r,e]):(n[r]=e,i.push([n,r,t]))}function l(e,t,r,i,o,a,c){var d;if(a+=1,"object"==typeof e&&null!==e){for(d=0;d<i.length;d++)if(i[d]===e)return void u(s,e,t,o);if(void 0!==c.depthLimit&&a>c.depthLimit)return void u(n,e,t,o);if(void 0!==c.edgesLimit&&r+1>c.edgesLimit)return void u(n,e,t,o);if(i.push(e),Array.isArray(e))for(d=0;d<e.length;d++)l(e[d],d,d,i,e,a,c);else{var h=Object.keys(e);for(d=0;d<h.length;d++){var f=h[d];l(e[f],f,d,i,e,a,c)}}i.pop()}}function d(e,t){return e<t?-1:e>t?1:0}function h(e,t,r,n){void 0===n&&(n=a());var s,c=f(e,"",0,[],undefined,0,n)||e;try{s=0===o.length?JSON.stringify(c,t,r):JSON.stringify(c,p(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==i.length;){var u=i.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return s}function f(e,t,r,o,a,c,l){var h;if(c+=1,"object"==typeof e&&null!==e){for(h=0;h<o.length;h++)if(o[h]===e)return void u(s,e,t,a);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==l.depthLimit&&c>l.depthLimit)return void u(n,e,t,a);if(void 0!==l.edgesLimit&&r+1>l.edgesLimit)return void u(n,e,t,a);if(o.push(e),Array.isArray(e))for(h=0;h<e.length;h++)f(e[h],h,h,o,e,c,l);else{var p={},m=Object.keys(e).sort(d);for(h=0;h<m.length;h++){var g=m[h];f(e[g],g,h,o,e,c,l),p[g]=e[g]}if(void 0===a)return p;i.push([a,t,e]),a[t]=p}o.pop()}}function p(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(o.length>0)for(var n=0;n<o.length;n++){var s=o[n];if(s[1]===t&&s[0]===r){r=s[2],o.splice(n,1);break}}return e.call(this,t,r)}}}}},{package:"eth-rpc-errors>fast-safe-stringify",file:"../../node_modules/fast-safe-stringify/index.js"}],[110,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=(e,t=process.argv)=>{const r=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(r+e),s=t.indexOf("--");return-1!==n&&(-1===s||n<s)}}}},{package:"istanbul-lib-report>supports-color>has-flag",file:"../../node_modules/has-flag/index.js"}],[111,{"./inherits_browser.js":112,util:"util"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){try{var n=e("util");if("function"!=typeof n.inherits)throw"";t.exports=n.inherits}catch(r){t.exports=e("./inherits_browser.js")}}}},{package:"browserify>inherits",file:"../../node_modules/inherits/inherits.js"}],[112,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}}}},{package:"browserify>inherits",file:"../../node_modules/inherits/inherits_browser.js"}],[113,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}
|
|
12144
|
+
Object.defineProperty(r,"__esModule",{value:!0}),r.randomBytes=r.wrapXOFConstructorWithOpts=r.wrapConstructorWithOpts=r.wrapConstructor=r.checkOpts=r.Hash=r.concatBytes=r.toBytes=r.utf8ToBytes=r.asyncLoop=r.nextTick=r.hexToBytes=r.bytesToHex=r.isLE=r.rotr=r.createView=r.u32=r.u8=void 0;const n=e("@noble/hashes/crypto"),s=e=>e instanceof Uint8Array;r.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);r.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));r.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);if(r.rotr=(e,t)=>e<<32-t|e>>>t,r.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!r.isLE)throw new Error("Non little-endian hardware is not supported");const i=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));r.bytesToHex=function(e){if(!s(e))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=i[e[r]];return t},r.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(t/2);for(let t=0;t<r.length;t++){const n=2*t,s=e.slice(n,n+2),i=Number.parseInt(s,16);if(Number.isNaN(i)||i<0)throw new Error("Invalid byte sequence");r[t]=i}return r};function o(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function a(e){if("string"==typeof e&&(e=o(e)),!s(e))throw new Error("expected Uint8Array, got "+typeof e);return e}r.nextTick=async()=>{},r.asyncLoop=async function(e,t,n){let s=Date.now();for(let i=0;i<e;i++){n(i);const e=Date.now()-s;e>=0&&e<t||(await(0,r.nextTick)(),s+=e)}},r.utf8ToBytes=o,r.toBytes=a,r.concatBytes=function(...e){const t=new Uint8Array(e.reduce(((e,t)=>e+t.length),0));let r=0;return e.forEach((e=>{if(!s(e))throw new Error("Uint8Array expected");t.set(e,r),r+=e.length})),t};r.Hash=class{clone(){return this._cloneInto()}};r.checkOpts=function(e,t){if(t!==undefined&&("object"!=typeof t||(r=t,"[object Object]"!==Object.prototype.toString.call(r)||r.constructor!==Object)))throw new Error("Options should be object or undefined");var r;return Object.assign(e,t)},r.wrapConstructor=function(e){const t=t=>e().update(a(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},r.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(a(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},r.wrapXOFConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(a(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},r.randomBytes=function(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}}}},{package:"@metamask/utils>@noble/hashes",file:"../../node_modules/@noble/hashes/utils.js"}],[94,{"../../is-buffer/index.js":113},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(e){(function(){function t(e){return Object.prototype.toString.call(e)}r.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===t(e)},r.isBoolean=function(e){return"boolean"==typeof e},r.isNull=function(e){return null===e},r.isNullOrUndefined=function(e){return null==e},r.isNumber=function(e){return"number"==typeof e},r.isString=function(e){return"string"==typeof e},r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=function(e){return void 0===e},r.isRegExp=function(e){return"[object RegExp]"===t(e)},r.isObject=function(e){return"object"==typeof e&&null!==e},r.isDate=function(e){return"[object Date]"===t(e)},r.isError=function(e){return"[object Error]"===t(e)||e instanceof Error},r.isFunction=function(e){return"function"==typeof e},r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e.isBuffer}).call(this)}).call(this,{isBuffer:e("../../is-buffer/index.js")})}}},{package:"browserify>readable-stream>core-util-is",file:"../../node_modules/core-util-is/lib/util.js"}],[95,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=1e3,s=60*n,i=60*s,o=24*i,a=7*o,c=365.25*o;function u(e,t,r,n){var s=t>=1.5*r;return Math.round(e/r)+" "+n+(s?"s":"")}t.exports=function(e,t){t=t||{};var r=typeof e;if("string"===r&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*c;case"weeks":case"week":case"w":return r*a;case"days":case"day":case"d":return r*o;case"hours":case"hour":case"hrs":case"hr":case"h":return r*i;case"minutes":case"minute":case"mins":case"min":case"m":return r*s;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return undefined}}(e);if("number"===r&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=o)return u(e,t,o,"day");if(t>=i)return u(e,t,i,"hour");if(t>=s)return u(e,t,s,"minute");if(t>=n)return u(e,t,n,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=o)return Math.round(e/o)+"d";if(t>=i)return Math.round(e/i)+"h";if(t>=s)return Math.round(e/s)+"m";if(t>=n)return Math.round(e/n)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}}},{package:"eslint>debug>ms",file:"../../node_modules/debug/node_modules/ms/index.js"}],[96,{"./common":97},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){r.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;e.splice(1,0,r,"color: inherit");let n=0,s=0;e[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(s=n))})),e.splice(s,0,r)},r.save=function(e){try{e?r.storage.setItem("debug",e):r.storage.removeItem("debug")}catch(e){}},r.load=function(){let e;try{e=r.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},r.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},r.storage=function(){try{return localStorage}catch(e){}}(),r.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),r.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],r.log=console.debug||console.log||(()=>{}),t.exports=e("./common")(r);const{formatters:n}=t.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}}},{package:"eslint>debug",file:"../../node_modules/debug/src/browser.js"}],[97,{ms:95},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=function(t){function r(e){let t,s,i,o=null;function a(...e){if(!a.enabled)return;const n=a,s=Number(new Date),i=s-(t||s);n.diff=i,n.prev=t,n.curr=s,t=s,e[0]=r.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((t,s)=>{if("%%"===t)return"%";o++;const i=r.formatters[s];if("function"==typeof i){const r=e[o];t=i.call(n,r),e.splice(o,1),o--}return t})),r.formatArgs.call(n,e);(n.log||r.log).apply(n,e)}return a.namespace=e,a.useColors=r.useColors(),a.color=r.selectColor(e),a.extend=n,a.destroy=r.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(s!==r.namespaces&&(s=r.namespaces,i=r.enabled(e)),i),set:e=>{o=e}}),"function"==typeof r.init&&r.init(a),a}function n(e,t){const n=r(this.namespace+(void 0===t?":":t)+e);return n.log=this.log,n}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return r.debug=r,r.default=r,r.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},r.disable=function(){const e=[...r.names.map(s),...r.skips.map(s).map((e=>"-"+e))].join(",");return r.enable(""),e},r.enable=function(e){let t;r.save(e),r.namespaces=e,r.names=[],r.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),s=n.length;for(t=0;t<s;t++)n[t]&&("-"===(e=n[t].replace(/\*/g,".*?"))[0]?r.skips.push(new RegExp("^"+e.slice(1)+"$")):r.names.push(new RegExp("^"+e+"$")))},r.enabled=function(e){if("*"===e[e.length-1])return!0;let t,n;for(t=0,n=r.skips.length;t<n;t++)if(r.skips[t].test(e))return!1;for(t=0,n=r.names.length;t<n;t++)if(r.names[t].test(e))return!0;return!1},r.humanize=e("ms"),r.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((e=>{r[e]=t[e]})),r.names=[],r.skips=[],r.formatters={},r.selectColor=function(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return r.colors[Math.abs(t)%r.colors.length]},r.enable(r.load()),r}}}},{package:"eslint>debug",file:"../../node_modules/debug/src/common.js"}],[98,{"./browser.js":96,"./node.js":99},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?t.exports=e("./browser.js"):t.exports=e("./node.js")}}},{package:"eslint>debug",file:"../../node_modules/debug/src/index.js"}],[99,{"./common":97,"supports-color":187,tty:"tty",util:"util"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("tty"),s=e("util");r.init=function(e){e.inspectOpts={};const t=Object.keys(r.inspectOpts);for(let n=0;n<t.length;n++)e.inspectOpts[t[n]]=r.inspectOpts[t[n]]},r.log=function(...e){return process.stderr.write(s.format(...e)+"\n")},r.formatArgs=function(e){const{namespace:n,useColors:s}=this;if(s){const r=this.color,s="[3"+(r<8?r:"8;5;"+r),i=` ${s};1m${n} [0m`;e[0]=i+e[0].split("\n").join("\n"+i),e.push(s+"m+"+t.exports.humanize(this.diff)+"[0m")}else e[0]=function(){if(r.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+n+" "+e[0]},r.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},r.load=function(){return process.env.DEBUG},r.useColors=function(){return"colors"in r.inspectOpts?Boolean(r.inspectOpts.colors):n.isatty(process.stderr.fd)},r.destroy=s.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),r.colors=[6,2,3,4,5,1];try{const t=e("supports-color");t&&(t.stderr||t).level>=2&&(r.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}r.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const r=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let n=process.env[t];return n=!!/^(yes|on|true|enabled)$/i.test(n)||!/^(no|off|false|disabled)$/i.test(n)&&("null"===n?null:Number(n)),e[r]=n,e}),{}),t.exports=e("./common")(r);const{formatters:i}=t.exports;i.o=function(e){return this.inspectOpts.colors=this.useColors,s.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},i.O=function(e){return this.inspectOpts.colors=this.useColors,s.inspect(e,this.inspectOpts)}}}},{package:"eslint>debug",file:"../../node_modules/debug/src/node.js"}],[100,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,s=0,i=t.length;s<i;s++)!n&&s in t||(n||(n=Array.prototype.slice.call(t,0,s)),n[s]=t[s]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(r,"__esModule",{value:!0}),r.getNodeVersion=r.detectOS=r.parseUserAgent=r.browserName=r.detect=r.ReactNativeInfo=r.BotInfo=r.SearchBotDeviceInfo=r.NodeInfo=r.BrowserInfo=void 0;var s=function(e,t,r){this.name=e,this.version=t,this.os=r,this.type="browser"};r.BrowserInfo=s;var i=function(e){this.version=e,this.type="node",this.name="node",this.os=process.platform};r.NodeInfo=i;var o=function(e,t,r,n){this.name=e,this.version=t,this.os=r,this.bot=n,this.type="bot-device"};r.SearchBotDeviceInfo=o;var a=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null};r.BotInfo=a;var c=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null};r.ReactNativeInfo=c;var u=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,l=3,d=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],h=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function f(e){return""!==e&&d.reduce((function(t,r){var n=r[0],s=r[1];if(t)return t;var i=s.exec(e);return!!i&&[n,i]}),!1)}function p(e){var t=f(e);if(!t)return null;var r=t[0],i=t[1];if("searchbot"===r)return new a;var c=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);c?c.length<l&&(c=n(n([],c,!0),function(e){for(var t=[],r=0;r<e;r++)t.push("0");return t}(l-c.length),!0)):c=[];var d=c.join("."),h=m(e),p=u.exec(e);return p&&p[1]?new o(r,d,h,p[1]):new s(r,d,h)}function m(e){for(var t=0,r=h.length;t<r;t++){var n=h[t],s=n[0];if(n[1].exec(e))return s}return null}function g(){return"undefined"!=typeof process&&process.version?new i(process.version.slice(1)):null}r.detect=function(e){return e?p(e):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new c:"undefined"!=typeof navigator?p(navigator.userAgent):g()},r.browserName=function(e){var t=f(e);return t?t[0]:null},r.parseUserAgent=p,r.detectOS=m,r.getNodeVersion=g}}},{package:"@metamask/providers>detect-browser",file:"../../node_modules/detect-browser/index.js"}],[101,{once:139},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("once"),s=function(){},i=function(e,t,r){if("function"==typeof t)return i(e,null,t);t||(t={}),r=n(r||s);var o=e._writableState,a=e._readableState,c=t.readable||!1!==t.readable&&e.readable,u=t.writable||!1!==t.writable&&e.writable,l=!1,d=function(){e.writable||h()},h=function(){u=!1,c||r.call(e)},f=function(){c=!1,u||r.call(e)},p=function(t){r.call(e,t?new Error("exited with error code: "+t):null)},m=function(t){r.call(e,t)},g=function(){process.nextTick(b)},b=function(){if(!l)return(!c||a&&a.ended&&!a.destroyed)&&(!u||o&&o.ended&&!o.destroyed)?void 0:r.call(e,new Error("premature close"))},w=function(){e.req.on("finish",h)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?u&&!o&&(e.on("end",d),e.on("close",d)):(e.on("complete",h),e.on("abort",g),e.req?w():e.on("request",w)),function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length}(e)&&e.on("exit",p),e.on("end",f),e.on("finish",h),!1!==t.error&&e.on("error",m),e.on("close",g),function(){l=!0,e.removeListener("complete",h),e.removeListener("abort",g),e.removeListener("request",w),e.req&&e.req.removeListener("finish",h),e.removeListener("end",d),e.removeListener("close",d),e.removeListener("finish",h),e.removeListener("exit",p),e.removeListener("end",f),e.removeListener("error",m),e.removeListener("close",g)}};t.exports=i}}},{package:"pump>end-of-stream",file:"../../node_modules/end-of-stream/index.js"}],[102,{"fast-safe-stringify":109},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.EthereumProviderError=r.EthereumRpcError=void 0;const n=e("fast-safe-stringify");class s extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,r!==undefined&&(this.data=r)}serialize(){const e={code:this.code,message:this.message};return this.data!==undefined&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return n.default(this.serialize(),i,2)}}r.EthereumRpcError=s;function i(e,t){return"[Circular]"===t?undefined:t}r.EthereumProviderError=class extends s{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}}}},{package:"eth-rpc-errors",file:"../../node_modules/eth-rpc-errors/dist/classes.js"}],[103,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.errorValues=r.errorCodes=void 0,r.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},r.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}}}},{package:"eth-rpc-errors",file:"../../node_modules/eth-rpc-errors/dist/error-constants.js"}],[104,{"./classes":102,"./error-constants":103,"./utils":106},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ethErrors=void 0;const n=e("./classes"),s=e("./utils"),i=e("./error-constants");function o(e,t){const[r,i]=c(t);return new n.EthereumRpcError(e,r||s.getMessageFromCode(e),i)}function a(e,t){const[r,i]=c(t);return new n.EthereumProviderError(e,r||s.getMessageFromCode(e),i)}function c(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t||undefined,r]}}return[]}r.ethErrors={rpc:{parse:e=>o(i.errorCodes.rpc.parse,e),invalidRequest:e=>o(i.errorCodes.rpc.invalidRequest,e),invalidParams:e=>o(i.errorCodes.rpc.invalidParams,e),methodNotFound:e=>o(i.errorCodes.rpc.methodNotFound,e),internal:e=>o(i.errorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return o(t,e)},invalidInput:e=>o(i.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>o(i.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>o(i.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>o(i.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>o(i.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>o(i.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>a(i.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>a(i.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>a(i.errorCodes.provider.unsupportedMethod,e),disconnected:e=>a(i.errorCodes.provider.disconnected,e),chainDisconnected:e=>a(i.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:s}=e;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new n.EthereumProviderError(t,r,s)}}}}}},{package:"eth-rpc-errors",file:"../../node_modules/eth-rpc-errors/dist/errors.js"}],[105,{"./classes":102,"./error-constants":103,"./errors":104,"./utils":106},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getMessageFromCode=r.serializeError=r.EthereumProviderError=r.EthereumRpcError=r.ethErrors=r.errorCodes=void 0;const n=e("./classes");Object.defineProperty(r,"EthereumRpcError",{enumerable:!0,get:function(){return n.EthereumRpcError}}),Object.defineProperty(r,"EthereumProviderError",{enumerable:!0,get:function(){return n.EthereumProviderError}});const s=e("./utils");Object.defineProperty(r,"serializeError",{enumerable:!0,get:function(){return s.serializeError}}),Object.defineProperty(r,"getMessageFromCode",{enumerable:!0,get:function(){return s.getMessageFromCode}});const i=e("./errors");Object.defineProperty(r,"ethErrors",{enumerable:!0,get:function(){return i.ethErrors}});const o=e("./error-constants");Object.defineProperty(r,"errorCodes",{enumerable:!0,get:function(){return o.errorCodes}})}}},{package:"eth-rpc-errors",file:"../../node_modules/eth-rpc-errors/dist/index.js"}],[106,{"./classes":102,"./error-constants":103},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.serializeError=r.isValidCode=r.getMessageFromCode=r.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const n=e("./error-constants"),s=e("./classes"),i=n.errorCodes.rpc.internal,o="Unspecified error message. This is a bug, please report it.",a={code:i,message:c(i)};function c(e,t=o){if(Number.isInteger(e)){const t=e.toString();if(h(n.errorValues,t))return n.errorValues[t].message;if(l(e))return r.JSON_RPC_SERVER_ERROR_MESSAGE}return t}function u(e){if(!Number.isInteger(e))return!1;const t=e.toString();return!!n.errorValues[t]||!!l(e)}function l(e){return e>=-32099&&e<=-32e3}function d(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function h(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",r.getMessageFromCode=c,r.isValidCode=u,r.serializeError=function(e,{fallbackError:t=a,shouldIncludeStack:r=!1}={}){var n,i;if(!t||!Number.isInteger(t.code)||"string"!=typeof t.message)throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof s.EthereumRpcError)return e.serialize();const o={};if(e&&"object"==typeof e&&!Array.isArray(e)&&h(e,"code")&&u(e.code)){const t=e;o.code=t.code,t.message&&"string"==typeof t.message?(o.message=t.message,h(t,"data")&&(o.data=t.data)):(o.message=c(o.code),o.data={originalError:d(e)})}else{o.code=t.code;const r=null===(n=e)||void 0===n?void 0:n.message;o.message=r&&"string"==typeof r?r:t.message,o.data={originalError:d(e)}}const l=null===(i=e)||void 0===i?void 0:i.stack;return r&&e&&l&&"string"==typeof l&&(o.stack=l),o}}}},{package:"eth-rpc-errors",file:"../../node_modules/eth-rpc-errors/dist/utils.js"}],[107,{buffer:"buffer",stream:"stream"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(r){(function(){const n=e("stream");t.exports=class extends n.Duplex{constructor(e){super({objectMode:!0}),this._port=e,this._port.onMessage.addListener((e=>this._onMessage(e))),this._port.onDisconnect.addListener((()=>this._onDisconnect()))}_onMessage(e){if(r.isBuffer(e)){const t=r.from(e);this.push(t)}else this.push(e)}_onDisconnect(){this.destroy()}_read(){return undefined}_write(e,t,n){try{if(r.isBuffer(e)){const t=e.toJSON();t._isBuffer=!0,this._port.postMessage(t)}else this._port.postMessage(e)}catch(e){return n(new Error("PortDuplexStream - disconnected"))}return n()}}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/providers>extension-port-stream",file:"../../node_modules/extension-port-stream/dist/index.js"}],[108,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,s,i;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(s=n;0!=s--;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(i=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(s=n;0!=s--;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=n;0!=s--;){var o=i[s];if(!e(t[o],r[o]))return!1}return!0}return t!=t&&r!=r}}}},{package:"eslint>fast-deep-equal",file:"../../node_modules/fast-deep-equal/index.js"}],[109,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=c,c.default=c,c.stable=h,c.stableStringify=h;var n="[...]",s="[Circular]",i=[],o=[];function a(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function c(e,t,r,n){var s;void 0===n&&(n=a()),l(e,"",0,[],undefined,0,n);try{s=0===o.length?JSON.stringify(e,t,r):JSON.stringify(e,p(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==i.length;){var c=i.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return s}function u(e,t,r,n){var s=Object.getOwnPropertyDescriptor(n,r);s.get!==undefined?s.configurable?(Object.defineProperty(n,r,{value:e}),i.push([n,r,t,s])):o.push([t,r,e]):(n[r]=e,i.push([n,r,t]))}function l(e,t,r,i,o,a,c){var d;if(a+=1,"object"==typeof e&&null!==e){for(d=0;d<i.length;d++)if(i[d]===e)return void u(s,e,t,o);if(void 0!==c.depthLimit&&a>c.depthLimit)return void u(n,e,t,o);if(void 0!==c.edgesLimit&&r+1>c.edgesLimit)return void u(n,e,t,o);if(i.push(e),Array.isArray(e))for(d=0;d<e.length;d++)l(e[d],d,d,i,e,a,c);else{var h=Object.keys(e);for(d=0;d<h.length;d++){var f=h[d];l(e[f],f,d,i,e,a,c)}}i.pop()}}function d(e,t){return e<t?-1:e>t?1:0}function h(e,t,r,n){void 0===n&&(n=a());var s,c=f(e,"",0,[],undefined,0,n)||e;try{s=0===o.length?JSON.stringify(c,t,r):JSON.stringify(c,p(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==i.length;){var u=i.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return s}function f(e,t,r,o,a,c,l){var h;if(c+=1,"object"==typeof e&&null!==e){for(h=0;h<o.length;h++)if(o[h]===e)return void u(s,e,t,a);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==l.depthLimit&&c>l.depthLimit)return void u(n,e,t,a);if(void 0!==l.edgesLimit&&r+1>l.edgesLimit)return void u(n,e,t,a);if(o.push(e),Array.isArray(e))for(h=0;h<e.length;h++)f(e[h],h,h,o,e,c,l);else{var p={},m=Object.keys(e).sort(d);for(h=0;h<m.length;h++){var g=m[h];f(e[g],g,h,o,e,c,l),p[g]=e[g]}if(void 0===a)return p;i.push([a,t,e]),a[t]=p}o.pop()}}function p(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(o.length>0)for(var n=0;n<o.length;n++){var s=o[n];if(s[1]===t&&s[0]===r){r=s[2],o.splice(n,1);break}}return e.call(this,t,r)}}}}},{package:"eth-rpc-errors>fast-safe-stringify",file:"../../node_modules/fast-safe-stringify/index.js"}],[110,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=(e,t=process.argv)=>{const r=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(r+e),s=t.indexOf("--");return-1!==n&&(-1===s||n<s)}}}},{package:"istanbul-lib-report>supports-color>has-flag",file:"../../node_modules/has-flag/index.js"}],[111,{"./inherits_browser.js":112,util:"util"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){try{var n=e("util");if("function"!=typeof n.inherits)throw"";t.exports=n.inherits}catch(r){t.exports=e("./inherits_browser.js")}}}},{package:"browserify>inherits",file:"../../node_modules/inherits/inherits.js"}],[112,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}}}},{package:"browserify>inherits",file:"../../node_modules/inherits/inherits_browser.js"}],[113,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}
|
|
12123
12145
|
/*!
|
|
12124
12146
|
* Determine if an object is a Buffer
|
|
12125
12147
|
*
|
|
12126
12148
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
12127
12149
|
* @license MIT
|
|
12128
12150
|
*/
|
|
12129
|
-
t.exports=function(e){return null!=e&&(n(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}(e)||!!e._isBuffer)}}}},{package:"browserify>insert-module-globals>is-buffer",file:"../../node_modules/is-buffer/index.js"}],[114,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;n.writable=e=>n(e)&&!1!==e.writable&&"function"==typeof e._write&&"object"==typeof e._writableState,n.readable=e=>n(e)&&!1!==e.readable&&"function"==typeof e._read&&"object"==typeof e._readableState,n.duplex=e=>n.writable(e)&&n.readable(e),n.transform=e=>n.duplex(e)&&"function"==typeof e._transform&&"object"==typeof e._transformState,t.exports=n}}},{package:"@metamask/providers>is-stream",file:"../../node_modules/is-stream/index.js"}],[115,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}}}},{package:"browserify>readable-stream>isarray",file:"../../node_modules/isarray/index.js"}],[116,{"@metamask/safe-event-emitter":71,"eth-rpc-errors":106},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.JsonRpcEngine=void 0;const s=n(e("@metamask/safe-event-emitter")),i=e("eth-rpc-errors");class o extends s.default{constructor(){super(),this._middleware=[]}push(e){this._middleware.push(e)}handle(e,t){if(t&&"function"!=typeof t)throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?t?this._handleBatch(e,t):this._handleBatch(e):t?this._handle(e,t):this._promiseHandle(e)}asMiddleware(){return async(e,t,r,n)=>{try{const[s,i,a]=await o._runAllMiddleware(e,t,this._middleware);return i?(await o._runReturnHandlers(a),n(s)):r((async e=>{try{await o._runReturnHandlers(a)}catch(t){return e(t)}return e()}))}catch(e){return n(e)}}}async _handleBatch(e,t){try{const r=await Promise.all(e.map(this._promiseHandle.bind(this)));return t?t(null,r):r}catch(e){if(t)return t(e);throw e}}_promiseHandle(e){return new Promise((t=>{this._handle(e,((e,r)=>{t(r)}))}))}async _handle(e,t){if(!e||Array.isArray(e)||"object"!=typeof e){const r=new i.EthereumRpcError(i.errorCodes.rpc.invalidRequest,"Requests must be plain objects. Received: "+typeof e,{request:e});return t(r,{id:undefined,jsonrpc:"2.0",error:r})}if("string"!=typeof e.method){const r=new i.EthereumRpcError(i.errorCodes.rpc.invalidRequest,"Must specify a string method. Received: "+typeof e.method,{request:e});return t(r,{id:e.id,jsonrpc:"2.0",error:r})}const r=Object.assign({},e),n={id:r.id,jsonrpc:r.jsonrpc};let s=null;try{await this._processRequest(r,n)}catch(e){s=e}return s&&(delete n.result,n.error||(n.error=i.serializeError(s))),t(s,n)}async _processRequest(e,t){const[r,n,s]=await o._runAllMiddleware(e,t,this._middleware);if(o._checkForCompletion(e,t,n),await o._runReturnHandlers(s),r)throw r}static async _runAllMiddleware(e,t,r){const n=[];let s=null,i=!1;for(const a of r)if([s,i]=await o._runMiddleware(e,t,a,n),i)break;return[s,i,n.reverse()]}static _runMiddleware(e,t,r,n){return new Promise((s=>{const o=e=>{const r=e||t.error;r&&(t.error=i.serializeError(r)),s([r,!0])},c=r=>{t.error?o(t.error):(r&&("function"!=typeof r&&o(new i.EthereumRpcError(i.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof r}" for request:\n${a(e)}`,{request:e})),n.push(r)),s([null,!1]))};try{r(e,t,c,o)}catch(e){o(e)}}))}static async _runReturnHandlers(e){for(const t of e)await new Promise(((e,r)=>{t((t=>t?r(t):e()))}))}static _checkForCompletion(e,t,r){if(!("result"in t)&&!("error"in t))throw new i.EthereumRpcError(i.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:\n${a(e)}`,{request:e});if(!r)throw new i.EthereumRpcError(i.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:\n${a(e)}`,{request:e})}}function a(e){return JSON.stringify(e,null,2)}r.JsonRpcEngine=o}}},{package:"json-rpc-engine",file:"../../node_modules/json-rpc-engine/dist/JsonRpcEngine.js"}],[117,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createAsyncMiddleware=void 0,r.createAsyncMiddleware=function(e){return async(t,r,n,s)=>{let i;const o=new Promise((e=>{i=e}));let a=null,c=!1;const u=async()=>{c=!0,n((e=>{a=e,i()})),await o};try{await e(t,r,u),c?(await o,a(null)):s(null)}catch(e){a?a(e):s(e)}}}}}},{package:"json-rpc-engine",file:"../../node_modules/json-rpc-engine/dist/createAsyncMiddleware.js"}],[118,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createScaffoldMiddleware=void 0,r.createScaffoldMiddleware=function(e){return(t,r,n,s)=>{const i=e[t.method];return i===undefined?n():"function"==typeof i?i(t,r,n,s):(r.result=i,s())}}}}},{package:"json-rpc-engine",file:"../../node_modules/json-rpc-engine/dist/createScaffoldMiddleware.js"}],[119,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getUniqueId=void 0;const n=4294967295;let s=Math.floor(Math.random()*n);r.getUniqueId=function(){return s=(s+1)%n,s}}}},{package:"json-rpc-engine",file:"../../node_modules/json-rpc-engine/dist/getUniqueId.js"}],[120,{"./getUniqueId":119},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createIdRemapMiddleware=void 0;const n=e("./getUniqueId");r.createIdRemapMiddleware=function(){return(e,t,r,s)=>{const i=e.id,o=n.getUniqueId();e.id=o,t.id=o,r((r=>{e.id=i,t.id=i,r()}))}}}}},{package:"json-rpc-engine",file:"../../node_modules/json-rpc-engine/dist/idRemapMiddleware.js"}],[121,{"./JsonRpcEngine":116,"./createAsyncMiddleware":117,"./createScaffoldMiddleware":118,"./getUniqueId":119,"./idRemapMiddleware":120,"./mergeMiddleware":122},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./idRemapMiddleware"),r),s(e("./createAsyncMiddleware"),r),s(e("./createScaffoldMiddleware"),r),s(e("./getUniqueId"),r),s(e("./JsonRpcEngine"),r),s(e("./mergeMiddleware"),r)}}},{package:"json-rpc-engine",file:"../../node_modules/json-rpc-engine/dist/index.js"}],[122,{"./JsonRpcEngine":116},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.mergeMiddleware=void 0;const n=e("./JsonRpcEngine");r.mergeMiddleware=function(e){const t=new n.JsonRpcEngine;return e.forEach((e=>t.push(e))),t.asMiddleware()}}}},{package:"json-rpc-engine",file:"../../node_modules/json-rpc-engine/dist/mergeMiddleware.js"}],[123,{"readable-stream":134},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});const n=e("readable-stream");r.default=function(e){if(!e||!e.engine)throw new Error("Missing engine parameter!");const{engine:t}=e,r=new n.Duplex({objectMode:!0,read:()=>undefined,write:function(e,n,s){t.handle(e,((e,t)=>{r.push(t)})),s()}});return t.on&&t.on("notification",(e=>{r.push(e)})),r}}}},{package:"@metamask/providers>json-rpc-middleware-stream",file:"../../node_modules/json-rpc-middleware-stream/dist/createEngineStream.js"}],[124,{"@metamask/safe-event-emitter":71,"readable-stream":134},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const s=n(e("@metamask/safe-event-emitter")),i=e("readable-stream");r.default=function(e={}){const t={},r=new i.Duplex({objectMode:!0,read:()=>undefined,write:function(r,s,i){let a=null;try{!r.id?function(r){(null==e?void 0:e.retryOnMessage)&&r.method===e.retryOnMessage&&Object.values(t).forEach((({req:e,retryCount:r=0})=>{if(e.id){if(r>=3)throw new Error(`StreamMiddleware - Retry limit exceeded for request id "${e.id}"`);t[e.id].retryCount=r+1,o(e)}}));n.emit("notification",r)}(r):function(e){const r=t[e.id];if(!r)return void console.warn(`StreamMiddleware - Unknown response id "${e.id}"`);delete t[e.id],Object.assign(r.res,e),setTimeout(r.end)}(r)}catch(e){a=e}i(a)}}),n=new s.default;return{events:n,middleware:(e,r,n,s)=>{o(e),t[e.id]={req:e,res:r,next:n,end:s}},stream:r};function o(e){r.push(e)}}}}},{package:"@metamask/providers>json-rpc-middleware-stream",file:"../../node_modules/json-rpc-middleware-stream/dist/createStreamMiddleware.js"}],[125,{"./createEngineStream":123,"./createStreamMiddleware":124},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.createStreamMiddleware=r.createEngineStream=void 0;const s=n(e("./createEngineStream"));r.createEngineStream=s.default;const i=n(e("./createStreamMiddleware"));r.createStreamMiddleware=i.default}}},{package:"@metamask/providers>json-rpc-middleware-stream",file:"../../node_modules/json-rpc-middleware-stream/dist/index.js"}],[126,{"./_stream_readable":128,"./_stream_writable":130,"core-util-is":95,inherits:111,"process-nextick-args":139},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("process-nextick-args"),s=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=d;var i=Object.create(e("core-util-is"));i.inherits=e("inherits");var o=e("./_stream_readable"),a=e("./_stream_writable");i.inherits(d,o);for(var c=s(a.prototype),u=0;u<c.length;u++){var l=c[u];d.prototype[l]||(d.prototype[l]=a.prototype[l])}function d(e){if(!(this instanceof d))return new d(e);o.call(this,e),a.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||n.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(d.prototype,"destroyed",{get:function(){return this._readableState!==undefined&&this._writableState!==undefined&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){this._readableState!==undefined&&this._writableState!==undefined&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),d.prototype._destroy=function(e,t){this.push(null),this.end(),n.nextTick(t,e)}}}},{package:"@metamask/providers>json-rpc-middleware-stream>readable-stream",file:"../../node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/_stream_duplex.js"}],[127,{"./_stream_transform":129,"core-util-is":95,inherits:111},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=i;var n=e("./_stream_transform"),s=Object.create(e("core-util-is"));function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}s.inherits=e("inherits"),s.inherits(i,n),i.prototype._transform=function(e,t,r){r(null,e)}}}},{package:"@metamask/providers>json-rpc-middleware-stream>readable-stream",file:"../../node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/_stream_passthrough.js"}],[128,{"./_stream_duplex":126,"./internal/streams/BufferList":131,"./internal/streams/destroy":132,"./internal/streams/stream":133,"core-util-is":95,events:"events",inherits:111,isarray:115,"process-nextick-args":139,"safe-buffer":135,"string_decoder/":136,util:"util"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("process-nextick-args");t.exports=w;var s,i=e("isarray");w.ReadableState=b;e("events").EventEmitter;var o=function(e,t){return e.listeners(t).length},a=e("./internal/streams/stream"),c=e("safe-buffer").Buffer,u=global.Uint8Array||function(){};var l=Object.create(e("core-util-is"));l.inherits=e("inherits");var d=e("util"),h=void 0;h=d&&d.debuglog?d.debuglog("stream"):function(){};var f,p=e("./internal/streams/BufferList"),m=e("./internal/streams/destroy");l.inherits(w,a);var g=["error","close","destroy","pause","resume"];function b(t,r){t=t||{};var n=r instanceof(s=s||e("./_stream_duplex"));this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,o=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(o||0===o)?o:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new p,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.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(f||(f=e("string_decoder/").StringDecoder),this.decoder=new f(t.encoding),this.encoding=t.encoding)}function w(t){if(s=s||e("./_stream_duplex"),!(this instanceof w))return new w(t);this._readableState=new b(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function y(e,t,r,n,s){var i,o=e._readableState;null===t?(o.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,k(e)}(e,o)):(s||(i=function(e,t){var r;n=t,c.isBuffer(n)||n instanceof u||"string"==typeof t||t===undefined||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(o,t)),i?e.emit("error",i):o.objectMode||t&&t.length>0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):v(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?v(e,o,t,!1):T(e,o)):v(e,o,t,!1))):n||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(o)}function v(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&k(e)),T(e,t)}Object.defineProperty(w.prototype,"destroyed",{get:function(){return this._readableState!==undefined&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),w.prototype.destroy=m.destroy,w.prototype._undestroy=m.undestroy,w.prototype._destroy=function(e,t){this.push(null),t(e)},w.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=c.from(e,t),t=""),r=!0),y(this,e,t,!1,r)},w.prototype.unshift=function(e){return y(this,e,null,!0,!1)},w.prototype.isPaused=function(){return!1===this._readableState.flowing},w.prototype.setEncoding=function(t){return f||(f=e("string_decoder/").StringDecoder),this._readableState.decoder=new f(t),this._readableState.encoding=t,this};var _=8388608;function S(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>=_?e=_:(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 k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?n.nextTick(E,e):E(e))}function E(e){h("emit readable"),e.emit("readable"),M(e)}function T(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(x,e,t))}function x(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(h("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function R(e){h("readable nexttick read 0"),e.read(0)}function j(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),M(e),t.flowing&&!t.reading&&e.read(0)}function M(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&null!==e.read(););}function O(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,s=r.data;e-=s.length;for(;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(o===i.length?s+=i:s+=i.slice(0,e),0===(e-=o)){o===i.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(o));break}++n}return t.length-=n,s}(e,t):function(e,t){var r=c.allocUnsafe(e),n=t.head,s=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var i=n.data,o=e>i.length?i.length:e;if(i.copy(r,r.length-e,0,o),0===(e-=o)){o===i.length?(++s,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(o));break}++s}return t.length-=s,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function P(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,n.nextTick(C,t,e))}function C(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function I(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}w.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?P(this):k(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&P(this),null;var n,s=t.needReadable;return h("need readable",s),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",s=!0),t.ended||t.reading?h("reading or ended",s=!1):s&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=S(r,t))),null===(n=e>0?O(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&P(this)),null!==n&&this.emit("data",n),n},w.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},w.prototype.pipe=function(e,t){var r=this,s=this._readableState;switch(s.pipesCount){case 0:s.pipes=e;break;case 1:s.pipes=[s.pipes,e];break;default:s.pipes.push(e)}s.pipesCount+=1,h("pipe count=%d opts=%j",s.pipesCount,t);var a=(!t||!1!==t.end)&&e!==process.stdout&&e!==process.stderr?u:w;function c(t,n){h("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,h("cleanup"),e.removeListener("close",g),e.removeListener("finish",b),e.removeListener("drain",l),e.removeListener("error",m),e.removeListener("unpipe",c),r.removeListener("end",u),r.removeListener("end",w),r.removeListener("data",p),d=!0,!s.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function u(){h("onend"),e.end()}s.endEmitted?n.nextTick(a):r.once("end",a),e.on("unpipe",c);var l=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,M(e))}}(r);e.on("drain",l);var d=!1;var f=!1;function p(t){h("ondata"),f=!1,!1!==e.write(t)||f||((1===s.pipesCount&&s.pipes===e||s.pipesCount>1&&-1!==I(s.pipes,e))&&!d&&(h("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,f=!0),r.pause())}function m(t){h("onerror",t),w(),e.removeListener("error",m),0===o(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",b),w()}function b(){h("onfinish"),e.removeListener("close",g),w()}function w(){h("unpipe"),r.unpipe(e)}return r.on("data",p),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?i(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",m),e.once("close",g),e.once("finish",b),e.emit("pipe",r),s.flowing||(h("pipe resume"),r.resume()),e},w.prototype.unpipe=function(e){var t=this._readableState,r={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,r)),this;if(!e){var n=t.pipes,s=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<s;i++)n[i].emit("unpipe",this,r);return this}var o=I(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},w.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var s=this._readableState;s.endEmitted||s.readableListening||(s.readableListening=s.needReadable=!0,s.emittedReadable=!1,s.reading?s.length&&k(this):n.nextTick(R,this))}return r},w.prototype.addListener=w.prototype.on,w.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(j,e,t))}(this,e)),this},w.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this},w.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var s in e.on("end",(function(){if(h("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(s){(h("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!r.objectMode||null!==s&&s!==undefined)&&((r.objectMode||s&&s.length)&&(t.push(s)||(n=!0,e.pause())))})),e)this[s]===undefined&&"function"==typeof e[s]&&(this[s]=function(t){return function(){return e[t].apply(e,arguments)}}(s));for(var i=0;i<g.length;i++)e.on(g[i],this.emit.bind(this,g[i]));return this._read=function(t){h("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(w.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),w._fromList=O}}},{package:"@metamask/providers>json-rpc-middleware-stream>readable-stream",file:"../../node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/_stream_readable.js"}],[129,{"./_stream_duplex":126,"core-util-is":95,inherits:111},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=o;var n=e("./_stream_duplex"),s=Object.create(e("core-util-is"));function i(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var s=this._readableState;s.reading=!1,(s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}function o(e){if(!(this instanceof o))return new o(e);n.call(this,e),this._transformState={afterTransform:i.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",a)}function a(){var e=this;"function"==typeof this._flush?this._flush((function(t,r){c(e,t,r)})):c(this,null,null)}function c(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}s.inherits=e("inherits"),s.inherits(o,n),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},o.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},o.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var s=this._readableState;(n.needTransform||s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}},o.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},o.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,(function(e){t(e),r.emit("close")}))}}}},{package:"@metamask/providers>json-rpc-middleware-stream>readable-stream",file:"../../node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/_stream_transform.js"}],[130,{"./_stream_duplex":126,"./internal/streams/destroy":132,"./internal/streams/stream":133,"core-util-is":95,inherits:111,"process-nextick-args":139,"safe-buffer":135,timers:"timers","util-deprecate":187},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(r){(function(){var n=e("process-nextick-args");function s(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var s=n.callback;t.pendingcb--,s(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}t.exports=g;var i,o=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?r:n.nextTick;g.WritableState=m;var a=Object.create(e("core-util-is"));a.inherits=e("inherits");var c={deprecate:e("util-deprecate")},u=e("./internal/streams/stream"),l=e("safe-buffer").Buffer,d=global.Uint8Array||function(){};var h,f=e("./internal/streams/destroy");function p(){}function m(t,r){i=i||e("./_stream_duplex"),t=t||{};var a=r instanceof i;this.objectMode=!!t.objectMode,a&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var c=t.highWaterMark,u=t.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=c||0===c?c:a&&(u||0===u)?u:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var d=!1===t.decodeStrings;this.decodeStrings=!d,this.defaultEncoding=t.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 r=e._writableState,s=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,s,i){--t.pendingcb,r?(n.nextTick(i,s),n.nextTick(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",s)):(i(s),e._writableState.errorEmitted=!0,e.emit("error",s),S(e,t))}(e,r,s,t,i);else{var a=v(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||y(e,r),s?o(w,e,r,a,i):w(e,r,a,i)}}(r,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function g(t){if(i=i||e("./_stream_duplex"),!(h.call(g,this)||this instanceof i))return new g(t);this._writableState=new m(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),u.call(this)}function b(e,t,r,n,s,i,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(s,t.onwrite):e._write(s,i,t.onwrite),t.sync=!1}function w(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),S(e,t)}function y(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var a=0,c=!0;r;)i[a]=r,r.isBuf||(c=!1),r=r.next,a+=1;i.allBuffers=c,b(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new s(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,d=r.callback;if(b(e,t,!1,t.objectMode?1:u.length,u,l,d),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function v(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function _(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),S(e,t)}))}function S(e,t){var r=v(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,n.nextTick(_,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}a.inherits(g,u),m.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(m.prototype,"buffer",{get:c.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]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(e){return!!h.call(this,e)||this===g&&(e&&e._writableState instanceof m)}})):h=function(e){return e instanceof this},g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},g.prototype.write=function(e,t,r){var s,i=this._writableState,o=!1,a=!i.objectMode&&(s=e,l.isBuffer(s)||s instanceof d);return a&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=p),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),n.nextTick(t,r)}(this,r):(a||function(e,t,r,s){var i=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||r===undefined||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),n.nextTick(s,o),i=!1),i}(this,i,e,r))&&(i.pendingcb++,o=function(e,t,r,n,s,i){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,r));return t}(t,n,s);n!==o&&(r=!0,s="buffer",n=o)}var a=t.objectMode?1:n.length;t.length+=a;var c=t.length<t.highWaterMark;c||(t.needDrain=!0);if(t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:s,isBuf:r,callback:i,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else b(e,t,!1,a,n,s,i);return c}(this,i,a,e,t,r)),o},g.prototype.cork=function(){this._writableState.corked++},g.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||y(this,e))},g.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 TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),g.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(e,t,r){var s=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!==e&&e!==undefined&&this.write(e,t),s.corked&&(s.corked=1,this.uncork()),s.ending||s.finished||function(e,t,r){t.ending=!0,S(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,s,r)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return this._writableState!==undefined&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),g.prototype.destroy=f.destroy,g.prototype._undestroy=f.undestroy,g.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this)}).call(this,e("timers").setImmediate)}}},{package:"@metamask/providers>json-rpc-middleware-stream>readable-stream",file:"../../node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/_stream_writable.js"}],[131,{"safe-buffer":135,util:"util"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("safe-buffer").Buffer,s=e("util");t.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}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=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}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t,r,s,i=n.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=i,s=a,t.copy(r,s),a+=o.data.length,o=o.next;return i},e}(),s&&s.inspect&&s.inspect.custom&&(t.exports.prototype[s.inspect.custom]=function(){var e=s.inspect({length:this.length});return this.constructor.name+" "+e})}}},{package:"@metamask/providers>json-rpc-middleware-stream>readable-stream",file:"../../node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js"}],[132,{"process-nextick-args":139},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("process-nextick-args");function s(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return i||o?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n.nextTick(s,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(n.nextTick(s,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})),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.finished=!1,this._writableState.errorEmitted=!1)}}}}},{package:"@metamask/providers>json-rpc-middleware-stream>readable-stream",file:"../../node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/internal/streams/destroy.js"}],[133,{stream:"stream"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=e("stream")}}},{package:"@metamask/providers>json-rpc-middleware-stream>readable-stream",file:"../../node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/internal/streams/stream.js"}],[134,{"./lib/_stream_duplex.js":126,"./lib/_stream_passthrough.js":127,"./lib/_stream_readable.js":128,"./lib/_stream_transform.js":129,"./lib/_stream_writable.js":130,stream:"stream"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("stream");"disable"===process.env.READABLE_STREAM&&n?(t.exports=n,(r=t.exports=n.Readable).Readable=n.Readable,r.Writable=n.Writable,r.Duplex=n.Duplex,r.Transform=n.Transform,r.PassThrough=n.PassThrough,r.Stream=n):((r=t.exports=e("./lib/_stream_readable.js")).Stream=n||r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"))}}},{package:"@metamask/providers>json-rpc-middleware-stream>readable-stream",file:"../../node_modules/json-rpc-middleware-stream/node_modules/readable-stream/readable.js"}],[135,{buffer:"buffer"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("buffer"),s=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return s(e,t,r)}s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow?t.exports=n:(i(n,r),r.Buffer=o),i(s,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return s(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=s(e);return t!==undefined?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return s(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}}}},{package:"@metamask/providers>json-rpc-middleware-stream>readable-stream>safe-buffer",file:"../../node_modules/json-rpc-middleware-stream/node_modules/safe-buffer/index.js"}],[136,{"safe-buffer":135},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("safe-buffer").Buffer,s=n.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 i(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&&(n.isEncoding===s||!s(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=l,this.end=d,t=3;break;default:return this.write=h,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){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 r!==undefined?r: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 c(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?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-r))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}r.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if((t=this.fillLast(e))===undefined)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var s=o(t[n]);if(s>=0)return s>0&&(e.lastNeed=s-1),s;if(--n<r||-2===s)return 0;if(s=o(t[n]),s>=0)return s>0&&(e.lastNeed=s-2),s;if(--n<r||-2===s)return 0;if(s=o(t[n]),s>=0)return s>0&&(2===s?s=0:e.lastNeed=s-3),s;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},i.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}}}},{package:"@metamask/providers>json-rpc-middleware-stream>readable-stream>string_decoder",file:"../../node_modules/json-rpc-middleware-stream/node_modules/string_decoder/lib/string_decoder.js"}],[137,{yallist:190},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("yallist"),s=Symbol("max"),i=Symbol("length"),o=Symbol("lengthCalculator"),a=Symbol("allowStale"),c=Symbol("maxAge"),u=Symbol("dispose"),l=Symbol("noDisposeOnSet"),d=Symbol("lruList"),h=Symbol("cache"),f=Symbol("updateAgeOnGet"),p=()=>1;const m=(e,t,r)=>{const n=e[h].get(t);if(n){const t=n.value;if(g(e,t)){if(w(e,n),!e[a])return undefined}else r&&(e[f]&&(n.value.now=Date.now()),e[d].unshiftNode(n));return t.value}},g=(e,t)=>{if(!t||!t.maxAge&&!e[c])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[c]&&r>e[c]},b=e=>{if(e[i]>e[s])for(let t=e[d].tail;e[i]>e[s]&&null!==t;){const r=t.prev;w(e,t),t=r}},w=(e,t)=>{if(t){const r=t.value;e[u]&&e[u](r.key,r.value),e[i]-=r.length,e[h].delete(r.key),e[d].removeNode(t)}};class y{constructor(e,t,r,n,s){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=s||0}}const v=(e,t,r,n)=>{let s=r.value;g(e,s)&&(w(e,r),e[a]||(s=undefined)),s&&t.call(n,s.value,s.key,e)};t.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[s]=e.max||Infinity;const t=e.length||p;if(this[o]="function"!=typeof t?p:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[c]=e.maxAge||0,this[u]=e.dispose,this[l]=e.noDisposeOnSet||!1,this[f]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[s]=e||Infinity,b(this)}get max(){return this[s]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[c]=e,b(this)}get maxAge(){return this[c]}set lengthCalculator(e){"function"!=typeof e&&(e=p),e!==this[o]&&(this[o]=e,this[i]=0,this[d].forEach((e=>{e.length=this[o](e.value,e.key),this[i]+=e.length}))),b(this)}get lengthCalculator(){return this[o]}get length(){return this[i]}get itemCount(){return this[d].length}rforEach(e,t){t=t||this;for(let r=this[d].tail;null!==r;){const n=r.prev;v(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[d].head;null!==r;){const n=r.next;v(this,e,r,t),r=n}}keys(){return this[d].toArray().map((e=>e.key))}values(){return this[d].toArray().map((e=>e.value))}reset(){this[u]&&this[d]&&this[d].length&&this[d].forEach((e=>this[u](e.key,e.value))),this[h]=new Map,this[d]=new n,this[i]=0}dump(){return this[d].map((e=>!g(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[d]}set(e,t,r){if((r=r||this[c])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,a=this[o](t,e);if(this[h].has(e)){if(a>this[s])return w(this,this[h].get(e)),!1;const o=this[h].get(e).value;return this[u]&&(this[l]||this[u](e,o.value)),o.now=n,o.maxAge=r,o.value=t,this[i]+=a-o.length,o.length=a,this.get(e),b(this),!0}const f=new y(e,t,a,n,r);return f.length>this[s]?(this[u]&&this[u](e,t),!1):(this[i]+=f.length,this[d].unshift(f),this[h].set(e,this[d].head),b(this),!0)}has(e){if(!this[h].has(e))return!1;const t=this[h].get(e).value;return!g(this,t)}get(e){return m(this,e,!0)}peek(e){return m(this,e,!1)}pop(){const e=this[d].tail;return e?(w(this,e),e.value):null}del(e){w(this,this[h].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],s=n.e||0;if(0===s)this.set(n.k,n.v);else{const e=s-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[h].forEach(((e,t)=>m(this,t,!1)))}}}}},{package:"@swc/cli>semver>lru-cache",file:"../../node_modules/lru-cache/index.js"}],[138,{wrappy:188},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("wrappy");function s(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function i(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}t.exports=n(s),t.exports.strict=n(i),s.proto=s((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return s(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return i(this)},configurable:!0})}))}}},{package:"pump>once",file:"../../node_modules/once/once.js"}],[139,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){"undefined"==typeof process||!process.version||0===process.version.indexOf("v0.")||0===process.version.indexOf("v1.")&&0!==process.version.indexOf("v1.8.")?t.exports={nextTick:function(e,t,r,n){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var s,i,o=arguments.length;switch(o){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick((function(){e.call(null,t)}));case 3:return process.nextTick((function(){e.call(null,t,r)}));case 4:return process.nextTick((function(){e.call(null,t,r,n)}));default:for(s=new Array(o-1),i=0;i<s.length;)s[i++]=arguments[i];return process.nextTick((function(){e.apply(null,s)}))}}}:t.exports=process}}},{package:"browserify>readable-stream>process-nextick-args",file:"../../node_modules/process-nextick-args/index.js"}],[140,{"end-of-stream":102,fs:"fs",once:138},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("once"),s=e("end-of-stream"),i=e("fs"),o=function(){},a=/^v?\.0/.test(process.version),c=function(e){return"function"==typeof e},u=function(e,t,r,u){u=n(u);var l=!1;e.on("close",(function(){l=!0})),s(e,{readable:t,writable:r},(function(e){if(e)return u(e);l=!0,u()}));var d=!1;return function(t){if(!l&&!d)return d=!0,function(e){return!!a&&!!i&&(e instanceof(i.ReadStream||o)||e instanceof(i.WriteStream||o))&&c(e.close)}(e)?e.close(o):function(e){return e.setHeader&&c(e.abort)}(e)?e.abort():c(e.destroy)?e.destroy():void u(t||new Error("stream was destroyed"))}},l=function(e){e()},d=function(e,t){return e.pipe(t)};t.exports=function(){var e,t=Array.prototype.slice.call(arguments),r=c(t[t.length-1]||o)&&t.pop()||o;if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Error("pump requires two streams per minimum");var n=t.map((function(s,i){var o=i<t.length-1;return u(s,o,i>0,(function(t){e||(e=t),t&&n.forEach(l),o||(n.forEach(l),r(e))}))}));return t.reduce(d)}}}},{package:"pump",file:"../../node_modules/pump/index.js"}],[141,{"../functions/cmp":145,"../internal/debug":170,"../internal/parse-options":172,"../internal/re":173,"./range":142,"./semver":143},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=Symbol("SemVer ANY");class s{static get ANY(){return n}constructor(e,t){if(t=i(t),e instanceof s){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),u("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){const t=this.options.loose?o[a.COMPARATORLOOSE]:o[a.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==undefined?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new l(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}return c(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof s))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):(!(t=i(t)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(c(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(c(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}t.exports=s;const i=e("../internal/parse-options"),{safeRe:o,t:a}=e("../internal/re"),c=e("../functions/cmp"),u=e("../internal/debug"),l=e("./semver"),d=e("./range")}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/classes/comparator.js"}],[142,{"../internal/constants":169,"../internal/debug":170,"../internal/parse-options":172,"../internal/re":173,"./comparator":141,"./semver":143,"lru-cache":137},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){class n{constructor(e,t){if(t=i(t),e instanceof n)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new n(e.raw,t);if(e instanceof o)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!g(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&b(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&p)|(this.options.loose&&m))+":"+e,r=s.get(t);if(r)return r;const n=this.options.loose,i=n?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];e=e.replace(i,M(this.options.includePrerelease)),a("hyphen replace",e),e=e.replace(u[l.COMPARATORTRIM],d),a("comparator trim",e),e=e.replace(u[l.TILDETRIM],h),a("tilde trim",e),e=e.replace(u[l.CARETTRIM],f),a("caret trim",e);let c=e.split(" ").map((e=>y(e,this.options))).join(" ").split(/\s+/).map((e=>j(e,this.options)));n&&(c=c.filter((e=>(a("loose invalid filter",e,this.options),!!e.match(u[l.COMPARATORLOOSE]))))),a("range list",c);const b=new Map,w=c.map((e=>new o(e,this.options)));for(const e of w){if(g(e))return[e];b.set(e.value,e)}b.size>1&&b.has("")&&b.delete("");const v=[...b.values()];return s.set(t,v),v}intersects(e,t){if(!(e instanceof n))throw new TypeError("a Range is required");return this.set.some((r=>w(r,t)&&e.set.some((e=>w(e,t)&&r.every((r=>e.every((e=>r.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(O(this.set[t],e,this.options))return!0;return!1}}t.exports=n;const s=new(e("lru-cache"))({max:1e3}),i=e("../internal/parse-options"),o=e("./comparator"),a=e("../internal/debug"),c=e("./semver"),{safeRe:u,t:l,comparatorTrimReplace:d,tildeTrimReplace:h,caretTrimReplace:f}=e("../internal/re"),{FLAG_INCLUDE_PRERELEASE:p,FLAG_LOOSE:m}=e("../internal/constants"),g=e=>"<0.0.0-0"===e.value,b=e=>""===e.value,w=(e,t)=>{let r=!0;const n=e.slice();let s=n.pop();for(;r&&n.length;)r=n.every((e=>s.intersects(e,t))),s=n.pop();return r},y=(e,t)=>(a("comp",e,t),e=k(e,t),a("caret",e),e=_(e,t),a("tildes",e),e=T(e,t),a("xrange",e),e=R(e,t),a("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,_=(e,t)=>e.trim().split(/\s+/).map((e=>S(e,t))).join(" "),S=(e,t)=>{const r=t.loose?u[l.TILDELOOSE]:u[l.TILDE];return e.replace(r,((t,r,n,s,i)=>{let o;return a("tilde",e,t,r,n,s,i),v(r)?o="":v(n)?o=`>=${r}.0.0 <${+r+1}.0.0-0`:v(s)?o=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:i?(a("replaceTilde pr",i),o=`>=${r}.${n}.${s}-${i} <${r}.${+n+1}.0-0`):o=`>=${r}.${n}.${s} <${r}.${+n+1}.0-0`,a("tilde return",o),o}))},k=(e,t)=>e.trim().split(/\s+/).map((e=>E(e,t))).join(" "),E=(e,t)=>{a("caret",e,t);const r=t.loose?u[l.CARETLOOSE]:u[l.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,s,i,o)=>{let c;return a("caret",e,t,r,s,i,o),v(r)?c="":v(s)?c=`>=${r}.0.0${n} <${+r+1}.0.0-0`:v(i)?c="0"===r?`>=${r}.${s}.0${n} <${r}.${+s+1}.0-0`:`>=${r}.${s}.0${n} <${+r+1}.0.0-0`:o?(a("replaceCaret pr",o),c="0"===r?"0"===s?`>=${r}.${s}.${i}-${o} <${r}.${s}.${+i+1}-0`:`>=${r}.${s}.${i}-${o} <${r}.${+s+1}.0-0`:`>=${r}.${s}.${i}-${o} <${+r+1}.0.0-0`):(a("no pr"),c="0"===r?"0"===s?`>=${r}.${s}.${i}${n} <${r}.${s}.${+i+1}-0`:`>=${r}.${s}.${i}${n} <${r}.${+s+1}.0-0`:`>=${r}.${s}.${i} <${+r+1}.0.0-0`),a("caret return",c),c}))},T=(e,t)=>(a("replaceXRanges",e,t),e.split(/\s+/).map((e=>x(e,t))).join(" ")),x=(e,t)=>{e=e.trim();const r=t.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return e.replace(r,((r,n,s,i,o,c)=>{a("xRange",e,r,n,s,i,o,c);const u=v(s),l=u||v(i),d=l||v(o),h=d;return"="===n&&h&&(n=""),c=t.includePrerelease?"-0":"",u?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&h?(l&&(i=0),o=0,">"===n?(n=">=",l?(s=+s+1,i=0,o=0):(i=+i+1,o=0)):"<="===n&&(n="<",l?s=+s+1:i=+i+1),"<"===n&&(c="-0"),r=`${n+s}.${i}.${o}${c}`):l?r=`>=${s}.0.0${c} <${+s+1}.0.0-0`:d&&(r=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),a("xRange return",r),r}))},R=(e,t)=>(a("replaceStars",e,t),e.trim().replace(u[l.STAR],"")),j=(e,t)=>(a("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?l.GTE0PRE:l.GTE0],"")),M=e=>(t,r,n,s,i,o,a,c,u,l,d,h,f)=>`${r=v(n)?"":v(s)?`>=${n}.0.0${e?"-0":""}`:v(i)?`>=${n}.${s}.0${e?"-0":""}`:o?`>=${r}`:`>=${r}${e?"-0":""}`} ${c=v(u)?"":v(l)?`<${+u+1}.0.0-0`:v(d)?`<${u}.${+l+1}.0-0`:h?`<=${u}.${l}.${d}-${h}`:e?`<${u}.${l}.${+d+1}-0`:`<=${c}`}`.trim(),O=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(a(e[r].semver),e[r].semver!==o.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/classes/range.js"}],[143,{"../internal/constants":169,"../internal/debug":170,"../internal/identifiers":171,"../internal/parse-options":172,"../internal/re":173},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../internal/debug"),{MAX_LENGTH:s,MAX_SAFE_INTEGER:i}=e("../internal/constants"),{safeRe:o,t:a}=e("../internal/re"),c=e("../internal/parse-options"),{compareIdentifiers:u}=e("../internal/identifiers");class l{constructor(e,t){if(t=c(t),e instanceof l){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>s)throw new TypeError(`version is longer than ${s} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?o[a.LOOSE]:o[a.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<i)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(n("SemVer.compare",this.version,this.options,e),!(e instanceof l)){if("string"==typeof e&&e===this.version)return 0;e=new l(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof l||(e=new l(e,this.options)),u(this.major,e.major)||u(this.minor,e.minor)||u(this.patch,e.patch)}comparePre(e){if(e instanceof l||(e=new l(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],s=e.prerelease[t];if(n("prerelease compare",t,r,s),r===undefined&&s===undefined)return 0;if(s===undefined)return 1;if(r===undefined)return-1;if(r!==s)return u(r,s)}while(++t)}compareBuild(e){e instanceof l||(e=new l(e,this.options));let t=0;do{const r=this.build[t],s=e.build[t];if(n("prerelease compare",t,r,s),r===undefined&&s===undefined)return 0;if(s===undefined)return 1;if(r===undefined)return-1;if(r!==s)return u(r,s)}while(++t)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}t.exports=l}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/classes/semver.js"}],[144,{"./parse":160},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./parse");t.exports=(e,t)=>{const r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/clean.js"}],[145,{"./eq":151,"./gt":152,"./gte":153,"./lt":155,"./lte":156,"./neq":159},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./eq"),s=e("./neq"),i=e("./gt"),o=e("./gte"),a=e("./lt"),c=e("./lte");t.exports=(e,t,r,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return n(e,r,u);case"!=":return s(e,r,u);case">":return i(e,r,u);case">=":return o(e,r,u);case"<":return a(e,r,u);case"<=":return c(e,r,u);default:throw new TypeError(`Invalid operator: ${t}`)}}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/cmp.js"}],[146,{"../classes/semver":143,"../internal/re":173,"./parse":160},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver"),s=e("./parse"),{safeRe:i,t:o}=e("../internal/re");t.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let t;for(;(t=i[o.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&t.index+t[0].length===r.index+r[0].length||(r=t),i[o.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;i[o.COERCERTL].lastIndex=-1}else r=e.match(i[o.COERCE]);return null===r?null:s(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/coerce.js"}],[147,{"../classes/semver":143},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver");t.exports=(e,t,r)=>{const s=new n(e,r),i=new n(t,r);return s.compare(i)||s.compareBuild(i)}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/compare-build.js"}],[148,{"./compare":149},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare");t.exports=(e,t)=>n(e,t,!0)}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/compare-loose.js"}],[149,{"../classes/semver":143},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver");t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/compare.js"}],[150,{"./parse.js":160},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./parse.js");t.exports=(e,t)=>{const r=n(e,null,!0),s=n(t,null,!0),i=r.compare(s);if(0===i)return null;const o=i>0,a=o?r:s,c=o?s:r,u=!!a.prerelease.length;if(!!c.prerelease.length&&!u)return c.patch||c.minor?a.patch?"patch":a.minor?"minor":"major":"major";const l=u?"pre":"";return r.major!==s.major?l+"major":r.minor!==s.minor?l+"minor":r.patch!==s.patch?l+"patch":"prerelease"}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/diff.js"}],[151,{"./compare":149},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare");t.exports=(e,t,r)=>0===n(e,t,r)}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/eq.js"}],[152,{"./compare":149},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare");t.exports=(e,t,r)=>n(e,t,r)>0}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/gt.js"}],[153,{"./compare":149},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare");t.exports=(e,t,r)=>n(e,t,r)>=0}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/gte.js"}],[154,{"../classes/semver":143},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver");t.exports=(e,t,r,s,i)=>{"string"==typeof r&&(i=s,s=r,r=undefined);try{return new n(e instanceof n?e.version:e,r).inc(t,s,i).version}catch(e){return null}}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/inc.js"}],[155,{"./compare":149},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare");t.exports=(e,t,r)=>n(e,t,r)<0}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/lt.js"}],[156,{"./compare":149},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare");t.exports=(e,t,r)=>n(e,t,r)<=0}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/lte.js"}],[157,{"../classes/semver":143},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver");t.exports=(e,t)=>new n(e,t).major}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/major.js"}],[158,{"../classes/semver":143},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver");t.exports=(e,t)=>new n(e,t).minor}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/minor.js"}],[159,{"./compare":149},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare");t.exports=(e,t,r)=>0!==n(e,t,r)}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/neq.js"}],[160,{"../classes/semver":143},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver");t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/parse.js"}],[161,{"../classes/semver":143},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver");t.exports=(e,t)=>new n(e,t).patch}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/patch.js"}],[162,{"./parse":160},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./parse");t.exports=(e,t)=>{const r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/prerelease.js"}],[163,{"./compare":149},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare");t.exports=(e,t,r)=>n(t,e,r)}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/rcompare.js"}],[164,{"./compare-build":147},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare-build");t.exports=(e,t)=>e.sort(((e,r)=>n(r,e,t)))}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/rsort.js"}],[165,{"../classes/range":142},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/range");t.exports=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/satisfies.js"}],[166,{"./compare-build":147},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare-build");t.exports=(e,t)=>e.sort(((e,r)=>n(e,r,t)))}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/sort.js"}],[167,{"./parse":160},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./parse");t.exports=(e,t)=>{const r=n(e,t);return r?r.version:null}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/valid.js"}],[168,{"./classes/comparator":141,"./classes/range":142,"./classes/semver":143,"./functions/clean":144,"./functions/cmp":145,"./functions/coerce":146,"./functions/compare":149,"./functions/compare-build":147,"./functions/compare-loose":148,"./functions/diff":150,"./functions/eq":151,"./functions/gt":152,"./functions/gte":153,"./functions/inc":154,"./functions/lt":155,"./functions/lte":156,"./functions/major":157,"./functions/minor":158,"./functions/neq":159,"./functions/parse":160,"./functions/patch":161,"./functions/prerelease":162,"./functions/rcompare":163,"./functions/rsort":164,"./functions/satisfies":165,"./functions/sort":166,"./functions/valid":167,"./internal/constants":169,"./internal/identifiers":171,"./internal/re":173,"./ranges/gtr":174,"./ranges/intersects":175,"./ranges/ltr":176,"./ranges/max-satisfying":177,"./ranges/min-satisfying":178,"./ranges/min-version":179,"./ranges/outside":180,"./ranges/simplify":181,"./ranges/subset":182,"./ranges/to-comparators":183,"./ranges/valid":184},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./internal/re"),s=e("./internal/constants"),i=e("./classes/semver"),o=e("./internal/identifiers"),a=e("./functions/parse"),c=e("./functions/valid"),u=e("./functions/clean"),l=e("./functions/inc"),d=e("./functions/diff"),h=e("./functions/major"),f=e("./functions/minor"),p=e("./functions/patch"),m=e("./functions/prerelease"),g=e("./functions/compare"),b=e("./functions/rcompare"),w=e("./functions/compare-loose"),y=e("./functions/compare-build"),v=e("./functions/sort"),_=e("./functions/rsort"),S=e("./functions/gt"),k=e("./functions/lt"),E=e("./functions/eq"),T=e("./functions/neq"),x=e("./functions/gte"),R=e("./functions/lte"),j=e("./functions/cmp"),M=e("./functions/coerce"),O=e("./classes/comparator"),P=e("./classes/range"),C=e("./functions/satisfies"),I=e("./ranges/to-comparators"),A=e("./ranges/max-satisfying"),N=e("./ranges/min-satisfying"),$=e("./ranges/min-version"),L=e("./ranges/valid"),B=e("./ranges/outside"),D=e("./ranges/gtr"),J=e("./ranges/ltr"),F=e("./ranges/intersects"),q=e("./ranges/simplify"),W=e("./ranges/subset");t.exports={parse:a,valid:c,clean:u,inc:l,diff:d,major:h,minor:f,patch:p,prerelease:m,compare:g,rcompare:b,compareLoose:w,compareBuild:y,sort:v,rsort:_,gt:S,lt:k,eq:E,neq:T,gte:x,lte:R,cmp:j,coerce:M,Comparator:O,Range:P,satisfies:C,toComparators:I,maxSatisfying:A,minSatisfying:N,minVersion:$,validRange:L,outside:B,gtr:D,ltr:J,intersects:F,simplifyRange:q,subset:W,SemVer:i,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:s.SEMVER_SPEC_VERSION,RELEASE_TYPES:s.RELEASE_TYPES,compareIdentifiers:o.compareIdentifiers,rcompareIdentifiers:o.rcompareIdentifiers}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/index.js"}],[169,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=Number.MAX_SAFE_INTEGER||9007199254740991;t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/internal/constants.js"}],[170,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};t.exports=n}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/internal/debug.js"}],[171,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=/^[0-9]+$/,s=(e,t)=>{const r=n.test(e),s=n.test(t);return r&&s&&(e=+e,t=+t),e===t?0:r&&!s?-1:s&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:s,rcompareIdentifiers:(e,t)=>s(t,e)}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/internal/identifiers.js"}],[172,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=Object.freeze({loose:!0}),s=Object.freeze({});t.exports=e=>e?"object"!=typeof e?n:e:s}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/internal/parse-options.js"}],[173,{"./constants":169,"./debug":170},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:s,MAX_LENGTH:i}=e("./constants"),o=e("./debug"),a=(r=t.exports={}).re=[],c=r.safeRe=[],u=r.src=[],l=r.t={};let d=0;const h="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",i],[h,s]],p=(e,t,r)=>{const n=(e=>{for(const[t,r]of f)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),s=d++;o(e,s,t),l[e]=s,u[s]=t,a[s]=new RegExp(t,r?"g":undefined),c[s]=new RegExp(n,r?"g":undefined)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),p("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${h}+`),p("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),p("FULL",`^${u[l.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),p("LOOSE",`^${u[l.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),p("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),p("COERCE",`${"(^|[^\\d])"+"(\\d{1,"}${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),p("COERCERTL",u[l.COERCE],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),r.tildeTrimReplace="$1~",p("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),r.caretTrimReplace="$1^",p("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),r.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/internal/re.js"}],[174,{"./outside":180},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./outside");t.exports=(e,t,r)=>n(e,t,">",r)}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/ranges/gtr.js"}],[175,{"../classes/range":142},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/range");t.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/ranges/intersects.js"}],[176,{"./outside":180},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./outside");t.exports=(e,t,r)=>n(e,t,"<",r)}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/ranges/ltr.js"}],[177,{"../classes/range":142,"../classes/semver":143},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver"),s=e("../classes/range");t.exports=(e,t,r)=>{let i=null,o=null,a=null;try{a=new s(t,r)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(i&&-1!==o.compare(e)||(i=e,o=new n(i,r)))})),i}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/ranges/max-satisfying.js"}],[178,{"../classes/range":142,"../classes/semver":143},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver"),s=e("../classes/range");t.exports=(e,t,r)=>{let i=null,o=null,a=null;try{a=new s(t,r)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(i&&1!==o.compare(e)||(i=e,o=new n(i,r)))})),i}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/ranges/min-satisfying.js"}],[179,{"../classes/range":142,"../classes/semver":143,"../functions/gt":152},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver"),s=e("../classes/range"),i=e("../functions/gt");t.exports=(e,t)=>{e=new s(e,t);let r=new n("0.0.0");if(e.test(r))return r;if(r=new n("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t<e.set.length;++t){const s=e.set[t];let o=null;s.forEach((e=>{const t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":o&&!i(t,o)||(o=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!o||r&&!i(r,o)||(r=o)}return r&&e.test(r)?r:null}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/ranges/min-version.js"}],[180,{"../classes/comparator":141,"../classes/range":142,"../classes/semver":143,"../functions/gt":152,"../functions/gte":153,"../functions/lt":155,"../functions/lte":156,"../functions/satisfies":165},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver"),s=e("../classes/comparator"),{ANY:i}=s,o=e("../classes/range"),a=e("../functions/satisfies"),c=e("../functions/gt"),u=e("../functions/lt"),l=e("../functions/lte"),d=e("../functions/gte");t.exports=(e,t,r,h)=>{let f,p,m,g,b;switch(e=new n(e,h),t=new o(t,h),r){case">":f=c,p=l,m=u,g=">",b=">=";break;case"<":f=u,p=d,m=c,g="<",b="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,h))return!1;for(let r=0;r<t.set.length;++r){const n=t.set[r];let o=null,a=null;if(n.forEach((e=>{e.semver===i&&(e=new s(">=0.0.0")),o=o||e,a=a||e,f(e.semver,o.semver,h)?o=e:m(e.semver,a.semver,h)&&(a=e)})),o.operator===g||o.operator===b)return!1;if((!a.operator||a.operator===g)&&p(e,a.semver))return!1;if(a.operator===b&&m(e,a.semver))return!1}return!0}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/ranges/outside.js"}],[181,{"../functions/compare.js":149,"../functions/satisfies.js":165},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../functions/satisfies.js"),s=e("../functions/compare.js");t.exports=(e,t,r)=>{const i=[];let o=null,a=null;const c=e.sort(((e,t)=>s(e,t,r)));for(const e of c){n(e,t,r)?(a=e,o||(o=e)):(a&&i.push([o,a]),a=null,o=null)}o&&i.push([o,null]);const u=[];for(const[e,t]of i)e===t?u.push(e):t||e!==c[0]?t?e===c[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");const l=u.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return l.length<d.length?l:t}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/ranges/simplify.js"}],[182,{"../classes/comparator.js":141,"../classes/range.js":142,"../functions/compare.js":149,"../functions/satisfies.js":165},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/range.js"),s=e("../classes/comparator.js"),{ANY:i}=s,o=e("../functions/satisfies.js"),a=e("../functions/compare.js"),c=[new s(">=0.0.0-0")],u=[new s(">=0.0.0")],l=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===i){if(1===t.length&&t[0].semver===i)return!0;e=r.includePrerelease?c:u}if(1===t.length&&t[0].semver===i){if(r.includePrerelease)return!0;t=u}const n=new Set;let s,l,f,p,m,g,b;for(const t of e)">"===t.operator||">="===t.operator?s=d(s,t,r):"<"===t.operator||"<="===t.operator?l=h(l,t,r):n.add(t.semver);if(n.size>1)return null;if(s&&l){if(f=a(s.semver,l.semver,r),f>0)return null;if(0===f&&(">="!==s.operator||"<="!==l.operator))return null}for(const e of n){if(s&&!o(e,String(s),r))return null;if(l&&!o(e,String(l),r))return null;for(const n of t)if(!o(e,String(n),r))return!1;return!0}let w=!(!l||r.includePrerelease||!l.semver.prerelease.length)&&l.semver,y=!(!s||r.includePrerelease||!s.semver.prerelease.length)&&s.semver;w&&1===w.prerelease.length&&"<"===l.operator&&0===w.prerelease[0]&&(w=!1);for(const e of t){if(b=b||">"===e.operator||">="===e.operator,g=g||"<"===e.operator||"<="===e.operator,s)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),">"===e.operator||">="===e.operator){if(p=d(s,e,r),p===e&&p!==s)return!1}else if(">="===s.operator&&!o(s.semver,String(e),r))return!1;if(l)if(w&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===w.major&&e.semver.minor===w.minor&&e.semver.patch===w.patch&&(w=!1),"<"===e.operator||"<="===e.operator){if(m=h(l,e,r),m===e&&m!==l)return!1}else if("<="===l.operator&&!o(l.semver,String(e),r))return!1;if(!e.operator&&(l||s)&&0!==f)return!1}return!(s&&g&&!l&&0!==f)&&(!(l&&b&&!s&&0!==f)&&(!y&&!w))},d=(e,t,r)=>{if(!e)return t;const n=a(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},h=(e,t,r)=>{if(!e)return t;const n=a(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};t.exports=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let s=!1;e:for(const n of e.set){for(const e of t.set){const t=l(n,e,r);if(s=s||null!==t,t)continue e}if(s)return!1}return!0}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/ranges/subset.js"}],[183,{"../classes/range":142},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/range");t.exports=(e,t)=>new n(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/ranges/to-comparators.js"}],[184,{"../classes/range":142},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/range");t.exports=(e,t)=>{try{return new n(e,t).range||"*"}catch(e){return null}}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/ranges/valid.js"}],[185,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){!function(e,n){"object"==typeof r&&void 0!==t?n(r):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).Superstruct={})}(this,(function(e){class t extends TypeError{constructor(e,t){let r;const{message:n,explanation:s,...i}=e,{path:o}=e,a=0===o.length?n:`At path: ${o.join(".")} -- ${n}`;super(s??a),null!=s&&(this.cause=a),Object.assign(this,i),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...t()])}}function r(e){return"object"==typeof e&&null!=e}function n(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function s(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function i(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:i,branch:o}=t,{type:a}=r,{refinement:c,message:u=`Expected a value of type \`${a}\`${c?` with refinement \`${c}\``:""}, but received: \`${s(n)}\``}=e;return{value:n,type:a,refinement:c,key:i[i.length-1],path:i,branch:o,...e,message:u}}function*o(e,t,n,s){var o;r(o=e)&&"function"==typeof o[Symbol.iterator]||(e=[e]);for(const r of e){const e=i(r,t,n,s);e&&(yield e)}}function*a(e,t,n={}){const{path:s=[],branch:i=[e],coerce:o=!1,mask:c=!1}=n,u={path:s,branch:i};if(o&&(e=t.coercer(e,u),c&&"type"!==t.type&&r(t.schema)&&r(e)&&!Array.isArray(e)))for(const r in e)t.schema[r]===undefined&&delete e[r];let l="valid";for(const r of t.validator(e,u))r.explanation=n.message,l="not_valid",yield[r,undefined];for(let[d,h,f]of t.entries(e,u)){const t=a(h,f,{path:d===undefined?s:[...s,d],branch:d===undefined?i:[...i,h],coerce:o,mask:c,message:n.message});for(const n of t)n[0]?(l=null!=n[0].refinement?"not_refined":"not_valid",yield[n[0],undefined]):o&&(h=n[1],d===undefined?e=h:e instanceof Map?e.set(d,h):e instanceof Set?e.add(h):r(e)&&(h!==undefined||d in e)&&(e[d]=h))}if("not_valid"!==l)for(const r of t.refiner(e,u))r.explanation=n.message,l="not_refined",yield[r,undefined];"valid"===l&&(yield[undefined,e])}class c{constructor(e){const{type:t,schema:r,validator:n,refiner:s,coercer:i=(e=>e),entries:a=function*(){}}=e;this.type=t,this.schema=r,this.entries=a,this.coercer=i,this.validator=n?(e,t)=>o(n(e,t),t,this,e):()=>[],this.refiner=s?(e,t)=>o(s(e,t),t,this,e):()=>[]}assert(e,t){return u(e,this,t)}create(e,t){return l(e,this,t)}is(e){return h(e,this)}mask(e,t){return d(e,this,t)}validate(e,t={}){return f(e,this,t)}}function u(e,t,r){const n=f(e,t,{message:r});if(n[0])throw n[0]}function l(e,t,r){const n=f(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function d(e,t,r){const n=f(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function h(e,t){return!f(e,t)[0]}function f(e,r,n={}){const s=a(e,r,n),i=function(e){const{done:t,value:r}=e.next();return t?undefined:r}(s);if(i[0]){return[new t(i[0],(function*(){for(const e of s)e[0]&&(yield e[0])})),undefined]}{const e=i[1];return[undefined,e]}}function p(e,t){return new c({type:e,schema:null,validator:t})}function m(){return p("never",(()=>!1))}function g(e){const t=e?Object.keys(e):[],n=m();return new c({type:"object",schema:e||null,*entries(s){if(e&&r(s)){const r=new Set(Object.keys(s));for(const n of t)r.delete(n),yield[n,s[n],e[n]];for(const e of r)yield[e,s[e],n]}},validator:e=>r(e)||`Expected an object, but received: ${s(e)}`,coercer:e=>r(e)?{...e}:e})}function b(e){return new c({...e,validator:(t,r)=>t===undefined||e.validator(t,r),refiner:(t,r)=>t===undefined||e.refiner(t,r)})}function w(){return p("string",(e=>"string"==typeof e||`Expected a string, but received: ${s(e)}`))}function y(e){const t=Object.keys(e);return new c({type:"type",schema:e,*entries(n){if(r(n))for(const r of t)yield[r,n[r],e[r]]},validator:e=>r(e)||`Expected an object, but received: ${s(e)}`,coercer:e=>r(e)?{...e}:e})}function v(){return p("unknown",(()=>!0))}function _(e,t,r){return new c({...e,coercer:(n,s)=>h(n,t)?e.coercer(r(n,s),s):e.coercer(n,s)})}function S(e){return e instanceof Map||e instanceof Set?e.size:e.length}function k(e,t,r){return new c({...e,*refiner(n,s){yield*e.refiner(n,s);const i=o(r(n,s),s,e,n);for(const e of i)yield{...e,refinement:t}}})}e.Struct=c,e.StructError=t,e.any=function(){return p("any",(()=>!0))},e.array=function(e){return new c({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${s(e)}`})},e.assert=u,e.assign=function(...e){const t="type"===e[0].type,r=e.map((e=>e.schema)),n=Object.assign({},...r);return t?y(n):g(n)},e.bigint=function(){return p("bigint",(e=>"bigint"==typeof e))},e.boolean=function(){return p("boolean",(e=>"boolean"==typeof e))},e.coerce=_,e.create=l,e.date=function(){return p("date",(e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${s(e)}`))},e.defaulted=function(e,t,r={}){return _(e,v(),(e=>{const s="function"==typeof t?t():t;if(e===undefined)return s;if(!r.strict&&n(e)&&n(s)){const t={...e};let r=!1;for(const e in s)t[e]===undefined&&(t[e]=s[e],r=!0);if(r)return t}return e}))},e.define=p,e.deprecated=function(e,t){return new c({...e,refiner:(t,r)=>t===undefined||e.refiner(t,r),validator:(r,n)=>r===undefined||(t(r,n),e.validator(r,n))})},e.dynamic=function(e){return new c({type:"dynamic",schema:null,*entries(t,r){const n=e(t,r);yield*n.entries(t,r)},validator:(t,r)=>e(t,r).validator(t,r),coercer:(t,r)=>e(t,r).coercer(t,r),refiner:(t,r)=>e(t,r).refiner(t,r)})},e.empty=function(e){return k(e,"empty",(t=>{const r=S(t);return 0===r||`Expected an empty ${e.type} but received one with a size of \`${r}\``}))},e.enums=function(e){const t={},r=e.map((e=>s(e))).join();for(const r of e)t[r]=r;return new c({type:"enums",schema:t,validator:t=>e.includes(t)||`Expected one of \`${r}\`, but received: ${s(t)}`})},e.func=function(){return p("func",(e=>"function"==typeof e||`Expected a function, but received: ${s(e)}`))},e.instance=function(e){return p("instance",(t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${s(t)}`))},e.integer=function(){return p("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${s(e)}`))},e.intersection=function(e){return new c({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)},*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})},e.is=h,e.lazy=function(e){let t;return new c({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator:(r,n)=>(t??(t=e()),t.validator(r,n)),coercer:(r,n)=>(t??(t=e()),t.coercer(r,n)),refiner:(r,n)=>(t??(t=e()),t.refiner(r,n))})},e.literal=function(e){const t=s(e),r=typeof e;return new c({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?e:null,validator:r=>r===e||`Expected the literal \`${t}\`, but received: ${s(r)}`})},e.map=function(e,t){return new c({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,s]of r.entries())yield[n,n,e],yield[n,s,t]},coercer:e=>e instanceof Map?new Map(e):e,validator:e=>e instanceof Map||`Expected a \`Map\` object, but received: ${s(e)}`})},e.mask=d,e.max=function(e,t,r={}){const{exclusive:n}=r;return k(e,"max",(r=>n?r<t:r<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${r}\``))},e.min=function(e,t,r={}){const{exclusive:n}=r;return k(e,"min",(r=>n?r>t:r>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${r}\``))},e.never=m,e.nonempty=function(e){return k(e,"nonempty",(t=>S(t)>0||`Expected a nonempty ${e.type} but received an empty one`))},e.nullable=function(e){return new c({...e,validator:(t,r)=>null===t||e.validator(t,r),refiner:(t,r)=>null===t||e.refiner(t,r)})},e.number=function(){return p("number",(e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${s(e)}`))},e.object=g,e.omit=function(e,t){const{schema:r}=e,n={...r};for(const e of t)delete n[e];return"type"===e.type?y(n):g(n)},e.optional=b,e.partial=function(e){const t=e instanceof c?{...e.schema}:{...e};for(const e in t)t[e]=b(t[e]);return g(t)},e.pattern=function(e,t){return k(e,"pattern",(r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`))},e.pick=function(e,t){const{schema:r}=e,n={};for(const e of t)n[e]=r[e];return g(n)},e.record=function(e,t){return new c({type:"record",schema:null,*entries(n){if(r(n))for(const r in n){const s=n[r];yield[r,r,e],yield[r,s,t]}},validator:e=>r(e)||`Expected an object, but received: ${s(e)}`})},e.refine=k,e.regexp=function(){return p("regexp",(e=>e instanceof RegExp))},e.set=function(e){return new c({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer:e=>e instanceof Set?new Set(e):e,validator:e=>e instanceof Set||`Expected a \`Set\` object, but received: ${s(e)}`})},e.size=function(e,t,r=t){const n=`Expected a ${e.type}`,s=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return k(e,"size",(e=>{if("number"==typeof e||e instanceof Date)return t<=e&&e<=r||`${n} ${s} but received \`${e}\``;if(e instanceof Map||e instanceof Set){const{size:i}=e;return t<=i&&i<=r||`${n} with a size ${s} but received one with a size of \`${i}\``}{const{length:i}=e;return t<=i&&i<=r||`${n} with a length ${s} but received one with a length of \`${i}\``}}))},e.string=w,e.struct=function(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),p(e,t)},e.trimmed=function(e){return _(e,w(),(e=>e.trim()))},e.tuple=function(e){const t=m();return new c({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let s=0;s<n;s++)yield[s,r[s],e[s]||t]}},validator:e=>Array.isArray(e)||`Expected an array, but received: ${s(e)}`})},e.type=y,e.union=function(e){const t=e.map((e=>e.type)).join(" | ");return new c({type:"union",schema:null,coercer(t){for(const r of e){const[e,n]=r.validate(t,{coerce:!0});if(!e)return n}return t},validator(r,n){const i=[];for(const t of e){const[...e]=a(r,t,n),[s]=e;if(!s[0])return[];for(const[t]of e)t&&i.push(t)}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${s(r)}`,...i]}})},e.unknown=v,e.validate=f}))}}},{package:"superstruct",file:"../../node_modules/superstruct/dist/index.cjs"}],[186,{"has-flag":110,os:"os",tty:"tty"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("os"),s=e("tty"),i=e("has-flag"),{env:o}=process;let a;function c(e,{streamIsTTY:t,sniffFlags:r=!0}={}){const s=function(){if("FORCE_COLOR"in o)return"true"===o.FORCE_COLOR?1:"false"===o.FORCE_COLOR?0:0===o.FORCE_COLOR.length?1:Math.min(Number.parseInt(o.FORCE_COLOR,10),3)}();s!==undefined&&(a=s);const c=r?a:s;if(0===c)return 0;if(r){if(i("color=16m")||i("color=full")||i("color=truecolor"))return 3;if(i("color=256"))return 2}if(e&&!t&&c===undefined)return 0;const u=c||0;if("dumb"===o.TERM)return u;if("win32"===process.platform){const e=n.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in o)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((e=>e in o))||"codeship"===o.CI_NAME?1:u;if("TEAMCITY_VERSION"in o)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0;if("truecolor"===o.COLORTERM)return 3;if("TERM_PROGRAM"in o){const e=Number.parseInt((o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(o.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)||"COLORTERM"in o?1:u}function u(e,t={}){return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(c(e,{streamIsTTY:e&&e.isTTY,...t}))}i("no-color")||i("no-colors")||i("color=false")||i("color=never")?a=0:(i("color")||i("colors")||i("color=true")||i("color=always"))&&(a=1),t.exports={supportsColor:u,stdout:u({isTTY:s.isatty(1)}),stderr:u({isTTY:s.isatty(2)})}}}},{package:"@wdio/mocha-framework>mocha>supports-color",file:"../../node_modules/supports-color/index.js"}],[187,{util:"util"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=e("util").deprecate}}},{package:"browserify>readable-stream>util-deprecate",file:"../../node_modules/util-deprecate/node.js"}],[188,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=function e(t,r){if(t&&r)return e(t)(r);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach((function(e){n[e]=t[e]})),n;function n(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var n=t.apply(this,e),s=e[e.length-1];return"function"==typeof n&&n!==s&&Object.keys(s).forEach((function(e){n[e]=s[e]})),n}}}}},{package:"pump>once>wrappy",file:"../../node_modules/wrappy/wrappy.js"}],[189,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}}}},{package:"@swc/cli>semver>lru-cache>yallist",file:"../../node_modules/yallist/iterator.js"}],[190,{"./iterator.js":189},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var r=0,s=arguments.length;r<s;r++)t.push(arguments[r]);return t}function s(e,t,r){var n=t===e.head?new a(r,null,t,e):new a(r,t,t.next,e);return null===n.next&&(e.tail=n),null===n.prev&&(e.head=n),e.length++,n}function i(e,t){e.tail=new a(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function o(e,t){e.head=new a(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function a(e,t,r,n){if(!(this instanceof a))return new a(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}t.exports=n,n.Node=a,n.create=n,n.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},n.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},n.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},n.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)i(this,arguments[e]);return this.length},n.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},n.prototype.pop=function(){if(!this.tail)return undefined;var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e},n.prototype.shift=function(){if(!this.head)return undefined;var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e},n.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},n.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},n.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},n.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},n.prototype.map=function(e,t){t=t||this;for(var r=new n,s=this.head;null!==s;)r.push(e.call(t,s.value,this)),s=s.next;return r},n.prototype.mapReverse=function(e,t){t=t||this;for(var r=new n,s=this.tail;null!==s;)r.push(e.call(t,s.value,this)),s=s.prev;return r},n.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var s=0;null!==n;s++)r=e(r,n.value,s),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var s=this.length-1;null!==n;s--)r=e(r,n.value,s),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var s=0,i=this.head;null!==i&&s<e;s++)i=i.next;for(;null!==i&&s<t;s++,i=i.next)r.push(i.value);return r},n.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var s=this.length,i=this.tail;null!==i&&s>t;s--)i=i.prev;for(;null!==i&&s>e;s--,i=i.prev)r.push(i.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,i=this.head;null!==i&&n<e;n++)i=i.next;var o=[];for(n=0;i&&n<t;n++)o.push(i.value),i=this.removeNode(i);null===i&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(n=0;n<r.length;n++)i=s(this,i,r[n]);return o},n.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};try{e("./iterator.js")(n)}catch(e){}}}},{package:"@swc/cli>semver>lru-cache>yallist",file:"../../node_modules/yallist/yallist.js"}],[191,{"../logging":210,"../openrpc.json":213,"./../../../snaps-utils/src/index.executionenv":215,"./commands":192,"./endowments":197,"./globalEvents":204,"./sortParams":207,"./utils":208,"./validation":209,"@metamask/providers":62,"@metamask/utils":80,"eth-rpc-errors":106,"json-rpc-engine":121,superstruct:185},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.BaseSnapExecutor=void 0;var n,s=e("@metamask/providers"),i=e("./../../../snaps-utils/src/index.executionenv"),o=e("@metamask/utils"),a=e("eth-rpc-errors"),c=e("json-rpc-engine"),u=e("superstruct"),l=e("../logging"),d=(n=e("../openrpc.json"))&&n.__esModule?n:{default:n},h=e("./commands"),f=e("./endowments"),p=e("./globalEvents"),m=e("./sortParams"),g=e("./utils"),b=e("./validation");function w(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(r!==undefined){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const y={code:a.errorCodes.rpc.internal,message:"Execution Environment Error"},v={ping:{struct:b.PingRequestArgumentsStruct,params:[]},executeSnap:{struct:b.ExecuteSnapRequestArgumentsStruct,params:["snapId","sourceCode","endowments"]},terminate:{struct:b.TerminateRequestArgumentsStruct,params:[]},snapRpc:{struct:b.SnapRpcRequestArgumentsStruct,params:["target","handler","origin","request"]}};r.BaseSnapExecutor=class{constructor(e,t){w(this,"snapData",void 0),w(this,"commandStream",void 0),w(this,"rpcStream",void 0),w(this,"methods",void 0),w(this,"snapErrorHandler",void 0),w(this,"snapPromiseErrorHandler",void 0),w(this,"lastTeardown",0),this.snapData=new Map,this.commandStream=e,this.commandStream.on("data",(e=>{this.onCommandRequest(e).catch((e=>{(0,i.logError)(e)}))})),this.rpcStream=t,this.methods=(0,h.getCommandMethodImplementations)(this.startSnap.bind(this),(async(e,t,r)=>{const n=this.snapData.get(e),s=null==n?void 0:n.exports[t],{required:a}=i.SNAP_EXPORTS[t];if((0,o.assert)(!a||s!==undefined,`No ${t} handler exported for snap "${e}`),!s)return null;let c=await this.executeInSnapContext(e,(()=>s(r)));c===undefined&&(c=null);try{return(0,o.getSafeJson)(c)}catch(e){throw new TypeError(`Received non-JSON-serializable value: ${e.message.replace(/^Assertion failed: /u,"")}`)}}),this.onTerminate.bind(this))}errorHandler(e,t){const r=(0,g.constructError)(e),n=(0,a.serializeError)(r,{fallbackError:y,shouldIncludeStack:!1}),s={...t,stack:(null==r?void 0:r.stack)??null};this.notify({method:"UnhandledError",params:{error:{...n,data:s}}})}async onCommandRequest(e){if(!(0,o.isJsonRpcRequest)(e))throw new Error("Command stream received a non-JSON-RPC request.");const{id:t,method:r,params:n}=e;if("rpc.discover"===r)return void this.respond(t,{result:d.default});if(!(0,o.hasProperty)(v,r))return void this.respond(t,{error:a.ethErrors.rpc.methodNotFound({data:{method:r}}).serialize()});const s=v[r],i=(0,m.sortParamKeys)(s.params,n),[c]=(0,u.validate)(i,s.struct);if(c)this.respond(t,{error:a.ethErrors.rpc.invalidParams({message:`Invalid parameters for method "${r}": ${c.message}.`,data:{method:r,params:i}}).serialize()});else try{const e=await this.methods[r](...i);this.respond(t,{result:e})}catch(e){this.respond(t,{error:(0,a.serializeError)(e,{fallbackError:y})})}}notify(e){if(!(0,o.isValidJson)(e)||!(0,o.isObject)(e))throw new Error("JSON-RPC notifications must be JSON serializable objects");this.commandStream.write({...e,jsonrpc:"2.0"})}respond(e,t){if(!(0,o.isValidJson)(t)||!(0,o.isObject)(t))throw new Error("JSON-RPC responses must be JSON serializable objects.");this.commandStream.write({...t,id:e,jsonrpc:"2.0"})}async startSnap(e,t,r){(0,l.log)(`Starting snap '${e}' in worker.`),this.snapPromiseErrorHandler&&(0,p.removeEventListener)("unhandledrejection",this.snapPromiseErrorHandler),this.snapErrorHandler&&(0,p.removeEventListener)("error",this.snapErrorHandler),this.snapErrorHandler=t=>{this.errorHandler(t.error,{snapId:e})},this.snapPromiseErrorHandler=t=>{this.errorHandler(t instanceof Error?t:t.reason,{snapId:e})};const n=new s.StreamProvider(this.rpcStream,{jsonRpcStreamName:"metamask-provider",rpcMiddleware:[(0,c.createIdRemapMiddleware)()]});await n.initialize();const i=this.createSnapGlobal(n),o=this.createEIP1193Provider(n),a={exports:{}};try{const{endowments:n,teardown:s}=(0,f.createEndowments)(i,o,e,r);this.snapData.set(e,{idleTeardown:s,runningEvaluations:new Set,exports:{}}),(0,p.addEventListener)("unhandledRejection",this.snapPromiseErrorHandler),(0,p.addEventListener)("error",this.snapErrorHandler);const c=new Compartment({...n,module:a,exports:a.exports});c.globalThis.self=c.globalThis,c.globalThis.global=c.globalThis,c.globalThis.window=c.globalThis,await this.executeInSnapContext(e,(()=>{c.evaluate(t),this.registerSnapExports(e,a)}))}catch(t){throw this.removeSnap(e),new Error(`Error while running snap '${e}': ${t.message}`)}}onTerminate(){this.snapData.forEach((e=>e.runningEvaluations.forEach((e=>e.stop())))),this.snapData.clear()}registerSnapExports(e,t){const r=this.snapData.get(e);r&&(r.exports=i.SNAP_EXPORT_NAMES.reduce(((e,r)=>{const n=t.exports[r],{validator:s}=i.SNAP_EXPORTS[r];return s(n)?{...e,[r]:n}:e}),{}))}createSnapGlobal(e){const t=e.request.bind(e),r=async e=>{(0,g.assertSnapOutboundRequest)(e);const r=(0,o.getSafeJson)(e);this.notify({method:"OutboundRequest"});try{return await(0,g.withTeardown)(t(r),this)}finally{this.notify({method:"OutboundResponse"})}},n=new Proxy({},{has:(e,t)=>"string"==typeof t&&["request"].includes(t),get:(e,t)=>"request"===t?r:undefined});return harden(n)}createEIP1193Provider(e){const t=e.request.bind(e),r=(0,g.proxyStreamProvider)(e,(async e=>{(0,g.assertEthereumOutboundRequest)(e);const r=(0,o.getSafeJson)(e);this.notify({method:"OutboundRequest"});try{return await(0,g.withTeardown)(t(r),this)}finally{this.notify({method:"OutboundResponse"})}}));return harden(r)}removeSnap(e){this.snapData.delete(e)}async executeInSnapContext(e,t){const r=this.snapData.get(e);if(r===undefined)throw new Error(`Tried to execute in context of unknown snap: "${e}".`);let n;const s=new Promise(((t,r)=>n=()=>r(a.ethErrors.rpc.internal(`The snap "${e}" has been terminated during execution.`)))),i={stop:n};try{return r.runningEvaluations.add(i),await Promise.race([t(),s])}finally{r.runningEvaluations.delete(i),0===r.runningEvaluations.size&&(this.lastTeardown+=1,await r.idleTeardown())}}}}}},{package:"$root$",file:"src/common/BaseSnapExecutor.ts"}],[192,{"./../../../snaps-utils/src/index.executionenv":215,"./validation":209,"@metamask/utils":80},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getCommandMethodImplementations=function(e,t,r){return{ping:async()=>Promise.resolve("OK"),terminate:async()=>(r(),Promise.resolve("OK")),executeSnap:async(t,r,n)=>(await e(t,r,n),"OK"),snapRpc:async(e,r,n,s)=>await t(e,r,o(n,r,s))??null}},r.getHandlerArguments=o;var n=e("./../../../snaps-utils/src/index.executionenv"),s=e("@metamask/utils"),i=e("./validation");function o(e,t,r){switch(t){case n.HandlerType.OnTransaction:{(0,i.assertIsOnTransactionRequestArguments)(r.params);const{transaction:e,chainId:t,transactionOrigin:n}=r.params;return{transaction:e,chainId:t,transactionOrigin:n}}case n.HandlerType.OnRpcRequest:return{origin:e,request:r};case n.HandlerType.OnCronjob:case n.HandlerType.OnInstall:case n.HandlerType.OnUpdate:return{request:r};default:return(0,s.assertExhaustive)(t)}}}}},{package:"$root$",file:"src/common/commands.ts"}],[193,{"../globalObject":205,"./console":194,"./crypto":195,"./date":196,"./interval":198,"./math":199,"./network":200,"./textDecoder":201,"./textEncoder":202,"./timeout":203},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=e("../globalObject"),s=f(e("./console")),i=f(e("./crypto")),o=f(e("./date")),a=f(e("./interval")),c=f(e("./math")),u=f(e("./network")),l=f(e("./textDecoder")),d=f(e("./textEncoder")),h=f(e("./timeout"));function f(e){return e&&e.__esModule?e:{default:e}}const p=[{endowment:AbortController,name:"AbortController"},{endowment:AbortSignal,name:"AbortSignal"},{endowment:ArrayBuffer,name:"ArrayBuffer"},{endowment:atob,name:"atob",bind:!0},{endowment:BigInt,name:"BigInt"},{endowment:BigInt64Array,name:"BigInt64Array"},{endowment:BigUint64Array,name:"BigUint64Array"},{endowment:btoa,name:"btoa",bind:!0},{endowment:DataView,name:"DataView"},{endowment:Float32Array,name:"Float32Array"},{endowment:Float64Array,name:"Float64Array"},{endowment:Int8Array,name:"Int8Array"},{endowment:Int16Array,name:"Int16Array"},{endowment:Int32Array,name:"Int32Array"},{endowment:Uint8Array,name:"Uint8Array"},{endowment:Uint8ClampedArray,name:"Uint8ClampedArray"},{endowment:Uint16Array,name:"Uint16Array"},{endowment:Uint32Array,name:"Uint32Array"},{endowment:URL,name:"URL"},{endowment:WebAssembly,name:"WebAssembly"}];var m=()=>{const e=[i.default,a.default,c.default,u.default,h.default,l.default,d.default,o.default,s.default];return p.forEach((t=>{const r={names:[t.name],factory:()=>{const e="function"==typeof t.endowment&&t.bind?t.endowment.bind(n.rootRealmGlobal):t.endowment;return{[t.name]:harden(e)}}};e.push(r)})),e};r.default=m}}},{package:"$root$",file:"src/common/endowments/commonEndowmentFactory.ts"}],[194,{"../globalObject":205,"@metamask/utils":80},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.consoleMethods=r.consoleAttenuatedMethods=void 0;var n=e("@metamask/utils"),s=e("../globalObject");const i=new Set(["log","assert","error","debug","info","warn"]);r.consoleAttenuatedMethods=i;const o=new Set(["debug","error","info","log","warn","dir","dirxml","table","trace","group","groupCollapsed","groupEnd","clear","count","countReset","assert","profile","profileEnd","time","timeLog","timeEnd","timeStamp","context"]);r.consoleMethods=o;const a=["log","error","debug","info","warn"];function c(e,t,...r){const n=`[Snap: ${e}]`;return"string"==typeof t?[`${n} ${t}`,...r]:[n,t,...r]}var u={names:["console"],factory:function({snapId:e}={}){(0,n.assert)(e!==undefined);const t=Object.getOwnPropertyNames(s.rootRealmGlobal.console).reduce(((e,t)=>o.has(t)&&!i.has(t)?{...e,[t]:s.rootRealmGlobal.console[t]}:e),{});return harden({console:{...t,assert:(t,r,...n)=>{s.rootRealmGlobal.console.assert(t,...c(e,r,...n))},...a.reduce(((t,r)=>({...t,[r]:(t,...n)=>{s.rootRealmGlobal.console[r](...c(e,t,...n))}})),{})}})}};r.default=u}}},{package:"$root$",file:"src/common/endowments/console.ts"}],[195,{"../globalObject":205,crypto:"crypto"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.createCrypto=void 0;var n=e("../globalObject");const s=()=>{if("crypto"in n.rootRealmGlobal&&"object"==typeof n.rootRealmGlobal.crypto&&"SubtleCrypto"in n.rootRealmGlobal&&"function"==typeof n.rootRealmGlobal.SubtleCrypto)return{crypto:harden(n.rootRealmGlobal.crypto),SubtleCrypto:harden(n.rootRealmGlobal.SubtleCrypto)};const t=e("crypto").webcrypto;return{crypto:harden(t),SubtleCrypto:harden(t.subtle.constructor)}};r.createCrypto=s;var i={names:["crypto","SubtleCrypto"],factory:s};r.default=i}}},{package:"$root$",file:"src/common/endowments/crypto.ts"}],[196,{"../globalObject":205},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=e("../globalObject");var s={names:["Date"],factory:function(){const e=Object.getOwnPropertyNames(n.rootRealmGlobal.Date);let t=0;const r=()=>{const e=n.rootRealmGlobal.Date.now(),r=Math.round(e+Math.random());return r>t&&(t=r),t},s=function(...e){return Reflect.construct(n.rootRealmGlobal.Date,0===e.length?[r()]:e,new.target)};return e.forEach((e=>{Reflect.defineProperty(s,e,{configurable:!1,writable:!1,value:"now"===e?r:n.rootRealmGlobal.Date[e]})})),{Date:harden(s)}}};r.default=s}}},{package:"$root$",file:"src/common/endowments/date.ts"}],[197,{"../globalObject":205,"./../../../../snaps-utils/src/index.executionenv":215,"./commonEndowmentFactory":193,"@metamask/utils":80},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createEndowments=function(e,t,r,n=[]){const c={},u=n.reduce((({allEndowments:e,teardowns:n},u)=>{if(a.has(u)){if(!(0,i.hasProperty)(c,u)){const{teardownFunction:e,...t}=a.get(u)({snapId:r});Object.assign(c,t),e&&n.push(e)}e[u]=c[u]}else if("ethereum"===u)e[u]=t;else{if(!(u in o.rootRealmGlobal))throw new Error(`Unknown endowment: "${u}".`);{(0,s.logWarning)(`Access to unhardened global ${u}.`);const t=o.rootRealmGlobal[u];e[u]=t}}return{allEndowments:e,teardowns:n}}),{allEndowments:{snap:e},teardowns:[]});return{endowments:u.allEndowments,teardown:async()=>{await Promise.all(u.teardowns.map((e=>e())))}}};var n,s=e("./../../../../snaps-utils/src/index.executionenv"),i=e("@metamask/utils"),o=e("../globalObject");const a=(0,((n=e("./commonEndowmentFactory"))&&n.__esModule?n:{default:n}).default)().reduce(((e,t)=>(t.names.forEach((r=>{e.set(r,t.factory)})),e)),new Map)}}},{package:"$root$",file:"src/common/endowments/index.ts"}],[198,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n={names:["setInterval","clearInterval"],factory:()=>{const e=new Map,t=t=>{harden(t);const r=e.get(t);r!==undefined&&(clearInterval(r),e.delete(t))};return{setInterval:harden(((t,r)=>{if("function"!=typeof t)throw new Error("The interval handler must be a function. Received: "+typeof t);harden(t);const n=Object.freeze(Object.create(null)),s=setInterval(t,Math.max(10,r??0));return e.set(n,s),n})),clearInterval:harden(t),teardownFunction:()=>{for(const r of e.keys())t(r)}}}};r.default=n}}},{package:"$root$",file:"src/common/endowments/interval.ts"}],[199,{"../globalObject":205,"./crypto":195},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=e("../globalObject"),s=e("./crypto");var i={names:["Math"],factory:function(){const e=Object.getOwnPropertyNames(n.rootRealmGlobal.Math).reduce(((e,t)=>"random"===t?e:{...e,[t]:n.rootRealmGlobal.Math[t]}),{}),{crypto:t}=(0,s.createCrypto)();return harden({Math:{...e,random:()=>t.getRandomValues(new Uint32Array(1))[0]/2**32}})}};r.default=i}}},{package:"$root$",file:"src/common/endowments/math.ts"}],[200,{"../utils":208},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=e("../utils");function s(e,t,r){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,r)}function i(e,t){return function(e,t){if(t.get)return t.get.call(e);return t.value}(e,a(e,t,"get"))}function o(e,t,r){return function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(e,a(e,t,"set"),r),r}function a(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}var c=new WeakMap,u=new WeakMap;class l{constructor(e,t){s(this,c,{writable:!0,value:void 0}),s(this,u,{writable:!0,value:void 0}),o(this,u,e),o(this,c,t)}get body(){return i(this,u).body}get bodyUsed(){return i(this,u).bodyUsed}get headers(){return i(this,u).headers}get ok(){return i(this,u).ok}get redirected(){return i(this,u).redirected}get status(){return i(this,u).status}get statusText(){return i(this,u).statusText}get type(){return i(this,u).type}get url(){return i(this,u).url}async text(){return(0,n.withTeardown)(i(this,u).text(),this)}async arrayBuffer(){return(0,n.withTeardown)(i(this,u).arrayBuffer(),this)}async blob(){return(0,n.withTeardown)(i(this,u).blob(),this)}clone(){const e=i(this,u).clone();return new l(e,i(this,c))}async formData(){return(0,n.withTeardown)(i(this,u).formData(),this)}async json(){return(0,n.withTeardown)(i(this,u).json(),this)}}var d={names:["fetch"],factory:()=>{const e=new Set,t={lastTeardown:0},r=new FinalizationRegistry((e=>e()));return{fetch:harden((async(s,i)=>{const o=new AbortController;if(null!==(null==i?void 0:i.signal)&&(null==i?void 0:i.signal)!==undefined){const e=i.signal;e.addEventListener("abort",(()=>{o.abort(e.reason)}),{once:!0})}let a,c;try{const r=fetch(s,{...i,signal:o.signal});c={cancel:async()=>{o.abort();try{await r}catch{}}},e.add(c),a=new l(await(0,n.withTeardown)(r,t),t)}finally{c!==undefined&&e.delete(c)}if(null!==a.body){const t=new WeakRef(a.body),n={cancel:async()=>{try{var e;await(null===(e=t.deref())||void 0===e?void 0:e.cancel())}catch{}}};e.add(n),r.register(a.body,(()=>e.delete(n)))}return harden(a)})),teardownFunction:async()=>{t.lastTeardown+=1;const r=[];e.forEach((({cancel:e})=>r.push(e()))),e.clear(),await Promise.all(r)}}}};r.default=d}}},{package:"$root$",file:"src/common/endowments/network.ts"}],[201,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n={names:["TextDecoder"],factory:()=>({TextDecoder:harden(TextDecoder)})};r.default=n}}},{package:"$root$",file:"src/common/endowments/textDecoder.ts"}],[202,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n={names:["TextEncoder"],factory:()=>({TextEncoder:harden(TextEncoder)})};r.default=n}}},{package:"$root$",file:"src/common/endowments/textEncoder.ts"}],[203,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n={names:["setTimeout","clearTimeout"],factory:()=>{const e=new Map,t=t=>{const r=e.get(t);r!==undefined&&(clearTimeout(r),e.delete(t))};return{setTimeout:harden(((t,r)=>{if("function"!=typeof t)throw new Error("The timeout handler must be a function. Received: "+typeof t);harden(t);const n=Object.freeze(Object.create(null)),s=setTimeout((()=>{e.delete(n),t()}),Math.max(10,r??0));return e.set(n,s),n})),clearTimeout:harden(t),teardownFunction:()=>{for(const r of e.keys())t(r)}}}};r.default=n}}},{package:"$root$",file:"src/common/endowments/timeout.ts"}],[204,{"./globalObject":205},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.addEventListener=function(e,t){if("addEventListener"in n.rootRealmGlobal&&"function"==typeof n.rootRealmGlobal.addEventListener)return n.rootRealmGlobal.addEventListener(e.toLowerCase(),t);if(n.rootRealmGlobal.process&&"on"in n.rootRealmGlobal.process&&"function"==typeof n.rootRealmGlobal.process.on)return n.rootRealmGlobal.process.on(e,t);throw new Error("Platform agnostic addEventListener failed")},r.removeEventListener=function(e,t){if("removeEventListener"in n.rootRealmGlobal&&"function"==typeof n.rootRealmGlobal.removeEventListener)return n.rootRealmGlobal.removeEventListener(e.toLowerCase(),t);if(n.rootRealmGlobal.process&&"removeListener"in n.rootRealmGlobal.process&&"function"==typeof n.rootRealmGlobal.process.removeListener)return n.rootRealmGlobal.process.removeListener(e,t);throw new Error("Platform agnostic removeEventListener failed")};var n=e("./globalObject")}}},{package:"$root$",file:"src/common/globalEvents.ts"}],[205,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.rootRealmGlobalName=r.rootRealmGlobal=void 0;var n=function(e){return e.globalThis="globalThis",e.global="global",e.self="self",e.window="window",e}(n||{});let s,i;if("undefined"!=typeof globalThis)s=globalThis,i=n.globalThis;else if("undefined"!=typeof self)s=self,i=n.self;else if("undefined"!=typeof window)s=window,i=n.window;else{if("undefined"==typeof global)throw new Error("Unknown realm type; failed to identify global object.");s=global,i=n.global}const o=s;r.rootRealmGlobal=o;const a=i;r.rootRealmGlobalName=a}}},{package:"$root$",file:"src/common/globalObject.ts"}],[206,{"./../../../../snaps-utils/src/index.executionenv":215},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.executeLockdownMore=function(){try{const e=Reflect.ownKeys((new Compartment).globalThis),t=new Set(["eval","Function"]);new Set([...e]).forEach((e=>{const r=Reflect.getOwnPropertyDescriptor(globalThis,e);r&&(r.configurable&&(!function(e){return"set"in e||"get"in e}(r)?Object.defineProperty(globalThis,e,{configurable:!1,writable:!1}):Object.defineProperty(globalThis,e,{configurable:!1})),t.has(e)&&harden(globalThis[e]))}))}catch(e){throw(0,n.logError)("Protecting intrinsics failed:",e),e}};var n=e("./../../../../snaps-utils/src/index.executionenv")}}},{package:"$root$",file:"src/common/lockdown/lockdown-more.ts"}],[207,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.sortParamKeys=void 0;r.sortParamKeys=(e,t)=>{if(!t)return[];if(t instanceof Array)return t;const r=e.reduce(((e,t,r)=>({...e,[t]:r})),{});return Object.entries(t).sort((([e,t],[n,s])=>r[e]-r[n])).map((([e,t])=>t))}}}},{package:"$root$",file:"src/common/sortParams.ts"}],[208,{"../logging":210,"@metamask/utils":80,"eth-rpc-errors":106},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.BLOCKED_RPC_METHODS=void 0,r.assertEthereumOutboundRequest=function(e){(0,n.assert)(!String.prototype.startsWith.call(e.method,"snap_"),s.ethErrors.rpc.methodNotFound({data:{method:e.method}})),(0,n.assert)(!o.includes(e.method),s.ethErrors.rpc.methodNotFound({data:{method:e.method}})),(0,n.assertStruct)(e,n.JsonStruct,"Provided value is not JSON-RPC compatible")},r.assertSnapOutboundRequest=function(e){(0,n.assert)(String.prototype.startsWith.call(e.method,"wallet_")||String.prototype.startsWith.call(e.method,"snap_"),"The global Snap API only allows RPC methods starting with `wallet_*` and `snap_*`."),(0,n.assert)(!o.includes(e.method),s.ethErrors.rpc.methodNotFound({data:{method:e.method}})),(0,n.assertStruct)(e,n.JsonStruct,"Provided value is not JSON-RPC compatible")},r.constructError=function(e){let t;e instanceof Error?t=e:"string"==typeof e&&(t=new Error(e),delete t.stack);return t},r.proxyStreamProvider=function(e,t){return new Proxy({},{has:(e,t)=>"string"==typeof t&&["request","on","removeListener"].includes(t),get:(r,n)=>"request"===n?t:["on","removeListener"].includes(n)?e[n]:undefined})},r.withTeardown=async function(e,t){const r=t.lastTeardown;return new Promise(((n,s)=>{e.then((e=>{t.lastTeardown===r?n(e):(0,i.log)("Late promise received after Snap finished execution. Promise will be dropped.")})).catch((e=>{t.lastTeardown===r?s(e):(0,i.log)("Late promise received after Snap finished execution. Promise will be dropped.")}))}))};var n=e("@metamask/utils"),s=e("eth-rpc-errors"),i=e("../logging");const o=Object.freeze(["wallet_requestSnaps","wallet_requestPermissions","eth_sendRawTransaction","eth_sendTransaction","eth_sign","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v3","eth_signTypedData_v4","eth_decrypt","eth_getEncryptionPublicKey","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_watchAsset","wallet_registerOnboarding","wallet_scanQRCode"]);r.BLOCKED_RPC_METHODS=o}}},{package:"$root$",file:"src/common/utils.ts"}],[209,{"./../../../snaps-utils/src/index.executionenv":215,"@metamask/utils":80,superstruct:185},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.TerminateRequestArgumentsStruct=r.SnapRpcRequestArgumentsStruct=r.PingRequestArgumentsStruct=r.OnTransactionRequestArgumentsStruct=r.JsonRpcRequestWithoutIdStruct=r.ExecuteSnapRequestArgumentsStruct=r.EndowmentStruct=void 0,r.assertIsOnTransactionRequestArguments=function(e){(0,s.assertStruct)(e,p,"Invalid request params")},r.isEndowment=c,r.isEndowmentsArray=function(e){return Array.isArray(e)&&e.every(c)};var n=e("./../../../snaps-utils/src/index.executionenv"),s=e("@metamask/utils"),i=e("superstruct");const o=(0,i.assign)((0,i.omit)(s.JsonRpcRequestStruct,["id"]),(0,i.object)({id:(0,i.optional)(s.JsonRpcIdStruct)}));r.JsonRpcRequestWithoutIdStruct=o;const a=(0,i.string)();function c(e){return(0,i.is)(e,a)}r.EndowmentStruct=a;const u=(0,i.literal)("OK"),l=(0,i.optional)((0,i.union)([(0,i.literal)(undefined),(0,i.array)()]));r.PingRequestArgumentsStruct=l;const d=(0,i.union)([(0,i.literal)(undefined),(0,i.array)()]);r.TerminateRequestArgumentsStruct=d;const h=(0,i.tuple)([(0,i.string)(),(0,i.string)(),(0,i.optional)((0,i.array)(a))]);r.ExecuteSnapRequestArgumentsStruct=h;const f=(0,i.tuple)([(0,i.string)(),(0,i.enums)(Object.values(n.HandlerType)),(0,i.string)(),(0,i.assign)(o,(0,i.object)({params:(0,i.optional)((0,i.record)((0,i.string)(),s.JsonStruct))}))]);r.SnapRpcRequestArgumentsStruct=f;const p=(0,i.object)({transaction:(0,i.record)((0,i.string)(),s.JsonStruct),chainId:n.ChainIdStruct,transactionOrigin:(0,i.nullable)((0,i.string)())});r.OnTransactionRequestArgumentsStruct=p;(0,i.assign)(s.JsonRpcSuccessStruct,(0,i.object)({result:u})),s.JsonRpcSuccessStruct}}},{package:"$root$",file:"src/common/validation.ts"}],[210,{"./../../snaps-utils/src/index.executionenv":215,"@metamask/utils":80},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.log=void 0;var n=e("./../../snaps-utils/src/index.executionenv");const s=(0,e("@metamask/utils").createModuleLogger)(n.snapsLogger,"snaps-execution-environments");r.log=s}}},{package:"$root$",file:"src/logging.ts"}],[211,{"../common/BaseSnapExecutor":191,"../logging":210,"./../../../snaps-utils/src/index.executionenv":215,"@metamask/object-multiplex":3,"@metamask/post-message-stream":18,pump:140},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ChildProcessSnapExecutor=void 0;var n=u(e("@metamask/object-multiplex")),s=e("@metamask/post-message-stream"),i=e("./../../../snaps-utils/src/index.executionenv"),o=u(e("pump")),a=e("../common/BaseSnapExecutor"),c=e("../logging");function u(e){return e&&e.__esModule?e:{default:e}}class l extends a.BaseSnapExecutor{static initialize(){(0,c.log)("Worker: Connecting to parent.");const e=new s.ProcessMessageStream,t=new n.default;(0,o.default)(e,t,e,(e=>{e&&(0,i.logError)("Parent stream failure, closing worker.",e),self.close()}));const r=t.createStream(i.SNAP_STREAM_NAMES.COMMAND),a=t.createStream(i.SNAP_STREAM_NAMES.JSON_RPC);return new l(r,a)}}r.ChildProcessSnapExecutor=l}}},{package:"$root$",file:"src/node-process/ChildProcessSnapExecutor.ts"}],[212,{"../common/lockdown/lockdown-more":206,"./ChildProcessSnapExecutor":211},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("../common/lockdown/lockdown-more"),s=e("./ChildProcessSnapExecutor");(0,n.executeLockdownMore)(),s.ChildProcessSnapExecutor.initialize()}}},{package:"$root$",file:"src/node-process/index.ts"}],[213,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports={openrpc:"1.2.4",info:{title:"MetaMask Snaps Execution Environment API",version:"0.0.0-development"},methods:[{name:"ping",description:"confirms that a connection has been established with the execution environment",params:[],result:{name:"PingResult",schema:{$ref:"#/components/schemas/OK"}}},{name:"terminate",description:"tells the execution environment that it is being shut down",params:[],result:{name:"TerminateResult",schema:{$ref:"#/components/schemas/OK"}}},{name:"executeSnap",description:"executes a snap in the environment. The snap can then be interacted with via `snapRpc`",params:[{name:"snapId",required:!0,description:"the name of the snap",schema:{title:"SnapName",type:"string"}},{name:"sourceCode",description:"a snaps source code that gets executed in the environment",required:!0,schema:{title:"SourceCode",type:"string"}},{name:"endowments",description:"A list of endowments to provide to SES",required:!1,schema:{title:"Endowments",description:"An array of the names of the endowments",type:"array",items:{title:"Endowment",type:"string"}}}],result:{name:"executeSnapResult",schema:{$ref:"#/components/schemas/OK"}},examples:[{name:"BasicTestSnapExecuteExample",params:[{name:"snapId",value:"TestSnap"},{name:"sourceCode",value:"module.exports.onRpcRequest = async ({ request }) => { return request.method + request.id }"}],result:{name:"BasicTestSnapExampleResult",value:"OK"}}]},{name:"snapRpc",params:[{name:"target",required:!0,description:"the name of the snap",schema:{title:"Target",type:"string"}},{name:"handler",required:!0,description:"the handler to trigger on the snap",schema:{title:"Handler",type:"string",enum:["onRpcRequest","onTransaction","onCronjob"]}},{name:"origin",required:!0,description:"Origin of the snap JSON-RPC request",schema:{title:"Origin",type:"string"}},{name:"request",required:!0,description:"JSON-RPC request",schema:{$ref:"#/components/schemas/JsonRpcRequest"}}],result:{name:"HandleSnapRpcResult",schema:{title:"SnapRpcResult"}},examples:[{name:"TestSnapExample",params:[{name:"target",value:"TestSnap"},{name:"origin",value:"foo.com"},{name:"request",value:{jsonrpc:"2.0",method:"hello",params:[],id:1}}],result:{name:"TestSnapResultExample",value:"hello1"}}]}],components:{schemas:{OK:{title:"OK",type:"string",const:"OK"},JsonRpcRequest:{title:"JsonRpcRequest",type:"object",required:["jsonrpc","method"],properties:{jsonrpc:{title:"JSONRPCString",type:"string",const:"2.0"},id:{title:"JSONRPCID",oneOf:[{type:"string"},{type:"number"}]},method:{title:"JSONRPCMethod",description:"the name of the method",type:"string"},params:{title:"JSONRPCParams",type:["array","object"]}}}}}}}}},{package:"$root$",file:"src/openrpc.json"}],[214,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.SNAP_EXPORTS=r.HandlerType=void 0;let n=function(e){return e.OnRpcRequest="onRpcRequest",e.OnTransaction="onTransaction",e.OnCronjob="onCronjob",e.OnInstall="onInstall",e.OnUpdate="onUpdate",e}({});r.HandlerType=n;const s={[n.OnRpcRequest]:{type:n.OnRpcRequest,required:!0,validator:e=>"function"==typeof e},[n.OnTransaction]:{type:n.OnTransaction,required:!0,validator:e=>"function"==typeof e},[n.OnCronjob]:{type:n.OnCronjob,required:!0,validator:e=>"function"==typeof e},[n.OnInstall]:{type:n.OnInstall,required:!1,validator:e=>"function"==typeof e},[n.OnUpdate]:{type:n.OnUpdate,required:!1,validator:e=>"function"==typeof e}};r.SNAP_EXPORTS=s}}},{package:"external:../snaps-utils/src/handlers.ts",file:"../snaps-utils/src/handlers.ts"}],[215,{"./handlers":214,"./logging":216,"./namespace":217,"./types":218},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e("./handlers");Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in r&&r[e]===n[e]||Object.defineProperty(r,e,{enumerable:!0,get:function(){return n[e]}}))}));var s=e("./logging");Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in r&&r[e]===s[e]||Object.defineProperty(r,e,{enumerable:!0,get:function(){return s[e]}}))}));var i=e("./namespace");Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in r&&r[e]===i[e]||Object.defineProperty(r,e,{enumerable:!0,get:function(){return i[e]}}))}));var o=e("./types");Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in r&&r[e]===o[e]||Object.defineProperty(r,e,{enumerable:!0,get:function(){return o[e]}}))}))}}},{package:"external:../snaps-utils/src/index.executionenv.ts",file:"../snaps-utils/src/index.executionenv.ts"}],[216,{"@metamask/utils":80},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.logError=function(e,...t){console.error(e,...t)},r.logInfo=function(e,...t){console.log(e,...t)},r.logWarning=function(e,...t){console.warn(e,...t)},r.snapsLogger=void 0;const n=(0,e("@metamask/utils").createProjectLogger)("snaps");r.snapsLogger=n}}},{package:"external:../snaps-utils/src/logging.ts",file:"../snaps-utils/src/logging.ts"}],[217,{superstruct:185},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.NamespaceStruct=r.NamespaceIdStruct=r.LimitedString=r.ChainStruct=r.ChainIdStruct=r.CHAIN_ID_REGEX=r.AccountIdStruct=r.AccountIdArrayStruct=r.ACCOUNT_ID_REGEX=void 0,r.isAccountId=function(e){return(0,n.is)(e,c)},r.isAccountIdArray=function(e){return(0,n.is)(e,u)},r.isChainId=function(e){return(0,n.is)(e,a)},r.isNamespace=function(e){return(0,n.is)(e,d)},r.isNamespaceId=function(e){return(0,n.is)(e,h)},r.parseAccountId=function(e){const t=i.exec(e);if(null==t||!t.groups)throw new Error("Invalid account ID.");return{address:t.groups.accountAddress,chainId:t.groups.chainId,chain:{namespace:t.groups.namespace,reference:t.groups.reference}}},r.parseChainId=function(e){const t=s.exec(e);if(null==t||!t.groups)throw new Error("Invalid chain ID.");return{namespace:t.groups.namespace,reference:t.groups.reference}};var n=e("superstruct");const s=/^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-a-zA-Z0-9]{1,32})$/u;r.CHAIN_ID_REGEX=s;const i=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-a-zA-Z0-9]{1,32})):(?<accountAddress>[a-zA-Z0-9]{1,64})$/u;r.ACCOUNT_ID_REGEX=i;const o=(0,n.size)((0,n.string)(),1,40);r.LimitedString=o;const a=(0,n.pattern)((0,n.string)(),s);r.ChainIdStruct=a;const c=(0,n.pattern)((0,n.string)(),i);r.AccountIdStruct=c;const u=(0,n.array)(c);r.AccountIdArrayStruct=u;const l=(0,n.object)({id:a,name:o});r.ChainStruct=l;const d=(0,n.object)({chains:(0,n.array)(l),methods:(0,n.optional)((0,n.array)(o)),events:(0,n.optional)((0,n.array)(o))});r.NamespaceStruct=d;const h=(0,n.pattern)((0,n.string)(),/^[-a-z0-9]{3,8}$/u);r.NamespaceIdStruct=h}}},{package:"external:../snaps-utils/src/namespace.ts",file:"../snaps-utils/src/namespace.ts"}],[218,{"./handlers":214,"@metamask/utils":80,superstruct:185},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.WALLET_SNAP_PERMISSION_KEY=r.SnapValidationFailureReason=r.SnapIdPrefixes=r.SNAP_STREAM_NAMES=r.SNAP_EXPORT_NAMES=r.NpmSnapPackageJsonStruct=r.NpmSnapFileNames=r.NameStruct=void 0,r.assertIsNpmSnapPackageJson=function(e){(0,n.assertStruct)(e,c,`"${o.PackageJson}" is invalid`)},r.isNpmSnapPackageJson=function(e){return(0,s.is)(e,c)},r.isValidUrl=function(e,t={}){return(0,s.is)(e,f(t))},r.uri=void 0;var n=e("@metamask/utils"),s=e("superstruct"),i=e("./handlers");let o=function(e){return e.PackageJson="package.json",e.Manifest="snap.manifest.json",e}({});r.NpmSnapFileNames=o;const a=(0,s.size)((0,s.pattern)((0,s.string)(),/^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/u),1,214);r.NameStruct=a;const c=(0,s.type)({version:n.VersionStruct,name:a,main:(0,s.optional)((0,s.size)((0,s.string)(),1,Infinity)),repository:(0,s.optional)((0,s.object)({type:(0,s.size)((0,s.string)(),1,Infinity),url:(0,s.size)((0,s.string)(),1,Infinity)}))});r.NpmSnapPackageJsonStruct=c;let u=function(e){return e.npm="npm:",e.local="local:",e}({});r.SnapIdPrefixes=u;let l=function(e){return e.NameMismatch='"name" field mismatch',e.VersionMismatch='"version" field mismatch',e.RepositoryMismatch='"repository" field mismatch',e.ShasumMismatch='"shasum" field mismatch',e}({});r.SnapValidationFailureReason=l;let d=function(e){return e.JSON_RPC="jsonRpc",e.COMMAND="command",e}({});r.SNAP_STREAM_NAMES=d;const h=Object.values(i.HandlerType);r.SNAP_EXPORT_NAMES=h;const f=(e={})=>(0,s.refine)((0,s.union)([(0,s.string)(),(0,s.instance)(URL)]),"uri",(t=>{try{const r=new URL(t),n=(0,s.type)(e);return(0,s.assert)(r,n),!0}catch{return`Expected URL, got "${t.toString()}".`}}));r.uri=f;r.WALLET_SNAP_PERMISSION_KEY="wallet_snap"}}},{package:"external:../snaps-utils/src/types.ts",file:"../snaps-utils/src/types.ts"}]],[212],{resources:{"@metamask/object-multiplex":{globals:{"console.warn":!0},packages:{"@metamask/object-multiplex>readable-stream":!0,"pump>end-of-stream":!0,"pump>once":!0}},"@metamask/object-multiplex>readable-stream":{builtin:{"events.EventEmitter":!0,stream:!0,"timers.setImmediate":!0,util:!0},globals:{"process.browser":!0,"process.env.READABLE_STREAM":!0,"process.stderr":!0,"process.stdout":!0,"process.version.slice":!0},packages:{"@metamask/object-multiplex>readable-stream>safe-buffer":!0,"@metamask/object-multiplex>readable-stream>string_decoder":!0,"browserify>inherits":!0,"browserify>readable-stream>core-util-is":!0,"browserify>readable-stream>isarray":!0,"browserify>readable-stream>process-nextick-args":!0,"browserify>readable-stream>util-deprecate":!0,events:!0,stream:!0,timers:!0,util:!0}},"@metamask/object-multiplex>readable-stream>safe-buffer":{builtin:{buffer:!0},packages:{buffer:!0}},"@metamask/object-multiplex>readable-stream>string_decoder":{packages:{"@metamask/object-multiplex>readable-stream>safe-buffer":!0}},"@metamask/post-message-stream":{builtin:{"worker_threads.parentPort":!0},globals:{"MessageEvent.prototype":!0,WorkerGlobalScope:!0,addEventListener:!0,browser:!0,chrome:!0,"location.origin":!0,postMessage:!0,"process.on":!0,"process.removeListener":!0,"process.send":!0,removeEventListener:!0},packages:{"@metamask/post-message-stream>@metamask/utils":!0,"@metamask/post-message-stream>readable-stream":!0,worker_threads:!0}},"@metamask/post-message-stream>@metamask/utils":{builtin:{"buffer.Buffer":!0},globals:{TextDecoder:!0,TextEncoder:!0},packages:{"@swc/cli>semver":!0,buffer:!0,"eslint>debug":!0,superstruct:!0}},"@metamask/post-message-stream>readable-stream":{builtin:{"events.EventEmitter":!0,stream:!0,"timers.setImmediate":!0,util:!0},globals:{"process.browser":!0,"process.env.READABLE_STREAM":!0,"process.stderr":!0,"process.stdout":!0,"process.version.slice":!0},packages:{"@metamask/post-message-stream>readable-stream>process-nextick-args":!0,"@metamask/post-message-stream>readable-stream>safe-buffer":!0,"@metamask/post-message-stream>readable-stream>string_decoder":!0,"browserify>inherits":!0,"browserify>readable-stream>core-util-is":!0,"browserify>readable-stream>isarray":!0,"browserify>readable-stream>util-deprecate":!0,events:!0,stream:!0,timers:!0,util:!0}},"@metamask/post-message-stream>readable-stream>process-nextick-args":{globals:{"process.nextTick":!0,"process.version":!0}},"@metamask/post-message-stream>readable-stream>safe-buffer":{builtin:{buffer:!0},packages:{buffer:!0}},"@metamask/post-message-stream>readable-stream>string_decoder":{packages:{"@metamask/post-message-stream>readable-stream>safe-buffer":!0}},"@metamask/providers":{globals:{Event:!0,addEventListener:!0,"chrome.runtime.connect":!0,console:!0,dispatchEvent:!0,"document.createElement":!0,"document.readyState":!0,ethereum:"write","location.hostname":!0,removeEventListener:!0,web3:!0},packages:{"@metamask/object-multiplex":!0,"@metamask/providers>@metamask/safe-event-emitter":!0,"@metamask/providers>detect-browser":!0,"@metamask/providers>extension-port-stream":!0,"@metamask/providers>fast-deep-equal":!0,"@metamask/providers>is-stream":!0,"@metamask/providers>json-rpc-middleware-stream":!0,"eth-rpc-errors":!0,"json-rpc-engine":!0,pump:!0}},"@metamask/providers>@metamask/safe-event-emitter":{builtin:{"events.EventEmitter":!0},globals:{setTimeout:!0},packages:{events:!0}},"@metamask/providers>detect-browser":{globals:{document:!0,navigator:!0,process:!0}},"@metamask/providers>extension-port-stream":{builtin:{"buffer.Buffer":!0,"stream.Duplex":!0},packages:{buffer:!0,stream:!0}},"@metamask/providers>json-rpc-middleware-stream":{globals:{"console.warn":!0,setTimeout:!0},packages:{"@metamask/providers>json-rpc-middleware-stream>readable-stream":!0,"json-rpc-engine>@metamask/safe-event-emitter":!0}},"@metamask/providers>json-rpc-middleware-stream>readable-stream":{builtin:{"events.EventEmitter":!0,stream:!0,"timers.setImmediate":!0,util:!0},globals:{"process.browser":!0,"process.env.READABLE_STREAM":!0,"process.stderr":!0,"process.stdout":!0,"process.version.slice":!0},packages:{"@metamask/providers>json-rpc-middleware-stream>readable-stream>safe-buffer":!0,"@metamask/providers>json-rpc-middleware-stream>readable-stream>string_decoder":!0,"browserify>inherits":!0,"browserify>readable-stream>core-util-is":!0,"browserify>readable-stream>isarray":!0,"browserify>readable-stream>process-nextick-args":!0,"browserify>readable-stream>util-deprecate":!0,events:!0,stream:!0,timers:!0,util:!0}},"@metamask/providers>json-rpc-middleware-stream>readable-stream>safe-buffer":{builtin:{buffer:!0},packages:{buffer:!0}},"@metamask/providers>json-rpc-middleware-stream>readable-stream>string_decoder":{packages:{"@metamask/providers>json-rpc-middleware-stream>readable-stream>safe-buffer":!0}},"@metamask/utils":{builtin:{"buffer.Buffer":!0},globals:{TextDecoder:!0,TextEncoder:!0},packages:{"@metamask/utils>@noble/hashes":!0,"@swc/cli>semver":!0,buffer:!0,"eslint>debug":!0,superstruct:!0}},"@metamask/utils>@noble/hashes":{globals:{TextEncoder:!0,crypto:!0}},"@swc/cli>semver":{globals:{"console.error":!0,process:!0},packages:{"@swc/cli>semver>lru-cache":!0}},"@swc/cli>semver>lru-cache":{packages:{"@swc/cli>semver>lru-cache>yallist":!0}},"@wdio/mocha-framework>mocha>supports-color":{builtin:{"os.release":!0,"tty.isatty":!0},globals:{"process.env":!0,"process.platform":!0},packages:{"istanbul-lib-report>supports-color>has-flag":!0,os:!0,tty:!0}},"browserify>inherits":{builtin:{"util.inherits":!0},packages:{util:!0}},"browserify>readable-stream>core-util-is":{packages:{"browserify>insert-module-globals>is-buffer":!0}},"browserify>readable-stream>process-nextick-args":{globals:{process:!0}},"browserify>readable-stream>util-deprecate":{builtin:{"util.deprecate":!0},packages:{util:!0}},"eslint>debug":{builtin:{"tty.isatty":!0,"util.deprecate":!0,"util.format":!0,"util.inspect":!0},globals:{console:!0,document:!0,localStorage:!0,navigator:!0,process:!0},packages:{"@wdio/mocha-framework>mocha>supports-color":!0,"eslint>debug>ms":!0,tty:!0,util:!0}},"eth-rpc-errors":{packages:{"eth-rpc-errors>fast-safe-stringify":!0}},"external:../snaps-utils/src/icon.ts":{builtin:{buffer:!0}},"external:../snaps-utils/src/index.executionenv.ts":{packages:{"external:../snaps-utils/src/handlers.ts":!0,"external:../snaps-utils/src/logging.ts":!0,"external:../snaps-utils/src/namespace.ts":!0,"external:../snaps-utils/src/types.ts":!0}},"external:../snaps-utils/src/logging.ts":{globals:{"console.error":!0,"console.log":!0,"console.warn":!0},packages:{"@metamask/utils":!0}},"external:../snaps-utils/src/namespace.ts":{packages:{superstruct:!0}},"external:../snaps-utils/src/types.ts":{globals:{URL:!0},packages:{"@metamask/utils":!0,"external:../snaps-utils/src/handlers.ts":!0,superstruct:!0}},"istanbul-lib-report>supports-color>has-flag":{globals:{"process.argv":!0}},"json-rpc-engine":{packages:{"eth-rpc-errors":!0,"json-rpc-engine>@metamask/safe-event-emitter":!0}},"json-rpc-engine>@metamask/safe-event-emitter":{builtin:{"events.EventEmitter":!0},globals:{setTimeout:!0},packages:{events:!0}},pump:{builtin:{fs:!0},globals:{"process.version":!0},packages:{fs:!0,"pump>end-of-stream":!0,"pump>once":!0}},"pump>end-of-stream":{globals:{"process.nextTick":!0},packages:{"pump>once":!0}},"pump>once":{packages:{"pump>once>wrappy":!0}},superstruct:{globals:{"console.warn":!0,define:!0}}}});
|
|
12151
|
+
t.exports=function(e){return null!=e&&(n(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}(e)||!!e._isBuffer)}}}},{package:"browserify>insert-module-globals>is-buffer",file:"../../node_modules/is-buffer/index.js"}],[114,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;n.writable=e=>n(e)&&!1!==e.writable&&"function"==typeof e._write&&"object"==typeof e._writableState,n.readable=e=>n(e)&&!1!==e.readable&&"function"==typeof e._read&&"object"==typeof e._readableState,n.duplex=e=>n.writable(e)&&n.readable(e),n.transform=e=>n.duplex(e)&&"function"==typeof e._transform&&"object"==typeof e._transformState,t.exports=n}}},{package:"@metamask/providers>is-stream",file:"../../node_modules/is-stream/index.js"}],[115,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}}}},{package:"browserify>readable-stream>isarray",file:"../../node_modules/isarray/index.js"}],[116,{"@metamask/safe-event-emitter":70,"eth-rpc-errors":105},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.JsonRpcEngine=void 0;const s=n(e("@metamask/safe-event-emitter")),i=e("eth-rpc-errors");class o extends s.default{constructor(){super(),this._middleware=[]}push(e){this._middleware.push(e)}handle(e,t){if(t&&"function"!=typeof t)throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?t?this._handleBatch(e,t):this._handleBatch(e):t?this._handle(e,t):this._promiseHandle(e)}asMiddleware(){return async(e,t,r,n)=>{try{const[s,i,a]=await o._runAllMiddleware(e,t,this._middleware);return i?(await o._runReturnHandlers(a),n(s)):r((async e=>{try{await o._runReturnHandlers(a)}catch(t){return e(t)}return e()}))}catch(e){return n(e)}}}async _handleBatch(e,t){try{const r=await Promise.all(e.map(this._promiseHandle.bind(this)));return t?t(null,r):r}catch(e){if(t)return t(e);throw e}}_promiseHandle(e){return new Promise((t=>{this._handle(e,((e,r)=>{t(r)}))}))}async _handle(e,t){if(!e||Array.isArray(e)||"object"!=typeof e){const r=new i.EthereumRpcError(i.errorCodes.rpc.invalidRequest,"Requests must be plain objects. Received: "+typeof e,{request:e});return t(r,{id:undefined,jsonrpc:"2.0",error:r})}if("string"!=typeof e.method){const r=new i.EthereumRpcError(i.errorCodes.rpc.invalidRequest,"Must specify a string method. Received: "+typeof e.method,{request:e});return t(r,{id:e.id,jsonrpc:"2.0",error:r})}const r=Object.assign({},e),n={id:r.id,jsonrpc:r.jsonrpc};let s=null;try{await this._processRequest(r,n)}catch(e){s=e}return s&&(delete n.result,n.error||(n.error=i.serializeError(s))),t(s,n)}async _processRequest(e,t){const[r,n,s]=await o._runAllMiddleware(e,t,this._middleware);if(o._checkForCompletion(e,t,n),await o._runReturnHandlers(s),r)throw r}static async _runAllMiddleware(e,t,r){const n=[];let s=null,i=!1;for(const a of r)if([s,i]=await o._runMiddleware(e,t,a,n),i)break;return[s,i,n.reverse()]}static _runMiddleware(e,t,r,n){return new Promise((s=>{const o=e=>{const r=e||t.error;r&&(t.error=i.serializeError(r)),s([r,!0])},c=r=>{t.error?o(t.error):(r&&("function"!=typeof r&&o(new i.EthereumRpcError(i.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof r}" for request:\n${a(e)}`,{request:e})),n.push(r)),s([null,!1]))};try{r(e,t,c,o)}catch(e){o(e)}}))}static async _runReturnHandlers(e){for(const t of e)await new Promise(((e,r)=>{t((t=>t?r(t):e()))}))}static _checkForCompletion(e,t,r){if(!("result"in t)&&!("error"in t))throw new i.EthereumRpcError(i.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:\n${a(e)}`,{request:e});if(!r)throw new i.EthereumRpcError(i.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:\n${a(e)}`,{request:e})}}function a(e){return JSON.stringify(e,null,2)}r.JsonRpcEngine=o}}},{package:"json-rpc-engine",file:"../../node_modules/json-rpc-engine/dist/JsonRpcEngine.js"}],[117,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createAsyncMiddleware=void 0,r.createAsyncMiddleware=function(e){return async(t,r,n,s)=>{let i;const o=new Promise((e=>{i=e}));let a=null,c=!1;const u=async()=>{c=!0,n((e=>{a=e,i()})),await o};try{await e(t,r,u),c?(await o,a(null)):s(null)}catch(e){a?a(e):s(e)}}}}}},{package:"json-rpc-engine",file:"../../node_modules/json-rpc-engine/dist/createAsyncMiddleware.js"}],[118,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createScaffoldMiddleware=void 0,r.createScaffoldMiddleware=function(e){return(t,r,n,s)=>{const i=e[t.method];return i===undefined?n():"function"==typeof i?i(t,r,n,s):(r.result=i,s())}}}}},{package:"json-rpc-engine",file:"../../node_modules/json-rpc-engine/dist/createScaffoldMiddleware.js"}],[119,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getUniqueId=void 0;const n=4294967295;let s=Math.floor(Math.random()*n);r.getUniqueId=function(){return s=(s+1)%n,s}}}},{package:"json-rpc-engine",file:"../../node_modules/json-rpc-engine/dist/getUniqueId.js"}],[120,{"./getUniqueId":119},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createIdRemapMiddleware=void 0;const n=e("./getUniqueId");r.createIdRemapMiddleware=function(){return(e,t,r,s)=>{const i=e.id,o=n.getUniqueId();e.id=o,t.id=o,r((r=>{e.id=i,t.id=i,r()}))}}}}},{package:"json-rpc-engine",file:"../../node_modules/json-rpc-engine/dist/idRemapMiddleware.js"}],[121,{"./JsonRpcEngine":116,"./createAsyncMiddleware":117,"./createScaffoldMiddleware":118,"./getUniqueId":119,"./idRemapMiddleware":120,"./mergeMiddleware":122},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./idRemapMiddleware"),r),s(e("./createAsyncMiddleware"),r),s(e("./createScaffoldMiddleware"),r),s(e("./getUniqueId"),r),s(e("./JsonRpcEngine"),r),s(e("./mergeMiddleware"),r)}}},{package:"json-rpc-engine",file:"../../node_modules/json-rpc-engine/dist/index.js"}],[122,{"./JsonRpcEngine":116},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.mergeMiddleware=void 0;const n=e("./JsonRpcEngine");r.mergeMiddleware=function(e){const t=new n.JsonRpcEngine;return e.forEach((e=>t.push(e))),t.asMiddleware()}}}},{package:"json-rpc-engine",file:"../../node_modules/json-rpc-engine/dist/mergeMiddleware.js"}],[123,{"readable-stream":135},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});const n=e("readable-stream");r.default=function(e){if(!e||!e.engine)throw new Error("Missing engine parameter!");const{engine:t}=e,r=new n.Duplex({objectMode:!0,read:()=>undefined,write:function(e,n,s){t.handle(e,((e,t)=>{r.push(t)})),s()}});return t.on&&t.on("notification",(e=>{r.push(e)})),r}}}},{package:"@metamask/providers>json-rpc-middleware-stream",file:"../../node_modules/json-rpc-middleware-stream/dist/createEngineStream.js"}],[124,{"@metamask/safe-event-emitter":70,"readable-stream":135},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const s=n(e("@metamask/safe-event-emitter")),i=e("readable-stream");r.default=function(e={}){const t={},r=new i.Duplex({objectMode:!0,read:()=>undefined,write:function(r,s,i){let a=null;try{!r.id?function(r){(null==e?void 0:e.retryOnMessage)&&r.method===e.retryOnMessage&&Object.values(t).forEach((({req:e,retryCount:r=0})=>{if(e.id){if(r>=3)throw new Error(`StreamMiddleware - Retry limit exceeded for request id "${e.id}"`);t[e.id].retryCount=r+1,o(e)}}));n.emit("notification",r)}(r):function(e){const r=t[e.id];if(!r)return void console.warn(`StreamMiddleware - Unknown response id "${e.id}"`);delete t[e.id],Object.assign(r.res,e),setTimeout(r.end)}(r)}catch(e){a=e}i(a)}}),n=new s.default;return{events:n,middleware:(e,r,n,s)=>{o(e),t[e.id]={req:e,res:r,next:n,end:s}},stream:r};function o(e){r.push(e)}}}}},{package:"@metamask/providers>json-rpc-middleware-stream",file:"../../node_modules/json-rpc-middleware-stream/dist/createStreamMiddleware.js"}],[125,{"./createEngineStream":123,"./createStreamMiddleware":124},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.createStreamMiddleware=r.createEngineStream=void 0;const s=n(e("./createEngineStream"));r.createEngineStream=s.default;const i=n(e("./createStreamMiddleware"));r.createStreamMiddleware=i.default}}},{package:"@metamask/providers>json-rpc-middleware-stream",file:"../../node_modules/json-rpc-middleware-stream/dist/index.js"}],[126,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){"undefined"==typeof process||!process.version||0===process.version.indexOf("v0.")||0===process.version.indexOf("v1.")&&0!==process.version.indexOf("v1.8.")?t.exports={nextTick:function(e,t,r,n){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var s,i,o=arguments.length;switch(o){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick((function(){e.call(null,t)}));case 3:return process.nextTick((function(){e.call(null,t,r)}));case 4:return process.nextTick((function(){e.call(null,t,r,n)}));default:for(s=new Array(o-1),i=0;i<s.length;)s[i++]=arguments[i];return process.nextTick((function(){e.apply(null,s)}))}}}:t.exports=process}}},{package:"@metamask/providers>json-rpc-middleware-stream>readable-stream>process-nextick-args",file:"../../node_modules/json-rpc-middleware-stream/node_modules/process-nextick-args/index.js"}],[127,{"./_stream_readable":129,"./_stream_writable":131,"core-util-is":94,inherits:111,"process-nextick-args":126},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("process-nextick-args"),s=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=d;var i=Object.create(e("core-util-is"));i.inherits=e("inherits");var o=e("./_stream_readable"),a=e("./_stream_writable");i.inherits(d,o);for(var c=s(a.prototype),u=0;u<c.length;u++){var l=c[u];d.prototype[l]||(d.prototype[l]=a.prototype[l])}function d(e){if(!(this instanceof d))return new d(e);o.call(this,e),a.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||n.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(d.prototype,"destroyed",{get:function(){return this._readableState!==undefined&&this._writableState!==undefined&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){this._readableState!==undefined&&this._writableState!==undefined&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),d.prototype._destroy=function(e,t){this.push(null),this.end(),n.nextTick(t,e)}}}},{package:"@metamask/providers>json-rpc-middleware-stream>readable-stream",file:"../../node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/_stream_duplex.js"}],[128,{"./_stream_transform":130,"core-util-is":94,inherits:111},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=i;var n=e("./_stream_transform"),s=Object.create(e("core-util-is"));function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}s.inherits=e("inherits"),s.inherits(i,n),i.prototype._transform=function(e,t,r){r(null,e)}}}},{package:"@metamask/providers>json-rpc-middleware-stream>readable-stream",file:"../../node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/_stream_passthrough.js"}],[129,{"./_stream_duplex":127,"./internal/streams/BufferList":132,"./internal/streams/destroy":133,"./internal/streams/stream":134,"core-util-is":94,events:"events",inherits:111,isarray:115,"process-nextick-args":126,"safe-buffer":136,"string_decoder/":137,util:"util"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("process-nextick-args");t.exports=w;var s,i=e("isarray");w.ReadableState=b;e("events").EventEmitter;var o=function(e,t){return e.listeners(t).length},a=e("./internal/streams/stream"),c=e("safe-buffer").Buffer,u=global.Uint8Array||function(){};var l=Object.create(e("core-util-is"));l.inherits=e("inherits");var d=e("util"),h=void 0;h=d&&d.debuglog?d.debuglog("stream"):function(){};var f,p=e("./internal/streams/BufferList"),m=e("./internal/streams/destroy");l.inherits(w,a);var g=["error","close","destroy","pause","resume"];function b(t,r){t=t||{};var n=r instanceof(s=s||e("./_stream_duplex"));this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,o=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(o||0===o)?o:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new p,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.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(f||(f=e("string_decoder/").StringDecoder),this.decoder=new f(t.encoding),this.encoding=t.encoding)}function w(t){if(s=s||e("./_stream_duplex"),!(this instanceof w))return new w(t);this._readableState=new b(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function y(e,t,r,n,s){var i,o=e._readableState;null===t?(o.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,k(e)}(e,o)):(s||(i=function(e,t){var r;n=t,c.isBuffer(n)||n instanceof u||"string"==typeof t||t===undefined||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(o,t)),i?e.emit("error",i):o.objectMode||t&&t.length>0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):v(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?v(e,o,t,!1):T(e,o)):v(e,o,t,!1))):n||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(o)}function v(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&k(e)),T(e,t)}Object.defineProperty(w.prototype,"destroyed",{get:function(){return this._readableState!==undefined&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),w.prototype.destroy=m.destroy,w.prototype._undestroy=m.undestroy,w.prototype._destroy=function(e,t){this.push(null),t(e)},w.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=c.from(e,t),t=""),r=!0),y(this,e,t,!1,r)},w.prototype.unshift=function(e){return y(this,e,null,!0,!1)},w.prototype.isPaused=function(){return!1===this._readableState.flowing},w.prototype.setEncoding=function(t){return f||(f=e("string_decoder/").StringDecoder),this._readableState.decoder=new f(t),this._readableState.encoding=t,this};var _=8388608;function S(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>=_?e=_:(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 k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?n.nextTick(E,e):E(e))}function E(e){h("emit readable"),e.emit("readable"),M(e)}function T(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(x,e,t))}function x(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(h("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function R(e){h("readable nexttick read 0"),e.read(0)}function j(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),M(e),t.flowing&&!t.reading&&e.read(0)}function M(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&null!==e.read(););}function O(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,s=r.data;e-=s.length;for(;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(o===i.length?s+=i:s+=i.slice(0,e),0===(e-=o)){o===i.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(o));break}++n}return t.length-=n,s}(e,t):function(e,t){var r=c.allocUnsafe(e),n=t.head,s=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var i=n.data,o=e>i.length?i.length:e;if(i.copy(r,r.length-e,0,o),0===(e-=o)){o===i.length?(++s,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(o));break}++s}return t.length-=s,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function P(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,n.nextTick(C,t,e))}function C(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function I(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}w.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?P(this):k(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&P(this),null;var n,s=t.needReadable;return h("need readable",s),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",s=!0),t.ended||t.reading?h("reading or ended",s=!1):s&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=S(r,t))),null===(n=e>0?O(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&P(this)),null!==n&&this.emit("data",n),n},w.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},w.prototype.pipe=function(e,t){var r=this,s=this._readableState;switch(s.pipesCount){case 0:s.pipes=e;break;case 1:s.pipes=[s.pipes,e];break;default:s.pipes.push(e)}s.pipesCount+=1,h("pipe count=%d opts=%j",s.pipesCount,t);var a=(!t||!1!==t.end)&&e!==process.stdout&&e!==process.stderr?u:w;function c(t,n){h("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,h("cleanup"),e.removeListener("close",g),e.removeListener("finish",b),e.removeListener("drain",l),e.removeListener("error",m),e.removeListener("unpipe",c),r.removeListener("end",u),r.removeListener("end",w),r.removeListener("data",p),d=!0,!s.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function u(){h("onend"),e.end()}s.endEmitted?n.nextTick(a):r.once("end",a),e.on("unpipe",c);var l=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,M(e))}}(r);e.on("drain",l);var d=!1;var f=!1;function p(t){h("ondata"),f=!1,!1!==e.write(t)||f||((1===s.pipesCount&&s.pipes===e||s.pipesCount>1&&-1!==I(s.pipes,e))&&!d&&(h("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,f=!0),r.pause())}function m(t){h("onerror",t),w(),e.removeListener("error",m),0===o(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",b),w()}function b(){h("onfinish"),e.removeListener("close",g),w()}function w(){h("unpipe"),r.unpipe(e)}return r.on("data",p),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?i(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",m),e.once("close",g),e.once("finish",b),e.emit("pipe",r),s.flowing||(h("pipe resume"),r.resume()),e},w.prototype.unpipe=function(e){var t=this._readableState,r={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,r)),this;if(!e){var n=t.pipes,s=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<s;i++)n[i].emit("unpipe",this,r);return this}var o=I(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},w.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var s=this._readableState;s.endEmitted||s.readableListening||(s.readableListening=s.needReadable=!0,s.emittedReadable=!1,s.reading?s.length&&k(this):n.nextTick(R,this))}return r},w.prototype.addListener=w.prototype.on,w.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(j,e,t))}(this,e)),this},w.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this},w.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var s in e.on("end",(function(){if(h("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(s){(h("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!r.objectMode||null!==s&&s!==undefined)&&((r.objectMode||s&&s.length)&&(t.push(s)||(n=!0,e.pause())))})),e)this[s]===undefined&&"function"==typeof e[s]&&(this[s]=function(t){return function(){return e[t].apply(e,arguments)}}(s));for(var i=0;i<g.length;i++)e.on(g[i],this.emit.bind(this,g[i]));return this._read=function(t){h("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(w.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),w._fromList=O}}},{package:"@metamask/providers>json-rpc-middleware-stream>readable-stream",file:"../../node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/_stream_readable.js"}],[130,{"./_stream_duplex":127,"core-util-is":94,inherits:111},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=o;var n=e("./_stream_duplex"),s=Object.create(e("core-util-is"));function i(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var s=this._readableState;s.reading=!1,(s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}function o(e){if(!(this instanceof o))return new o(e);n.call(this,e),this._transformState={afterTransform:i.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",a)}function a(){var e=this;"function"==typeof this._flush?this._flush((function(t,r){c(e,t,r)})):c(this,null,null)}function c(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}s.inherits=e("inherits"),s.inherits(o,n),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},o.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},o.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var s=this._readableState;(n.needTransform||s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}},o.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},o.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,(function(e){t(e),r.emit("close")}))}}}},{package:"@metamask/providers>json-rpc-middleware-stream>readable-stream",file:"../../node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/_stream_transform.js"}],[131,{"./_stream_duplex":127,"./internal/streams/destroy":133,"./internal/streams/stream":134,"core-util-is":94,inherits:111,"process-nextick-args":126,"safe-buffer":136,timers:"timers","util-deprecate":188},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(r){(function(){var n=e("process-nextick-args");function s(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var s=n.callback;t.pendingcb--,s(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}t.exports=g;var i,o=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?r:n.nextTick;g.WritableState=m;var a=Object.create(e("core-util-is"));a.inherits=e("inherits");var c={deprecate:e("util-deprecate")},u=e("./internal/streams/stream"),l=e("safe-buffer").Buffer,d=global.Uint8Array||function(){};var h,f=e("./internal/streams/destroy");function p(){}function m(t,r){i=i||e("./_stream_duplex"),t=t||{};var a=r instanceof i;this.objectMode=!!t.objectMode,a&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var c=t.highWaterMark,u=t.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=c||0===c?c:a&&(u||0===u)?u:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var d=!1===t.decodeStrings;this.decodeStrings=!d,this.defaultEncoding=t.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 r=e._writableState,s=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,s,i){--t.pendingcb,r?(n.nextTick(i,s),n.nextTick(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",s)):(i(s),e._writableState.errorEmitted=!0,e.emit("error",s),S(e,t))}(e,r,s,t,i);else{var a=v(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||y(e,r),s?o(w,e,r,a,i):w(e,r,a,i)}}(r,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function g(t){if(i=i||e("./_stream_duplex"),!(h.call(g,this)||this instanceof i))return new g(t);this._writableState=new m(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),u.call(this)}function b(e,t,r,n,s,i,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(s,t.onwrite):e._write(s,i,t.onwrite),t.sync=!1}function w(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),S(e,t)}function y(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var a=0,c=!0;r;)i[a]=r,r.isBuf||(c=!1),r=r.next,a+=1;i.allBuffers=c,b(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new s(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,d=r.callback;if(b(e,t,!1,t.objectMode?1:u.length,u,l,d),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function v(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function _(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),S(e,t)}))}function S(e,t){var r=v(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,n.nextTick(_,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}a.inherits(g,u),m.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(m.prototype,"buffer",{get:c.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]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(e){return!!h.call(this,e)||this===g&&(e&&e._writableState instanceof m)}})):h=function(e){return e instanceof this},g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},g.prototype.write=function(e,t,r){var s,i=this._writableState,o=!1,a=!i.objectMode&&(s=e,l.isBuffer(s)||s instanceof d);return a&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=p),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),n.nextTick(t,r)}(this,r):(a||function(e,t,r,s){var i=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||r===undefined||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),n.nextTick(s,o),i=!1),i}(this,i,e,r))&&(i.pendingcb++,o=function(e,t,r,n,s,i){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,r));return t}(t,n,s);n!==o&&(r=!0,s="buffer",n=o)}var a=t.objectMode?1:n.length;t.length+=a;var c=t.length<t.highWaterMark;c||(t.needDrain=!0);if(t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:s,isBuf:r,callback:i,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else b(e,t,!1,a,n,s,i);return c}(this,i,a,e,t,r)),o},g.prototype.cork=function(){this._writableState.corked++},g.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||y(this,e))},g.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 TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),g.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(e,t,r){var s=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!==e&&e!==undefined&&this.write(e,t),s.corked&&(s.corked=1,this.uncork()),s.ending||s.finished||function(e,t,r){t.ending=!0,S(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,s,r)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return this._writableState!==undefined&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),g.prototype.destroy=f.destroy,g.prototype._undestroy=f.undestroy,g.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this)}).call(this,e("timers").setImmediate)}}},{package:"@metamask/providers>json-rpc-middleware-stream>readable-stream",file:"../../node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/_stream_writable.js"}],[132,{"safe-buffer":136,util:"util"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("safe-buffer").Buffer,s=e("util");t.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}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=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}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t,r,s,i=n.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=i,s=a,t.copy(r,s),a+=o.data.length,o=o.next;return i},e}(),s&&s.inspect&&s.inspect.custom&&(t.exports.prototype[s.inspect.custom]=function(){var e=s.inspect({length:this.length});return this.constructor.name+" "+e})}}},{package:"@metamask/providers>json-rpc-middleware-stream>readable-stream",file:"../../node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js"}],[133,{"process-nextick-args":126},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("process-nextick-args");function s(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return i||o?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n.nextTick(s,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(n.nextTick(s,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})),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.finished=!1,this._writableState.errorEmitted=!1)}}}}},{package:"@metamask/providers>json-rpc-middleware-stream>readable-stream",file:"../../node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/internal/streams/destroy.js"}],[134,{stream:"stream"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=e("stream")}}},{package:"@metamask/providers>json-rpc-middleware-stream>readable-stream",file:"../../node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/internal/streams/stream.js"}],[135,{"./lib/_stream_duplex.js":127,"./lib/_stream_passthrough.js":128,"./lib/_stream_readable.js":129,"./lib/_stream_transform.js":130,"./lib/_stream_writable.js":131,stream:"stream"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("stream");"disable"===process.env.READABLE_STREAM&&n?(t.exports=n,(r=t.exports=n.Readable).Readable=n.Readable,r.Writable=n.Writable,r.Duplex=n.Duplex,r.Transform=n.Transform,r.PassThrough=n.PassThrough,r.Stream=n):((r=t.exports=e("./lib/_stream_readable.js")).Stream=n||r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"))}}},{package:"@metamask/providers>json-rpc-middleware-stream>readable-stream",file:"../../node_modules/json-rpc-middleware-stream/node_modules/readable-stream/readable.js"}],[136,{buffer:"buffer"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("buffer"),s=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return s(e,t,r)}s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow?t.exports=n:(i(n,r),r.Buffer=o),i(s,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return s(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=s(e);return t!==undefined?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return s(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}}}},{package:"@metamask/providers>json-rpc-middleware-stream>readable-stream>safe-buffer",file:"../../node_modules/json-rpc-middleware-stream/node_modules/safe-buffer/index.js"}],[137,{"safe-buffer":136},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("safe-buffer").Buffer,s=n.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 i(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&&(n.isEncoding===s||!s(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=l,this.end=d,t=3;break;default:return this.write=h,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){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 r!==undefined?r: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 c(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?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-r))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}r.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if((t=this.fillLast(e))===undefined)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var s=o(t[n]);if(s>=0)return s>0&&(e.lastNeed=s-1),s;if(--n<r||-2===s)return 0;if(s=o(t[n]),s>=0)return s>0&&(e.lastNeed=s-2),s;if(--n<r||-2===s)return 0;if(s=o(t[n]),s>=0)return s>0&&(2===s?s=0:e.lastNeed=s-3),s;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},i.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}}}},{package:"@metamask/providers>json-rpc-middleware-stream>readable-stream>string_decoder",file:"../../node_modules/json-rpc-middleware-stream/node_modules/string_decoder/lib/string_decoder.js"}],[138,{yallist:191},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("yallist"),s=Symbol("max"),i=Symbol("length"),o=Symbol("lengthCalculator"),a=Symbol("allowStale"),c=Symbol("maxAge"),u=Symbol("dispose"),l=Symbol("noDisposeOnSet"),d=Symbol("lruList"),h=Symbol("cache"),f=Symbol("updateAgeOnGet"),p=()=>1;const m=(e,t,r)=>{const n=e[h].get(t);if(n){const t=n.value;if(g(e,t)){if(w(e,n),!e[a])return undefined}else r&&(e[f]&&(n.value.now=Date.now()),e[d].unshiftNode(n));return t.value}},g=(e,t)=>{if(!t||!t.maxAge&&!e[c])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[c]&&r>e[c]},b=e=>{if(e[i]>e[s])for(let t=e[d].tail;e[i]>e[s]&&null!==t;){const r=t.prev;w(e,t),t=r}},w=(e,t)=>{if(t){const r=t.value;e[u]&&e[u](r.key,r.value),e[i]-=r.length,e[h].delete(r.key),e[d].removeNode(t)}};class y{constructor(e,t,r,n,s){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=s||0}}const v=(e,t,r,n)=>{let s=r.value;g(e,s)&&(w(e,r),e[a]||(s=undefined)),s&&t.call(n,s.value,s.key,e)};t.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[s]=e.max||Infinity;const t=e.length||p;if(this[o]="function"!=typeof t?p:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[c]=e.maxAge||0,this[u]=e.dispose,this[l]=e.noDisposeOnSet||!1,this[f]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[s]=e||Infinity,b(this)}get max(){return this[s]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[c]=e,b(this)}get maxAge(){return this[c]}set lengthCalculator(e){"function"!=typeof e&&(e=p),e!==this[o]&&(this[o]=e,this[i]=0,this[d].forEach((e=>{e.length=this[o](e.value,e.key),this[i]+=e.length}))),b(this)}get lengthCalculator(){return this[o]}get length(){return this[i]}get itemCount(){return this[d].length}rforEach(e,t){t=t||this;for(let r=this[d].tail;null!==r;){const n=r.prev;v(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[d].head;null!==r;){const n=r.next;v(this,e,r,t),r=n}}keys(){return this[d].toArray().map((e=>e.key))}values(){return this[d].toArray().map((e=>e.value))}reset(){this[u]&&this[d]&&this[d].length&&this[d].forEach((e=>this[u](e.key,e.value))),this[h]=new Map,this[d]=new n,this[i]=0}dump(){return this[d].map((e=>!g(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[d]}set(e,t,r){if((r=r||this[c])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,a=this[o](t,e);if(this[h].has(e)){if(a>this[s])return w(this,this[h].get(e)),!1;const o=this[h].get(e).value;return this[u]&&(this[l]||this[u](e,o.value)),o.now=n,o.maxAge=r,o.value=t,this[i]+=a-o.length,o.length=a,this.get(e),b(this),!0}const f=new y(e,t,a,n,r);return f.length>this[s]?(this[u]&&this[u](e,t),!1):(this[i]+=f.length,this[d].unshift(f),this[h].set(e,this[d].head),b(this),!0)}has(e){if(!this[h].has(e))return!1;const t=this[h].get(e).value;return!g(this,t)}get(e){return m(this,e,!0)}peek(e){return m(this,e,!1)}pop(){const e=this[d].tail;return e?(w(this,e),e.value):null}del(e){w(this,this[h].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],s=n.e||0;if(0===s)this.set(n.k,n.v);else{const e=s-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[h].forEach(((e,t)=>m(this,t,!1)))}}}}},{package:"@swc/cli>semver>lru-cache",file:"../../node_modules/lru-cache/index.js"}],[139,{wrappy:189},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("wrappy");function s(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function i(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}t.exports=n(s),t.exports.strict=n(i),s.proto=s((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return s(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return i(this)},configurable:!0})}))}}},{package:"pump>once",file:"../../node_modules/once/once.js"}],[140,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){!process.version||0===process.version.indexOf("v0.")||0===process.version.indexOf("v1.")&&0!==process.version.indexOf("v1.8.")?t.exports=function(e,t,r,n){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var s,i,o=arguments.length;switch(o){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick((function(){e.call(null,t)}));case 3:return process.nextTick((function(){e.call(null,t,r)}));case 4:return process.nextTick((function(){e.call(null,t,r,n)}));default:for(s=new Array(o-1),i=0;i<s.length;)s[i++]=arguments[i];return process.nextTick((function(){e.apply(null,s)}))}}:t.exports=process.nextTick}}},{package:"@metamask/post-message-stream>readable-stream>process-nextick-args",file:"../../node_modules/process-nextick-args/index.js"}],[141,{"end-of-stream":101,fs:"fs",once:139},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("once"),s=e("end-of-stream"),i=e("fs"),o=function(){},a=/^v?\.0/.test(process.version),c=function(e){return"function"==typeof e},u=function(e,t,r,u){u=n(u);var l=!1;e.on("close",(function(){l=!0})),s(e,{readable:t,writable:r},(function(e){if(e)return u(e);l=!0,u()}));var d=!1;return function(t){if(!l&&!d)return d=!0,function(e){return!!a&&!!i&&(e instanceof(i.ReadStream||o)||e instanceof(i.WriteStream||o))&&c(e.close)}(e)?e.close(o):function(e){return e.setHeader&&c(e.abort)}(e)?e.abort():c(e.destroy)?e.destroy():void u(t||new Error("stream was destroyed"))}},l=function(e){e()},d=function(e,t){return e.pipe(t)};t.exports=function(){var e,t=Array.prototype.slice.call(arguments),r=c(t[t.length-1]||o)&&t.pop()||o;if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Error("pump requires two streams per minimum");var n=t.map((function(s,i){var o=i<t.length-1;return u(s,o,i>0,(function(t){e||(e=t),t&&n.forEach(l),o||(n.forEach(l),r(e))}))}));return t.reduce(d)}}}},{package:"pump",file:"../../node_modules/pump/index.js"}],[142,{"../functions/cmp":146,"../internal/debug":171,"../internal/parse-options":173,"../internal/re":174,"./range":143,"./semver":144},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=Symbol("SemVer ANY");class s{static get ANY(){return n}constructor(e,t){if(t=i(t),e instanceof s){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),u("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){const t=this.options.loose?o[a.COMPARATORLOOSE]:o[a.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==undefined?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new l(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}return c(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof s))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):(!(t=i(t)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(c(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(c(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}t.exports=s;const i=e("../internal/parse-options"),{safeRe:o,t:a}=e("../internal/re"),c=e("../functions/cmp"),u=e("../internal/debug"),l=e("./semver"),d=e("./range")}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/classes/comparator.js"}],[143,{"../internal/constants":170,"../internal/debug":171,"../internal/parse-options":173,"../internal/re":174,"./comparator":142,"./semver":144,"lru-cache":138},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){class n{constructor(e,t){if(t=i(t),e instanceof n)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new n(e.raw,t);if(e instanceof o)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!g(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&b(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&p)|(this.options.loose&&m))+":"+e,r=s.get(t);if(r)return r;const n=this.options.loose,i=n?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];e=e.replace(i,M(this.options.includePrerelease)),a("hyphen replace",e),e=e.replace(u[l.COMPARATORTRIM],d),a("comparator trim",e),e=e.replace(u[l.TILDETRIM],h),a("tilde trim",e),e=e.replace(u[l.CARETTRIM],f),a("caret trim",e);let c=e.split(" ").map((e=>y(e,this.options))).join(" ").split(/\s+/).map((e=>j(e,this.options)));n&&(c=c.filter((e=>(a("loose invalid filter",e,this.options),!!e.match(u[l.COMPARATORLOOSE]))))),a("range list",c);const b=new Map,w=c.map((e=>new o(e,this.options)));for(const e of w){if(g(e))return[e];b.set(e.value,e)}b.size>1&&b.has("")&&b.delete("");const v=[...b.values()];return s.set(t,v),v}intersects(e,t){if(!(e instanceof n))throw new TypeError("a Range is required");return this.set.some((r=>w(r,t)&&e.set.some((e=>w(e,t)&&r.every((r=>e.every((e=>r.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(O(this.set[t],e,this.options))return!0;return!1}}t.exports=n;const s=new(e("lru-cache"))({max:1e3}),i=e("../internal/parse-options"),o=e("./comparator"),a=e("../internal/debug"),c=e("./semver"),{safeRe:u,t:l,comparatorTrimReplace:d,tildeTrimReplace:h,caretTrimReplace:f}=e("../internal/re"),{FLAG_INCLUDE_PRERELEASE:p,FLAG_LOOSE:m}=e("../internal/constants"),g=e=>"<0.0.0-0"===e.value,b=e=>""===e.value,w=(e,t)=>{let r=!0;const n=e.slice();let s=n.pop();for(;r&&n.length;)r=n.every((e=>s.intersects(e,t))),s=n.pop();return r},y=(e,t)=>(a("comp",e,t),e=k(e,t),a("caret",e),e=_(e,t),a("tildes",e),e=T(e,t),a("xrange",e),e=R(e,t),a("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,_=(e,t)=>e.trim().split(/\s+/).map((e=>S(e,t))).join(" "),S=(e,t)=>{const r=t.loose?u[l.TILDELOOSE]:u[l.TILDE];return e.replace(r,((t,r,n,s,i)=>{let o;return a("tilde",e,t,r,n,s,i),v(r)?o="":v(n)?o=`>=${r}.0.0 <${+r+1}.0.0-0`:v(s)?o=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:i?(a("replaceTilde pr",i),o=`>=${r}.${n}.${s}-${i} <${r}.${+n+1}.0-0`):o=`>=${r}.${n}.${s} <${r}.${+n+1}.0-0`,a("tilde return",o),o}))},k=(e,t)=>e.trim().split(/\s+/).map((e=>E(e,t))).join(" "),E=(e,t)=>{a("caret",e,t);const r=t.loose?u[l.CARETLOOSE]:u[l.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,s,i,o)=>{let c;return a("caret",e,t,r,s,i,o),v(r)?c="":v(s)?c=`>=${r}.0.0${n} <${+r+1}.0.0-0`:v(i)?c="0"===r?`>=${r}.${s}.0${n} <${r}.${+s+1}.0-0`:`>=${r}.${s}.0${n} <${+r+1}.0.0-0`:o?(a("replaceCaret pr",o),c="0"===r?"0"===s?`>=${r}.${s}.${i}-${o} <${r}.${s}.${+i+1}-0`:`>=${r}.${s}.${i}-${o} <${r}.${+s+1}.0-0`:`>=${r}.${s}.${i}-${o} <${+r+1}.0.0-0`):(a("no pr"),c="0"===r?"0"===s?`>=${r}.${s}.${i}${n} <${r}.${s}.${+i+1}-0`:`>=${r}.${s}.${i}${n} <${r}.${+s+1}.0-0`:`>=${r}.${s}.${i} <${+r+1}.0.0-0`),a("caret return",c),c}))},T=(e,t)=>(a("replaceXRanges",e,t),e.split(/\s+/).map((e=>x(e,t))).join(" ")),x=(e,t)=>{e=e.trim();const r=t.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return e.replace(r,((r,n,s,i,o,c)=>{a("xRange",e,r,n,s,i,o,c);const u=v(s),l=u||v(i),d=l||v(o),h=d;return"="===n&&h&&(n=""),c=t.includePrerelease?"-0":"",u?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&h?(l&&(i=0),o=0,">"===n?(n=">=",l?(s=+s+1,i=0,o=0):(i=+i+1,o=0)):"<="===n&&(n="<",l?s=+s+1:i=+i+1),"<"===n&&(c="-0"),r=`${n+s}.${i}.${o}${c}`):l?r=`>=${s}.0.0${c} <${+s+1}.0.0-0`:d&&(r=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),a("xRange return",r),r}))},R=(e,t)=>(a("replaceStars",e,t),e.trim().replace(u[l.STAR],"")),j=(e,t)=>(a("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?l.GTE0PRE:l.GTE0],"")),M=e=>(t,r,n,s,i,o,a,c,u,l,d,h,f)=>`${r=v(n)?"":v(s)?`>=${n}.0.0${e?"-0":""}`:v(i)?`>=${n}.${s}.0${e?"-0":""}`:o?`>=${r}`:`>=${r}${e?"-0":""}`} ${c=v(u)?"":v(l)?`<${+u+1}.0.0-0`:v(d)?`<${u}.${+l+1}.0-0`:h?`<=${u}.${l}.${d}-${h}`:e?`<${u}.${l}.${+d+1}-0`:`<=${c}`}`.trim(),O=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(a(e[r].semver),e[r].semver!==o.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/classes/range.js"}],[144,{"../internal/constants":170,"../internal/debug":171,"../internal/identifiers":172,"../internal/parse-options":173,"../internal/re":174},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../internal/debug"),{MAX_LENGTH:s,MAX_SAFE_INTEGER:i}=e("../internal/constants"),{safeRe:o,t:a}=e("../internal/re"),c=e("../internal/parse-options"),{compareIdentifiers:u}=e("../internal/identifiers");class l{constructor(e,t){if(t=c(t),e instanceof l){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>s)throw new TypeError(`version is longer than ${s} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?o[a.LOOSE]:o[a.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<i)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(n("SemVer.compare",this.version,this.options,e),!(e instanceof l)){if("string"==typeof e&&e===this.version)return 0;e=new l(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof l||(e=new l(e,this.options)),u(this.major,e.major)||u(this.minor,e.minor)||u(this.patch,e.patch)}comparePre(e){if(e instanceof l||(e=new l(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],s=e.prerelease[t];if(n("prerelease compare",t,r,s),r===undefined&&s===undefined)return 0;if(s===undefined)return 1;if(r===undefined)return-1;if(r!==s)return u(r,s)}while(++t)}compareBuild(e){e instanceof l||(e=new l(e,this.options));let t=0;do{const r=this.build[t],s=e.build[t];if(n("prerelease compare",t,r,s),r===undefined&&s===undefined)return 0;if(s===undefined)return 1;if(r===undefined)return-1;if(r!==s)return u(r,s)}while(++t)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}t.exports=l}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/classes/semver.js"}],[145,{"./parse":161},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./parse");t.exports=(e,t)=>{const r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/clean.js"}],[146,{"./eq":152,"./gt":153,"./gte":154,"./lt":156,"./lte":157,"./neq":160},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./eq"),s=e("./neq"),i=e("./gt"),o=e("./gte"),a=e("./lt"),c=e("./lte");t.exports=(e,t,r,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return n(e,r,u);case"!=":return s(e,r,u);case">":return i(e,r,u);case">=":return o(e,r,u);case"<":return a(e,r,u);case"<=":return c(e,r,u);default:throw new TypeError(`Invalid operator: ${t}`)}}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/cmp.js"}],[147,{"../classes/semver":144,"../internal/re":174,"./parse":161},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver"),s=e("./parse"),{safeRe:i,t:o}=e("../internal/re");t.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let t;for(;(t=i[o.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&t.index+t[0].length===r.index+r[0].length||(r=t),i[o.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;i[o.COERCERTL].lastIndex=-1}else r=e.match(i[o.COERCE]);return null===r?null:s(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/coerce.js"}],[148,{"../classes/semver":144},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver");t.exports=(e,t,r)=>{const s=new n(e,r),i=new n(t,r);return s.compare(i)||s.compareBuild(i)}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/compare-build.js"}],[149,{"./compare":150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare");t.exports=(e,t)=>n(e,t,!0)}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/compare-loose.js"}],[150,{"../classes/semver":144},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver");t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/compare.js"}],[151,{"./parse.js":161},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./parse.js");t.exports=(e,t)=>{const r=n(e,null,!0),s=n(t,null,!0),i=r.compare(s);if(0===i)return null;const o=i>0,a=o?r:s,c=o?s:r,u=!!a.prerelease.length;if(!!c.prerelease.length&&!u)return c.patch||c.minor?a.patch?"patch":a.minor?"minor":"major":"major";const l=u?"pre":"";return r.major!==s.major?l+"major":r.minor!==s.minor?l+"minor":r.patch!==s.patch?l+"patch":"prerelease"}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/diff.js"}],[152,{"./compare":150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare");t.exports=(e,t,r)=>0===n(e,t,r)}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/eq.js"}],[153,{"./compare":150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare");t.exports=(e,t,r)=>n(e,t,r)>0}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/gt.js"}],[154,{"./compare":150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare");t.exports=(e,t,r)=>n(e,t,r)>=0}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/gte.js"}],[155,{"../classes/semver":144},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver");t.exports=(e,t,r,s,i)=>{"string"==typeof r&&(i=s,s=r,r=undefined);try{return new n(e instanceof n?e.version:e,r).inc(t,s,i).version}catch(e){return null}}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/inc.js"}],[156,{"./compare":150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare");t.exports=(e,t,r)=>n(e,t,r)<0}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/lt.js"}],[157,{"./compare":150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare");t.exports=(e,t,r)=>n(e,t,r)<=0}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/lte.js"}],[158,{"../classes/semver":144},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver");t.exports=(e,t)=>new n(e,t).major}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/major.js"}],[159,{"../classes/semver":144},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver");t.exports=(e,t)=>new n(e,t).minor}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/minor.js"}],[160,{"./compare":150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare");t.exports=(e,t,r)=>0!==n(e,t,r)}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/neq.js"}],[161,{"../classes/semver":144},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver");t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/parse.js"}],[162,{"../classes/semver":144},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver");t.exports=(e,t)=>new n(e,t).patch}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/patch.js"}],[163,{"./parse":161},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./parse");t.exports=(e,t)=>{const r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/prerelease.js"}],[164,{"./compare":150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare");t.exports=(e,t,r)=>n(t,e,r)}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/rcompare.js"}],[165,{"./compare-build":148},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare-build");t.exports=(e,t)=>e.sort(((e,r)=>n(r,e,t)))}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/rsort.js"}],[166,{"../classes/range":143},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/range");t.exports=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/satisfies.js"}],[167,{"./compare-build":148},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare-build");t.exports=(e,t)=>e.sort(((e,r)=>n(e,r,t)))}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/sort.js"}],[168,{"./parse":161},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./parse");t.exports=(e,t)=>{const r=n(e,t);return r?r.version:null}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/functions/valid.js"}],[169,{"./classes/comparator":142,"./classes/range":143,"./classes/semver":144,"./functions/clean":145,"./functions/cmp":146,"./functions/coerce":147,"./functions/compare":150,"./functions/compare-build":148,"./functions/compare-loose":149,"./functions/diff":151,"./functions/eq":152,"./functions/gt":153,"./functions/gte":154,"./functions/inc":155,"./functions/lt":156,"./functions/lte":157,"./functions/major":158,"./functions/minor":159,"./functions/neq":160,"./functions/parse":161,"./functions/patch":162,"./functions/prerelease":163,"./functions/rcompare":164,"./functions/rsort":165,"./functions/satisfies":166,"./functions/sort":167,"./functions/valid":168,"./internal/constants":170,"./internal/identifiers":172,"./internal/re":174,"./ranges/gtr":175,"./ranges/intersects":176,"./ranges/ltr":177,"./ranges/max-satisfying":178,"./ranges/min-satisfying":179,"./ranges/min-version":180,"./ranges/outside":181,"./ranges/simplify":182,"./ranges/subset":183,"./ranges/to-comparators":184,"./ranges/valid":185},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./internal/re"),s=e("./internal/constants"),i=e("./classes/semver"),o=e("./internal/identifiers"),a=e("./functions/parse"),c=e("./functions/valid"),u=e("./functions/clean"),l=e("./functions/inc"),d=e("./functions/diff"),h=e("./functions/major"),f=e("./functions/minor"),p=e("./functions/patch"),m=e("./functions/prerelease"),g=e("./functions/compare"),b=e("./functions/rcompare"),w=e("./functions/compare-loose"),y=e("./functions/compare-build"),v=e("./functions/sort"),_=e("./functions/rsort"),S=e("./functions/gt"),k=e("./functions/lt"),E=e("./functions/eq"),T=e("./functions/neq"),x=e("./functions/gte"),R=e("./functions/lte"),j=e("./functions/cmp"),M=e("./functions/coerce"),O=e("./classes/comparator"),P=e("./classes/range"),C=e("./functions/satisfies"),I=e("./ranges/to-comparators"),A=e("./ranges/max-satisfying"),N=e("./ranges/min-satisfying"),$=e("./ranges/min-version"),L=e("./ranges/valid"),B=e("./ranges/outside"),D=e("./ranges/gtr"),J=e("./ranges/ltr"),F=e("./ranges/intersects"),q=e("./ranges/simplify"),W=e("./ranges/subset");t.exports={parse:a,valid:c,clean:u,inc:l,diff:d,major:h,minor:f,patch:p,prerelease:m,compare:g,rcompare:b,compareLoose:w,compareBuild:y,sort:v,rsort:_,gt:S,lt:k,eq:E,neq:T,gte:x,lte:R,cmp:j,coerce:M,Comparator:O,Range:P,satisfies:C,toComparators:I,maxSatisfying:A,minSatisfying:N,minVersion:$,validRange:L,outside:B,gtr:D,ltr:J,intersects:F,simplifyRange:q,subset:W,SemVer:i,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:s.SEMVER_SPEC_VERSION,RELEASE_TYPES:s.RELEASE_TYPES,compareIdentifiers:o.compareIdentifiers,rcompareIdentifiers:o.rcompareIdentifiers}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/index.js"}],[170,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=Number.MAX_SAFE_INTEGER||9007199254740991;t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/internal/constants.js"}],[171,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};t.exports=n}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/internal/debug.js"}],[172,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=/^[0-9]+$/,s=(e,t)=>{const r=n.test(e),s=n.test(t);return r&&s&&(e=+e,t=+t),e===t?0:r&&!s?-1:s&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:s,rcompareIdentifiers:(e,t)=>s(t,e)}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/internal/identifiers.js"}],[173,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=Object.freeze({loose:!0}),s=Object.freeze({});t.exports=e=>e?"object"!=typeof e?n:e:s}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/internal/parse-options.js"}],[174,{"./constants":170,"./debug":171},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:s,MAX_LENGTH:i}=e("./constants"),o=e("./debug"),a=(r=t.exports={}).re=[],c=r.safeRe=[],u=r.src=[],l=r.t={};let d=0;const h="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",i],[h,s]],p=(e,t,r)=>{const n=(e=>{for(const[t,r]of f)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),s=d++;o(e,s,t),l[e]=s,u[s]=t,a[s]=new RegExp(t,r?"g":undefined),c[s]=new RegExp(n,r?"g":undefined)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),p("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${h}+`),p("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),p("FULL",`^${u[l.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),p("LOOSE",`^${u[l.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),p("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),p("COERCE",`${"(^|[^\\d])"+"(\\d{1,"}${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),p("COERCERTL",u[l.COERCE],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),r.tildeTrimReplace="$1~",p("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),r.caretTrimReplace="$1^",p("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),r.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/internal/re.js"}],[175,{"./outside":181},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./outside");t.exports=(e,t,r)=>n(e,t,">",r)}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/ranges/gtr.js"}],[176,{"../classes/range":143},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/range");t.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/ranges/intersects.js"}],[177,{"./outside":181},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./outside");t.exports=(e,t,r)=>n(e,t,"<",r)}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/ranges/ltr.js"}],[178,{"../classes/range":143,"../classes/semver":144},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver"),s=e("../classes/range");t.exports=(e,t,r)=>{let i=null,o=null,a=null;try{a=new s(t,r)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(i&&-1!==o.compare(e)||(i=e,o=new n(i,r)))})),i}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/ranges/max-satisfying.js"}],[179,{"../classes/range":143,"../classes/semver":144},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver"),s=e("../classes/range");t.exports=(e,t,r)=>{let i=null,o=null,a=null;try{a=new s(t,r)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(i&&1!==o.compare(e)||(i=e,o=new n(i,r)))})),i}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/ranges/min-satisfying.js"}],[180,{"../classes/range":143,"../classes/semver":144,"../functions/gt":153},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver"),s=e("../classes/range"),i=e("../functions/gt");t.exports=(e,t)=>{e=new s(e,t);let r=new n("0.0.0");if(e.test(r))return r;if(r=new n("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t<e.set.length;++t){const s=e.set[t];let o=null;s.forEach((e=>{const t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":o&&!i(t,o)||(o=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!o||r&&!i(r,o)||(r=o)}return r&&e.test(r)?r:null}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/ranges/min-version.js"}],[181,{"../classes/comparator":142,"../classes/range":143,"../classes/semver":144,"../functions/gt":153,"../functions/gte":154,"../functions/lt":156,"../functions/lte":157,"../functions/satisfies":166},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver"),s=e("../classes/comparator"),{ANY:i}=s,o=e("../classes/range"),a=e("../functions/satisfies"),c=e("../functions/gt"),u=e("../functions/lt"),l=e("../functions/lte"),d=e("../functions/gte");t.exports=(e,t,r,h)=>{let f,p,m,g,b;switch(e=new n(e,h),t=new o(t,h),r){case">":f=c,p=l,m=u,g=">",b=">=";break;case"<":f=u,p=d,m=c,g="<",b="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,h))return!1;for(let r=0;r<t.set.length;++r){const n=t.set[r];let o=null,a=null;if(n.forEach((e=>{e.semver===i&&(e=new s(">=0.0.0")),o=o||e,a=a||e,f(e.semver,o.semver,h)?o=e:m(e.semver,a.semver,h)&&(a=e)})),o.operator===g||o.operator===b)return!1;if((!a.operator||a.operator===g)&&p(e,a.semver))return!1;if(a.operator===b&&m(e,a.semver))return!1}return!0}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/ranges/outside.js"}],[182,{"../functions/compare.js":150,"../functions/satisfies.js":166},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../functions/satisfies.js"),s=e("../functions/compare.js");t.exports=(e,t,r)=>{const i=[];let o=null,a=null;const c=e.sort(((e,t)=>s(e,t,r)));for(const e of c){n(e,t,r)?(a=e,o||(o=e)):(a&&i.push([o,a]),a=null,o=null)}o&&i.push([o,null]);const u=[];for(const[e,t]of i)e===t?u.push(e):t||e!==c[0]?t?e===c[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");const l=u.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return l.length<d.length?l:t}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/ranges/simplify.js"}],[183,{"../classes/comparator.js":142,"../classes/range.js":143,"../functions/compare.js":150,"../functions/satisfies.js":166},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/range.js"),s=e("../classes/comparator.js"),{ANY:i}=s,o=e("../functions/satisfies.js"),a=e("../functions/compare.js"),c=[new s(">=0.0.0-0")],u=[new s(">=0.0.0")],l=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===i){if(1===t.length&&t[0].semver===i)return!0;e=r.includePrerelease?c:u}if(1===t.length&&t[0].semver===i){if(r.includePrerelease)return!0;t=u}const n=new Set;let s,l,f,p,m,g,b;for(const t of e)">"===t.operator||">="===t.operator?s=d(s,t,r):"<"===t.operator||"<="===t.operator?l=h(l,t,r):n.add(t.semver);if(n.size>1)return null;if(s&&l){if(f=a(s.semver,l.semver,r),f>0)return null;if(0===f&&(">="!==s.operator||"<="!==l.operator))return null}for(const e of n){if(s&&!o(e,String(s),r))return null;if(l&&!o(e,String(l),r))return null;for(const n of t)if(!o(e,String(n),r))return!1;return!0}let w=!(!l||r.includePrerelease||!l.semver.prerelease.length)&&l.semver,y=!(!s||r.includePrerelease||!s.semver.prerelease.length)&&s.semver;w&&1===w.prerelease.length&&"<"===l.operator&&0===w.prerelease[0]&&(w=!1);for(const e of t){if(b=b||">"===e.operator||">="===e.operator,g=g||"<"===e.operator||"<="===e.operator,s)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),">"===e.operator||">="===e.operator){if(p=d(s,e,r),p===e&&p!==s)return!1}else if(">="===s.operator&&!o(s.semver,String(e),r))return!1;if(l)if(w&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===w.major&&e.semver.minor===w.minor&&e.semver.patch===w.patch&&(w=!1),"<"===e.operator||"<="===e.operator){if(m=h(l,e,r),m===e&&m!==l)return!1}else if("<="===l.operator&&!o(l.semver,String(e),r))return!1;if(!e.operator&&(l||s)&&0!==f)return!1}return!(s&&g&&!l&&0!==f)&&(!(l&&b&&!s&&0!==f)&&(!y&&!w))},d=(e,t,r)=>{if(!e)return t;const n=a(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},h=(e,t,r)=>{if(!e)return t;const n=a(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};t.exports=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let s=!1;e:for(const n of e.set){for(const e of t.set){const t=l(n,e,r);if(s=s||null!==t,t)continue e}if(s)return!1}return!0}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/ranges/subset.js"}],[184,{"../classes/range":143},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/range");t.exports=(e,t)=>new n(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/ranges/to-comparators.js"}],[185,{"../classes/range":143},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/range");t.exports=(e,t)=>{try{return new n(e,t).range||"*"}catch(e){return null}}}}},{package:"@swc/cli>semver",file:"../../node_modules/semver/ranges/valid.js"}],[186,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){!function(e,n){"object"==typeof r&&void 0!==t?n(r):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).Superstruct={})}(this,(function(e){class t extends TypeError{constructor(e,t){let r;const{message:n,explanation:s,...i}=e,{path:o}=e,a=0===o.length?n:`At path: ${o.join(".")} -- ${n}`;super(s??a),null!=s&&(this.cause=a),Object.assign(this,i),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...t()])}}function r(e){return"object"==typeof e&&null!=e}function n(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function s(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function i(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:i,branch:o}=t,{type:a}=r,{refinement:c,message:u=`Expected a value of type \`${a}\`${c?` with refinement \`${c}\``:""}, but received: \`${s(n)}\``}=e;return{value:n,type:a,refinement:c,key:i[i.length-1],path:i,branch:o,...e,message:u}}function*o(e,t,n,s){var o;r(o=e)&&"function"==typeof o[Symbol.iterator]||(e=[e]);for(const r of e){const e=i(r,t,n,s);e&&(yield e)}}function*a(e,t,n={}){const{path:s=[],branch:i=[e],coerce:o=!1,mask:c=!1}=n,u={path:s,branch:i};if(o&&(e=t.coercer(e,u),c&&"type"!==t.type&&r(t.schema)&&r(e)&&!Array.isArray(e)))for(const r in e)t.schema[r]===undefined&&delete e[r];let l="valid";for(const r of t.validator(e,u))r.explanation=n.message,l="not_valid",yield[r,undefined];for(let[d,h,f]of t.entries(e,u)){const t=a(h,f,{path:d===undefined?s:[...s,d],branch:d===undefined?i:[...i,h],coerce:o,mask:c,message:n.message});for(const n of t)n[0]?(l=null!=n[0].refinement?"not_refined":"not_valid",yield[n[0],undefined]):o&&(h=n[1],d===undefined?e=h:e instanceof Map?e.set(d,h):e instanceof Set?e.add(h):r(e)&&(h!==undefined||d in e)&&(e[d]=h))}if("not_valid"!==l)for(const r of t.refiner(e,u))r.explanation=n.message,l="not_refined",yield[r,undefined];"valid"===l&&(yield[undefined,e])}class c{constructor(e){const{type:t,schema:r,validator:n,refiner:s,coercer:i=(e=>e),entries:a=function*(){}}=e;this.type=t,this.schema=r,this.entries=a,this.coercer=i,this.validator=n?(e,t)=>o(n(e,t),t,this,e):()=>[],this.refiner=s?(e,t)=>o(s(e,t),t,this,e):()=>[]}assert(e,t){return u(e,this,t)}create(e,t){return l(e,this,t)}is(e){return h(e,this)}mask(e,t){return d(e,this,t)}validate(e,t={}){return f(e,this,t)}}function u(e,t,r){const n=f(e,t,{message:r});if(n[0])throw n[0]}function l(e,t,r){const n=f(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function d(e,t,r){const n=f(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function h(e,t){return!f(e,t)[0]}function f(e,r,n={}){const s=a(e,r,n),i=function(e){const{done:t,value:r}=e.next();return t?undefined:r}(s);if(i[0]){return[new t(i[0],(function*(){for(const e of s)e[0]&&(yield e[0])})),undefined]}{const e=i[1];return[undefined,e]}}function p(e,t){return new c({type:e,schema:null,validator:t})}function m(){return p("never",(()=>!1))}function g(e){const t=e?Object.keys(e):[],n=m();return new c({type:"object",schema:e||null,*entries(s){if(e&&r(s)){const r=new Set(Object.keys(s));for(const n of t)r.delete(n),yield[n,s[n],e[n]];for(const e of r)yield[e,s[e],n]}},validator:e=>r(e)||`Expected an object, but received: ${s(e)}`,coercer:e=>r(e)?{...e}:e})}function b(e){return new c({...e,validator:(t,r)=>t===undefined||e.validator(t,r),refiner:(t,r)=>t===undefined||e.refiner(t,r)})}function w(){return p("string",(e=>"string"==typeof e||`Expected a string, but received: ${s(e)}`))}function y(e){const t=Object.keys(e);return new c({type:"type",schema:e,*entries(n){if(r(n))for(const r of t)yield[r,n[r],e[r]]},validator:e=>r(e)||`Expected an object, but received: ${s(e)}`,coercer:e=>r(e)?{...e}:e})}function v(){return p("unknown",(()=>!0))}function _(e,t,r){return new c({...e,coercer:(n,s)=>h(n,t)?e.coercer(r(n,s),s):e.coercer(n,s)})}function S(e){return e instanceof Map||e instanceof Set?e.size:e.length}function k(e,t,r){return new c({...e,*refiner(n,s){yield*e.refiner(n,s);const i=o(r(n,s),s,e,n);for(const e of i)yield{...e,refinement:t}}})}e.Struct=c,e.StructError=t,e.any=function(){return p("any",(()=>!0))},e.array=function(e){return new c({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${s(e)}`})},e.assert=u,e.assign=function(...e){const t="type"===e[0].type,r=e.map((e=>e.schema)),n=Object.assign({},...r);return t?y(n):g(n)},e.bigint=function(){return p("bigint",(e=>"bigint"==typeof e))},e.boolean=function(){return p("boolean",(e=>"boolean"==typeof e))},e.coerce=_,e.create=l,e.date=function(){return p("date",(e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${s(e)}`))},e.defaulted=function(e,t,r={}){return _(e,v(),(e=>{const s="function"==typeof t?t():t;if(e===undefined)return s;if(!r.strict&&n(e)&&n(s)){const t={...e};let r=!1;for(const e in s)t[e]===undefined&&(t[e]=s[e],r=!0);if(r)return t}return e}))},e.define=p,e.deprecated=function(e,t){return new c({...e,refiner:(t,r)=>t===undefined||e.refiner(t,r),validator:(r,n)=>r===undefined||(t(r,n),e.validator(r,n))})},e.dynamic=function(e){return new c({type:"dynamic",schema:null,*entries(t,r){const n=e(t,r);yield*n.entries(t,r)},validator:(t,r)=>e(t,r).validator(t,r),coercer:(t,r)=>e(t,r).coercer(t,r),refiner:(t,r)=>e(t,r).refiner(t,r)})},e.empty=function(e){return k(e,"empty",(t=>{const r=S(t);return 0===r||`Expected an empty ${e.type} but received one with a size of \`${r}\``}))},e.enums=function(e){const t={},r=e.map((e=>s(e))).join();for(const r of e)t[r]=r;return new c({type:"enums",schema:t,validator:t=>e.includes(t)||`Expected one of \`${r}\`, but received: ${s(t)}`})},e.func=function(){return p("func",(e=>"function"==typeof e||`Expected a function, but received: ${s(e)}`))},e.instance=function(e){return p("instance",(t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${s(t)}`))},e.integer=function(){return p("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${s(e)}`))},e.intersection=function(e){return new c({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)},*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})},e.is=h,e.lazy=function(e){let t;return new c({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator:(r,n)=>(t??(t=e()),t.validator(r,n)),coercer:(r,n)=>(t??(t=e()),t.coercer(r,n)),refiner:(r,n)=>(t??(t=e()),t.refiner(r,n))})},e.literal=function(e){const t=s(e),r=typeof e;return new c({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?e:null,validator:r=>r===e||`Expected the literal \`${t}\`, but received: ${s(r)}`})},e.map=function(e,t){return new c({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,s]of r.entries())yield[n,n,e],yield[n,s,t]},coercer:e=>e instanceof Map?new Map(e):e,validator:e=>e instanceof Map||`Expected a \`Map\` object, but received: ${s(e)}`})},e.mask=d,e.max=function(e,t,r={}){const{exclusive:n}=r;return k(e,"max",(r=>n?r<t:r<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${r}\``))},e.min=function(e,t,r={}){const{exclusive:n}=r;return k(e,"min",(r=>n?r>t:r>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${r}\``))},e.never=m,e.nonempty=function(e){return k(e,"nonempty",(t=>S(t)>0||`Expected a nonempty ${e.type} but received an empty one`))},e.nullable=function(e){return new c({...e,validator:(t,r)=>null===t||e.validator(t,r),refiner:(t,r)=>null===t||e.refiner(t,r)})},e.number=function(){return p("number",(e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${s(e)}`))},e.object=g,e.omit=function(e,t){const{schema:r}=e,n={...r};for(const e of t)delete n[e];return"type"===e.type?y(n):g(n)},e.optional=b,e.partial=function(e){const t=e instanceof c?{...e.schema}:{...e};for(const e in t)t[e]=b(t[e]);return g(t)},e.pattern=function(e,t){return k(e,"pattern",(r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`))},e.pick=function(e,t){const{schema:r}=e,n={};for(const e of t)n[e]=r[e];return g(n)},e.record=function(e,t){return new c({type:"record",schema:null,*entries(n){if(r(n))for(const r in n){const s=n[r];yield[r,r,e],yield[r,s,t]}},validator:e=>r(e)||`Expected an object, but received: ${s(e)}`})},e.refine=k,e.regexp=function(){return p("regexp",(e=>e instanceof RegExp))},e.set=function(e){return new c({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer:e=>e instanceof Set?new Set(e):e,validator:e=>e instanceof Set||`Expected a \`Set\` object, but received: ${s(e)}`})},e.size=function(e,t,r=t){const n=`Expected a ${e.type}`,s=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return k(e,"size",(e=>{if("number"==typeof e||e instanceof Date)return t<=e&&e<=r||`${n} ${s} but received \`${e}\``;if(e instanceof Map||e instanceof Set){const{size:i}=e;return t<=i&&i<=r||`${n} with a size ${s} but received one with a size of \`${i}\``}{const{length:i}=e;return t<=i&&i<=r||`${n} with a length ${s} but received one with a length of \`${i}\``}}))},e.string=w,e.struct=function(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),p(e,t)},e.trimmed=function(e){return _(e,w(),(e=>e.trim()))},e.tuple=function(e){const t=m();return new c({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let s=0;s<n;s++)yield[s,r[s],e[s]||t]}},validator:e=>Array.isArray(e)||`Expected an array, but received: ${s(e)}`})},e.type=y,e.union=function(e){const t=e.map((e=>e.type)).join(" | ");return new c({type:"union",schema:null,coercer(t){for(const r of e){const[e,n]=r.validate(t,{coerce:!0});if(!e)return n}return t},validator(r,n){const i=[];for(const t of e){const[...e]=a(r,t,n),[s]=e;if(!s[0])return[];for(const[t]of e)t&&i.push(t)}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${s(r)}`,...i]}})},e.unknown=v,e.validate=f}))}}},{package:"superstruct",file:"../../node_modules/superstruct/dist/index.cjs"}],[187,{"has-flag":110,os:"os",tty:"tty"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("os"),s=e("tty"),i=e("has-flag"),{env:o}=process;let a;function c(e,{streamIsTTY:t,sniffFlags:r=!0}={}){const s=function(){if("FORCE_COLOR"in o)return"true"===o.FORCE_COLOR?1:"false"===o.FORCE_COLOR?0:0===o.FORCE_COLOR.length?1:Math.min(Number.parseInt(o.FORCE_COLOR,10),3)}();s!==undefined&&(a=s);const c=r?a:s;if(0===c)return 0;if(r){if(i("color=16m")||i("color=full")||i("color=truecolor"))return 3;if(i("color=256"))return 2}if(e&&!t&&c===undefined)return 0;const u=c||0;if("dumb"===o.TERM)return u;if("win32"===process.platform){const e=n.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in o)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((e=>e in o))||"codeship"===o.CI_NAME?1:u;if("TEAMCITY_VERSION"in o)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0;if("truecolor"===o.COLORTERM)return 3;if("TERM_PROGRAM"in o){const e=Number.parseInt((o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(o.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)||"COLORTERM"in o?1:u}function u(e,t={}){return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(c(e,{streamIsTTY:e&&e.isTTY,...t}))}i("no-color")||i("no-colors")||i("color=false")||i("color=never")?a=0:(i("color")||i("colors")||i("color=true")||i("color=always"))&&(a=1),t.exports={supportsColor:u,stdout:u({isTTY:s.isatty(1)}),stderr:u({isTTY:s.isatty(2)})}}}},{package:"@wdio/mocha-framework>mocha>supports-color",file:"../../node_modules/supports-color/index.js"}],[188,{util:"util"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=e("util").deprecate}}},{package:"browserify>readable-stream>util-deprecate",file:"../../node_modules/util-deprecate/node.js"}],[189,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=function e(t,r){if(t&&r)return e(t)(r);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach((function(e){n[e]=t[e]})),n;function n(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var n=t.apply(this,e),s=e[e.length-1];return"function"==typeof n&&n!==s&&Object.keys(s).forEach((function(e){n[e]=s[e]})),n}}}}},{package:"pump>once>wrappy",file:"../../node_modules/wrappy/wrappy.js"}],[190,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}}}},{package:"@swc/cli>semver>lru-cache>yallist",file:"../../node_modules/yallist/iterator.js"}],[191,{"./iterator.js":190},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var r=0,s=arguments.length;r<s;r++)t.push(arguments[r]);return t}function s(e,t,r){var n=t===e.head?new a(r,null,t,e):new a(r,t,t.next,e);return null===n.next&&(e.tail=n),null===n.prev&&(e.head=n),e.length++,n}function i(e,t){e.tail=new a(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function o(e,t){e.head=new a(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function a(e,t,r,n){if(!(this instanceof a))return new a(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}t.exports=n,n.Node=a,n.create=n,n.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},n.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},n.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},n.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)i(this,arguments[e]);return this.length},n.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},n.prototype.pop=function(){if(!this.tail)return undefined;var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e},n.prototype.shift=function(){if(!this.head)return undefined;var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e},n.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},n.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},n.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},n.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},n.prototype.map=function(e,t){t=t||this;for(var r=new n,s=this.head;null!==s;)r.push(e.call(t,s.value,this)),s=s.next;return r},n.prototype.mapReverse=function(e,t){t=t||this;for(var r=new n,s=this.tail;null!==s;)r.push(e.call(t,s.value,this)),s=s.prev;return r},n.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var s=0;null!==n;s++)r=e(r,n.value,s),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var s=this.length-1;null!==n;s--)r=e(r,n.value,s),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var s=0,i=this.head;null!==i&&s<e;s++)i=i.next;for(;null!==i&&s<t;s++,i=i.next)r.push(i.value);return r},n.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var s=this.length,i=this.tail;null!==i&&s>t;s--)i=i.prev;for(;null!==i&&s>e;s--,i=i.prev)r.push(i.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,i=this.head;null!==i&&n<e;n++)i=i.next;var o=[];for(n=0;i&&n<t;n++)o.push(i.value),i=this.removeNode(i);null===i&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(n=0;n<r.length;n++)i=s(this,i,r[n]);return o},n.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};try{e("./iterator.js")(n)}catch(e){}}}},{package:"@swc/cli>semver>lru-cache>yallist",file:"../../node_modules/yallist/yallist.js"}],[192,{"../logging":211,"../openrpc.json":214,"./../../../snaps-utils/src/index.executionenv":216,"./commands":193,"./endowments":198,"./globalEvents":205,"./sortParams":208,"./utils":209,"./validation":210,"@metamask/providers":62,"@metamask/utils":79,"eth-rpc-errors":105,"json-rpc-engine":121,superstruct:186},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.BaseSnapExecutor=void 0;var n,s=e("@metamask/providers"),i=e("./../../../snaps-utils/src/index.executionenv"),o=e("@metamask/utils"),a=e("eth-rpc-errors"),c=e("json-rpc-engine"),u=e("superstruct"),l=e("../logging"),d=(n=e("../openrpc.json"))&&n.__esModule?n:{default:n},h=e("./commands"),f=e("./endowments"),p=e("./globalEvents"),m=e("./sortParams"),g=e("./utils"),b=e("./validation");function w(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(r!==undefined){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const y={code:a.errorCodes.rpc.internal,message:"Execution Environment Error"},v={ping:{struct:b.PingRequestArgumentsStruct,params:[]},executeSnap:{struct:b.ExecuteSnapRequestArgumentsStruct,params:["snapId","sourceCode","endowments"]},terminate:{struct:b.TerminateRequestArgumentsStruct,params:[]},snapRpc:{struct:b.SnapRpcRequestArgumentsStruct,params:["target","handler","origin","request"]}};r.BaseSnapExecutor=class{constructor(e,t){w(this,"snapData",void 0),w(this,"commandStream",void 0),w(this,"rpcStream",void 0),w(this,"methods",void 0),w(this,"snapErrorHandler",void 0),w(this,"snapPromiseErrorHandler",void 0),w(this,"lastTeardown",0),this.snapData=new Map,this.commandStream=e,this.commandStream.on("data",(e=>{this.onCommandRequest(e).catch((e=>{(0,i.logError)(e)}))})),this.rpcStream=t,this.methods=(0,h.getCommandMethodImplementations)(this.startSnap.bind(this),(async(e,t,r)=>{const n=this.snapData.get(e),s=null==n?void 0:n.exports[t],{required:a}=i.SNAP_EXPORTS[t];if((0,o.assert)(!a||s!==undefined,`No ${t} handler exported for snap "${e}`),!s)return null;let c=await this.executeInSnapContext(e,(()=>s(r)));c===undefined&&(c=null);try{return(0,o.getSafeJson)(c)}catch(e){throw new TypeError(`Received non-JSON-serializable value: ${e.message.replace(/^Assertion failed: /u,"")}`)}}),this.onTerminate.bind(this))}errorHandler(e,t){const r=(0,g.constructError)(e),n=(0,a.serializeError)(r,{fallbackError:y,shouldIncludeStack:!1}),s={...t,stack:(null==r?void 0:r.stack)??null};this.notify({method:"UnhandledError",params:{error:{...n,data:s}}})}async onCommandRequest(e){if(!(0,o.isJsonRpcRequest)(e))throw new Error("Command stream received a non-JSON-RPC request.");const{id:t,method:r,params:n}=e;if("rpc.discover"===r)return void this.respond(t,{result:d.default});if(!(0,o.hasProperty)(v,r))return void this.respond(t,{error:a.ethErrors.rpc.methodNotFound({data:{method:r}}).serialize()});const s=v[r],i=(0,m.sortParamKeys)(s.params,n),[c]=(0,u.validate)(i,s.struct);if(c)this.respond(t,{error:a.ethErrors.rpc.invalidParams({message:`Invalid parameters for method "${r}": ${c.message}.`,data:{method:r,params:i}}).serialize()});else try{const e=await this.methods[r](...i);this.respond(t,{result:e})}catch(e){this.respond(t,{error:(0,a.serializeError)(e,{fallbackError:y})})}}notify(e){if(!(0,o.isValidJson)(e)||!(0,o.isObject)(e))throw new Error("JSON-RPC notifications must be JSON serializable objects");this.commandStream.write({...e,jsonrpc:"2.0"})}respond(e,t){if(!(0,o.isValidJson)(t)||!(0,o.isObject)(t))throw new Error("JSON-RPC responses must be JSON serializable objects.");this.commandStream.write({...t,id:e,jsonrpc:"2.0"})}async startSnap(e,t,r){(0,l.log)(`Starting snap '${e}' in worker.`),this.snapPromiseErrorHandler&&(0,p.removeEventListener)("unhandledrejection",this.snapPromiseErrorHandler),this.snapErrorHandler&&(0,p.removeEventListener)("error",this.snapErrorHandler),this.snapErrorHandler=t=>{this.errorHandler(t.error,{snapId:e})},this.snapPromiseErrorHandler=t=>{this.errorHandler(t instanceof Error?t:t.reason,{snapId:e})};const n=new s.StreamProvider(this.rpcStream,{jsonRpcStreamName:"metamask-provider",rpcMiddleware:[(0,c.createIdRemapMiddleware)()]});await n.initialize();const i=this.createSnapGlobal(n),o=this.createEIP1193Provider(n),a={exports:{}};try{const{endowments:n,teardown:s}=(0,f.createEndowments)(i,o,e,r);this.snapData.set(e,{idleTeardown:s,runningEvaluations:new Set,exports:{}}),(0,p.addEventListener)("unhandledRejection",this.snapPromiseErrorHandler),(0,p.addEventListener)("error",this.snapErrorHandler);const c=new Compartment({...n,module:a,exports:a.exports});c.globalThis.self=c.globalThis,c.globalThis.global=c.globalThis,c.globalThis.window=c.globalThis,await this.executeInSnapContext(e,(()=>{c.evaluate(t),this.registerSnapExports(e,a)}))}catch(t){throw this.removeSnap(e),new Error(`Error while running snap '${e}': ${t.message}`)}}onTerminate(){this.snapData.forEach((e=>e.runningEvaluations.forEach((e=>e.stop())))),this.snapData.clear()}registerSnapExports(e,t){const r=this.snapData.get(e);r&&(r.exports=i.SNAP_EXPORT_NAMES.reduce(((e,r)=>{const n=t.exports[r],{validator:s}=i.SNAP_EXPORTS[r];return s(n)?{...e,[r]:n}:e}),{}))}createSnapGlobal(e){const t=e.request.bind(e),r=async e=>{(0,g.assertSnapOutboundRequest)(e);const r=(0,o.getSafeJson)(e);this.notify({method:"OutboundRequest"});try{return await(0,g.withTeardown)(t(r),this)}finally{this.notify({method:"OutboundResponse"})}},n=new Proxy({},{has:(e,t)=>"string"==typeof t&&["request"].includes(t),get:(e,t)=>"request"===t?r:undefined});return harden(n)}createEIP1193Provider(e){const t=e.request.bind(e),r=(0,g.proxyStreamProvider)(e,(async e=>{(0,g.assertEthereumOutboundRequest)(e);const r=(0,o.getSafeJson)(e);this.notify({method:"OutboundRequest"});try{return await(0,g.withTeardown)(t(r),this)}finally{this.notify({method:"OutboundResponse"})}}));return harden(r)}removeSnap(e){this.snapData.delete(e)}async executeInSnapContext(e,t){const r=this.snapData.get(e);if(r===undefined)throw new Error(`Tried to execute in context of unknown snap: "${e}".`);let n;const s=new Promise(((t,r)=>n=()=>r(a.ethErrors.rpc.internal(`The snap "${e}" has been terminated during execution.`)))),i={stop:n};try{return r.runningEvaluations.add(i),await Promise.race([t(),s])}finally{r.runningEvaluations.delete(i),0===r.runningEvaluations.size&&(this.lastTeardown+=1,await r.idleTeardown())}}}}}},{package:"$root$",file:"src/common/BaseSnapExecutor.ts"}],[193,{"./../../../snaps-utils/src/index.executionenv":216,"./validation":210,"@metamask/utils":79},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getCommandMethodImplementations=function(e,t,r){return{ping:async()=>Promise.resolve("OK"),terminate:async()=>(r(),Promise.resolve("OK")),executeSnap:async(t,r,n)=>(await e(t,r,n),"OK"),snapRpc:async(e,r,n,s)=>await t(e,r,o(n,r,s))??null}},r.getHandlerArguments=o;var n=e("./../../../snaps-utils/src/index.executionenv"),s=e("@metamask/utils"),i=e("./validation");function o(e,t,r){switch(t){case n.HandlerType.OnTransaction:{(0,i.assertIsOnTransactionRequestArguments)(r.params);const{transaction:e,chainId:t,transactionOrigin:n}=r.params;return{transaction:e,chainId:t,transactionOrigin:n}}case n.HandlerType.OnRpcRequest:return{origin:e,request:r};case n.HandlerType.OnCronjob:case n.HandlerType.OnInstall:case n.HandlerType.OnUpdate:return{request:r};default:return(0,s.assertExhaustive)(t)}}}}},{package:"$root$",file:"src/common/commands.ts"}],[194,{"../globalObject":206,"./console":195,"./crypto":196,"./date":197,"./interval":199,"./math":200,"./network":201,"./textDecoder":202,"./textEncoder":203,"./timeout":204},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=e("../globalObject"),s=f(e("./console")),i=f(e("./crypto")),o=f(e("./date")),a=f(e("./interval")),c=f(e("./math")),u=f(e("./network")),l=f(e("./textDecoder")),d=f(e("./textEncoder")),h=f(e("./timeout"));function f(e){return e&&e.__esModule?e:{default:e}}const p=[{endowment:AbortController,name:"AbortController"},{endowment:AbortSignal,name:"AbortSignal"},{endowment:ArrayBuffer,name:"ArrayBuffer"},{endowment:atob,name:"atob",bind:!0},{endowment:BigInt,name:"BigInt"},{endowment:BigInt64Array,name:"BigInt64Array"},{endowment:BigUint64Array,name:"BigUint64Array"},{endowment:btoa,name:"btoa",bind:!0},{endowment:DataView,name:"DataView"},{endowment:Float32Array,name:"Float32Array"},{endowment:Float64Array,name:"Float64Array"},{endowment:Int8Array,name:"Int8Array"},{endowment:Int16Array,name:"Int16Array"},{endowment:Int32Array,name:"Int32Array"},{endowment:Uint8Array,name:"Uint8Array"},{endowment:Uint8ClampedArray,name:"Uint8ClampedArray"},{endowment:Uint16Array,name:"Uint16Array"},{endowment:Uint32Array,name:"Uint32Array"},{endowment:URL,name:"URL"},{endowment:WebAssembly,name:"WebAssembly"}];var m=()=>{const e=[i.default,a.default,c.default,u.default,h.default,l.default,d.default,o.default,s.default];return p.forEach((t=>{const r={names:[t.name],factory:()=>{const e="function"==typeof t.endowment&&t.bind?t.endowment.bind(n.rootRealmGlobal):t.endowment;return{[t.name]:harden(e)}}};e.push(r)})),e};r.default=m}}},{package:"$root$",file:"src/common/endowments/commonEndowmentFactory.ts"}],[195,{"../globalObject":206,"@metamask/utils":79},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.consoleMethods=r.consoleAttenuatedMethods=void 0;var n=e("@metamask/utils"),s=e("../globalObject");const i=new Set(["log","assert","error","debug","info","warn"]);r.consoleAttenuatedMethods=i;const o=new Set(["debug","error","info","log","warn","dir","dirxml","table","trace","group","groupCollapsed","groupEnd","clear","count","countReset","assert","profile","profileEnd","time","timeLog","timeEnd","timeStamp","context"]);r.consoleMethods=o;const a=["log","error","debug","info","warn"];function c(e,t,...r){const n=`[Snap: ${e}]`;return"string"==typeof t?[`${n} ${t}`,...r]:[n,t,...r]}var u={names:["console"],factory:function({snapId:e}={}){(0,n.assert)(e!==undefined);const t=Object.getOwnPropertyNames(s.rootRealmGlobal.console).reduce(((e,t)=>o.has(t)&&!i.has(t)?{...e,[t]:s.rootRealmGlobal.console[t]}:e),{});return harden({console:{...t,assert:(t,r,...n)=>{s.rootRealmGlobal.console.assert(t,...c(e,r,...n))},...a.reduce(((t,r)=>({...t,[r]:(t,...n)=>{s.rootRealmGlobal.console[r](...c(e,t,...n))}})),{})}})}};r.default=u}}},{package:"$root$",file:"src/common/endowments/console.ts"}],[196,{"../globalObject":206,crypto:"crypto"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.createCrypto=void 0;var n=e("../globalObject");const s=()=>{if("crypto"in n.rootRealmGlobal&&"object"==typeof n.rootRealmGlobal.crypto&&"SubtleCrypto"in n.rootRealmGlobal&&"function"==typeof n.rootRealmGlobal.SubtleCrypto)return{crypto:harden(n.rootRealmGlobal.crypto),SubtleCrypto:harden(n.rootRealmGlobal.SubtleCrypto)};const t=e("crypto").webcrypto;return{crypto:harden(t),SubtleCrypto:harden(t.subtle.constructor)}};r.createCrypto=s;var i={names:["crypto","SubtleCrypto"],factory:s};r.default=i}}},{package:"$root$",file:"src/common/endowments/crypto.ts"}],[197,{"../globalObject":206},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=e("../globalObject");var s={names:["Date"],factory:function(){const e=Object.getOwnPropertyNames(n.rootRealmGlobal.Date);let t=0;const r=()=>{const e=n.rootRealmGlobal.Date.now(),r=Math.round(e+Math.random());return r>t&&(t=r),t},s=function(...e){return Reflect.construct(n.rootRealmGlobal.Date,0===e.length?[r()]:e,new.target)};return e.forEach((e=>{Reflect.defineProperty(s,e,{configurable:!1,writable:!1,value:"now"===e?r:n.rootRealmGlobal.Date[e]})})),{Date:harden(s)}}};r.default=s}}},{package:"$root$",file:"src/common/endowments/date.ts"}],[198,{"../globalObject":206,"./../../../../snaps-utils/src/index.executionenv":216,"./commonEndowmentFactory":194,"@metamask/utils":79},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createEndowments=function(e,t,r,n=[]){const c={},u=n.reduce((({allEndowments:e,teardowns:n},u)=>{if(a.has(u)){if(!(0,i.hasProperty)(c,u)){const{teardownFunction:e,...t}=a.get(u)({snapId:r});Object.assign(c,t),e&&n.push(e)}e[u]=c[u]}else if("ethereum"===u)e[u]=t;else{if(!(u in o.rootRealmGlobal))throw new Error(`Unknown endowment: "${u}".`);{(0,s.logWarning)(`Access to unhardened global ${u}.`);const t=o.rootRealmGlobal[u];e[u]=t}}return{allEndowments:e,teardowns:n}}),{allEndowments:{snap:e},teardowns:[]});return{endowments:u.allEndowments,teardown:async()=>{await Promise.all(u.teardowns.map((e=>e())))}}};var n,s=e("./../../../../snaps-utils/src/index.executionenv"),i=e("@metamask/utils"),o=e("../globalObject");const a=(0,((n=e("./commonEndowmentFactory"))&&n.__esModule?n:{default:n}).default)().reduce(((e,t)=>(t.names.forEach((r=>{e.set(r,t.factory)})),e)),new Map)}}},{package:"$root$",file:"src/common/endowments/index.ts"}],[199,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n={names:["setInterval","clearInterval"],factory:()=>{const e=new Map,t=t=>{harden(t);const r=e.get(t);r!==undefined&&(clearInterval(r),e.delete(t))};return{setInterval:harden(((t,r)=>{if("function"!=typeof t)throw new Error("The interval handler must be a function. Received: "+typeof t);harden(t);const n=Object.freeze(Object.create(null)),s=setInterval(t,Math.max(10,r??0));return e.set(n,s),n})),clearInterval:harden(t),teardownFunction:()=>{for(const r of e.keys())t(r)}}}};r.default=n}}},{package:"$root$",file:"src/common/endowments/interval.ts"}],[200,{"../globalObject":206,"./crypto":196},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=e("../globalObject"),s=e("./crypto");var i={names:["Math"],factory:function(){const e=Object.getOwnPropertyNames(n.rootRealmGlobal.Math).reduce(((e,t)=>"random"===t?e:{...e,[t]:n.rootRealmGlobal.Math[t]}),{}),{crypto:t}=(0,s.createCrypto)();return harden({Math:{...e,random:()=>t.getRandomValues(new Uint32Array(1))[0]/2**32}})}};r.default=i}}},{package:"$root$",file:"src/common/endowments/math.ts"}],[201,{"../utils":209},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=e("../utils");function s(e,t,r){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,r)}function i(e,t){return function(e,t){if(t.get)return t.get.call(e);return t.value}(e,a(e,t,"get"))}function o(e,t,r){return function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(e,a(e,t,"set"),r),r}function a(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}var c=new WeakMap,u=new WeakMap;class l{constructor(e,t){s(this,c,{writable:!0,value:void 0}),s(this,u,{writable:!0,value:void 0}),o(this,u,e),o(this,c,t)}get body(){return i(this,u).body}get bodyUsed(){return i(this,u).bodyUsed}get headers(){return i(this,u).headers}get ok(){return i(this,u).ok}get redirected(){return i(this,u).redirected}get status(){return i(this,u).status}get statusText(){return i(this,u).statusText}get type(){return i(this,u).type}get url(){return i(this,u).url}async text(){return(0,n.withTeardown)(i(this,u).text(),this)}async arrayBuffer(){return(0,n.withTeardown)(i(this,u).arrayBuffer(),this)}async blob(){return(0,n.withTeardown)(i(this,u).blob(),this)}clone(){const e=i(this,u).clone();return new l(e,i(this,c))}async formData(){return(0,n.withTeardown)(i(this,u).formData(),this)}async json(){return(0,n.withTeardown)(i(this,u).json(),this)}}var d={names:["fetch"],factory:()=>{const e=new Set,t={lastTeardown:0},r=new FinalizationRegistry((e=>e()));return{fetch:harden((async(s,i)=>{const o=new AbortController;if(null!==(null==i?void 0:i.signal)&&(null==i?void 0:i.signal)!==undefined){const e=i.signal;e.addEventListener("abort",(()=>{o.abort(e.reason)}),{once:!0})}let a,c;try{const r=fetch(s,{...i,signal:o.signal});c={cancel:async()=>{o.abort();try{await r}catch{}}},e.add(c),a=new l(await(0,n.withTeardown)(r,t),t)}finally{c!==undefined&&e.delete(c)}if(null!==a.body){const t=new WeakRef(a.body),n={cancel:async()=>{try{var e;await(null===(e=t.deref())||void 0===e?void 0:e.cancel())}catch{}}};e.add(n),r.register(a.body,(()=>e.delete(n)))}return harden(a)})),teardownFunction:async()=>{t.lastTeardown+=1;const r=[];e.forEach((({cancel:e})=>r.push(e()))),e.clear(),await Promise.all(r)}}}};r.default=d}}},{package:"$root$",file:"src/common/endowments/network.ts"}],[202,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n={names:["TextDecoder"],factory:()=>({TextDecoder:harden(TextDecoder)})};r.default=n}}},{package:"$root$",file:"src/common/endowments/textDecoder.ts"}],[203,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n={names:["TextEncoder"],factory:()=>({TextEncoder:harden(TextEncoder)})};r.default=n}}},{package:"$root$",file:"src/common/endowments/textEncoder.ts"}],[204,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n={names:["setTimeout","clearTimeout"],factory:()=>{const e=new Map,t=t=>{const r=e.get(t);r!==undefined&&(clearTimeout(r),e.delete(t))};return{setTimeout:harden(((t,r)=>{if("function"!=typeof t)throw new Error("The timeout handler must be a function. Received: "+typeof t);harden(t);const n=Object.freeze(Object.create(null)),s=setTimeout((()=>{e.delete(n),t()}),Math.max(10,r??0));return e.set(n,s),n})),clearTimeout:harden(t),teardownFunction:()=>{for(const r of e.keys())t(r)}}}};r.default=n}}},{package:"$root$",file:"src/common/endowments/timeout.ts"}],[205,{"./globalObject":206},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.addEventListener=function(e,t){if("addEventListener"in n.rootRealmGlobal&&"function"==typeof n.rootRealmGlobal.addEventListener)return n.rootRealmGlobal.addEventListener(e.toLowerCase(),t);if(n.rootRealmGlobal.process&&"on"in n.rootRealmGlobal.process&&"function"==typeof n.rootRealmGlobal.process.on)return n.rootRealmGlobal.process.on(e,t);throw new Error("Platform agnostic addEventListener failed")},r.removeEventListener=function(e,t){if("removeEventListener"in n.rootRealmGlobal&&"function"==typeof n.rootRealmGlobal.removeEventListener)return n.rootRealmGlobal.removeEventListener(e.toLowerCase(),t);if(n.rootRealmGlobal.process&&"removeListener"in n.rootRealmGlobal.process&&"function"==typeof n.rootRealmGlobal.process.removeListener)return n.rootRealmGlobal.process.removeListener(e,t);throw new Error("Platform agnostic removeEventListener failed")};var n=e("./globalObject")}}},{package:"$root$",file:"src/common/globalEvents.ts"}],[206,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.rootRealmGlobalName=r.rootRealmGlobal=void 0;var n=function(e){return e.globalThis="globalThis",e.global="global",e.self="self",e.window="window",e}(n||{});let s,i;if("undefined"!=typeof globalThis)s=globalThis,i=n.globalThis;else if("undefined"!=typeof self)s=self,i=n.self;else if("undefined"!=typeof window)s=window,i=n.window;else{if("undefined"==typeof global)throw new Error("Unknown realm type; failed to identify global object.");s=global,i=n.global}const o=s;r.rootRealmGlobal=o;const a=i;r.rootRealmGlobalName=a}}},{package:"$root$",file:"src/common/globalObject.ts"}],[207,{"./../../../../snaps-utils/src/index.executionenv":216},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.executeLockdownMore=function(){try{const e=Reflect.ownKeys((new Compartment).globalThis),t=new Set(["eval","Function"]);new Set([...e]).forEach((e=>{const r=Reflect.getOwnPropertyDescriptor(globalThis,e);r&&(r.configurable&&(!function(e){return"set"in e||"get"in e}(r)?Object.defineProperty(globalThis,e,{configurable:!1,writable:!1}):Object.defineProperty(globalThis,e,{configurable:!1})),t.has(e)&&harden(globalThis[e]))}))}catch(e){throw(0,n.logError)("Protecting intrinsics failed:",e),e}};var n=e("./../../../../snaps-utils/src/index.executionenv")}}},{package:"$root$",file:"src/common/lockdown/lockdown-more.ts"}],[208,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.sortParamKeys=void 0;r.sortParamKeys=(e,t)=>{if(!t)return[];if(t instanceof Array)return t;const r=e.reduce(((e,t,r)=>({...e,[t]:r})),{});return Object.entries(t).sort((([e,t],[n,s])=>r[e]-r[n])).map((([e,t])=>t))}}}},{package:"$root$",file:"src/common/sortParams.ts"}],[209,{"../logging":211,"@metamask/utils":79,"eth-rpc-errors":105},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.BLOCKED_RPC_METHODS=void 0,r.assertEthereumOutboundRequest=function(e){(0,n.assert)(!String.prototype.startsWith.call(e.method,"snap_"),s.ethErrors.rpc.methodNotFound({data:{method:e.method}})),(0,n.assert)(!o.includes(e.method),s.ethErrors.rpc.methodNotFound({data:{method:e.method}})),(0,n.assertStruct)(e,n.JsonStruct,"Provided value is not JSON-RPC compatible")},r.assertSnapOutboundRequest=function(e){(0,n.assert)(String.prototype.startsWith.call(e.method,"wallet_")||String.prototype.startsWith.call(e.method,"snap_"),"The global Snap API only allows RPC methods starting with `wallet_*` and `snap_*`."),(0,n.assert)(!o.includes(e.method),s.ethErrors.rpc.methodNotFound({data:{method:e.method}})),(0,n.assertStruct)(e,n.JsonStruct,"Provided value is not JSON-RPC compatible")},r.constructError=function(e){let t;e instanceof Error?t=e:"string"==typeof e&&(t=new Error(e),delete t.stack);return t},r.proxyStreamProvider=function(e,t){return new Proxy({},{has:(e,t)=>"string"==typeof t&&["request","on","removeListener"].includes(t),get:(r,n)=>"request"===n?t:["on","removeListener"].includes(n)?e[n]:undefined})},r.withTeardown=async function(e,t){const r=t.lastTeardown;return new Promise(((n,s)=>{e.then((e=>{t.lastTeardown===r?n(e):(0,i.log)("Late promise received after Snap finished execution. Promise will be dropped.")})).catch((e=>{t.lastTeardown===r?s(e):(0,i.log)("Late promise received after Snap finished execution. Promise will be dropped.")}))}))};var n=e("@metamask/utils"),s=e("eth-rpc-errors"),i=e("../logging");const o=Object.freeze(["wallet_requestSnaps","wallet_requestPermissions","eth_sendRawTransaction","eth_sendTransaction","eth_sign","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v3","eth_signTypedData_v4","eth_decrypt","eth_getEncryptionPublicKey","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_watchAsset","wallet_registerOnboarding","wallet_scanQRCode"]);r.BLOCKED_RPC_METHODS=o}}},{package:"$root$",file:"src/common/utils.ts"}],[210,{"./../../../snaps-utils/src/index.executionenv":216,"@metamask/utils":79,superstruct:186},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.TerminateRequestArgumentsStruct=r.SnapRpcRequestArgumentsStruct=r.PingRequestArgumentsStruct=r.OnTransactionRequestArgumentsStruct=r.JsonRpcRequestWithoutIdStruct=r.ExecuteSnapRequestArgumentsStruct=r.EndowmentStruct=void 0,r.assertIsOnTransactionRequestArguments=function(e){(0,s.assertStruct)(e,p,"Invalid request params")},r.isEndowment=c,r.isEndowmentsArray=function(e){return Array.isArray(e)&&e.every(c)};var n=e("./../../../snaps-utils/src/index.executionenv"),s=e("@metamask/utils"),i=e("superstruct");const o=(0,i.assign)((0,i.omit)(s.JsonRpcRequestStruct,["id"]),(0,i.object)({id:(0,i.optional)(s.JsonRpcIdStruct)}));r.JsonRpcRequestWithoutIdStruct=o;const a=(0,i.string)();function c(e){return(0,i.is)(e,a)}r.EndowmentStruct=a;const u=(0,i.literal)("OK"),l=(0,i.optional)((0,i.union)([(0,i.literal)(undefined),(0,i.array)()]));r.PingRequestArgumentsStruct=l;const d=(0,i.union)([(0,i.literal)(undefined),(0,i.array)()]);r.TerminateRequestArgumentsStruct=d;const h=(0,i.tuple)([(0,i.string)(),(0,i.string)(),(0,i.optional)((0,i.array)(a))]);r.ExecuteSnapRequestArgumentsStruct=h;const f=(0,i.tuple)([(0,i.string)(),(0,i.enums)(Object.values(n.HandlerType)),(0,i.string)(),(0,i.assign)(o,(0,i.object)({params:(0,i.optional)((0,i.record)((0,i.string)(),s.JsonStruct))}))]);r.SnapRpcRequestArgumentsStruct=f;const p=(0,i.object)({transaction:(0,i.record)((0,i.string)(),s.JsonStruct),chainId:n.ChainIdStruct,transactionOrigin:(0,i.nullable)((0,i.string)())});r.OnTransactionRequestArgumentsStruct=p;(0,i.assign)(s.JsonRpcSuccessStruct,(0,i.object)({result:u})),s.JsonRpcSuccessStruct}}},{package:"$root$",file:"src/common/validation.ts"}],[211,{"./../../snaps-utils/src/index.executionenv":216,"@metamask/utils":79},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.log=void 0;var n=e("./../../snaps-utils/src/index.executionenv");const s=(0,e("@metamask/utils").createModuleLogger)(n.snapsLogger,"snaps-execution-environments");r.log=s}}},{package:"$root$",file:"src/logging.ts"}],[212,{"../common/BaseSnapExecutor":192,"../logging":211,"./../../../snaps-utils/src/index.executionenv":216,"@metamask/object-multiplex":3,"@metamask/post-message-stream":19,pump:141},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ChildProcessSnapExecutor=void 0;var n=u(e("@metamask/object-multiplex")),s=e("@metamask/post-message-stream"),i=e("./../../../snaps-utils/src/index.executionenv"),o=u(e("pump")),a=e("../common/BaseSnapExecutor"),c=e("../logging");function u(e){return e&&e.__esModule?e:{default:e}}class l extends a.BaseSnapExecutor{static initialize(){(0,c.log)("Worker: Connecting to parent.");const e=new s.ProcessMessageStream,t=new n.default;(0,o.default)(e,t,e,(e=>{e&&(0,i.logError)("Parent stream failure, closing worker.",e),self.close()}));const r=t.createStream(i.SNAP_STREAM_NAMES.COMMAND),a=t.createStream(i.SNAP_STREAM_NAMES.JSON_RPC);return new l(r,a)}}r.ChildProcessSnapExecutor=l}}},{package:"$root$",file:"src/node-process/ChildProcessSnapExecutor.ts"}],[213,{"../common/lockdown/lockdown-more":207,"./ChildProcessSnapExecutor":212},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("../common/lockdown/lockdown-more"),s=e("./ChildProcessSnapExecutor");(0,n.executeLockdownMore)(),s.ChildProcessSnapExecutor.initialize()}}},{package:"$root$",file:"src/node-process/index.ts"}],[214,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports={openrpc:"1.2.4",info:{title:"MetaMask Snaps Execution Environment API",version:"0.0.0-development"},methods:[{name:"ping",description:"confirms that a connection has been established with the execution environment",params:[],result:{name:"PingResult",schema:{$ref:"#/components/schemas/OK"}}},{name:"terminate",description:"tells the execution environment that it is being shut down",params:[],result:{name:"TerminateResult",schema:{$ref:"#/components/schemas/OK"}}},{name:"executeSnap",description:"executes a snap in the environment. The snap can then be interacted with via `snapRpc`",params:[{name:"snapId",required:!0,description:"the name of the snap",schema:{title:"SnapName",type:"string"}},{name:"sourceCode",description:"a snaps source code that gets executed in the environment",required:!0,schema:{title:"SourceCode",type:"string"}},{name:"endowments",description:"A list of endowments to provide to SES",required:!1,schema:{title:"Endowments",description:"An array of the names of the endowments",type:"array",items:{title:"Endowment",type:"string"}}}],result:{name:"executeSnapResult",schema:{$ref:"#/components/schemas/OK"}},examples:[{name:"BasicTestSnapExecuteExample",params:[{name:"snapId",value:"TestSnap"},{name:"sourceCode",value:"module.exports.onRpcRequest = async ({ request }) => { return request.method + request.id }"}],result:{name:"BasicTestSnapExampleResult",value:"OK"}}]},{name:"snapRpc",params:[{name:"target",required:!0,description:"the name of the snap",schema:{title:"Target",type:"string"}},{name:"handler",required:!0,description:"the handler to trigger on the snap",schema:{title:"Handler",type:"string",enum:["onRpcRequest","onTransaction","onCronjob"]}},{name:"origin",required:!0,description:"Origin of the snap JSON-RPC request",schema:{title:"Origin",type:"string"}},{name:"request",required:!0,description:"JSON-RPC request",schema:{$ref:"#/components/schemas/JsonRpcRequest"}}],result:{name:"HandleSnapRpcResult",schema:{title:"SnapRpcResult"}},examples:[{name:"TestSnapExample",params:[{name:"target",value:"TestSnap"},{name:"origin",value:"foo.com"},{name:"request",value:{jsonrpc:"2.0",method:"hello",params:[],id:1}}],result:{name:"TestSnapResultExample",value:"hello1"}}]}],components:{schemas:{OK:{title:"OK",type:"string",const:"OK"},JsonRpcRequest:{title:"JsonRpcRequest",type:"object",required:["jsonrpc","method"],properties:{jsonrpc:{title:"JSONRPCString",type:"string",const:"2.0"},id:{title:"JSONRPCID",oneOf:[{type:"string"},{type:"number"}]},method:{title:"JSONRPCMethod",description:"the name of the method",type:"string"},params:{title:"JSONRPCParams",type:["array","object"]}}}}}}}}},{package:"$root$",file:"src/openrpc.json"}],[215,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.SeverityLevel=r.SNAP_EXPORTS=r.HandlerType=void 0;let n=function(e){return e.OnRpcRequest="onRpcRequest",e.OnTransaction="onTransaction",e.OnCronjob="onCronjob",e.OnInstall="onInstall",e.OnUpdate="onUpdate",e}({});r.HandlerType=n;const s={[n.OnRpcRequest]:{type:n.OnRpcRequest,required:!0,validator:e=>"function"==typeof e},[n.OnTransaction]:{type:n.OnTransaction,required:!0,validator:e=>"function"==typeof e},[n.OnCronjob]:{type:n.OnCronjob,required:!0,validator:e=>"function"==typeof e},[n.OnInstall]:{type:n.OnInstall,required:!1,validator:e=>"function"==typeof e},[n.OnUpdate]:{type:n.OnUpdate,required:!1,validator:e=>"function"==typeof e}};r.SNAP_EXPORTS=s;let i=function(e){return e.Critical="critical",e}({});r.SeverityLevel=i}}},{package:"external:../snaps-utils/src/handlers.ts",file:"../snaps-utils/src/handlers.ts"}],[216,{"./handlers":215,"./logging":217,"./namespace":218,"./types":219},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=e("./handlers");Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in r&&r[e]===n[e]||Object.defineProperty(r,e,{enumerable:!0,get:function(){return n[e]}}))}));var s=e("./logging");Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in r&&r[e]===s[e]||Object.defineProperty(r,e,{enumerable:!0,get:function(){return s[e]}}))}));var i=e("./namespace");Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in r&&r[e]===i[e]||Object.defineProperty(r,e,{enumerable:!0,get:function(){return i[e]}}))}));var o=e("./types");Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in r&&r[e]===o[e]||Object.defineProperty(r,e,{enumerable:!0,get:function(){return o[e]}}))}))}}},{package:"external:../snaps-utils/src/index.executionenv.ts",file:"../snaps-utils/src/index.executionenv.ts"}],[217,{"@metamask/utils":79},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.logError=function(e,...t){console.error(e,...t)},r.logInfo=function(e,...t){console.log(e,...t)},r.logWarning=function(e,...t){console.warn(e,...t)},r.snapsLogger=void 0;const n=(0,e("@metamask/utils").createProjectLogger)("snaps");r.snapsLogger=n}}},{package:"external:../snaps-utils/src/logging.ts",file:"../snaps-utils/src/logging.ts"}],[218,{superstruct:186},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.NamespaceStruct=r.NamespaceIdStruct=r.LimitedString=r.ChainStruct=r.ChainIdStruct=r.CHAIN_ID_REGEX=r.AccountIdStruct=r.AccountIdArrayStruct=r.ACCOUNT_ID_REGEX=void 0,r.isAccountId=function(e){return(0,n.is)(e,c)},r.isAccountIdArray=function(e){return(0,n.is)(e,u)},r.isChainId=function(e){return(0,n.is)(e,a)},r.isNamespace=function(e){return(0,n.is)(e,d)},r.isNamespaceId=function(e){return(0,n.is)(e,h)},r.parseAccountId=function(e){const t=i.exec(e);if(null==t||!t.groups)throw new Error("Invalid account ID.");return{address:t.groups.accountAddress,chainId:t.groups.chainId,chain:{namespace:t.groups.namespace,reference:t.groups.reference}}},r.parseChainId=function(e){const t=s.exec(e);if(null==t||!t.groups)throw new Error("Invalid chain ID.");return{namespace:t.groups.namespace,reference:t.groups.reference}};var n=e("superstruct");const s=/^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-a-zA-Z0-9]{1,32})$/u;r.CHAIN_ID_REGEX=s;const i=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-a-zA-Z0-9]{1,32})):(?<accountAddress>[a-zA-Z0-9]{1,64})$/u;r.ACCOUNT_ID_REGEX=i;const o=(0,n.size)((0,n.string)(),1,40);r.LimitedString=o;const a=(0,n.pattern)((0,n.string)(),s);r.ChainIdStruct=a;const c=(0,n.pattern)((0,n.string)(),i);r.AccountIdStruct=c;const u=(0,n.array)(c);r.AccountIdArrayStruct=u;const l=(0,n.object)({id:a,name:o});r.ChainStruct=l;const d=(0,n.object)({chains:(0,n.array)(l),methods:(0,n.optional)((0,n.array)(o)),events:(0,n.optional)((0,n.array)(o))});r.NamespaceStruct=d;const h=(0,n.pattern)((0,n.string)(),/^[-a-z0-9]{3,8}$/u);r.NamespaceIdStruct=h}}},{package:"external:../snaps-utils/src/namespace.ts",file:"../snaps-utils/src/namespace.ts"}],[219,{"./handlers":215,"@metamask/utils":79,superstruct:186},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.WALLET_SNAP_PERMISSION_KEY=r.SnapValidationFailureReason=r.SnapIdPrefixes=r.SNAP_STREAM_NAMES=r.SNAP_EXPORT_NAMES=r.NpmSnapPackageJsonStruct=r.NpmSnapFileNames=r.NameStruct=void 0,r.assertIsNpmSnapPackageJson=function(e){(0,n.assertStruct)(e,c,`"${o.PackageJson}" is invalid`)},r.isNpmSnapPackageJson=function(e){return(0,s.is)(e,c)},r.isValidUrl=function(e,t={}){return(0,s.is)(e,f(t))},r.uri=void 0;var n=e("@metamask/utils"),s=e("superstruct"),i=e("./handlers");let o=function(e){return e.PackageJson="package.json",e.Manifest="snap.manifest.json",e}({});r.NpmSnapFileNames=o;const a=(0,s.size)((0,s.pattern)((0,s.string)(),/^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/u),1,214);r.NameStruct=a;const c=(0,s.type)({version:n.VersionStruct,name:a,main:(0,s.optional)((0,s.size)((0,s.string)(),1,Infinity)),repository:(0,s.optional)((0,s.object)({type:(0,s.size)((0,s.string)(),1,Infinity),url:(0,s.size)((0,s.string)(),1,Infinity)}))});r.NpmSnapPackageJsonStruct=c;let u=function(e){return e.npm="npm:",e.local="local:",e}({});r.SnapIdPrefixes=u;let l=function(e){return e.NameMismatch='"name" field mismatch',e.VersionMismatch='"version" field mismatch',e.RepositoryMismatch='"repository" field mismatch',e.ShasumMismatch='"shasum" field mismatch',e}({});r.SnapValidationFailureReason=l;let d=function(e){return e.JSON_RPC="jsonRpc",e.COMMAND="command",e}({});r.SNAP_STREAM_NAMES=d;const h=Object.values(i.HandlerType);r.SNAP_EXPORT_NAMES=h;const f=(e={})=>(0,s.refine)((0,s.union)([(0,s.string)(),(0,s.instance)(URL)]),"uri",(t=>{try{const r=new URL(t),n=(0,s.type)(e);return(0,s.assert)(r,n),!0}catch{return`Expected URL, got "${t.toString()}".`}}));r.uri=f;r.WALLET_SNAP_PERMISSION_KEY="wallet_snap"}}},{package:"external:../snaps-utils/src/types.ts",file:"../snaps-utils/src/types.ts"}]],[213],{resources:{"@metamask/object-multiplex":{globals:{"console.warn":!0},packages:{"@metamask/object-multiplex>readable-stream":!0,"pump>end-of-stream":!0,"pump>once":!0}},"@metamask/object-multiplex>readable-stream":{builtin:{"events.EventEmitter":!0,stream:!0,"timers.setImmediate":!0,util:!0},globals:{"process.browser":!0,"process.env.READABLE_STREAM":!0,"process.stderr":!0,"process.stdout":!0,"process.version.slice":!0},packages:{"@metamask/object-multiplex>readable-stream>process-nextick-args":!0,"@metamask/object-multiplex>readable-stream>safe-buffer":!0,"@metamask/object-multiplex>readable-stream>string_decoder":!0,"browserify>inherits":!0,"browserify>readable-stream>core-util-is":!0,"browserify>readable-stream>isarray":!0,"browserify>readable-stream>util-deprecate":!0,events:!0,stream:!0,timers:!0,util:!0}},"@metamask/object-multiplex>readable-stream>process-nextick-args":{globals:{process:!0}},"@metamask/object-multiplex>readable-stream>safe-buffer":{builtin:{buffer:!0},packages:{buffer:!0}},"@metamask/object-multiplex>readable-stream>string_decoder":{packages:{"@metamask/object-multiplex>readable-stream>safe-buffer":!0}},"@metamask/post-message-stream":{builtin:{"worker_threads.parentPort":!0},globals:{"MessageEvent.prototype":!0,WorkerGlobalScope:!0,addEventListener:!0,browser:!0,chrome:!0,"location.origin":!0,postMessage:!0,"process.on":!0,"process.removeListener":!0,"process.send":!0,removeEventListener:!0},packages:{"@metamask/post-message-stream>@metamask/utils":!0,"@metamask/post-message-stream>readable-stream":!0,worker_threads:!0}},"@metamask/post-message-stream>@metamask/utils":{builtin:{"buffer.Buffer":!0},globals:{TextDecoder:!0,TextEncoder:!0},packages:{"@swc/cli>semver":!0,buffer:!0,"eslint>debug":!0,superstruct:!0}},"@metamask/post-message-stream>readable-stream":{builtin:{"events.EventEmitter":!0,stream:!0,"timers.setImmediate":!0,util:!0},globals:{"process.browser":!0,"process.env.READABLE_STREAM":!0,"process.stderr":!0,"process.stdout":!0,"process.version.slice":!0},packages:{"@metamask/post-message-stream>readable-stream>process-nextick-args":!0,"@metamask/post-message-stream>readable-stream>safe-buffer":!0,"@metamask/post-message-stream>readable-stream>string_decoder":!0,"browserify>inherits":!0,"browserify>readable-stream>core-util-is":!0,"browserify>readable-stream>isarray":!0,"browserify>readable-stream>util-deprecate":!0,events:!0,stream:!0,timers:!0,util:!0}},"@metamask/post-message-stream>readable-stream>process-nextick-args":{globals:{"process.nextTick":!0,"process.version":!0}},"@metamask/post-message-stream>readable-stream>safe-buffer":{builtin:{buffer:!0},packages:{buffer:!0}},"@metamask/post-message-stream>readable-stream>string_decoder":{packages:{"@metamask/post-message-stream>readable-stream>safe-buffer":!0}},"@metamask/providers":{globals:{Event:!0,addEventListener:!0,"chrome.runtime.connect":!0,console:!0,dispatchEvent:!0,"document.createElement":!0,"document.readyState":!0,ethereum:"write","location.hostname":!0,removeEventListener:!0,web3:!0},packages:{"@metamask/object-multiplex":!0,"@metamask/providers>@metamask/safe-event-emitter":!0,"@metamask/providers>detect-browser":!0,"@metamask/providers>extension-port-stream":!0,"@metamask/providers>is-stream":!0,"@metamask/providers>json-rpc-middleware-stream":!0,"eslint>fast-deep-equal":!0,"eth-rpc-errors":!0,"json-rpc-engine":!0,pump:!0}},"@metamask/providers>@metamask/safe-event-emitter":{builtin:{"events.EventEmitter":!0},globals:{setTimeout:!0},packages:{events:!0}},"@metamask/providers>detect-browser":{globals:{document:!0,navigator:!0,process:!0}},"@metamask/providers>extension-port-stream":{builtin:{"buffer.Buffer":!0,"stream.Duplex":!0},packages:{buffer:!0,stream:!0}},"@metamask/providers>json-rpc-middleware-stream":{globals:{"console.warn":!0,setTimeout:!0},packages:{"@metamask/providers>json-rpc-middleware-stream>readable-stream":!0,"json-rpc-engine>@metamask/safe-event-emitter":!0}},"@metamask/providers>json-rpc-middleware-stream>readable-stream":{builtin:{"events.EventEmitter":!0,stream:!0,"timers.setImmediate":!0,util:!0},globals:{"process.browser":!0,"process.env.READABLE_STREAM":!0,"process.stderr":!0,"process.stdout":!0,"process.version.slice":!0},packages:{"@metamask/providers>json-rpc-middleware-stream>readable-stream>process-nextick-args":!0,"@metamask/providers>json-rpc-middleware-stream>readable-stream>safe-buffer":!0,"@metamask/providers>json-rpc-middleware-stream>readable-stream>string_decoder":!0,"browserify>inherits":!0,"browserify>readable-stream>core-util-is":!0,"browserify>readable-stream>isarray":!0,"browserify>readable-stream>util-deprecate":!0,events:!0,stream:!0,timers:!0,util:!0}},"@metamask/providers>json-rpc-middleware-stream>readable-stream>process-nextick-args":{globals:{process:!0}},"@metamask/providers>json-rpc-middleware-stream>readable-stream>safe-buffer":{builtin:{buffer:!0},packages:{buffer:!0}},"@metamask/providers>json-rpc-middleware-stream>readable-stream>string_decoder":{packages:{"@metamask/providers>json-rpc-middleware-stream>readable-stream>safe-buffer":!0}},"@metamask/utils":{builtin:{"buffer.Buffer":!0},globals:{TextDecoder:!0,TextEncoder:!0},packages:{"@metamask/utils>@noble/hashes":!0,"@swc/cli>semver":!0,buffer:!0,"eslint>debug":!0,superstruct:!0}},"@metamask/utils>@noble/hashes":{globals:{TextEncoder:!0,crypto:!0}},"@swc/cli>semver":{globals:{"console.error":!0,process:!0},packages:{"@swc/cli>semver>lru-cache":!0}},"@swc/cli>semver>lru-cache":{packages:{"@swc/cli>semver>lru-cache>yallist":!0}},"@wdio/mocha-framework>mocha>supports-color":{builtin:{"os.release":!0,"tty.isatty":!0},globals:{"process.env":!0,"process.platform":!0},packages:{"istanbul-lib-report>supports-color>has-flag":!0,os:!0,tty:!0}},"browserify>inherits":{builtin:{"util.inherits":!0},packages:{util:!0}},"browserify>readable-stream>core-util-is":{packages:{"browserify>insert-module-globals>is-buffer":!0}},"browserify>readable-stream>util-deprecate":{builtin:{"util.deprecate":!0},packages:{util:!0}},"eslint>debug":{builtin:{"tty.isatty":!0,"util.deprecate":!0,"util.format":!0,"util.inspect":!0},globals:{console:!0,document:!0,localStorage:!0,navigator:!0,process:!0},packages:{"@wdio/mocha-framework>mocha>supports-color":!0,"eslint>debug>ms":!0,tty:!0,util:!0}},"eth-rpc-errors":{packages:{"eth-rpc-errors>fast-safe-stringify":!0}},"external:../snaps-utils/src/icon.ts":{builtin:{buffer:!0}},"external:../snaps-utils/src/index.executionenv.ts":{packages:{"external:../snaps-utils/src/handlers.ts":!0,"external:../snaps-utils/src/logging.ts":!0,"external:../snaps-utils/src/namespace.ts":!0,"external:../snaps-utils/src/types.ts":!0}},"external:../snaps-utils/src/logging.ts":{globals:{"console.error":!0,"console.log":!0,"console.warn":!0},packages:{"@metamask/utils":!0}},"external:../snaps-utils/src/namespace.ts":{packages:{superstruct:!0}},"external:../snaps-utils/src/types.ts":{globals:{URL:!0},packages:{"@metamask/utils":!0,"external:../snaps-utils/src/handlers.ts":!0,superstruct:!0}},"istanbul-lib-report>supports-color>has-flag":{globals:{"process.argv":!0}},"json-rpc-engine":{packages:{"eth-rpc-errors":!0,"json-rpc-engine>@metamask/safe-event-emitter":!0}},"json-rpc-engine>@metamask/safe-event-emitter":{builtin:{"events.EventEmitter":!0},globals:{setTimeout:!0},packages:{events:!0}},pump:{builtin:{fs:!0},globals:{"process.version":!0},packages:{fs:!0,"pump>end-of-stream":!0,"pump>once":!0}},"pump>end-of-stream":{globals:{"process.nextTick":!0},packages:{"pump>once":!0}},"pump>once":{packages:{"pump>once>wrappy":!0}},superstruct:{globals:{"console.warn":!0,define:!0}}}});
|