@wormhole-foundation/wormhole-connect 0.3.18-beta.2-development → 0.3.18-beta.3-development

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.
Files changed (99) hide show
  1. package/dist/assets/{ccip-Cn2GV6zJ.js → ccip-DZSSxbfG.js} +1 -1
  2. package/dist/assets/{evm-DtOGrurb.js → evm-DPbsPo2H.js} +4 -4
  3. package/dist/assets/{index-BMsphhTc.js → index-DQiwN_Ue.js} +2 -2
  4. package/dist/assets/{index-CgYSKnqj.js → index-DeBYURSI.js} +1 -1
  5. package/dist/assets/{index.es-CemSjxmT.js → index.es-YhlgvURC.js} +2 -2
  6. package/dist/main.js +4 -4
  7. package/dist/src/components/TokensModal.d.ts.map +1 -1
  8. package/lib/{algorand-BDEvXX59.js → algorand--fALMVQ6.js} +1 -1
  9. package/lib/{algorand-Zc_bwW4S.mjs → algorand-BscStaE0.mjs} +4 -4
  10. package/lib/{aptos-2xBTg_HB.js → aptos-B3AS31XA.js} +1 -1
  11. package/lib/{aptos-BXil1ow6.mjs → aptos-D3gQDkVy.mjs} +4 -4
  12. package/lib/{aptos-HGzvDQev.mjs → aptos-DblrFWKz.mjs} +1 -1
  13. package/lib/{aptos-DBVV7qfV.js → aptos-uzjcRbKQ.js} +2 -2
  14. package/lib/{browser-DkelnPvs.js → browser-CUR1_-g7.js} +1 -1
  15. package/lib/{browser-D9O31Eeu.mjs → browser-CzNUhOtu.mjs} +2 -2
  16. package/lib/{ccip-C6SEFKkH.js → ccip-5uEJrSao.js} +1 -1
  17. package/lib/{ccip-BbYeuDVL.mjs → ccip-6d6x_AR7.mjs} +1 -1
  18. package/lib/{chain-BNKwvp-5.js → chain-Bq0KV5Nv.js} +1 -1
  19. package/lib/{chain-CdLYfAPM.mjs → chain-WayEKuld.mjs} +1 -1
  20. package/lib/{cosmos-BquWOK1X.mjs → cosmos-CwUr8XHO.mjs} +3 -3
  21. package/lib/{cosmos-Bsg4ShMs.js → cosmos-uP_qWSoq.js} +1 -1
  22. package/lib/{cosmwasm-DYmgsUUs.mjs → cosmwasm-ByfSCJro.mjs} +6 -6
  23. package/lib/{cosmwasm-Bhw3FsD_.js → cosmwasm-nZ1bv1b_.js} +2 -2
  24. package/lib/{create-D0TucuHl.js → create-CvZ650sz.js} +1 -1
  25. package/lib/{create-HDqF-1ZK.mjs → create-DppBfW47.mjs} +1 -1
  26. package/lib/{ens-validation.es6-BCps0Eec.js → ens-validation.es6-CCfWbdrS.js} +1 -1
  27. package/lib/{ens-validation.es6-w8x_dHmb.mjs → ens-validation.es6-CJs8RCzz.mjs} +2 -2
  28. package/lib/{evm-BbX0J1y-.js → evm-B80a5HsG.js} +2 -2
  29. package/lib/{evm-Dr0UlgwP.mjs → evm-BHI64qKH.mjs} +6 -6
  30. package/lib/{evm-BpzK53GX.js → evm-BSRvb7zQ.js} +4 -4
  31. package/lib/{evm-2KelLB7H.mjs → evm-DYiU2-MQ.mjs} +6 -6
  32. package/lib/{index-DaO7I-qg.js → index--J8UGeLt.js} +1 -1
  33. package/lib/{index-BcDN2lKv.mjs → index-00seDHdc.mjs} +5 -5
  34. package/lib/{index-D3MP5ran.js → index-B98kSotj.js} +1 -1
  35. package/lib/{index-zIY9Ty8L.js → index-BCWmM6sh.js} +1 -1
  36. package/lib/{index-Cpoq8bln.mjs → index-BMEA_Z4x.mjs} +27 -29
  37. package/lib/{index-DsDKaGAZ.mjs → index-BO4gCfyo.mjs} +4 -4
  38. package/lib/{index--Ya24MuT.mjs → index-BPttYMSW.mjs} +4 -4
  39. package/lib/{index-DIvMhatg.js → index-BR0KcmSP.js} +1 -1
  40. package/lib/{index-BTzpW2CH.js → index-BRws2oLK.js} +1 -1
  41. package/lib/{index-B-SCKn9E.js → index-BUGVfe_P.js} +1 -1
  42. package/lib/{index-DnCA55BS.mjs → index-BVlhk1Zx.mjs} +5 -5
  43. package/lib/{index-Buf5ViDI.mjs → index-BfaX86DY.mjs} +3 -3
  44. package/lib/{index-NzkgoUpB.js → index-BmHNRhrd.js} +1 -1
  45. package/lib/{index-CZgNyZsy.js → index-Bn43dUZE.js} +1 -1
  46. package/lib/{index-BG6SOggM.mjs → index-Bo_tkV1D.mjs} +4 -4
  47. package/lib/{index-DDZSvfje.js → index-Bs2fWIwl.js} +1 -1
  48. package/lib/{index-X4H_rID0.mjs → index-BxsrjQ0g.mjs} +1 -1
  49. package/lib/{index-LXVztnX2.mjs → index-CGXg743L.mjs} +4 -4
  50. package/lib/{index-e7hjhyhE.js → index-CGpTGfVX.js} +1 -1
  51. package/lib/{index-BRGuBbmG.js → index-CLqv0W4C.js} +1 -1
  52. package/lib/{index-C6xc4p84.mjs → index-CQBMnJe7.mjs} +5 -5
  53. package/lib/{index-Cl-uVarz.mjs → index-CXpmXMhQ.mjs} +4 -4
  54. package/lib/{index-t7bJ4K5j.js → index-CjCHChpV.js} +1 -1
  55. package/lib/{index-Cv97j9VV.mjs → index-Cnyhr_GO.mjs} +4 -4
  56. package/lib/{index-lKHt_xhK.mjs → index-D1i1U0GS.mjs} +2 -2
  57. package/lib/{index-beeGh_NR.js → index-DAxvZmWh.js} +1 -1
  58. package/lib/{index-B5hw5mz3.js → index-DBG3lw8A.js} +1 -1
  59. package/lib/{index-BlByGb6g.js → index-DDYPSDXG.js} +1 -1
  60. package/lib/{index-BszwlEHw.js → index-DGy0PI4x.js} +1 -1
  61. package/lib/{index-axLvotHN.js → index-DL8e8Ka6.js} +1 -1
  62. package/lib/{index-DnBgHoFF.mjs → index-DNGg8WTv.mjs} +2 -2
  63. package/lib/{index-Dpo5JDQ4.mjs → index-DQ2pTa4G.mjs} +4 -4
  64. package/lib/{index-TS5n3zuc.mjs → index-D_T-tAub.mjs} +3 -3
  65. package/lib/{index-CccfGakZ.mjs → index-DgYJEsdX.mjs} +6 -6
  66. package/lib/{index-DTnmfiVy.mjs → index-E1UraJoM.mjs} +4 -4
  67. package/lib/{index-DJs2hxJ9.mjs → index-E1ooefEo.mjs} +2 -2
  68. package/lib/{index-DDgLIB9M.mjs → index-FWQH1rP1.mjs} +4 -4
  69. package/lib/{index-gttJGZ38.js → index-FbJRnzPp.js} +1 -1
  70. package/lib/{index-LA5IFiOg.js → index-OFbST_Zc.js} +1 -1
  71. package/lib/{index-Bk8dO7l7.mjs → index-Pwy5eDgZ.mjs} +3 -3
  72. package/lib/{index-DpAzpz2b.mjs → index-WptHX8MN.mjs} +1 -1
  73. package/lib/{index-TBqhnkaj.js → index-aCGqbPEi.js} +1 -1
  74. package/lib/{index-Cc0jpWQp.js → index-c66y1A6n.js} +1 -1
  75. package/lib/{index-dO02pyGr.mjs → index-eglOHB-b.mjs} +4 -4
  76. package/lib/{index-BYtnAVI1.js → index-haDnu8fh.js} +1 -1
  77. package/lib/{index-B4AF-Mv-.js → index-s2bgjlxF.js} +4 -4
  78. package/lib/{index.es-BuUqRsMC.js → index.es-C8TErlAd.js} +2 -2
  79. package/lib/{index.es-BNrPiOfV.mjs → index.es-CYR-A5sx.mjs} +4 -4
  80. package/lib/index.js +1 -1
  81. package/lib/index.mjs +1 -1
  82. package/lib/{libsodium-wrappers-ByFZy5hK.mjs → libsodium-wrappers-ARgV8dAO.mjs} +1 -1
  83. package/lib/{libsodium-wrappers-DEhSVGdH.js → libsodium-wrappers-DPGrOV2g.js} +1 -1
  84. package/lib/{sei-BjdQujMd.js → sei-Cjl5-5UW.js} +1 -1
  85. package/lib/{sei-D7pceI_5.mjs → sei-J9YwRQlR.mjs} +2 -2
  86. package/lib/{solana-BNgUb2lt.mjs → solana-3b1G6Ldj.mjs} +6 -6
  87. package/lib/{solana-DtLIToHc.mjs → solana-BnUyf5pK.mjs} +3 -3
  88. package/lib/{solana-D4Kn_xyO.js → solana-DFbLZfms.js} +2 -2
  89. package/lib/{solana-BuMaCwGs.js → solana-Dd_Vo-ZU.js} +1 -1
  90. package/lib/{solanaEmbed.esm-Cu68qIpS.mjs → solanaEmbed.esm-BeK6jZyl.mjs} +2 -2
  91. package/lib/{solanaEmbed.esm-BIYw7Z4-.js → solanaEmbed.esm-DWWS4MCV.js} +1 -1
  92. package/lib/src/components/TokensModal.d.ts.map +1 -1
  93. package/lib/{sui-B7wNAAIg.mjs → sui-B14yKSv0.mjs} +1 -1
  94. package/lib/{sui-BemqzeyY.js → sui-BwHn_8Xv.js} +2 -2
  95. package/lib/{sui-NM9S9bWA.js → sui-C9dQK1dR.js} +1 -1
  96. package/lib/{sui-D4a4x3cu.mjs → sui-Ccg74tOQ.mjs} +4 -4
  97. package/lib/{unsignedTransaction-CNIMIRIN.mjs → unsignedTransaction-N51EO9OV.mjs} +2 -2
  98. package/lib/{unsignedTransaction-DIjo7pbX.js → unsignedTransaction-qRahjlzp.js} +1 -1
  99. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("./index-B4AF-Mv-.js"),bo=require("./index-t7bJ4K5j.js");var vh=Sh;function Sh(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}const Rh=x.getDefaultExportFromCjs(vh);var ss={exports:{}},po,Ma;function Ah(){if(Ma)return po;Ma=1;var e=1e3,t=e*60,r=t*60,n=r*24,o=n*7,i=n*365.25;po=function(u,h){h=h||{};var b=typeof u;if(b==="string"&&u.length>0)return s(u);if(b==="number"&&isFinite(u))return h.long?f(u):c(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function s(u){if(u=String(u),!(u.length>100)){var h=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(h){var b=parseFloat(h[1]),_=(h[2]||"ms").toLowerCase();switch(_){case"years":case"year":case"yrs":case"yr":case"y":return b*i;case"weeks":case"week":case"w":return b*o;case"days":case"day":case"d":return b*n;case"hours":case"hour":case"hrs":case"hr":case"h":return b*r;case"minutes":case"minute":case"mins":case"min":case"m":return b*t;case"seconds":case"second":case"secs":case"sec":case"s":return b*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return b;default:return}}}}function c(u){var h=Math.abs(u);return h>=n?Math.round(u/n)+"d":h>=r?Math.round(u/r)+"h":h>=t?Math.round(u/t)+"m":h>=e?Math.round(u/e)+"s":u+"ms"}function f(u){var h=Math.abs(u);return h>=n?l(u,h,n,"day"):h>=r?l(u,h,r,"hour"):h>=t?l(u,h,t,"minute"):h>=e?l(u,h,e,"second"):u+" ms"}function l(u,h,b,_){var R=h>=b*1.5;return Math.round(u/b)+" "+_+(R?"s":"")}return po}function Ih(e){r.debug=r,r.default=r,r.coerce=f,r.disable=i,r.enable=o,r.enabled=s,r.humanize=Ah(),r.destroy=l,Object.keys(e).forEach(u=>{r[u]=e[u]}),r.names=[],r.skips=[],r.formatters={};function t(u){let h=0;for(let b=0;b<u.length;b++)h=(h<<5)-h+u.charCodeAt(b),h|=0;return r.colors[Math.abs(h)%r.colors.length]}r.selectColor=t;function r(u){let h,b=null,_,R;function T(...C){if(!T.enabled)return;const D=T,L=Number(new Date),O=L-(h||L);D.diff=O,D.prev=h,D.curr=L,h=L,C[0]=r.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let S=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(Y,X)=>{if(Y==="%%")return"%";S++;const F=r.formatters[X];if(typeof F=="function"){const V=C[S];Y=F.call(D,V),C.splice(S,1),S--}return Y}),r.formatArgs.call(D,C),(D.log||r.log).apply(D,C)}return T.namespace=u,T.useColors=r.useColors(),T.color=r.selectColor(u),T.extend=n,T.destroy=r.destroy,Object.defineProperty(T,"enabled",{enumerable:!0,configurable:!1,get:()=>b!==null?b:(_!==r.namespaces&&(_=r.namespaces,R=r.enabled(u)),R),set:C=>{b=C}}),typeof r.init=="function"&&r.init(T),T}function n(u,h){const b=r(this.namespace+(typeof h>"u"?":":h)+u);return b.log=this.log,b}function o(u){r.save(u),r.namespaces=u,r.names=[],r.skips=[];let h;const b=(typeof u=="string"?u:"").split(/[\s,]+/),_=b.length;for(h=0;h<_;h++)b[h]&&(u=b[h].replace(/\*/g,".*?"),u[0]==="-"?r.skips.push(new RegExp("^"+u.slice(1)+"$")):r.names.push(new RegExp("^"+u+"$")))}function i(){const u=[...r.names.map(c),...r.skips.map(c).map(h=>"-"+h)].join(",");return r.enable(""),u}function s(u){if(u[u.length-1]==="*")return!0;let h,b;for(h=0,b=r.skips.length;h<b;h++)if(r.skips[h].test(u))return!1;for(h=0,b=r.names.length;h<b;h++)if(r.names[h].test(u))return!0;return!1}function c(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function f(u){return u instanceof Error?u.stack||u.message:u}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var Th=Ih;(function(e,t){t.formatArgs=n,t.save=o,t.load=i,t.useColors=r,t.storage=s(),t.destroy=(()=>{let f=!1;return()=>{f||(f=!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`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function n(f){if(f[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+f[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;f.splice(1,0,l,"color: inherit");let u=0,h=0;f[0].replace(/%[a-zA-Z%]/g,b=>{b!=="%%"&&(u++,b==="%c"&&(h=u))}),f.splice(h,0,l)}t.log=console.debug||console.log||(()=>{});function o(f){try{f?t.storage.setItem("debug",f):t.storage.removeItem("debug")}catch{}}function i(){let f;try{f=t.storage.getItem("debug")}catch{}return!f&&typeof x.dist.process<"u"&&"env"in x.dist.process&&(f=x.dist.process.env.DEBUG),f}function s(){try{return localStorage}catch{}}e.exports=Th(t);const{formatters:c}=e.exports;c.j=function(f){try{return JSON.stringify(f)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}})(ss,ss.exports);var Oh=ss.exports,Wt={},mr={},Bs=On;On.default=On;On.stable=Wl;On.stableStringify=Wl;var ui="[...]",Hl="[Circular]",Cr=[],Lr=[];function zl(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function On(e,t,r,n){typeof n>"u"&&(n=zl()),as(e,"",0,[],void 0,0,n);var o;try{Lr.length===0?o=JSON.stringify(e,t,r):o=JSON.stringify(e,Vl(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Cr.length!==0;){var i=Cr.pop();i.length===4?Object.defineProperty(i[0],i[1],i[3]):i[0][i[1]]=i[2]}}return o}function qr(e,t,r,n){var o=Object.getOwnPropertyDescriptor(n,r);o.get!==void 0?o.configurable?(Object.defineProperty(n,r,{value:e}),Cr.push([n,r,t,o])):Lr.push([t,r,e]):(n[r]=e,Cr.push([n,r,t]))}function as(e,t,r,n,o,i,s){i+=1;var c;if(typeof e=="object"&&e!==null){for(c=0;c<n.length;c++)if(n[c]===e){qr(Hl,e,t,o);return}if(typeof s.depthLimit<"u"&&i>s.depthLimit){qr(ui,e,t,o);return}if(typeof s.edgesLimit<"u"&&r+1>s.edgesLimit){qr(ui,e,t,o);return}if(n.push(e),Array.isArray(e))for(c=0;c<e.length;c++)as(e[c],c,c,n,e,i,s);else{var f=Object.keys(e);for(c=0;c<f.length;c++){var l=f[c];as(e[l],l,c,n,e,i,s)}}n.pop()}}function Lh(e,t){return e<t?-1:e>t?1:0}function Wl(e,t,r,n){typeof n>"u"&&(n=zl());var o=fs(e,"",0,[],void 0,0,n)||e,i;try{Lr.length===0?i=JSON.stringify(o,t,r):i=JSON.stringify(o,Vl(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Cr.length!==0;){var s=Cr.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function fs(e,t,r,n,o,i,s){i+=1;var c;if(typeof e=="object"&&e!==null){for(c=0;c<n.length;c++)if(n[c]===e){qr(Hl,e,t,o);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof s.depthLimit<"u"&&i>s.depthLimit){qr(ui,e,t,o);return}if(typeof s.edgesLimit<"u"&&r+1>s.edgesLimit){qr(ui,e,t,o);return}if(n.push(e),Array.isArray(e))for(c=0;c<e.length;c++)fs(e[c],c,c,n,e,i,s);else{var f={},l=Object.keys(e).sort(Lh);for(c=0;c<l.length;c++){var u=l[c];fs(e[u],u,c,n,e,i,s),f[u]=e[u]}if(typeof o<"u")Cr.push([o,t,e]),o[t]=f;else return f}n.pop()}}function Vl(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(Lr.length>0)for(var n=0;n<Lr.length;n++){var o=Lr[n];if(o[1]===t&&o[0]===r){r=o[2],Lr.splice(n,1);break}}return e.call(this,t,r)}}const Ph=x.getDefaultExportFromCjs(Bs);Object.defineProperty(mr,"__esModule",{value:!0});mr.EthereumProviderError=mr.EthereumRpcError=void 0;const Ch=Bs;class ql extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return Ch.default(this.serialize(),$h,2)}}mr.EthereumRpcError=ql;let Nh=class extends ql{constructor(t,r,n){if(!Bh(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};mr.EthereumProviderError=Nh;function Bh(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function $h(e,t){if(t!=="[Circular]")return t}var $s={},Er={};Object.defineProperty(Er,"__esModule",{value:!0});Er.errorValues=Er.errorCodes=void 0;Er.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}};Er.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."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Er,r=mr,n=t.errorCodes.rpc.internal,o="Unspecified error message. This is a bug, please report it.",i={code:n,message:s(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function s(b,_=o){if(Number.isInteger(b)){const R=b.toString();if(h(t.errorValues,R))return t.errorValues[R].message;if(l(b))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return _}e.getMessageFromCode=s;function c(b){if(!Number.isInteger(b))return!1;const _=b.toString();return!!(t.errorValues[_]||l(b))}e.isValidCode=c;function f(b,{fallbackError:_=i,shouldIncludeStack:R=!1}={}){var T,C;if(!_||!Number.isInteger(_.code)||typeof _.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(b instanceof r.EthereumRpcError)return b.serialize();const D={};if(b&&typeof b=="object"&&!Array.isArray(b)&&h(b,"code")&&c(b.code)){const O=b;D.code=O.code,O.message&&typeof O.message=="string"?(D.message=O.message,h(O,"data")&&(D.data=O.data)):(D.message=s(D.code),D.data={originalError:u(b)})}else{D.code=_.code;const O=(T=b)===null||T===void 0?void 0:T.message;D.message=O&&typeof O=="string"?O:_.message,D.data={originalError:u(b)}}const L=(C=b)===null||C===void 0?void 0:C.stack;return R&&b&&L&&typeof L=="string"&&(D.stack=L),D}e.serializeError=f;function l(b){return b>=-32099&&b<=-32e3}function u(b){return b&&typeof b=="object"&&!Array.isArray(b)?Object.assign({},b):b}function h(b,_){return Object.prototype.hasOwnProperty.call(b,_)}})($s);var Ei={};Object.defineProperty(Ei,"__esModule",{value:!0});Ei.ethErrors=void 0;const ks=mr,Gl=$s,_t=Er;Ei.ethErrors={rpc:{parse:e=>Ct(_t.errorCodes.rpc.parse,e),invalidRequest:e=>Ct(_t.errorCodes.rpc.invalidRequest,e),invalidParams:e=>Ct(_t.errorCodes.rpc.invalidParams,e),methodNotFound:e=>Ct(_t.errorCodes.rpc.methodNotFound,e),internal:e=>Ct(_t.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||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 Ct(t,e)},invalidInput:e=>Ct(_t.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>Ct(_t.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Ct(_t.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Ct(_t.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Ct(_t.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Ct(_t.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>gn(_t.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>gn(_t.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>gn(_t.errorCodes.provider.unsupportedMethod,e),disconnected:e=>gn(_t.errorCodes.provider.disconnected,e),chainDisconnected:e=>gn(_t.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new ks.EthereumProviderError(t,r,n)}}};function Ct(e,t){const[r,n]=Zl(t);return new ks.EthereumRpcError(e,r||Gl.getMessageFromCode(e),n)}function gn(e,t){const[r,n]=Zl(t);return new ks.EthereumProviderError(e,r||Gl.getMessageFromCode(e),n)}function Zl(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=mr;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=$s;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=Ei;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const o=Er;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return o.errorCodes}})})(Wt);var kh={exports:{}},yo={exports:{}},et={ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,r){return e.slice(t,r)},Error,FunctionPrototypeCall(e,t,...r){return e.call(t,...r)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,r){return Object.defineProperty(e,t,r)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,r){return e.then(t,r)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,r){return e.slice(t,r)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,t,r){return e.set(t,r)},Boolean,Uint8Array},Kl={exports:{}},_n={exports:{}},Fa;function Ln(){if(Fa)return _n.exports;Fa=1;const{AbortController:e,AbortSignal:t}=typeof self<"u"?self:typeof window<"u"?window:void 0;return _n.exports=e,_n.exports.AbortSignal=t,_n.exports.default=e,_n.exports}(function(e){const t=x.bufferPolyfill,{kResistStopPropagation:r,SymbolDispose:n}=et,o=globalThis.AbortSignal||Ln().AbortSignal,i=globalThis.AbortController||Ln().AbortController,s=Object.getPrototypeOf(async function(){}).constructor,c=globalThis.Blob||t.Blob,f=typeof c<"u"?function(_){return _ instanceof c}:function(_){return!1},l=(b,_)=>{if(b!==void 0&&(b===null||typeof b!="object"||!("aborted"in b)))throw new ERR_INVALID_ARG_TYPE(_,"AbortSignal",b)},u=(b,_)=>{if(typeof b!="function")throw new ERR_INVALID_ARG_TYPE(_,"Function",b)};class h extends Error{constructor(_){if(!Array.isArray(_))throw new TypeError(`Expected input to be an Array, got ${typeof _}`);let R="";for(let T=0;T<_.length;T++)R+=` ${_[T].stack}
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("./index-s2bgjlxF.js"),bo=require("./index-CjCHChpV.js");var vh=Sh;function Sh(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}const Rh=x.getDefaultExportFromCjs(vh);var ss={exports:{}},po,Ma;function Ah(){if(Ma)return po;Ma=1;var e=1e3,t=e*60,r=t*60,n=r*24,o=n*7,i=n*365.25;po=function(u,h){h=h||{};var b=typeof u;if(b==="string"&&u.length>0)return s(u);if(b==="number"&&isFinite(u))return h.long?f(u):c(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function s(u){if(u=String(u),!(u.length>100)){var h=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(h){var b=parseFloat(h[1]),_=(h[2]||"ms").toLowerCase();switch(_){case"years":case"year":case"yrs":case"yr":case"y":return b*i;case"weeks":case"week":case"w":return b*o;case"days":case"day":case"d":return b*n;case"hours":case"hour":case"hrs":case"hr":case"h":return b*r;case"minutes":case"minute":case"mins":case"min":case"m":return b*t;case"seconds":case"second":case"secs":case"sec":case"s":return b*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return b;default:return}}}}function c(u){var h=Math.abs(u);return h>=n?Math.round(u/n)+"d":h>=r?Math.round(u/r)+"h":h>=t?Math.round(u/t)+"m":h>=e?Math.round(u/e)+"s":u+"ms"}function f(u){var h=Math.abs(u);return h>=n?l(u,h,n,"day"):h>=r?l(u,h,r,"hour"):h>=t?l(u,h,t,"minute"):h>=e?l(u,h,e,"second"):u+" ms"}function l(u,h,b,_){var R=h>=b*1.5;return Math.round(u/b)+" "+_+(R?"s":"")}return po}function Ih(e){r.debug=r,r.default=r,r.coerce=f,r.disable=i,r.enable=o,r.enabled=s,r.humanize=Ah(),r.destroy=l,Object.keys(e).forEach(u=>{r[u]=e[u]}),r.names=[],r.skips=[],r.formatters={};function t(u){let h=0;for(let b=0;b<u.length;b++)h=(h<<5)-h+u.charCodeAt(b),h|=0;return r.colors[Math.abs(h)%r.colors.length]}r.selectColor=t;function r(u){let h,b=null,_,R;function T(...C){if(!T.enabled)return;const D=T,L=Number(new Date),O=L-(h||L);D.diff=O,D.prev=h,D.curr=L,h=L,C[0]=r.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let S=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(Y,X)=>{if(Y==="%%")return"%";S++;const F=r.formatters[X];if(typeof F=="function"){const V=C[S];Y=F.call(D,V),C.splice(S,1),S--}return Y}),r.formatArgs.call(D,C),(D.log||r.log).apply(D,C)}return T.namespace=u,T.useColors=r.useColors(),T.color=r.selectColor(u),T.extend=n,T.destroy=r.destroy,Object.defineProperty(T,"enabled",{enumerable:!0,configurable:!1,get:()=>b!==null?b:(_!==r.namespaces&&(_=r.namespaces,R=r.enabled(u)),R),set:C=>{b=C}}),typeof r.init=="function"&&r.init(T),T}function n(u,h){const b=r(this.namespace+(typeof h>"u"?":":h)+u);return b.log=this.log,b}function o(u){r.save(u),r.namespaces=u,r.names=[],r.skips=[];let h;const b=(typeof u=="string"?u:"").split(/[\s,]+/),_=b.length;for(h=0;h<_;h++)b[h]&&(u=b[h].replace(/\*/g,".*?"),u[0]==="-"?r.skips.push(new RegExp("^"+u.slice(1)+"$")):r.names.push(new RegExp("^"+u+"$")))}function i(){const u=[...r.names.map(c),...r.skips.map(c).map(h=>"-"+h)].join(",");return r.enable(""),u}function s(u){if(u[u.length-1]==="*")return!0;let h,b;for(h=0,b=r.skips.length;h<b;h++)if(r.skips[h].test(u))return!1;for(h=0,b=r.names.length;h<b;h++)if(r.names[h].test(u))return!0;return!1}function c(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function f(u){return u instanceof Error?u.stack||u.message:u}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var Th=Ih;(function(e,t){t.formatArgs=n,t.save=o,t.load=i,t.useColors=r,t.storage=s(),t.destroy=(()=>{let f=!1;return()=>{f||(f=!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`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function n(f){if(f[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+f[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;f.splice(1,0,l,"color: inherit");let u=0,h=0;f[0].replace(/%[a-zA-Z%]/g,b=>{b!=="%%"&&(u++,b==="%c"&&(h=u))}),f.splice(h,0,l)}t.log=console.debug||console.log||(()=>{});function o(f){try{f?t.storage.setItem("debug",f):t.storage.removeItem("debug")}catch{}}function i(){let f;try{f=t.storage.getItem("debug")}catch{}return!f&&typeof x.dist.process<"u"&&"env"in x.dist.process&&(f=x.dist.process.env.DEBUG),f}function s(){try{return localStorage}catch{}}e.exports=Th(t);const{formatters:c}=e.exports;c.j=function(f){try{return JSON.stringify(f)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}})(ss,ss.exports);var Oh=ss.exports,Wt={},mr={},Bs=On;On.default=On;On.stable=Wl;On.stableStringify=Wl;var ui="[...]",Hl="[Circular]",Cr=[],Lr=[];function zl(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function On(e,t,r,n){typeof n>"u"&&(n=zl()),as(e,"",0,[],void 0,0,n);var o;try{Lr.length===0?o=JSON.stringify(e,t,r):o=JSON.stringify(e,Vl(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Cr.length!==0;){var i=Cr.pop();i.length===4?Object.defineProperty(i[0],i[1],i[3]):i[0][i[1]]=i[2]}}return o}function qr(e,t,r,n){var o=Object.getOwnPropertyDescriptor(n,r);o.get!==void 0?o.configurable?(Object.defineProperty(n,r,{value:e}),Cr.push([n,r,t,o])):Lr.push([t,r,e]):(n[r]=e,Cr.push([n,r,t]))}function as(e,t,r,n,o,i,s){i+=1;var c;if(typeof e=="object"&&e!==null){for(c=0;c<n.length;c++)if(n[c]===e){qr(Hl,e,t,o);return}if(typeof s.depthLimit<"u"&&i>s.depthLimit){qr(ui,e,t,o);return}if(typeof s.edgesLimit<"u"&&r+1>s.edgesLimit){qr(ui,e,t,o);return}if(n.push(e),Array.isArray(e))for(c=0;c<e.length;c++)as(e[c],c,c,n,e,i,s);else{var f=Object.keys(e);for(c=0;c<f.length;c++){var l=f[c];as(e[l],l,c,n,e,i,s)}}n.pop()}}function Lh(e,t){return e<t?-1:e>t?1:0}function Wl(e,t,r,n){typeof n>"u"&&(n=zl());var o=fs(e,"",0,[],void 0,0,n)||e,i;try{Lr.length===0?i=JSON.stringify(o,t,r):i=JSON.stringify(o,Vl(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Cr.length!==0;){var s=Cr.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function fs(e,t,r,n,o,i,s){i+=1;var c;if(typeof e=="object"&&e!==null){for(c=0;c<n.length;c++)if(n[c]===e){qr(Hl,e,t,o);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof s.depthLimit<"u"&&i>s.depthLimit){qr(ui,e,t,o);return}if(typeof s.edgesLimit<"u"&&r+1>s.edgesLimit){qr(ui,e,t,o);return}if(n.push(e),Array.isArray(e))for(c=0;c<e.length;c++)fs(e[c],c,c,n,e,i,s);else{var f={},l=Object.keys(e).sort(Lh);for(c=0;c<l.length;c++){var u=l[c];fs(e[u],u,c,n,e,i,s),f[u]=e[u]}if(typeof o<"u")Cr.push([o,t,e]),o[t]=f;else return f}n.pop()}}function Vl(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(Lr.length>0)for(var n=0;n<Lr.length;n++){var o=Lr[n];if(o[1]===t&&o[0]===r){r=o[2],Lr.splice(n,1);break}}return e.call(this,t,r)}}const Ph=x.getDefaultExportFromCjs(Bs);Object.defineProperty(mr,"__esModule",{value:!0});mr.EthereumProviderError=mr.EthereumRpcError=void 0;const Ch=Bs;class ql extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return Ch.default(this.serialize(),$h,2)}}mr.EthereumRpcError=ql;let Nh=class extends ql{constructor(t,r,n){if(!Bh(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};mr.EthereumProviderError=Nh;function Bh(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function $h(e,t){if(t!=="[Circular]")return t}var $s={},Er={};Object.defineProperty(Er,"__esModule",{value:!0});Er.errorValues=Er.errorCodes=void 0;Er.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}};Er.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."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Er,r=mr,n=t.errorCodes.rpc.internal,o="Unspecified error message. This is a bug, please report it.",i={code:n,message:s(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function s(b,_=o){if(Number.isInteger(b)){const R=b.toString();if(h(t.errorValues,R))return t.errorValues[R].message;if(l(b))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return _}e.getMessageFromCode=s;function c(b){if(!Number.isInteger(b))return!1;const _=b.toString();return!!(t.errorValues[_]||l(b))}e.isValidCode=c;function f(b,{fallbackError:_=i,shouldIncludeStack:R=!1}={}){var T,C;if(!_||!Number.isInteger(_.code)||typeof _.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(b instanceof r.EthereumRpcError)return b.serialize();const D={};if(b&&typeof b=="object"&&!Array.isArray(b)&&h(b,"code")&&c(b.code)){const O=b;D.code=O.code,O.message&&typeof O.message=="string"?(D.message=O.message,h(O,"data")&&(D.data=O.data)):(D.message=s(D.code),D.data={originalError:u(b)})}else{D.code=_.code;const O=(T=b)===null||T===void 0?void 0:T.message;D.message=O&&typeof O=="string"?O:_.message,D.data={originalError:u(b)}}const L=(C=b)===null||C===void 0?void 0:C.stack;return R&&b&&L&&typeof L=="string"&&(D.stack=L),D}e.serializeError=f;function l(b){return b>=-32099&&b<=-32e3}function u(b){return b&&typeof b=="object"&&!Array.isArray(b)?Object.assign({},b):b}function h(b,_){return Object.prototype.hasOwnProperty.call(b,_)}})($s);var Ei={};Object.defineProperty(Ei,"__esModule",{value:!0});Ei.ethErrors=void 0;const ks=mr,Gl=$s,_t=Er;Ei.ethErrors={rpc:{parse:e=>Ct(_t.errorCodes.rpc.parse,e),invalidRequest:e=>Ct(_t.errorCodes.rpc.invalidRequest,e),invalidParams:e=>Ct(_t.errorCodes.rpc.invalidParams,e),methodNotFound:e=>Ct(_t.errorCodes.rpc.methodNotFound,e),internal:e=>Ct(_t.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||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 Ct(t,e)},invalidInput:e=>Ct(_t.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>Ct(_t.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Ct(_t.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Ct(_t.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Ct(_t.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Ct(_t.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>gn(_t.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>gn(_t.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>gn(_t.errorCodes.provider.unsupportedMethod,e),disconnected:e=>gn(_t.errorCodes.provider.disconnected,e),chainDisconnected:e=>gn(_t.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new ks.EthereumProviderError(t,r,n)}}};function Ct(e,t){const[r,n]=Zl(t);return new ks.EthereumRpcError(e,r||Gl.getMessageFromCode(e),n)}function gn(e,t){const[r,n]=Zl(t);return new ks.EthereumProviderError(e,r||Gl.getMessageFromCode(e),n)}function Zl(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=mr;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=$s;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=Ei;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const o=Er;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return o.errorCodes}})})(Wt);var kh={exports:{}},yo={exports:{}},et={ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,r){return e.slice(t,r)},Error,FunctionPrototypeCall(e,t,...r){return e.call(t,...r)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,r){return Object.defineProperty(e,t,r)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,r){return e.then(t,r)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,r){return e.slice(t,r)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,t,r){return e.set(t,r)},Boolean,Uint8Array},Kl={exports:{}},_n={exports:{}},Fa;function Ln(){if(Fa)return _n.exports;Fa=1;const{AbortController:e,AbortSignal:t}=typeof self<"u"?self:typeof window<"u"?window:void 0;return _n.exports=e,_n.exports.AbortSignal=t,_n.exports.default=e,_n.exports}(function(e){const t=x.bufferPolyfill,{kResistStopPropagation:r,SymbolDispose:n}=et,o=globalThis.AbortSignal||Ln().AbortSignal,i=globalThis.AbortController||Ln().AbortController,s=Object.getPrototypeOf(async function(){}).constructor,c=globalThis.Blob||t.Blob,f=typeof c<"u"?function(_){return _ instanceof c}:function(_){return!1},l=(b,_)=>{if(b!==void 0&&(b===null||typeof b!="object"||!("aborted"in b)))throw new ERR_INVALID_ARG_TYPE(_,"AbortSignal",b)},u=(b,_)=>{if(typeof b!="function")throw new ERR_INVALID_ARG_TYPE(_,"Function",b)};class h extends Error{constructor(_){if(!Array.isArray(_))throw new TypeError(`Expected input to be an Array, got ${typeof _}`);let R="";for(let T=0;T<_.length;T++)R+=` ${_[T].stack}
2
2
  `;super(R),this.name="AggregateError",this.errors=_}}e.exports={AggregateError:h,kEmptyObject:Object.freeze({}),once(b){let _=!1;return function(...R){_||(_=!0,b.apply(this,R))}},createDeferredPromise:function(){let b,_;return{promise:new Promise((T,C)=>{b=T,_=C}),resolve:b,reject:_}},promisify(b){return new Promise((_,R)=>{b((T,...C)=>T?R(T):_(...C))})},debuglog(){return function(){}},format(b,..._){return b.replace(/%([sdifj])/g,function(...[R,T]){const C=_.shift();return T==="f"?C.toFixed(6):T==="j"?JSON.stringify(C):T==="s"&&typeof C=="object"?`${C.constructor!==Object?C.constructor.name:""} {}`.trim():C.toString()})},inspect(b){switch(typeof b){case"string":if(b.includes("'"))if(b.includes('"')){if(!b.includes("`")&&!b.includes("${"))return`\`${b}\``}else return`"${b}"`;return`'${b}'`;case"number":return isNaN(b)?"NaN":Object.is(b,-0)?String(b):b;case"bigint":return`${String(b)}n`;case"boolean":case"undefined":return String(b);case"object":return"{}"}},types:{isAsyncFunction(b){return b instanceof s},isArrayBufferView(b){return ArrayBuffer.isView(b)}},isBlob:f,deprecate(b,_){return b},addAbortListener:x.eventsExports.addAbortListener||function(_,R){if(_===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",_);l(_,"signal"),u(R,"listener");let T;return _.aborted?queueMicrotask(()=>R()):(_.addEventListener("abort",R,{__proto__:null,once:!0,[r]:!0}),T=()=>{_.removeEventListener("abort",R)}),{__proto__:null,[n](){var C;(C=T)===null||C===void 0||C()}}},AbortSignalAny:o.any||function(_){if(_.length===1)return _[0];const R=new i,T=()=>R.abort();return _.forEach(C=>{l(C,"signals"),C.addEventListener("abort",T,{once:!0})}),R.signal.addEventListener("abort",()=>{_.forEach(C=>C.removeEventListener("abort",T))},{once:!0}),R.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(Kl);var mt=Kl.exports,xs={};const{format:xh,inspect:di,AggregateError:Dh}=mt,jh=globalThis.AggregateError||Dh,Mh=Symbol("kIsNodeError"),Fh=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Uh=/^([A-Z][a-z0-9]*)+$/,Hh="__node_internal_",vi={};function Pr(e,t){if(!e)throw new vi.ERR_INTERNAL_ASSERTION(t)}function Ua(e){let t="",r=e.length;const n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function zh(e,t,r){if(typeof t=="function")return Pr(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);const n=(t.match(/%[dfijoOs]/g)||[]).length;return Pr(n===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?t:xh(t,...r)}function ht(e,t,r){r||(r=Error);class n extends r{constructor(...i){super(zh(e,t,i))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(n.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=e,n.prototype[Mh]=!0,vi[e]=n}function Ha(e){const t=Hh+e.name;return Object.defineProperty(e,"name",{value:t}),e}function Wh(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const r=new jh([t,e],t.message);return r.code=t.code,r}return e||t}let Vh=class extends Error{constructor(t="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new vi.ERR_INVALID_ARG_TYPE("options","Object",r);super(t,r),this.code="ABORT_ERR",this.name="AbortError"}};ht("ERR_ASSERTION","%s",Error);ht("ERR_INVALID_ARG_TYPE",(e,t,r)=>{Pr(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";const o=[],i=[],s=[];for(const f of t)Pr(typeof f=="string","All expected entries have to be of type string"),Fh.includes(f)?o.push(f.toLowerCase()):Uh.test(f)?i.push(f):(Pr(f!=="object",'The value "object" should be written as "Object"'),s.push(f));if(i.length>0){const f=o.indexOf("object");f!==-1&&(o.splice(o,f,1),i.push("Object"))}if(o.length>0){switch(o.length){case 1:n+=`of type ${o[0]}`;break;case 2:n+=`one of type ${o[0]} or ${o[1]}`;break;default:{const f=o.pop();n+=`one of type ${o.join(", ")}, or ${f}`}}(i.length>0||s.length>0)&&(n+=" or ")}if(i.length>0){switch(i.length){case 1:n+=`an instance of ${i[0]}`;break;case 2:n+=`an instance of ${i[0]} or ${i[1]}`;break;default:{const f=i.pop();n+=`an instance of ${i.join(", ")}, or ${f}`}}s.length>0&&(n+=" or ")}switch(s.length){case 0:break;case 1:s[0].toLowerCase()!==s[0]&&(n+="an "),n+=`${s[0]}`;break;case 2:n+=`one of ${s[0]} or ${s[1]}`;break;default:{const f=s.pop();n+=`one of ${s.join(", ")}, or ${f}`}}if(r==null)n+=`. Received ${r}`;else if(typeof r=="function"&&r.name)n+=`. Received function ${r.name}`;else if(typeof r=="object"){var c;if((c=r.constructor)!==null&&c!==void 0&&c.name)n+=`. Received an instance of ${r.constructor.name}`;else{const f=di(r,{depth:-1});n+=`. Received ${f}`}}else{let f=di(r,{colors:!1});f.length>25&&(f=`${f.slice(0,25)}...`),n+=`. Received type ${typeof r} (${f})`}return n},TypeError);ht("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let n=di(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${n}`},TypeError);ht("ERR_INVALID_RETURN_VALUE",(e,t,r)=>{var n;const o=r!=null&&(n=r.constructor)!==null&&n!==void 0&&n.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${e} to be returned from the "${t}" function but got ${o}.`},TypeError);ht("ERR_MISSING_ARGS",(...e)=>{Pr(e.length>0,"At least one arg needs to be specified");let t;const r=e.length;switch(e=(Array.isArray(e)?e:[e]).map(n=>`"${n}"`).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{const n=e.pop();t+=`The ${e.join(", ")}, and ${n} arguments`}break}return`${t} must be specified`},TypeError);ht("ERR_OUT_OF_RANGE",(e,t,r)=>{Pr(t,'Missing "range" argument');let n;return Number.isInteger(r)&&Math.abs(r)>2**32?n=Ua(String(r)):typeof r=="bigint"?(n=String(r),(r>2n**32n||r<-(2n**32n))&&(n=Ua(n)),n+="n"):n=di(r),`The value of "${e}" is out of range. It must be ${t}. Received ${n}`},RangeError);ht("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);ht("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);ht("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);ht("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);ht("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);ht("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);ht("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);ht("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);ht("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);ht("ERR_STREAM_WRITE_AFTER_END","write after end",Error);ht("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);var Rt={AbortError:Vh,aggregateTwoErrors:Ha(Wh),hideStackFrames:Ha,codes:vi};const{ArrayIsArray:Ds,ArrayPrototypeIncludes:Jl,ArrayPrototypeJoin:Xl,ArrayPrototypeMap:qh,NumberIsInteger:js,NumberIsNaN:Gh,NumberMAX_SAFE_INTEGER:Zh,NumberMIN_SAFE_INTEGER:Kh,NumberParseInt:Jh,ObjectPrototypeHasOwnProperty:Xh,RegExpPrototypeExec:Yl,String:Yh,StringPrototypeToUpperCase:Qh,StringPrototypeTrim:eg}=et,{hideStackFrames:jt,codes:{ERR_SOCKET_BAD_PORT:tg,ERR_INVALID_ARG_TYPE:yt,ERR_INVALID_ARG_VALUE:on,ERR_OUT_OF_RANGE:Nr,ERR_UNKNOWN_SIGNAL:za}}=Rt,{normalizeEncoding:rg}=mt,{isAsyncFunction:ng,isArrayBufferView:ig}=mt.types,Wa={};function og(e){return e===(e|0)}function sg(e){return e===e>>>0}const ag=/^[0-7]+$/,fg="must be a 32-bit unsigned integer or an octal string";function lg(e,t,r){if(typeof e>"u"&&(e=r),typeof e=="string"){if(Yl(ag,e)===null)throw new on(t,e,fg);e=Jh(e,8)}return Ql(e,t),e}const cg=jt((e,t,r=Kh,n=Zh)=>{if(typeof e!="number")throw new yt(t,"number",e);if(!js(e))throw new Nr(t,"an integer",e);if(e<r||e>n)throw new Nr(t,`>= ${r} && <= ${n}`,e)}),ug=jt((e,t,r=-2147483648,n=2147483647)=>{if(typeof e!="number")throw new yt(t,"number",e);if(!js(e))throw new Nr(t,"an integer",e);if(e<r||e>n)throw new Nr(t,`>= ${r} && <= ${n}`,e)}),Ql=jt((e,t,r=!1)=>{if(typeof e!="number")throw new yt(t,"number",e);if(!js(e))throw new Nr(t,"an integer",e);const n=r?1:0,o=4294967295;if(e<n||e>o)throw new Nr(t,`>= ${n} && <= ${o}`,e)});function Ms(e,t){if(typeof e!="string")throw new yt(t,"string",e)}function dg(e,t,r=void 0,n){if(typeof e!="number")throw new yt(t,"number",e);if(r!=null&&e<r||n!=null&&e>n||(r!=null||n!=null)&&Gh(e))throw new Nr(t,`${r!=null?`>= ${r}`:""}${r!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,e)}const hg=jt((e,t,r)=>{if(!Jl(r,e)){const o="must be one of: "+Xl(qh(r,i=>typeof i=="string"?`'${i}'`:Yh(i)),", ");throw new on(t,e,o)}});function ec(e,t){if(typeof e!="boolean")throw new yt(t,"boolean",e)}function wo(e,t,r){return e==null||!Xh(e,t)?r:e[t]}const gg=jt((e,t,r=null)=>{const n=wo(r,"allowArray",!1),o=wo(r,"allowFunction",!1);if(!wo(r,"nullable",!1)&&e===null||!n&&Ds(e)||typeof e!="object"&&(!o||typeof e!="function"))throw new yt(t,"Object",e)}),_g=jt((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new yt(t,"a dictionary",e)}),Si=jt((e,t,r=0)=>{if(!Ds(e))throw new yt(t,"Array",e);if(e.length<r){const n=`must be longer than ${r}`;throw new on(t,e,n)}});function bg(e,t){Si(e,t);for(let r=0;r<e.length;r++)Ms(e[r],`${t}[${r}]`)}function pg(e,t){Si(e,t);for(let r=0;r<e.length;r++)ec(e[r],`${t}[${r}]`)}function yg(e,t){Si(e,t);for(let r=0;r<e.length;r++){const n=e[r],o=`${t}[${r}]`;if(n==null)throw new yt(o,"AbortSignal",n);tc(n,o)}}function wg(e,t="signal"){if(Ms(e,t),Wa[e]===void 0)throw Wa[Qh(e)]!==void 0?new za(e+" (signals must use all capital letters)"):new za(e)}const mg=jt((e,t="buffer")=>{if(!ig(e))throw new yt(t,["Buffer","TypedArray","DataView"],e)});function Eg(e,t){const r=rg(t),n=e.length;if(r==="hex"&&n%2!==0)throw new on("encoding",t,`is invalid for data of length ${n}`)}function vg(e,t="Port",r=!0){if(typeof e!="number"&&typeof e!="string"||typeof e=="string"&&eg(e).length===0||+e!==+e>>>0||e>65535||e===0&&!r)throw new tg(t,e,r);return e|0}const tc=jt((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new yt(t,"AbortSignal",e)}),Sg=jt((e,t)=>{if(typeof e!="function")throw new yt(t,"Function",e)}),Rg=jt((e,t)=>{if(typeof e!="function"||ng(e))throw new yt(t,"Function",e)}),Ag=jt((e,t)=>{if(e!==void 0)throw new yt(t,"undefined",e)});function Ig(e,t,r){if(!Jl(r,e))throw new yt(t,`('${Xl(r,"|")}')`,e)}const Tg=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Va(e,t){if(typeof e>"u"||!Yl(Tg,e))throw new on(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Og(e){if(typeof e=="string")return Va(e,"hints"),e;if(Ds(e)){const t=e.length;let r="";if(t===0)return r;for(let n=0;n<t;n++){const o=e[n];Va(o,"hints"),r+=o,n!==t-1&&(r+=", ")}return r}throw new on("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}var kn={isInt32:og,isUint32:sg,parseFileMode:lg,validateArray:Si,validateStringArray:bg,validateBooleanArray:pg,validateAbortSignalArray:yg,validateBoolean:ec,validateBuffer:mg,validateDictionary:_g,validateEncoding:Eg,validateFunction:Sg,validateInt32:ug,validateInteger:cg,validateNumber:dg,validateObject:gg,validateOneOf:hg,validatePlainFunction:Rg,validatePort:vg,validateSignalName:wg,validateString:Ms,validateUint32:Ql,validateUndefined:Ag,validateUnion:Ig,validateAbortSignal:tc,validateLinkHeaderValue:Og},Fs={exports:{}};const{SymbolAsyncIterator:qa,SymbolIterator:Ga,SymbolFor:kr}=et,rc=kr("nodejs.stream.destroyed"),nc=kr("nodejs.stream.errored"),ls=kr("nodejs.stream.readable"),cs=kr("nodejs.stream.writable"),ic=kr("nodejs.stream.disturbed"),Lg=kr("nodejs.webstream.isClosedPromise"),Pg=kr("nodejs.webstream.controllerErrorFunction");function Ri(e,t=!1){var r;return!!(e&&typeof e.pipe=="function"&&typeof e.on=="function"&&(!t||typeof e.pause=="function"&&typeof e.resume=="function")&&(!e._writableState||((r=e._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!e._writableState||e._readableState))}function Ai(e){var t;return!!(e&&typeof e.write=="function"&&typeof e.on=="function"&&(!e._readableState||((t=e._writableState)===null||t===void 0?void 0:t.writable)!==!1))}function Cg(e){return!!(e&&typeof e.pipe=="function"&&e._readableState&&typeof e.on=="function"&&typeof e.write=="function")}function ir(e){return e&&(e._readableState||e._writableState||typeof e.write=="function"&&typeof e.on=="function"||typeof e.pipe=="function"&&typeof e.on=="function")}function oc(e){return!!(e&&!ir(e)&&typeof e.pipeThrough=="function"&&typeof e.getReader=="function"&&typeof e.cancel=="function")}function sc(e){return!!(e&&!ir(e)&&typeof e.getWriter=="function"&&typeof e.abort=="function")}function ac(e){return!!(e&&!ir(e)&&typeof e.readable=="object"&&typeof e.writable=="object")}function Ng(e){return oc(e)||sc(e)||ac(e)}function Bg(e,t){return e==null?!1:t===!0?typeof e[qa]=="function":t===!1?typeof e[Ga]=="function":typeof e[qa]=="function"||typeof e[Ga]=="function"}function Ii(e){if(!ir(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[rc]||n!=null&&n.destroyed)}function fc(e){if(!Ai(e))return null;if(e.writableEnded===!0)return!0;const t=e._writableState;return t!=null&&t.errored?!1:typeof(t==null?void 0:t.ended)!="boolean"?null:t.ended}function $g(e,t){if(!Ai(e))return null;if(e.writableFinished===!0)return!0;const r=e._writableState;return r!=null&&r.errored?!1:typeof(r==null?void 0:r.finished)!="boolean"?null:!!(r.finished||t===!1&&r.ended===!0&&r.length===0)}function kg(e){if(!Ri(e))return null;if(e.readableEnded===!0)return!0;const t=e._readableState;return!t||t.errored?!1:typeof(t==null?void 0:t.ended)!="boolean"?null:t.ended}function lc(e,t){if(!Ri(e))return null;const r=e._readableState;return r!=null&&r.errored?!1:typeof(r==null?void 0:r.endEmitted)!="boolean"?null:!!(r.endEmitted||t===!1&&r.ended===!0&&r.length===0)}function cc(e){return e&&e[ls]!=null?e[ls]:typeof(e==null?void 0:e.readable)!="boolean"?null:Ii(e)?!1:Ri(e)&&e.readable&&!lc(e)}function uc(e){return e&&e[cs]!=null?e[cs]:typeof(e==null?void 0:e.writable)!="boolean"?null:Ii(e)?!1:Ai(e)&&e.writable&&!fc(e)}function xg(e,t){return ir(e)?Ii(e)?!0:!((t==null?void 0:t.readable)!==!1&&cc(e)||(t==null?void 0:t.writable)!==!1&&uc(e)):null}function Dg(e){var t,r;return ir(e)?e.writableErrored?e.writableErrored:(t=(r=e._writableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}function jg(e){var t,r;return ir(e)?e.readableErrored?e.readableErrored:(t=(r=e._readableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}function Mg(e){if(!ir(e))return null;if(typeof e.closed=="boolean")return e.closed;const t=e._writableState,r=e._readableState;return typeof(t==null?void 0:t.closed)=="boolean"||typeof(r==null?void 0:r.closed)=="boolean"?(t==null?void 0:t.closed)||(r==null?void 0:r.closed):typeof e._closed=="boolean"&&dc(e)?e._closed:null}function dc(e){return typeof e._closed=="boolean"&&typeof e._defaultKeepAlive=="boolean"&&typeof e._removedConnection=="boolean"&&typeof e._removedContLen=="boolean"}function hc(e){return typeof e._sent100=="boolean"&&dc(e)}function Fg(e){var t;return typeof e._consuming=="boolean"&&typeof e._dumped=="boolean"&&((t=e.req)===null||t===void 0?void 0:t.upgradeOrConnect)===void 0}function Ug(e){if(!ir(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!n&&hc(e)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}function Hg(e){var t;return!!(e&&((t=e[ic])!==null&&t!==void 0?t:e.readableDidRead||e.readableAborted))}function zg(e){var t,r,n,o,i,s,c,f,l,u;return!!(e&&((t=(r=(n=(o=(i=(s=e[nc])!==null&&s!==void 0?s:e.readableErrored)!==null&&i!==void 0?i:e.writableErrored)!==null&&o!==void 0?o:(c=e._readableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&n!==void 0?n:(f=e._writableState)===null||f===void 0?void 0:f.errorEmitted)!==null&&r!==void 0?r:(l=e._readableState)===null||l===void 0?void 0:l.errored)!==null&&t!==void 0?t:!((u=e._writableState)===null||u===void 0)&&u.errored))}var hr={isDestroyed:Ii,kIsDestroyed:rc,isDisturbed:Hg,kIsDisturbed:ic,isErrored:zg,kIsErrored:nc,isReadable:cc,kIsReadable:ls,kIsClosedPromise:Lg,kControllerErrorFunction:Pg,kIsWritable:cs,isClosed:Mg,isDuplexNodeStream:Cg,isFinished:xg,isIterable:Bg,isReadableNodeStream:Ri,isReadableStream:oc,isReadableEnded:kg,isReadableFinished:lc,isReadableErrored:jg,isNodeStream:ir,isWebStream:Ng,isWritable:uc,isWritableNodeStream:Ai,isWritableStream:sc,isWritableEnded:fc,isWritableFinished:$g,isWritableErrored:Dg,isServerRequest:Fg,isServerResponse:hc,willEmitClose:Ug,isTransformStream:ac};const pr=x.browserExports,{AbortError:gc,codes:Wg}=Rt,{ERR_INVALID_ARG_TYPE:Vg,ERR_STREAM_PREMATURE_CLOSE:Za}=Wg,{kEmptyObject:us,once:ds}=mt,{validateAbortSignal:qg,validateFunction:Gg,validateObject:Zg,validateBoolean:Kg}=kn,{Promise:Jg,PromisePrototypeThen:Xg,SymbolDispose:_c}=et,{isClosed:Yg,isReadable:Ka,isReadableNodeStream:mo,isReadableStream:Qg,isReadableFinished:Ja,isReadableErrored:Xa,isWritable:Ya,isWritableNodeStream:Qa,isWritableStream:e0,isWritableFinished:ef,isWritableErrored:tf,isNodeStream:t0,willEmitClose:r0,kIsClosedPromise:n0}=hr;let Gr;function i0(e){return e.setHeader&&typeof e.abort=="function"}const hs=()=>{};function bc(e,t,r){var n,o;if(arguments.length===2?(r=t,t=us):t==null?t=us:Zg(t,"options"),Gg(r,"callback"),qg(t.signal,"options.signal"),r=ds(r),Qg(e)||e0(e))return o0(e,t,r);if(!t0(e))throw new Vg("stream",["ReadableStream","WritableStream","Stream"],e);const i=(n=t.readable)!==null&&n!==void 0?n:mo(e),s=(o=t.writable)!==null&&o!==void 0?o:Qa(e),c=e._writableState,f=e._readableState,l=()=>{e.writable||b()};let u=r0(e)&&mo(e)===i&&Qa(e)===s,h=ef(e,!1);const b=()=>{h=!0,e.destroyed&&(u=!1),!(u&&(!e.readable||i))&&(!i||_)&&r.call(e)};let _=Ja(e,!1);const R=()=>{_=!0,e.destroyed&&(u=!1),!(u&&(!e.writable||s))&&(!s||h)&&r.call(e)},T=z=>{r.call(e,z)};let C=Yg(e);const D=()=>{C=!0;const z=tf(e)||Xa(e);if(z&&typeof z!="boolean")return r.call(e,z);if(i&&!_&&mo(e,!0)&&!Ja(e,!1))return r.call(e,new Za);if(s&&!h&&!ef(e,!1))return r.call(e,new Za);r.call(e)},L=()=>{C=!0;const z=tf(e)||Xa(e);if(z&&typeof z!="boolean")return r.call(e,z);r.call(e)},O=()=>{e.req.on("finish",b)};i0(e)?(e.on("complete",b),u||e.on("abort",D),e.req?O():e.on("request",O)):s&&!c&&(e.on("end",l),e.on("close",l)),!u&&typeof e.aborted=="boolean"&&e.on("aborted",D),e.on("end",R),e.on("finish",b),t.error!==!1&&e.on("error",T),e.on("close",D),C?pr.nextTick(D):c!=null&&c.errorEmitted||f!=null&&f.errorEmitted?u||pr.nextTick(L):(!i&&(!u||Ka(e))&&(h||Ya(e)===!1)||!s&&(!u||Ya(e))&&(_||Ka(e)===!1)||f&&e.req&&e.aborted)&&pr.nextTick(L);const S=()=>{r=hs,e.removeListener("aborted",D),e.removeListener("complete",b),e.removeListener("abort",D),e.removeListener("request",O),e.req&&e.req.removeListener("finish",b),e.removeListener("end",l),e.removeListener("close",l),e.removeListener("finish",b),e.removeListener("end",R),e.removeListener("error",T),e.removeListener("close",D)};if(t.signal&&!C){const z=()=>{const Y=r;S(),Y.call(e,new gc(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)pr.nextTick(z);else{Gr=Gr||mt.addAbortListener;const Y=Gr(t.signal,z),X=r;r=ds((...F)=>{Y[_c](),X.apply(e,F)})}}return S}function o0(e,t,r){let n=!1,o=hs;if(t.signal)if(o=()=>{n=!0,r.call(e,new gc(void 0,{cause:t.signal.reason}))},t.signal.aborted)pr.nextTick(o);else{Gr=Gr||mt.addAbortListener;const s=Gr(t.signal,o),c=r;r=ds((...f)=>{s[_c](),c.apply(e,f)})}const i=(...s)=>{n||pr.nextTick(()=>r.apply(e,s))};return Xg(e[n0].promise,i,i),hs}function s0(e,t){var r;let n=!1;return t===null&&(t=us),(r=t)!==null&&r!==void 0&&r.cleanup&&(Kg(t.cleanup,"cleanup"),n=t.cleanup),new Jg((o,i)=>{const s=bc(e,t,c=>{n&&s(),c?i(c):o()})})}Fs.exports=bc;Fs.exports.finished=s0;var Sr=Fs.exports;const tr=x.browserExports,{aggregateTwoErrors:a0,codes:{ERR_MULTIPLE_CALLBACK:f0},AbortError:l0}=Rt,{Symbol:pc}=et,{kIsDestroyed:c0,isDestroyed:u0,isFinished:d0,isServerRequest:h0}=hr,yc=pc("kDestroy"),gs=pc("kConstruct");function wc(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function g0(e,t){const r=this._readableState,n=this._writableState,o=n||r;return n!=null&&n.destroyed||r!=null&&r.destroyed?(typeof t=="function"&&t(),this):(wc(e,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),o.constructed?rf(this,e,t):this.once(yc,function(i){rf(this,a0(i,e),t)}),this)}function rf(e,t,r){let n=!1;function o(i){if(n)return;n=!0;const s=e._readableState,c=e._writableState;wc(i,c,s),c&&(c.closed=!0),s&&(s.closed=!0),typeof r=="function"&&r(i),i?tr.nextTick(_0,e,i):tr.nextTick(mc,e)}try{e._destroy(t||null,o)}catch(i){o(i)}}function _0(e,t){_s(e,t),mc(e)}function mc(e){const t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(r!=null&&r.emitClose||t!=null&&t.emitClose)&&e.emit("close")}function _s(e,t){const r=e._readableState,n=e._writableState;n!=null&&n.errorEmitted||r!=null&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function b0(){const e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=e.readable===!1,e.endEmitted=e.readable===!1),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=t.writable===!1,t.ending=t.writable===!1,t.finished=t.writable===!1)}function bs(e,t,r){const n=e._readableState,o=e._writableState;if(o!=null&&o.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||o!=null&&o.autoDestroy?e.destroy(t):t&&(t.stack,o&&!o.errored&&(o.errored=t),n&&!n.errored&&(n.errored=t),r?tr.nextTick(_s,e,t):_s(e,t))}function p0(e,t){if(typeof e._construct!="function")return;const r=e._readableState,n=e._writableState;r&&(r.constructed=!1),n&&(n.constructed=!1),e.once(gs,t),!(e.listenerCount(gs)>1)&&tr.nextTick(y0,e)}function y0(e){let t=!1;function r(n){if(t){bs(e,n??new f0);return}t=!0;const o=e._readableState,i=e._writableState,s=i||o;o&&(o.constructed=!0),i&&(i.constructed=!0),s.destroyed?e.emit(yc,n):n?bs(e,n,!0):tr.nextTick(w0,e)}try{e._construct(n=>{tr.nextTick(r,n)})}catch(n){tr.nextTick(r,n)}}function w0(e){e.emit(gs)}function nf(e){return(e==null?void 0:e.setHeader)&&typeof e.abort=="function"}function Ec(e){e.emit("close")}function m0(e,t){e.emit("error",t),tr.nextTick(Ec,e)}function E0(e,t){!e||u0(e)||(!t&&!d0(e)&&(t=new l0),h0(e)?(e.socket=null,e.destroy(t)):nf(e)?e.abort():nf(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?tr.nextTick(m0,e,t):tr.nextTick(Ec,e),e.destroyed||(e[c0]=!0))}var sn={construct:p0,destroyer:E0,destroy:g0,undestroy:b0,errorOrDestroy:bs};const{ArrayIsArray:v0,ObjectSetPrototypeOf:vc}=et,{EventEmitter:Ti}=x.eventsExports;function Oi(e){Ti.call(this,e)}vc(Oi.prototype,Ti.prototype);vc(Oi,Ti);Oi.prototype.pipe=function(e,t){const r=this;function n(u){e.writable&&e.write(u)===!1&&r.pause&&r.pause()}r.on("data",n);function o(){r.readable&&r.resume&&r.resume()}e.on("drain",o),!e._isStdio&&(!t||t.end!==!1)&&(r.on("end",s),r.on("close",c));let i=!1;function s(){i||(i=!0,e.end())}function c(){i||(i=!0,typeof e.destroy=="function"&&e.destroy())}function f(u){l(),Ti.listenerCount(this,"error")===0&&this.emit("error",u)}ps(r,"error",f),ps(e,"error",f);function l(){r.removeListener("data",n),e.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",c),r.removeListener("error",f),e.removeListener("error",f),r.removeListener("end",l),r.removeListener("close",l),e.removeListener("close",l)}return r.on("end",l),r.on("close",l),e.on("close",l),e.emit("pipe",r),e};function ps(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):v0(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}var Us={Stream:Oi,prependListener:ps},Sc={exports:{}};(function(e){const{SymbolDispose:t}=et,{AbortError:r,codes:n}=Rt,{isNodeStream:o,isWebStream:i,kControllerErrorFunction:s}=hr,c=Sr,{ERR_INVALID_ARG_TYPE:f}=n;let l;const u=(h,b)=>{if(typeof h!="object"||!("aborted"in h))throw new f(b,"AbortSignal",h)};e.exports.addAbortSignal=function(b,_){if(u(b,"signal"),!o(_)&&!i(_))throw new f("stream",["ReadableStream","WritableStream","Stream"],_);return e.exports.addAbortSignalNoValidate(b,_)},e.exports.addAbortSignalNoValidate=function(h,b){if(typeof h!="object"||!("aborted"in h))return b;const _=o(b)?()=>{b.destroy(new r(void 0,{cause:h.reason}))}:()=>{b[s](new r(void 0,{cause:h.reason}))};if(h.aborted)_();else{l=l||mt.addAbortListener;const R=l(h,_);c(b,R[t])}return b}})(Sc);var Li=Sc.exports;const{StringPrototypeSlice:of,SymbolIterator:S0,TypedArrayPrototypeSet:Kn,Uint8Array:R0}=et,{Buffer:Eo}=x.bufferPolyfill,{inspect:A0}=mt;var I0=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){const r={data:t,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(t){const r={data:t,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;const t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let r=this.head,n=""+r.data;for(;(r=r.next)!==null;)n+=t+r.data;return n}concat(t){if(this.length===0)return Eo.alloc(0);const r=Eo.allocUnsafe(t>>>0);let n=this.head,o=0;for(;n;)Kn(r,n.data,o),o+=n.data.length,n=n.next;return r}consume(t,r){const n=this.head.data;if(t<n.length){const o=n.slice(0,t);return this.head.data=n.slice(t),o}return t===n.length?this.shift():r?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[S0](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let r="",n=this.head,o=0;do{const i=n.data;if(t>i.length)r+=i,t-=i.length;else{t===i.length?(r+=i,++o,n.next?this.head=n.next:this.head=this.tail=null):(r+=of(i,0,t),this.head=n,n.data=of(i,t));break}++o}while((n=n.next)!==null);return this.length-=o,r}_getBuffer(t){const r=Eo.allocUnsafe(t),n=t;let o=this.head,i=0;do{const s=o.data;if(t>s.length)Kn(r,s,n-t),t-=s.length;else{t===s.length?(Kn(r,s,n-t),++i,o.next?this.head=o.next:this.head=this.tail=null):(Kn(r,new R0(s.buffer,s.byteOffset,t),n-t),this.head=o,o.data=s.slice(t));break}++i}while((o=o.next)!==null);return this.length-=i,r}[Symbol.for("nodejs.util.inspect.custom")](t,r){return A0(this,{...r,depth:0,customInspect:!1})}};const{MathFloor:T0,NumberIsInteger:O0}=et,{validateInteger:L0}=kn,{ERR_INVALID_ARG_VALUE:P0}=Rt.codes;let Rc=16*1024,Ac=16;function C0(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function Ic(e){return e?Ac:Rc}function N0(e,t){L0(t,"value",0),e?Ac=t:Rc=t}function B0(e,t,r,n){const o=C0(t,n,r);if(o!=null){if(!O0(o)||o<0){const i=n?`options.${r}`:"options.highWaterMark";throw new P0(i,o)}return T0(o)}return Ic(e.objectMode)}var Pi={getHighWaterMark:B0,getDefaultHighWaterMark:Ic,setDefaultHighWaterMark:N0};const sf=x.browserExports,{PromisePrototypeThen:$0,SymbolAsyncIterator:af,SymbolIterator:ff}=et,{Buffer:k0}=x.bufferPolyfill,{ERR_INVALID_ARG_TYPE:x0,ERR_STREAM_NULL_VALUES:D0}=Rt.codes;function j0(e,t,r){let n;if(typeof t=="string"||t instanceof k0)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});let o;if(t&&t[af])o=!0,n=t[af]();else if(t&&t[ff])o=!1,n=t[ff]();else throw new x0("iterable",["Iterable"],t);const i=new e({objectMode:!0,highWaterMark:1,...r});let s=!1;i._read=function(){s||(s=!0,f())},i._destroy=function(l,u){$0(c(l),()=>sf.nextTick(u,l),h=>sf.nextTick(u,h||l))};async function c(l){const u=l!=null,h=typeof n.throw=="function";if(u&&h){const{value:b,done:_}=await n.throw(l);if(await b,_)return}if(typeof n.return=="function"){const{value:b}=await n.return();await b}}async function f(){for(;;){try{const{value:l,done:u}=o?await n.next():n.next();if(u)i.push(null);else{const h=l&&typeof l.then=="function"?await l:l;if(h===null)throw s=!1,new D0;if(i.push(h))continue;s=!1}}catch(l){i.destroy(l)}break}}return i}var Tc=j0,vo,lf;function Ci(){if(lf)return vo;lf=1;const e=x.browserExports,{ArrayPrototypeIndexOf:t,NumberIsInteger:r,NumberIsNaN:n,NumberParseInt:o,ObjectDefineProperties:i,ObjectKeys:s,ObjectSetPrototypeOf:c,Promise:f,SafeSet:l,SymbolAsyncDispose:u,SymbolAsyncIterator:h,Symbol:b}=et;vo=me,me.ReadableState=$e;const{EventEmitter:_}=x.eventsExports,{Stream:R,prependListener:T}=Us,{Buffer:C}=x.bufferPolyfill,{addAbortSignal:D}=Li,L=Sr;let O=mt.debuglog("stream",p=>{O=p});const S=I0,z=sn,{getHighWaterMark:Y,getDefaultHighWaterMark:X}=Pi,{aggregateTwoErrors:F,codes:{ERR_INVALID_ARG_TYPE:V,ERR_METHOD_NOT_IMPLEMENTED:oe,ERR_OUT_OF_RANGE:ee,ERR_STREAM_PUSH_AFTER_EOF:w,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:d},AbortError:m}=Rt,{validateObject:$}=kn,M=b("kPaused"),{StringDecoder:N}=x.requireString_decoder(),U=Tc;c(me.prototype,R.prototype),c(me,R);const P=()=>{},{errorOrDestroy:H}=z,G=1,se=2,q=4,ie=8,ce=16,de=32,Ee=64,_e=128,ye=256,Ce=512,Ne=1024,Re=2048,I=4096,B=8192,K=16384,ue=32768,ae=65536,be=1<<17,Ae=1<<18;function Ie(p){return{enumerable:!1,get(){return(this.state&p)!==0},set(v){v?this.state|=p:this.state&=~p}}}i($e.prototype,{objectMode:Ie(G),ended:Ie(se),endEmitted:Ie(q),reading:Ie(ie),constructed:Ie(ce),sync:Ie(de),needReadable:Ie(Ee),emittedReadable:Ie(_e),readableListening:Ie(ye),resumeScheduled:Ie(Ce),errorEmitted:Ie(Ne),emitClose:Ie(Re),autoDestroy:Ie(I),destroyed:Ie(B),closed:Ie(K),closeEmitted:Ie(ue),multiAwaitDrain:Ie(ae),readingMore:Ie(be),dataEmitted:Ie(Ae)});function $e(p,v,ne){typeof ne!="boolean"&&(ne=v instanceof cr()),this.state=Re|I|ce|de,p&&p.objectMode&&(this.state|=G),ne&&p&&p.readableObjectMode&&(this.state|=G),this.highWaterMark=p?Y(this,p,"readableHighWaterMark",ne):X(!1),this.buffer=new S,this.length=0,this.pipes=[],this.flowing=null,this[M]=null,p&&p.emitClose===!1&&(this.state&=~Re),p&&p.autoDestroy===!1&&(this.state&=~I),this.errored=null,this.defaultEncoding=p&&p.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,p&&p.encoding&&(this.decoder=new N(p.encoding),this.encoding=p.encoding)}function me(p){if(!(this instanceof me))return new me(p);const v=this instanceof cr();this._readableState=new $e(p,this,v),p&&(typeof p.read=="function"&&(this._read=p.read),typeof p.destroy=="function"&&(this._destroy=p.destroy),typeof p.construct=="function"&&(this._construct=p.construct),p.signal&&!v&&D(p.signal,this)),R.call(this,p),z.construct(this,()=>{this._readableState.needReadable&&E(this,this._readableState)})}me.prototype.destroy=z.destroy,me.prototype._undestroy=z.undestroy,me.prototype._destroy=function(p,v){v(p)},me.prototype[_.captureRejectionSymbol]=function(p){this.destroy(p)},me.prototype[u]=function(){let p;return this.destroyed||(p=this.readableEnded?null:new m,this.destroy(p)),new f((v,ne)=>L(this,ge=>ge&&ge!==p?ne(ge):v(null)))},me.prototype.push=function(p,v){return je(this,p,v,!1)},me.prototype.unshift=function(p,v){return je(this,p,v,!0)};function je(p,v,ne,ge){O("readableAddChunk",v);const pe=p._readableState;let Oe;if(pe.state&G||(typeof v=="string"?(ne=ne||pe.defaultEncoding,pe.encoding!==ne&&(ge&&pe.encoding?v=C.from(v,ne).toString(pe.encoding):(v=C.from(v,ne),ne=""))):v instanceof C?ne="":R._isUint8Array(v)?(v=R._uint8ArrayToBuffer(v),ne=""):v!=null&&(Oe=new V("chunk",["string","Buffer","Uint8Array"],v))),Oe)H(p,Oe);else if(v===null)pe.state&=~ie,Fe(p,pe);else if(pe.state&G||v&&v.length>0)if(ge)if(pe.state&q)H(p,new d);else{if(pe.destroyed||pe.errored)return!1;tt(p,pe,v,!0)}else if(pe.ended)H(p,new w);else{if(pe.destroyed||pe.errored)return!1;pe.state&=~ie,pe.decoder&&!ne?(v=pe.decoder.write(v),pe.objectMode||v.length!==0?tt(p,pe,v,!1):E(p,pe)):tt(p,pe,v,!1)}else ge||(pe.state&=~ie,E(p,pe));return!pe.ended&&(pe.length<pe.highWaterMark||pe.length===0)}function tt(p,v,ne,ge){v.flowing&&v.length===0&&!v.sync&&p.listenerCount("data")>0?(v.state&ae?v.awaitDrainWriters.clear():v.awaitDrainWriters=null,v.dataEmitted=!0,p.emit("data",ne)):(v.length+=v.objectMode?1:ne.length,ge?v.buffer.unshift(ne):v.buffer.push(ne),v.state&Ee&&nt(p)),E(p,v)}me.prototype.isPaused=function(){const p=this._readableState;return p[M]===!0||p.flowing===!1},me.prototype.setEncoding=function(p){const v=new N(p);this._readableState.decoder=v,this._readableState.encoding=this._readableState.decoder.encoding;const ne=this._readableState.buffer;let ge="";for(const pe of ne)ge+=v.write(pe);return ne.clear(),ge!==""&&ne.push(ge),this._readableState.length=ge.length,this};const Ge=1073741824;function vt(p){if(p>Ge)throw new ee("size","<= 1GiB",p);return p--,p|=p>>>1,p|=p>>>2,p|=p>>>4,p|=p>>>8,p|=p>>>16,p++,p}function rt(p,v){return p<=0||v.length===0&&v.ended?0:v.state&G?1:n(p)?v.flowing&&v.length?v.buffer.first().length:v.length:p<=v.length?p:v.ended?v.length:0}me.prototype.read=function(p){O("read",p),p===void 0?p=NaN:r(p)||(p=o(p,10));const v=this._readableState,ne=p;if(p>v.highWaterMark&&(v.highWaterMark=vt(p)),p!==0&&(v.state&=~_e),p===0&&v.needReadable&&((v.highWaterMark!==0?v.length>=v.highWaterMark:v.length>0)||v.ended))return O("read: emitReadable",v.length,v.ended),v.length===0&&v.ended?Q(this):nt(this),null;if(p=rt(p,v),p===0&&v.ended)return v.length===0&&Q(this),null;let ge=(v.state&Ee)!==0;if(O("need readable",ge),(v.length===0||v.length-p<v.highWaterMark)&&(ge=!0,O("length less than watermark",ge)),v.ended||v.reading||v.destroyed||v.errored||!v.constructed)ge=!1,O("reading, ended or constructing",ge);else if(ge){O("do read"),v.state|=ie|de,v.length===0&&(v.state|=Ee);try{this._read(v.highWaterMark)}catch(Oe){H(this,Oe)}v.state&=~de,v.reading||(p=rt(ne,v))}let pe;return p>0?pe=J(p,v):pe=null,pe===null?(v.needReadable=v.length<=v.highWaterMark,p=0):(v.length-=p,v.multiAwaitDrain?v.awaitDrainWriters.clear():v.awaitDrainWriters=null),v.length===0&&(v.ended||(v.needReadable=!0),ne!==p&&v.ended&&Q(this)),pe!==null&&!v.errorEmitted&&!v.closeEmitted&&(v.dataEmitted=!0,this.emit("data",pe)),pe};function Fe(p,v){if(O("onEofChunk"),!v.ended){if(v.decoder){const ne=v.decoder.end();ne&&ne.length&&(v.buffer.push(ne),v.length+=v.objectMode?1:ne.length)}v.ended=!0,v.sync?nt(p):(v.needReadable=!1,v.emittedReadable=!0,at(p))}}function nt(p){const v=p._readableState;O("emitReadable",v.needReadable,v.emittedReadable),v.needReadable=!1,v.emittedReadable||(O("emitReadable",v.flowing),v.emittedReadable=!0,e.nextTick(at,p))}function at(p){const v=p._readableState;O("emitReadable_",v.destroyed,v.length,v.ended),!v.destroyed&&!v.errored&&(v.length||v.ended)&&(p.emit("readable"),v.emittedReadable=!1),v.needReadable=!v.flowing&&!v.ended&&v.length<=v.highWaterMark,le(p)}function E(p,v){!v.readingMore&&v.constructed&&(v.readingMore=!0,e.nextTick(fe,p,v))}function fe(p,v){for(;!v.reading&&!v.ended&&(v.length<v.highWaterMark||v.flowing&&v.length===0);){const ne=v.length;if(O("maybeReadMore read 0"),p.read(0),ne===v.length)break}v.readingMore=!1}me.prototype._read=function(p){throw new oe("_read()")},me.prototype.pipe=function(p,v){const ne=this,ge=this._readableState;ge.pipes.length===1&&(ge.multiAwaitDrain||(ge.multiAwaitDrain=!0,ge.awaitDrainWriters=new l(ge.awaitDrainWriters?[ge.awaitDrainWriters]:[]))),ge.pipes.push(p),O("pipe count=%d opts=%j",ge.pipes.length,v);const Oe=(!v||v.end!==!1)&&p!==e.stdout&&p!==e.stderr?it:Gt;ge.endEmitted?e.nextTick(Oe):ne.once("end",Oe),p.on("unpipe",ke);function ke(sr,Mt){O("onunpipe"),sr===ne&&Mt&&Mt.hasUnpiped===!1&&(Mt.hasUnpiped=!0,gr())}function it(){O("onend"),p.end()}let Ue,or=!1;function gr(){O("cleanup"),p.removeListener("close",st),p.removeListener("finish",gt),Ue&&p.removeListener("drain",Ue),p.removeListener("error",Xe),p.removeListener("unpipe",ke),ne.removeListener("end",it),ne.removeListener("end",Gt),ne.removeListener("data",ut),or=!0,Ue&&ge.awaitDrainWriters&&(!p._writableState||p._writableState.needDrain)&&Ue()}function Ze(){or||(ge.pipes.length===1&&ge.pipes[0]===p?(O("false write response, pause",0),ge.awaitDrainWriters=p,ge.multiAwaitDrain=!1):ge.pipes.length>1&&ge.pipes.includes(p)&&(O("false write response, pause",ge.awaitDrainWriters.size),ge.awaitDrainWriters.add(p)),ne.pause()),Ue||(Ue=he(ne,p),p.on("drain",Ue))}ne.on("data",ut);function ut(sr){O("ondata");const Mt=p.write(sr);O("dest.write",Mt),Mt===!1&&Ze()}function Xe(sr){if(O("onerror",sr),Gt(),p.removeListener("error",Xe),p.listenerCount("error")===0){const Mt=p._writableState||p._readableState;Mt&&!Mt.errorEmitted?H(p,sr):p.emit("error",sr)}}T(p,"error",Xe);function st(){p.removeListener("finish",gt),Gt()}p.once("close",st);function gt(){O("onfinish"),p.removeListener("close",st),Gt()}p.once("finish",gt);function Gt(){O("unpipe"),ne.unpipe(p)}return p.emit("pipe",ne),p.writableNeedDrain===!0?Ze():ge.flowing||(O("pipe resume"),ne.resume()),p};function he(p,v){return function(){const ge=p._readableState;ge.awaitDrainWriters===v?(O("pipeOnDrain",1),ge.awaitDrainWriters=null):ge.multiAwaitDrain&&(O("pipeOnDrain",ge.awaitDrainWriters.size),ge.awaitDrainWriters.delete(v)),(!ge.awaitDrainWriters||ge.awaitDrainWriters.size===0)&&p.listenerCount("data")&&p.resume()}}me.prototype.unpipe=function(p){const v=this._readableState,ne={hasUnpiped:!1};if(v.pipes.length===0)return this;if(!p){const pe=v.pipes;v.pipes=[],this.pause();for(let Oe=0;Oe<pe.length;Oe++)pe[Oe].emit("unpipe",this,{hasUnpiped:!1});return this}const ge=t(v.pipes,p);return ge===-1?this:(v.pipes.splice(ge,1),v.pipes.length===0&&this.pause(),p.emit("unpipe",this,ne),this)},me.prototype.on=function(p,v){const ne=R.prototype.on.call(this,p,v),ge=this._readableState;return p==="data"?(ge.readableListening=this.listenerCount("readable")>0,ge.flowing!==!1&&this.resume()):p==="readable"&&!ge.endEmitted&&!ge.readableListening&&(ge.readableListening=ge.needReadable=!0,ge.flowing=!1,ge.emittedReadable=!1,O("on readable",ge.length,ge.reading),ge.length?nt(this):ge.reading||e.nextTick(j,this)),ne},me.prototype.addListener=me.prototype.on,me.prototype.removeListener=function(p,v){const ne=R.prototype.removeListener.call(this,p,v);return p==="readable"&&e.nextTick(we,this),ne},me.prototype.off=me.prototype.removeListener,me.prototype.removeAllListeners=function(p){const v=R.prototype.removeAllListeners.apply(this,arguments);return(p==="readable"||p===void 0)&&e.nextTick(we,this),v};function we(p){const v=p._readableState;v.readableListening=p.listenerCount("readable")>0,v.resumeScheduled&&v[M]===!1?v.flowing=!0:p.listenerCount("data")>0?p.resume():v.readableListening||(v.flowing=null)}function j(p){O("readable nexttick read 0"),p.read(0)}me.prototype.resume=function(){const p=this._readableState;return p.flowing||(O("resume"),p.flowing=!p.readableListening,re(this,p)),p[M]=!1,this};function re(p,v){v.resumeScheduled||(v.resumeScheduled=!0,e.nextTick(g,p,v))}function g(p,v){O("resume",v.reading),v.reading||p.read(0),v.resumeScheduled=!1,p.emit("resume"),le(p),v.flowing&&!v.reading&&p.read(0)}me.prototype.pause=function(){return O("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(O("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[M]=!0,this};function le(p){const v=p._readableState;for(O("flow",v.flowing);v.flowing&&p.read()!==null;);}me.prototype.wrap=function(p){let v=!1;p.on("data",ge=>{!this.push(ge)&&p.pause&&(v=!0,p.pause())}),p.on("end",()=>{this.push(null)}),p.on("error",ge=>{H(this,ge)}),p.on("close",()=>{this.destroy()}),p.on("destroy",()=>{this.destroy()}),this._read=()=>{v&&p.resume&&(v=!1,p.resume())};const ne=s(p);for(let ge=1;ge<ne.length;ge++){const pe=ne[ge];this[pe]===void 0&&typeof p[pe]=="function"&&(this[pe]=p[pe].bind(p))}return this},me.prototype[h]=function(){return Te(this)},me.prototype.iterator=function(p){return p!==void 0&&$(p,"options"),Te(this,p)};function Te(p,v){typeof p.read!="function"&&(p=me.wrap(p,{objectMode:!0}));const ne=a(p,v);return ne.stream=p,ne}async function*a(p,v){let ne=P;function ge(ke){this===p?(ne(),ne=P):ne=ke}p.on("readable",ge);let pe;const Oe=L(p,{writable:!1},ke=>{pe=ke?F(pe,ke):null,ne(),ne=P});try{for(;;){const ke=p.destroyed?null:p.read();if(ke!==null)yield ke;else{if(pe)throw pe;if(pe===null)return;await new f(ge)}}}catch(ke){throw pe=F(pe,ke),pe}finally{(pe||(v==null?void 0:v.destroyOnReturn)!==!1)&&(pe===void 0||p._readableState.autoDestroy)?z.destroyer(p,null):(p.off("readable",ge),Oe())}}i(me.prototype,{readable:{__proto__:null,get(){const p=this._readableState;return!!p&&p.readable!==!1&&!p.destroyed&&!p.errorEmitted&&!p.endEmitted},set(p){this._readableState&&(this._readableState.readable=!!p)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(p){this._readableState&&(this._readableState.flowing=p)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(p){this._readableState&&(this._readableState.destroyed=p)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),i($e.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[M]!==!1},set(p){this[M]=!!p}}}),me._fromList=J;function J(p,v){if(v.length===0)return null;let ne;return v.objectMode?ne=v.buffer.shift():!p||p>=v.length?(v.decoder?ne=v.buffer.join(""):v.buffer.length===1?ne=v.buffer.first():ne=v.buffer.concat(v.length),v.buffer.clear()):ne=v.buffer.consume(p,v.decoder),ne}function Q(p){const v=p._readableState;O("endReadable",v.endEmitted),v.endEmitted||(v.ended=!0,e.nextTick(y,v,p))}function y(p,v){if(O("endReadableNT",p.endEmitted,p.length),!p.errored&&!p.closeEmitted&&!p.endEmitted&&p.length===0){if(p.endEmitted=!0,v.emit("end"),v.writable&&v.allowHalfOpen===!1)e.nextTick(k,v);else if(p.autoDestroy){const ne=v._writableState;(!ne||ne.autoDestroy&&(ne.finished||ne.writable===!1))&&v.destroy()}}}function k(p){p.writable&&!p.writableEnded&&!p.destroyed&&p.end()}me.from=function(p,v){return U(me,p,v)};let Z;function ve(){return Z===void 0&&(Z={}),Z}return me.fromWeb=function(p,v){return ve().newStreamReadableFromReadableStream(p,v)},me.toWeb=function(p,v){return ve().newReadableStreamFromStreamReadable(p,v)},me.wrap=function(p,v){var ne,ge;return new me({objectMode:(ne=(ge=p.readableObjectMode)!==null&&ge!==void 0?ge:p.objectMode)!==null&&ne!==void 0?ne:!0,...v,destroy(pe,Oe){z.destroyer(p,pe),Oe(pe)}}).wrap(p)},vo}var So,cf;function Hs(){if(cf)return So;cf=1;const e=x.browserExports,{ArrayPrototypeSlice:t,Error:r,FunctionPrototypeSymbolHasInstance:n,ObjectDefineProperty:o,ObjectDefineProperties:i,ObjectSetPrototypeOf:s,StringPrototypeToLowerCase:c,Symbol:f,SymbolHasInstance:l}=et;So=$,$.WritableState=d;const{EventEmitter:u}=x.eventsExports,h=Us.Stream,{Buffer:b}=x.bufferPolyfill,_=sn,{addAbortSignal:R}=Li,{getHighWaterMark:T,getDefaultHighWaterMark:C}=Pi,{ERR_INVALID_ARG_TYPE:D,ERR_METHOD_NOT_IMPLEMENTED:L,ERR_MULTIPLE_CALLBACK:O,ERR_STREAM_CANNOT_PIPE:S,ERR_STREAM_DESTROYED:z,ERR_STREAM_ALREADY_FINISHED:Y,ERR_STREAM_NULL_VALUES:X,ERR_STREAM_WRITE_AFTER_END:F,ERR_UNKNOWN_ENCODING:V}=Rt.codes,{errorOrDestroy:oe}=_;s($.prototype,h.prototype),s($,h);function ee(){}const w=f("kOnFinished");function d(I,B,K){typeof K!="boolean"&&(K=B instanceof cr()),this.objectMode=!!(I&&I.objectMode),K&&(this.objectMode=this.objectMode||!!(I&&I.writableObjectMode)),this.highWaterMark=I?T(this,I,"writableHighWaterMark",K):C(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const ue=!!(I&&I.decodeStrings===!1);this.decodeStrings=!ue,this.defaultEncoding=I&&I.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=H.bind(void 0,B),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,m(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!I||I.emitClose!==!1,this.autoDestroy=!I||I.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[w]=[]}function m(I){I.buffered=[],I.bufferedIndex=0,I.allBuffers=!0,I.allNoop=!0}d.prototype.getBuffer=function(){return t(this.buffered,this.bufferedIndex)},o(d.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function $(I){const B=this instanceof cr();if(!B&&!n($,this))return new $(I);this._writableState=new d(I,this,B),I&&(typeof I.write=="function"&&(this._write=I.write),typeof I.writev=="function"&&(this._writev=I.writev),typeof I.destroy=="function"&&(this._destroy=I.destroy),typeof I.final=="function"&&(this._final=I.final),typeof I.construct=="function"&&(this._construct=I.construct),I.signal&&R(I.signal,this)),h.call(this,I),_.construct(this,()=>{const K=this._writableState;K.writing||ie(this,K),_e(this,K)})}o($,l,{__proto__:null,value:function(I){return n(this,I)?!0:this!==$?!1:I&&I._writableState instanceof d}}),$.prototype.pipe=function(){oe(this,new S)};function M(I,B,K,ue){const ae=I._writableState;if(typeof K=="function")ue=K,K=ae.defaultEncoding;else{if(!K)K=ae.defaultEncoding;else if(K!=="buffer"&&!b.isEncoding(K))throw new V(K);typeof ue!="function"&&(ue=ee)}if(B===null)throw new X;if(!ae.objectMode)if(typeof B=="string")ae.decodeStrings!==!1&&(B=b.from(B,K),K="buffer");else if(B instanceof b)K="buffer";else if(h._isUint8Array(B))B=h._uint8ArrayToBuffer(B),K="buffer";else throw new D("chunk",["string","Buffer","Uint8Array"],B);let be;return ae.ending?be=new F:ae.destroyed&&(be=new z("write")),be?(e.nextTick(ue,be),oe(I,be,!0),be):(ae.pendingcb++,N(I,ae,B,K,ue))}$.prototype.write=function(I,B,K){return M(this,I,B,K)===!0},$.prototype.cork=function(){this._writableState.corked++},$.prototype.uncork=function(){const I=this._writableState;I.corked&&(I.corked--,I.writing||ie(this,I))},$.prototype.setDefaultEncoding=function(B){if(typeof B=="string"&&(B=c(B)),!b.isEncoding(B))throw new V(B);return this._writableState.defaultEncoding=B,this};function N(I,B,K,ue,ae){const be=B.objectMode?1:K.length;B.length+=be;const Ae=B.length<B.highWaterMark;return Ae||(B.needDrain=!0),B.writing||B.corked||B.errored||!B.constructed?(B.buffered.push({chunk:K,encoding:ue,callback:ae}),B.allBuffers&&ue!=="buffer"&&(B.allBuffers=!1),B.allNoop&&ae!==ee&&(B.allNoop=!1)):(B.writelen=be,B.writecb=ae,B.writing=!0,B.sync=!0,I._write(K,ue,B.onwrite),B.sync=!1),Ae&&!B.errored&&!B.destroyed}function U(I,B,K,ue,ae,be,Ae){B.writelen=ue,B.writecb=Ae,B.writing=!0,B.sync=!0,B.destroyed?B.onwrite(new z("write")):K?I._writev(ae,B.onwrite):I._write(ae,be,B.onwrite),B.sync=!1}function P(I,B,K,ue){--B.pendingcb,ue(K),q(B),oe(I,K)}function H(I,B){const K=I._writableState,ue=K.sync,ae=K.writecb;if(typeof ae!="function"){oe(I,new O);return}K.writing=!1,K.writecb=null,K.length-=K.writelen,K.writelen=0,B?(B.stack,K.errored||(K.errored=B),I._readableState&&!I._readableState.errored&&(I._readableState.errored=B),ue?e.nextTick(P,I,K,B,ae):P(I,K,B,ae)):(K.buffered.length>K.bufferedIndex&&ie(I,K),ue?K.afterWriteTickInfo!==null&&K.afterWriteTickInfo.cb===ae?K.afterWriteTickInfo.count++:(K.afterWriteTickInfo={count:1,cb:ae,stream:I,state:K},e.nextTick(G,K.afterWriteTickInfo)):se(I,K,1,ae))}function G({stream:I,state:B,count:K,cb:ue}){return B.afterWriteTickInfo=null,se(I,B,K,ue)}function se(I,B,K,ue){for(!B.ending&&!I.destroyed&&B.length===0&&B.needDrain&&(B.needDrain=!1,I.emit("drain"));K-- >0;)B.pendingcb--,ue();B.destroyed&&q(B),_e(I,B)}function q(I){if(I.writing)return;for(let ae=I.bufferedIndex;ae<I.buffered.length;++ae){var B;const{chunk:be,callback:Ae}=I.buffered[ae],Ie=I.objectMode?1:be.length;I.length-=Ie,Ae((B=I.errored)!==null&&B!==void 0?B:new z("write"))}const K=I[w].splice(0);for(let ae=0;ae<K.length;ae++){var ue;K[ae]((ue=I.errored)!==null&&ue!==void 0?ue:new z("end"))}m(I)}function ie(I,B){if(B.corked||B.bufferProcessing||B.destroyed||!B.constructed)return;const{buffered:K,bufferedIndex:ue,objectMode:ae}=B,be=K.length-ue;if(!be)return;let Ae=ue;if(B.bufferProcessing=!0,be>1&&I._writev){B.pendingcb-=be-1;const Ie=B.allNoop?ee:me=>{for(let je=Ae;je<K.length;++je)K[je].callback(me)},$e=B.allNoop&&Ae===0?K:t(K,Ae);$e.allBuffers=B.allBuffers,U(I,B,!0,B.length,$e,"",Ie),m(B)}else{do{const{chunk:Ie,encoding:$e,callback:me}=K[Ae];K[Ae++]=null;const je=ae?1:Ie.length;U(I,B,!1,je,Ie,$e,me)}while(Ae<K.length&&!B.writing);Ae===K.length?m(B):Ae>256?(K.splice(0,Ae),B.bufferedIndex=0):B.bufferedIndex=Ae}B.bufferProcessing=!1}$.prototype._write=function(I,B,K){if(this._writev)this._writev([{chunk:I,encoding:B}],K);else throw new L("_write()")},$.prototype._writev=null,$.prototype.end=function(I,B,K){const ue=this._writableState;typeof I=="function"?(K=I,I=null,B=null):typeof B=="function"&&(K=B,B=null);let ae;if(I!=null){const be=M(this,I,B);be instanceof r&&(ae=be)}return ue.corked&&(ue.corked=1,this.uncork()),ae||(!ue.errored&&!ue.ending?(ue.ending=!0,_e(this,ue,!0),ue.ended=!0):ue.finished?ae=new Y("end"):ue.destroyed&&(ae=new z("end"))),typeof K=="function"&&(ae||ue.finished?e.nextTick(K,ae):ue[w].push(K)),this};function ce(I){return I.ending&&!I.destroyed&&I.constructed&&I.length===0&&!I.errored&&I.buffered.length===0&&!I.finished&&!I.writing&&!I.errorEmitted&&!I.closeEmitted}function de(I,B){let K=!1;function ue(ae){if(K){oe(I,ae??O());return}if(K=!0,B.pendingcb--,ae){const be=B[w].splice(0);for(let Ae=0;Ae<be.length;Ae++)be[Ae](ae);oe(I,ae,B.sync)}else ce(B)&&(B.prefinished=!0,I.emit("prefinish"),B.pendingcb++,e.nextTick(ye,I,B))}B.sync=!0,B.pendingcb++;try{I._final(ue)}catch(ae){ue(ae)}B.sync=!1}function Ee(I,B){!B.prefinished&&!B.finalCalled&&(typeof I._final=="function"&&!B.destroyed?(B.finalCalled=!0,de(I,B)):(B.prefinished=!0,I.emit("prefinish")))}function _e(I,B,K){ce(B)&&(Ee(I,B),B.pendingcb===0&&(K?(B.pendingcb++,e.nextTick((ue,ae)=>{ce(ae)?ye(ue,ae):ae.pendingcb--},I,B)):ce(B)&&(B.pendingcb++,ye(I,B))))}function ye(I,B){B.pendingcb--,B.finished=!0;const K=B[w].splice(0);for(let ue=0;ue<K.length;ue++)K[ue]();if(I.emit("finish"),B.autoDestroy){const ue=I._readableState;(!ue||ue.autoDestroy&&(ue.endEmitted||ue.readable===!1))&&I.destroy()}}i($.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(I){this._writableState&&(this._writableState.destroyed=I)}},writable:{__proto__:null,get(){const I=this._writableState;return!!I&&I.writable!==!1&&!I.destroyed&&!I.errored&&!I.ending&&!I.ended},set(I){this._writableState&&(this._writableState.writable=!!I)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const I=this._writableState;return I?!I.destroyed&&!I.ending&&I.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const Ce=_.destroy;$.prototype.destroy=function(I,B){const K=this._writableState;return!K.destroyed&&(K.bufferedIndex<K.buffered.length||K[w].length)&&e.nextTick(q,K),Ce.call(this,I,B),this},$.prototype._undestroy=_.undestroy,$.prototype._destroy=function(I,B){B(I)},$.prototype[u.captureRejectionSymbol]=function(I){this.destroy(I)};let Ne;function Re(){return Ne===void 0&&(Ne={}),Ne}return $.fromWeb=function(I,B){return Re().newStreamWritableFromWritableStream(I,B)},$.toWeb=function(I){return Re().newWritableStreamFromStreamWritable(I)},So}var Ro,uf;function M0(){if(uf)return Ro;uf=1;const e=x.browserExports,t=x.bufferPolyfill,{isReadable:r,isWritable:n,isIterable:o,isNodeStream:i,isReadableNodeStream:s,isWritableNodeStream:c,isDuplexNodeStream:f,isReadableStream:l,isWritableStream:u}=hr,h=Sr,{AbortError:b,codes:{ERR_INVALID_ARG_TYPE:_,ERR_INVALID_RETURN_VALUE:R}}=Rt,{destroyer:T}=sn,C=cr(),D=Ci(),L=Hs(),{createDeferredPromise:O}=mt,S=Tc,z=globalThis.Blob||t.Blob,Y=typeof z<"u"?function(d){return d instanceof z}:function(d){return!1},X=globalThis.AbortController||Ln().AbortController,{FunctionPrototypeCall:F}=et;class V extends C{constructor(d){super(d),(d==null?void 0:d.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(d==null?void 0:d.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}Ro=function w(d,m){if(f(d))return d;if(s(d))return ee({readable:d});if(c(d))return ee({writable:d});if(i(d))return ee({writable:!1,readable:!1});if(l(d))return ee({readable:D.fromWeb(d)});if(u(d))return ee({writable:L.fromWeb(d)});if(typeof d=="function"){const{value:M,write:N,final:U,destroy:P}=oe(d);if(o(M))return S(V,M,{objectMode:!0,write:N,final:U,destroy:P});const H=M==null?void 0:M.then;if(typeof H=="function"){let G;const se=F(H,M,q=>{if(q!=null)throw new R("nully","body",q)},q=>{T(G,q)});return G=new V({objectMode:!0,readable:!1,write:N,final(q){U(async()=>{try{await se,e.nextTick(q,null)}catch(ie){e.nextTick(q,ie)}})},destroy:P})}throw new R("Iterable, AsyncIterable or AsyncFunction",m,M)}if(Y(d))return w(d.arrayBuffer());if(o(d))return S(V,d,{objectMode:!0,writable:!1});if(l(d==null?void 0:d.readable)&&u(d==null?void 0:d.writable))return V.fromWeb(d);if(typeof(d==null?void 0:d.writable)=="object"||typeof(d==null?void 0:d.readable)=="object"){const M=d!=null&&d.readable?s(d==null?void 0:d.readable)?d==null?void 0:d.readable:w(d.readable):void 0,N=d!=null&&d.writable?c(d==null?void 0:d.writable)?d==null?void 0:d.writable:w(d.writable):void 0;return ee({readable:M,writable:N})}const $=d==null?void 0:d.then;if(typeof $=="function"){let M;return F($,d,N=>{N!=null&&M.push(N),M.push(null)},N=>{T(M,N)}),M=new V({objectMode:!0,writable:!1,read(){}})}throw new _(m,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],d)};function oe(w){let{promise:d,resolve:m}=O();const $=new X,M=$.signal;return{value:w(async function*(){for(;;){const U=d;d=null;const{chunk:P,done:H,cb:G}=await U;if(e.nextTick(G),H)return;if(M.aborted)throw new b(void 0,{cause:M.reason});({promise:d,resolve:m}=O()),yield P}}(),{signal:M}),write(U,P,H){const G=m;m=null,G({chunk:U,done:!1,cb:H})},final(U){const P=m;m=null,P({done:!0,cb:U})},destroy(U,P){$.abort(),P(U)}}}function ee(w){const d=w.readable&&typeof w.readable.read!="function"?D.wrap(w.readable):w.readable,m=w.writable;let $=!!r(d),M=!!n(m),N,U,P,H,G;function se(q){const ie=H;H=null,ie?ie(q):q&&G.destroy(q)}return G=new V({readableObjectMode:!!(d!=null&&d.readableObjectMode),writableObjectMode:!!(m!=null&&m.writableObjectMode),readable:$,writable:M}),M&&(h(m,q=>{M=!1,q&&T(d,q),se(q)}),G._write=function(q,ie,ce){m.write(q,ie)?ce():N=ce},G._final=function(q){m.end(),U=q},m.on("drain",function(){if(N){const q=N;N=null,q()}}),m.on("finish",function(){if(U){const q=U;U=null,q()}})),$&&(h(d,q=>{$=!1,q&&T(d,q),se(q)}),d.on("readable",function(){if(P){const q=P;P=null,q()}}),d.on("end",function(){G.push(null)}),G._read=function(){for(;;){const q=d.read();if(q===null){P=G._read;return}if(!G.push(q))return}}),G._destroy=function(q,ie){!q&&H!==null&&(q=new b),P=null,N=null,U=null,H===null?ie(q):(H=ie,T(m,q),T(d,q))},G}return Ro}var Ao,df;function cr(){if(df)return Ao;df=1;const{ObjectDefineProperties:e,ObjectGetOwnPropertyDescriptor:t,ObjectKeys:r,ObjectSetPrototypeOf:n}=et;Ao=s;const o=Ci(),i=Hs();n(s.prototype,o.prototype),n(s,o);{const u=r(i.prototype);for(let h=0;h<u.length;h++){const b=u[h];s.prototype[b]||(s.prototype[b]=i.prototype[b])}}function s(u){if(!(this instanceof s))return new s(u);o.call(this,u),i.call(this,u),u?(this.allowHalfOpen=u.allowHalfOpen!==!1,u.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),u.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}e(s.prototype,{writable:{__proto__:null,...t(i.prototype,"writable")},writableHighWaterMark:{__proto__:null,...t(i.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...t(i.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...t(i.prototype,"writableBuffer")},writableLength:{__proto__:null,...t(i.prototype,"writableLength")},writableFinished:{__proto__:null,...t(i.prototype,"writableFinished")},writableCorked:{__proto__:null,...t(i.prototype,"writableCorked")},writableEnded:{__proto__:null,...t(i.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...t(i.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(u){this._readableState&&this._writableState&&(this._readableState.destroyed=u,this._writableState.destroyed=u)}}});let c;function f(){return c===void 0&&(c={}),c}s.fromWeb=function(u,h){return f().newStreamDuplexFromReadableWritablePair(u,h)},s.toWeb=function(u){return f().newReadableWritablePairFromDuplex(u)};let l;return s.from=function(u){return l||(l=M0()),l(u,"body")},Ao}const{ObjectSetPrototypeOf:Oc,Symbol:F0}=et;var Lc=ur;const{ERR_METHOD_NOT_IMPLEMENTED:U0}=Rt.codes,zs=cr(),{getHighWaterMark:H0}=Pi;Oc(ur.prototype,zs.prototype);Oc(ur,zs);const Rn=F0("kCallback");function ur(e){if(!(this instanceof ur))return new ur(e);const t=e?H0(this,e,"readableHighWaterMark",!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),zs.call(this,e),this._readableState.sync=!1,this[Rn]=null,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",z0)}function ys(e){typeof this._flush=="function"&&!this.destroyed?this._flush((t,r)=>{if(t){e?e(t):this.destroy(t);return}r!=null&&this.push(r),this.push(null),e&&e()}):(this.push(null),e&&e())}function z0(){this._final!==ys&&ys.call(this)}ur.prototype._final=ys;ur.prototype._transform=function(e,t,r){throw new U0("_transform()")};ur.prototype._write=function(e,t,r){const n=this._readableState,o=this._writableState,i=n.length;this._transform(e,t,(s,c)=>{if(s){r(s);return}c!=null&&this.push(c),o.ended||i===n.length||n.length<n.highWaterMark?r():this[Rn]=r})};ur.prototype._read=function(){if(this[Rn]){const e=this[Rn];this[Rn]=null,e()}};const{ObjectSetPrototypeOf:Pc}=et;var Cc=Jr;const Ws=Lc;Pc(Jr.prototype,Ws.prototype);Pc(Jr,Ws);function Jr(e){if(!(this instanceof Jr))return new Jr(e);Ws.call(this,e)}Jr.prototype._transform=function(e,t,r){r(null,e)};const Sn=x.browserExports,{ArrayIsArray:W0,Promise:V0,SymbolAsyncIterator:q0,SymbolDispose:G0}=et,hi=Sr,{once:Z0}=mt,K0=sn,hf=cr(),{aggregateTwoErrors:J0,codes:{ERR_INVALID_ARG_TYPE:ws,ERR_INVALID_RETURN_VALUE:Io,ERR_MISSING_ARGS:X0,ERR_STREAM_DESTROYED:Y0,ERR_STREAM_PREMATURE_CLOSE:Q0},AbortError:e_}=Rt,{validateFunction:t_,validateAbortSignal:r_}=kn,{isIterable:Or,isReadable:To,isReadableNodeStream:fi,isNodeStream:gf,isTransformStream:Wr,isWebStream:n_,isReadableStream:Oo,isReadableFinished:i_}=hr,o_=globalThis.AbortController||Ln().AbortController;let Lo,Po,Co;function _f(e,t,r){let n=!1;e.on("close",()=>{n=!0});const o=hi(e,{readable:t,writable:r},i=>{n=!i});return{destroy:i=>{n||(n=!0,K0.destroyer(e,i||new Y0("pipe")))},cleanup:o}}function s_(e){return t_(e[e.length-1],"streams[stream.length - 1]"),e.pop()}function No(e){if(Or(e))return e;if(fi(e))return a_(e);throw new ws("val",["Readable","Iterable","AsyncIterable"],e)}async function*a_(e){Po||(Po=Ci()),yield*Po.prototype[q0].call(e)}async function Jn(e,t,r,{end:n}){let o,i=null;const s=l=>{if(l&&(o=l),i){const u=i;i=null,u()}},c=()=>new V0((l,u)=>{o?u(o):i=()=>{o?u(o):l()}});t.on("drain",s);const f=hi(t,{readable:!1},s);try{t.writableNeedDrain&&await c();for await(const l of e)t.write(l)||await c();n&&(t.end(),await c()),r()}catch(l){r(o!==l?J0(o,l):l)}finally{f(),t.off("drain",s)}}async function Bo(e,t,r,{end:n}){Wr(t)&&(t=t.writable);const o=t.getWriter();try{for await(const i of e)await o.ready,o.write(i).catch(()=>{});await o.ready,n&&await o.close(),r()}catch(i){try{await o.abort(i),r(i)}catch(s){r(s)}}}function f_(...e){return Nc(e,Z0(s_(e)))}function Nc(e,t,r){if(e.length===1&&W0(e[0])&&(e=e[0]),e.length<2)throw new X0("streams");const n=new o_,o=n.signal,i=r==null?void 0:r.signal,s=[];r_(i,"options.signal");function c(){R(new e_)}Co=Co||mt.addAbortListener;let f;i&&(f=Co(i,c));let l,u;const h=[];let b=0;function _(L){R(L,--b===0)}function R(L,O){var S;if(L&&(!l||l.code==="ERR_STREAM_PREMATURE_CLOSE")&&(l=L),!(!l&&!O)){for(;h.length;)h.shift()(l);(S=f)===null||S===void 0||S[G0](),n.abort(),O&&(l||s.forEach(z=>z()),Sn.nextTick(t,l,u))}}let T;for(let L=0;L<e.length;L++){const O=e[L],S=L<e.length-1,z=L>0,Y=S||(r==null?void 0:r.end)!==!1,X=L===e.length-1;if(gf(O)){let F=function(V){V&&V.name!=="AbortError"&&V.code!=="ERR_STREAM_PREMATURE_CLOSE"&&_(V)};if(Y){const{destroy:V,cleanup:oe}=_f(O,S,z);h.push(V),To(O)&&X&&s.push(oe)}O.on("error",F),To(O)&&X&&s.push(()=>{O.removeListener("error",F)})}if(L===0)if(typeof O=="function"){if(T=O({signal:o}),!Or(T))throw new Io("Iterable, AsyncIterable or Stream","source",T)}else Or(O)||fi(O)||Wr(O)?T=O:T=hf.from(O);else if(typeof O=="function"){if(Wr(T)){var C;T=No((C=T)===null||C===void 0?void 0:C.readable)}else T=No(T);if(T=O(T,{signal:o}),S){if(!Or(T,!0))throw new Io("AsyncIterable",`transform[${L-1}]`,T)}else{var D;Lo||(Lo=Cc);const F=new Lo({objectMode:!0}),V=(D=T)===null||D===void 0?void 0:D.then;if(typeof V=="function")b++,V.call(T,w=>{u=w,w!=null&&F.write(w),Y&&F.end(),Sn.nextTick(_)},w=>{F.destroy(w),Sn.nextTick(_,w)});else if(Or(T,!0))b++,Jn(T,F,_,{end:Y});else if(Oo(T)||Wr(T)){const w=T.readable||T;b++,Jn(w,F,_,{end:Y})}else throw new Io("AsyncIterable or Promise","destination",T);T=F;const{destroy:oe,cleanup:ee}=_f(T,!1,!0);h.push(oe),X&&s.push(ee)}}else if(gf(O)){if(fi(T)){b+=2;const F=l_(T,O,_,{end:Y});To(O)&&X&&s.push(F)}else if(Wr(T)||Oo(T)){const F=T.readable||T;b++,Jn(F,O,_,{end:Y})}else if(Or(T))b++,Jn(T,O,_,{end:Y});else throw new ws("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],T);T=O}else if(n_(O)){if(fi(T))b++,Bo(No(T),O,_,{end:Y});else if(Oo(T)||Or(T))b++,Bo(T,O,_,{end:Y});else if(Wr(T))b++,Bo(T.readable,O,_,{end:Y});else throw new ws("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],T);T=O}else T=hf.from(O)}return(o!=null&&o.aborted||i!=null&&i.aborted)&&Sn.nextTick(c),T}function l_(e,t,r,{end:n}){let o=!1;if(t.on("close",()=>{o||r(new Q0)}),e.pipe(t,{end:!1}),n){let i=function(){o=!0,t.end()};i_(e)?Sn.nextTick(i):e.once("end",i)}else r();return hi(e,{readable:!0,writable:!1},i=>{const s=e._readableState;i&&i.code==="ERR_STREAM_PREMATURE_CLOSE"&&s&&s.ended&&!s.errored&&!s.errorEmitted?e.once("end",r).once("error",r):r(i)}),hi(t,{readable:!1,writable:!0},r)}var Vs={pipelineImpl:Nc,pipeline:f_};const{pipeline:c_}=Vs,Xn=cr(),{destroyer:u_}=sn,{isNodeStream:Yn,isReadable:bf,isWritable:pf,isWebStream:$o,isTransformStream:Ir,isWritableStream:yf,isReadableStream:wf}=hr,{AbortError:d_,codes:{ERR_INVALID_ARG_VALUE:mf,ERR_MISSING_ARGS:h_}}=Rt,g_=Sr;var Bc=function(...t){if(t.length===0)throw new h_("streams");if(t.length===1)return Xn.from(t[0]);const r=[...t];if(typeof t[0]=="function"&&(t[0]=Xn.from(t[0])),typeof t[t.length-1]=="function"){const _=t.length-1;t[_]=Xn.from(t[_])}for(let _=0;_<t.length;++_)if(!(!Yn(t[_])&&!$o(t[_]))){if(_<t.length-1&&!(bf(t[_])||wf(t[_])||Ir(t[_])))throw new mf(`streams[${_}]`,r[_],"must be readable");if(_>0&&!(pf(t[_])||yf(t[_])||Ir(t[_])))throw new mf(`streams[${_}]`,r[_],"must be writable")}let n,o,i,s,c;function f(_){const R=s;s=null,R?R(_):_?c.destroy(_):!b&&!h&&c.destroy()}const l=t[0],u=c_(t,f),h=!!(pf(l)||yf(l)||Ir(l)),b=!!(bf(u)||wf(u)||Ir(u));if(c=new Xn({writableObjectMode:!!(l!=null&&l.writableObjectMode),readableObjectMode:!!(u!=null&&u.readableObjectMode),writable:h,readable:b}),h){if(Yn(l))c._write=function(R,T,C){l.write(R,T)?C():n=C},c._final=function(R){l.end(),o=R},l.on("drain",function(){if(n){const R=n;n=null,R()}});else if($o(l)){const T=(Ir(l)?l.writable:l).getWriter();c._write=async function(C,D,L){try{await T.ready,T.write(C).catch(()=>{}),L()}catch(O){L(O)}},c._final=async function(C){try{await T.ready,T.close().catch(()=>{}),o=C}catch(D){C(D)}}}const _=Ir(u)?u.readable:u;g_(_,()=>{if(o){const R=o;o=null,R()}})}if(b){if(Yn(u))u.on("readable",function(){if(i){const _=i;i=null,_()}}),u.on("end",function(){c.push(null)}),c._read=function(){for(;;){const _=u.read();if(_===null){i=c._read;return}if(!c.push(_))return}};else if($o(u)){const R=(Ir(u)?u.readable:u).getReader();c._read=async function(){for(;;)try{const{value:T,done:C}=await R.read();if(!c.push(T))return;if(C){c.push(null);return}}catch{return}}}}return c._destroy=function(_,R){!_&&s!==null&&(_=new d_),i=null,n=null,o=null,s===null?R(_):(s=R,Yn(u)&&u_(u,_))},c};const __=globalThis.AbortController||Ln().AbortController,{codes:{ERR_INVALID_ARG_VALUE:b_,ERR_INVALID_ARG_TYPE:xn,ERR_MISSING_ARGS:p_,ERR_OUT_OF_RANGE:y_},AbortError:nr}=Rt,{validateAbortSignal:xr,validateInteger:Ef,validateObject:Dr}=kn,w_=et.Symbol("kWeak"),m_=et.Symbol("kResistStopPropagation"),{finished:E_}=Sr,v_=Bc,{addAbortSignalNoValidate:S_}=Li,{isWritable:R_,isNodeStream:A_}=hr,{deprecate:I_}=mt,{ArrayPrototypePush:T_,Boolean:O_,MathFloor:vf,Number:L_,NumberIsNaN:P_,Promise:Sf,PromiseReject:Rf,PromiseResolve:C_,PromisePrototypeThen:Af,Symbol:$c}=et,gi=$c("kEmpty"),If=$c("kEof");function N_(e,t){if(t!=null&&Dr(t,"options"),(t==null?void 0:t.signal)!=null&&xr(t.signal,"options.signal"),A_(e)&&!R_(e))throw new b_("stream",e,"must be writable");const r=v_(this,e);return t!=null&&t.signal&&S_(t.signal,r),r}function Ni(e,t){if(typeof e!="function")throw new xn("fn",["Function","AsyncFunction"],e);t!=null&&Dr(t,"options"),(t==null?void 0:t.signal)!=null&&xr(t.signal,"options.signal");let r=1;(t==null?void 0:t.concurrency)!=null&&(r=vf(t.concurrency));let n=r-1;return(t==null?void 0:t.highWaterMark)!=null&&(n=vf(t.highWaterMark)),Ef(r,"options.concurrency",1),Ef(n,"options.highWaterMark",0),n+=r,(async function*(){const i=mt.AbortSignalAny([t==null?void 0:t.signal].filter(O_)),s=this,c=[],f={signal:i};let l,u,h=!1,b=0;function _(){h=!0,R()}function R(){b-=1,T()}function T(){u&&!h&&b<r&&c.length<n&&(u(),u=null)}async function C(){try{for await(let D of s){if(h)return;if(i.aborted)throw new nr;try{if(D=e(D,f),D===gi)continue;D=C_(D)}catch(L){D=Rf(L)}b+=1,Af(D,R,_),c.push(D),l&&(l(),l=null),!h&&(c.length>=n||b>=r)&&await new Sf(L=>{u=L})}c.push(If)}catch(D){const L=Rf(D);Af(L,R,_),c.push(L)}finally{h=!0,l&&(l(),l=null)}}C();try{for(;;){for(;c.length>0;){const D=await c[0];if(D===If)return;if(i.aborted)throw new nr;D!==gi&&(yield D),c.shift(),T()}await new Sf(D=>{l=D})}}finally{h=!0,u&&(u(),u=null)}}).call(this)}function B_(e=void 0){return e!=null&&Dr(e,"options"),(e==null?void 0:e.signal)!=null&&xr(e.signal,"options.signal"),(async function*(){let r=0;for await(const o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new nr({cause:e.signal.reason});yield[r++,o]}}).call(this)}async function kc(e,t=void 0){for await(const r of qs.call(this,e,t))return!0;return!1}async function $_(e,t=void 0){if(typeof e!="function")throw new xn("fn",["Function","AsyncFunction"],e);return!await kc.call(this,async(...r)=>!await e(...r),t)}async function k_(e,t){for await(const r of qs.call(this,e,t))return r}async function x_(e,t){if(typeof e!="function")throw new xn("fn",["Function","AsyncFunction"],e);async function r(n,o){return await e(n,o),gi}for await(const n of Ni.call(this,r,t));}function qs(e,t){if(typeof e!="function")throw new xn("fn",["Function","AsyncFunction"],e);async function r(n,o){return await e(n,o)?n:gi}return Ni.call(this,r,t)}class D_ extends p_{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function j_(e,t,r){var n;if(typeof e!="function")throw new xn("reducer",["Function","AsyncFunction"],e);r!=null&&Dr(r,"options"),(r==null?void 0:r.signal)!=null&&xr(r.signal,"options.signal");let o=arguments.length>1;if(r!=null&&(n=r.signal)!==null&&n!==void 0&&n.aborted){const l=new nr(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await E_(this.destroy(l)),l}const i=new __,s=i.signal;if(r!=null&&r.signal){const l={once:!0,[w_]:this,[m_]:!0};r.signal.addEventListener("abort",()=>i.abort(),l)}let c=!1;try{for await(const l of this){var f;if(c=!0,r!=null&&(f=r.signal)!==null&&f!==void 0&&f.aborted)throw new nr;o?t=await e(t,l,{signal:s}):(t=l,o=!0)}if(!c&&!o)throw new D_}finally{i.abort()}return t}async function M_(e){e!=null&&Dr(e,"options"),(e==null?void 0:e.signal)!=null&&xr(e.signal,"options.signal");const t=[];for await(const n of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new nr(void 0,{cause:e.signal.reason});T_(t,n)}return t}function F_(e,t){const r=Ni.call(this,e,t);return(async function*(){for await(const o of r)yield*o}).call(this)}function xc(e){if(e=L_(e),P_(e))return 0;if(e<0)throw new y_("number",">= 0",e);return e}function U_(e,t=void 0){return t!=null&&Dr(t,"options"),(t==null?void 0:t.signal)!=null&&xr(t.signal,"options.signal"),e=xc(e),(async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new nr;for await(const i of this){var o;if(t!=null&&(o=t.signal)!==null&&o!==void 0&&o.aborted)throw new nr;e--<=0&&(yield i)}}).call(this)}function H_(e,t=void 0){return t!=null&&Dr(t,"options"),(t==null?void 0:t.signal)!=null&&xr(t.signal,"options.signal"),e=xc(e),(async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new nr;for await(const i of this){var o;if(t!=null&&(o=t.signal)!==null&&o!==void 0&&o.aborted)throw new nr;if(e-- >0&&(yield i),e<=0)return}}).call(this)}xs.streamReturningOperators={asIndexedPairs:I_(B_,"readable.asIndexedPairs will be removed in a future version."),drop:U_,filter:qs,flatMap:F_,map:Ni,take:H_,compose:N_};xs.promiseReturningOperators={every:$_,forEach:x_,reduce:j_,toArray:M_,some:kc,find:k_};var ko,Tf;function Dc(){if(Tf)return ko;Tf=1;const{ArrayPrototypePop:e,Promise:t}=et,{isIterable:r,isNodeStream:n,isWebStream:o}=hr,{pipelineImpl:i}=Vs,{finished:s}=Sr;jc();function c(...f){return new t((l,u)=>{let h,b;const _=f[f.length-1];if(_&&typeof _=="object"&&!n(_)&&!r(_)&&!o(_)){const R=e(f);h=R.signal,b=R.end}i(f,(R,T)=>{R?u(R):l(T)},{signal:h,end:b})})}return ko={finished:s,pipeline:c},ko}var Of;function jc(){if(Of)return yo.exports;Of=1;const{Buffer:e}=x.bufferPolyfill,{ObjectDefineProperty:t,ObjectKeys:r,ReflectApply:n}=et,{promisify:{custom:o}}=mt,{streamReturningOperators:i,promiseReturningOperators:s}=xs,{codes:{ERR_ILLEGAL_CONSTRUCTOR:c}}=Rt,f=Bc,{setDefaultHighWaterMark:l,getDefaultHighWaterMark:u}=Pi,{pipeline:h}=Vs,{destroyer:b}=sn,_=Sr,R=Dc(),T=hr,C=yo.exports=Us.Stream;C.isDestroyed=T.isDestroyed,C.isDisturbed=T.isDisturbed,C.isErrored=T.isErrored,C.isReadable=T.isReadable,C.isWritable=T.isWritable,C.Readable=Ci();for(const L of r(i)){let S=function(...z){if(new.target)throw c();return C.Readable.from(n(O,this,z))};const O=i[L];t(S,"name",{__proto__:null,value:O.name}),t(S,"length",{__proto__:null,value:O.length}),t(C.Readable.prototype,L,{__proto__:null,value:S,enumerable:!1,configurable:!0,writable:!0})}for(const L of r(s)){let S=function(...z){if(new.target)throw c();return n(O,this,z)};const O=s[L];t(S,"name",{__proto__:null,value:O.name}),t(S,"length",{__proto__:null,value:O.length}),t(C.Readable.prototype,L,{__proto__:null,value:S,enumerable:!1,configurable:!0,writable:!0})}C.Writable=Hs(),C.Duplex=cr(),C.Transform=Lc,C.PassThrough=Cc,C.pipeline=h;const{addAbortSignal:D}=Li;return C.addAbortSignal=D,C.finished=_,C.destroy=b,C.compose=f,C.setDefaultHighWaterMark=l,C.getDefaultHighWaterMark=u,t(C,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return R}}),t(h,o,{__proto__:null,enumerable:!0,get(){return R.pipeline}}),t(_,o,{__proto__:null,enumerable:!0,get(){return R.finished}}),C.Stream=C,C._isUint8Array=function(O){return O instanceof Uint8Array},C._uint8ArrayToBuffer=function(O){return e.from(O.buffer,O.byteOffset,O.byteLength)},yo.exports}(function(e){const t=jc(),r=Dc(),n=t.Readable.destroy;e.exports=t.Readable,e.exports._uint8ArrayToBuffer=t._uint8ArrayToBuffer,e.exports._isUint8Array=t._isUint8Array,e.exports.isDisturbed=t.isDisturbed,e.exports.isErrored=t.isErrored,e.exports.isReadable=t.isReadable,e.exports.Readable=t.Readable,e.exports.Writable=t.Writable,e.exports.Duplex=t.Duplex,e.exports.Transform=t.Transform,e.exports.PassThrough=t.PassThrough,e.exports.addAbortSignal=t.addAbortSignal,e.exports.finished=t.finished,e.exports.destroy=t.destroy,e.exports.destroy=n,e.exports.pipeline=t.pipeline,e.exports.compose=t.compose,Object.defineProperty(t,"promises",{configurable:!0,enumerable:!0,get(){return r}}),e.exports.Stream=t.Stream,e.exports.default=e.exports})(kh);var z_={},Br={},Gs={},dt={};class Mc extends TypeError{constructor(t,r){let n;const{message:o,explanation:i,...s}=t,{path:c}=t,f=c.length===0?o:`At path: ${c.join(".")} -- ${o}`;super(i??f),i!=null&&(this.cause=f),Object.assign(this,s),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function W_(e){return Dt(e)&&typeof e[Symbol.iterator]=="function"}function Dt(e){return typeof e=="object"&&e!=null}function Lf(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function ft(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function V_(e){const{done:t,value:r}=e.next();return t?void 0:r}function q_(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:o,branch:i}=t,{type:s}=r,{refinement:c,message:f=`Expected a value of type \`${s}\`${c?` with refinement \`${c}\``:""}, but received: \`${ft(n)}\``}=e;return{value:n,type:s,refinement:c,key:o[o.length-1],path:o,branch:i,...e,message:f}}function*ms(e,t,r,n){W_(e)||(e=[e]);for(const o of e){const i=q_(o,t,r,n);i&&(yield i)}}function*Zs(e,t,r={}){const{path:n=[],branch:o=[e],coerce:i=!1,mask:s=!1}=r,c={path:n,branch:o};if(i&&(e=t.coercer(e,c),s&&t.type!=="type"&&Dt(t.schema)&&Dt(e)&&!Array.isArray(e)))for(const l in e)t.schema[l]===void 0&&delete e[l];let f="valid";for(const l of t.validator(e,c))l.explanation=r.message,f="not_valid",yield[l,void 0];for(let[l,u,h]of t.entries(e,c)){const b=Zs(u,h,{path:l===void 0?n:[...n,l],branch:l===void 0?o:[...o,u],coerce:i,mask:s,message:r.message});for(const _ of b)_[0]?(f=_[0].refinement!=null?"not_refined":"not_valid",yield[_[0],void 0]):i&&(u=_[1],l===void 0?e=u:e instanceof Map?e.set(l,u):e instanceof Set?e.add(u):Dt(e)&&(u!==void 0||l in e)&&(e[l]=u))}if(f!=="not_valid")for(const l of t.refiner(e,c))l.explanation=r.message,f="not_refined",yield[l,void 0];f==="valid"&&(yield[void 0,e])}class ot{constructor(t){const{type:r,schema:n,validator:o,refiner:i,coercer:s=f=>f,entries:c=function*(){}}=t;this.type=r,this.schema=n,this.entries=c,this.coercer=s,o?this.validator=(f,l)=>{const u=o(f,l);return ms(u,l,this,f)}:this.validator=()=>[],i?this.refiner=(f,l)=>{const u=i(f,l);return ms(u,l,this,f)}:this.refiner=()=>[]}assert(t,r){return Fc(t,this,r)}create(t,r){return Uc(t,this,r)}is(t){return Ks(t,this)}mask(t,r){return Hc(t,this,r)}validate(t,r={}){return an(t,this,r)}}function Fc(e,t,r){const n=an(e,t,{message:r});if(n[0])throw n[0]}function Uc(e,t,r){const n=an(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Hc(e,t,r){const n=an(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function Ks(e,t){return!an(e,t)[0]}function an(e,t,r={}){const n=Zs(e,t,r),o=V_(n);return o[0]?[new Mc(o[0],function*(){for(const s of n)s[0]&&(yield s[0])}),void 0]:[void 0,o[1]]}function G_(...e){const t=e[0].type==="type",r=e.map(o=>o.schema),n=Object.assign({},...r);return t?jn(n):Dn(n)}function At(e,t){return new ot({type:e,schema:null,validator:t})}function Z_(e,t){return new ot({...e,refiner:(r,n)=>r===void 0||e.refiner(r,n),validator(r,n){return r===void 0?!0:(t(r,n),e.validator(r,n))}})}function K_(e){return new ot({type:"dynamic",schema:null,*entries(t,r){yield*e(t,r).entries(t,r)},validator(t,r){return e(t,r).validator(t,r)},coercer(t,r){return e(t,r).coercer(t,r)},refiner(t,r){return e(t,r).refiner(t,r)}})}function J_(e){let t;return new ot({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator(r,n){return t??(t=e()),t.validator(r,n)},coercer(r,n){return t??(t=e()),t.coercer(r,n)},refiner(r,n){return t??(t=e()),t.refiner(r,n)}})}function X_(e,t){const{schema:r}=e,n={...r};for(const o of t)delete n[o];switch(e.type){case"type":return jn(n);default:return Dn(n)}}function Y_(e){const t=e instanceof ot,r=t?{...e.schema}:{...e};for(const n in r)r[n]=zc(r[n]);return t&&e.type==="type"?jn(r):Dn(r)}function Q_(e,t){const{schema:r}=e,n={};for(const o of t)n[o]=r[o];switch(e.type){case"type":return jn(n);default:return Dn(n)}}function eb(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),At(e,t)}function tb(){return At("any",()=>!0)}function rb(e){return new ot({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${ft(t)}`}})}function nb(){return At("bigint",e=>typeof e=="bigint")}function ib(){return At("boolean",e=>typeof e=="boolean")}function ob(){return At("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${ft(e)}`)}function sb(e){const t={},r=e.map(n=>ft(n)).join();for(const n of e)t[n]=n;return new ot({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${ft(n)}`}})}function ab(){return At("func",e=>typeof e=="function"||`Expected a function, but received: ${ft(e)}`)}function fb(e){return At("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${ft(t)}`)}function lb(){return At("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${ft(e)}`)}function cb(e){return new ot({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)}})}function ub(e){const t=ft(e),r=typeof e;return new ot({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${ft(n)}`}})}function db(e,t){return new ot({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,o]of r.entries())yield[n,n,e],yield[n,o,t]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${ft(r)}`}})}function Js(){return At("never",()=>!1)}function hb(e){return new ot({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function gb(){return At("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${ft(e)}`)}function Dn(e){const t=e?Object.keys(e):[],r=Js();return new ot({type:"object",schema:e||null,*entries(n){if(e&&Dt(n)){const o=new Set(Object.keys(n));for(const i of t)o.delete(i),yield[i,n[i],e[i]];for(const i of o)yield[i,n[i],r]}},validator(n){return Dt(n)||`Expected an object, but received: ${ft(n)}`},coercer(n){return Dt(n)?{...n}:n}})}function zc(e){return new ot({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function _b(e,t){return new ot({type:"record",schema:null,*entries(r){if(Dt(r))for(const n in r){const o=r[n];yield[n,n,e],yield[n,o,t]}},validator(r){return Dt(r)||`Expected an object, but received: ${ft(r)}`}})}function bb(){return At("regexp",e=>e instanceof RegExp)}function pb(e){return new ot({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer(t){return t instanceof Set?new Set(t):t},validator(t){return t instanceof Set||`Expected a \`Set\` object, but received: ${ft(t)}`}})}function Wc(){return At("string",e=>typeof e=="string"||`Expected a string, but received: ${ft(e)}`)}function yb(e){const t=Js();return new ot({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let o=0;o<n;o++)yield[o,r[o],e[o]||t]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${ft(r)}`}})}function jn(e){const t=Object.keys(e);return new ot({type:"type",schema:e,*entries(r){if(Dt(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return Dt(r)||`Expected an object, but received: ${ft(r)}`},coercer(r){return Dt(r)?{...r}:r}})}function wb(e){const t=e.map(r=>r.type).join(" | ");return new ot({type:"union",schema:null,coercer(r){for(const n of e){const[o,i]=n.validate(r,{coerce:!0});if(!o)return i}return r},validator(r,n){const o=[];for(const i of e){const[...s]=Zs(r,i,n),[c]=s;if(c[0])for(const[f]of s)f&&o.push(f);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${ft(r)}`,...o]}})}function Vc(){return At("unknown",()=>!0)}function Xs(e,t,r){return new ot({...e,coercer:(n,o)=>Ks(n,t)?e.coercer(r(n,o),o):e.coercer(n,o)})}function mb(e,t,r={}){return Xs(e,Vc(),n=>{const o=typeof t=="function"?t():t;if(n===void 0)return o;if(!r.strict&&Lf(n)&&Lf(o)){const i={...n};let s=!1;for(const c in o)i[c]===void 0&&(i[c]=o[c],s=!0);if(s)return i}return n})}function Eb(e){return Xs(e,Wc(),t=>t.trim())}function vb(e){return jr(e,"empty",t=>{const r=qc(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function qc(e){return e instanceof Map||e instanceof Set?e.size:e.length}function Sb(e,t,r={}){const{exclusive:n}=r;return jr(e,"max",o=>n?o<t:o<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${o}\``)}function Rb(e,t,r={}){const{exclusive:n}=r;return jr(e,"min",o=>n?o>t:o>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${o}\``)}function Ab(e){return jr(e,"nonempty",t=>qc(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function Ib(e,t){return jr(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function Tb(e,t,r=t){const n=`Expected a ${e.type}`,o=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return jr(e,"size",i=>{if(typeof i=="number"||i instanceof Date)return t<=i&&i<=r||`${n} ${o} but received \`${i}\``;if(i instanceof Map||i instanceof Set){const{size:s}=i;return t<=s&&s<=r||`${n} with a size ${o} but received one with a size of \`${s}\``}else{const{length:s}=i;return t<=s&&s<=r||`${n} with a length ${o} but received one with a length of \`${s}\``}})}function jr(e,t,r){return new ot({...e,*refiner(n,o){yield*e.refiner(n,o);const i=r(n,o),s=ms(i,o,e,n);for(const c of s)yield{...c,refinement:t}}})}const Ob=Object.freeze(Object.defineProperty({__proto__:null,Struct:ot,StructError:Mc,any:tb,array:rb,assert:Fc,assign:G_,bigint:nb,boolean:ib,coerce:Xs,create:Uc,date:ob,defaulted:mb,define:At,deprecated:Z_,dynamic:K_,empty:vb,enums:sb,func:ab,instance:fb,integer:lb,intersection:cb,is:Ks,lazy:J_,literal:ub,map:db,mask:Hc,max:Sb,min:Rb,never:Js,nonempty:Ab,nullable:hb,number:gb,object:Dn,omit:X_,optional:zc,partial:Y_,pattern:Ib,pick:Q_,record:_b,refine:jr,regexp:bb,set:pb,size:Tb,string:Wc,struct:eb,trimmed:Eb,tuple:yb,type:jn,union:wb,unknown:Vc,validate:an},Symbol.toStringTag,{value:"Module"})),Mr=x.getAugmentedNamespace(Ob);Object.defineProperty(dt,"__esModule",{value:!0});dt.assertExhaustive=dt.assertStruct=dt.assert=dt.AssertionError=void 0;const Lb=Mr;function Pb(e){return typeof e=="object"&&e!==null&&"message"in e}function Cb(e){var t,r;return typeof((r=(t=e==null?void 0:e.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function Nb(e){const t=Pb(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function Gc(e,t){return Cb(e)?new e({message:t}):e({message:t})}class Ys extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}dt.AssertionError=Ys;function Bb(e,t="Assertion failed.",r=Ys){if(!e)throw t instanceof Error?t:Gc(r,t)}dt.assert=Bb;function $b(e,t,r="Assertion failed",n=Ys){try{(0,Lb.assert)(e,t)}catch(o){throw Gc(n,`${r}: ${Nb(o)}.`)}}dt.assertStruct=$b;function kb(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}dt.assertExhaustive=kb;var Mn={};Object.defineProperty(Mn,"__esModule",{value:!0});Mn.base64=void 0;const xb=Mr,Db=dt,jb=(e,t={})=>{var r,n;const o=(r=t.paddingRequired)!==null&&r!==void 0?r:!1,i=(n=t.characterSet)!==null&&n!==void 0?n:"base64";let s;i==="base64"?s=String.raw`[A-Za-z0-9+\/]`:((0,Db.assert)(i==="base64url"),s=String.raw`[-_A-Za-z0-9]`);let c;return o?c=new RegExp(`^(?:${s}{4})*(?:${s}{3}=|${s}{2}==)?$`,"u"):c=new RegExp(`^(?:${s}{4})*(?:${s}{2,3}|${s}{3}=|${s}{2}==)?$`,"u"),(0,xb.pattern)(e,c)};Mn.base64=jb;var De={},Fn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const t=Mr,r=dt;e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu);function n(l){return(0,t.is)(l,e.HexStruct)}e.isHexString=n;function o(l){return(0,t.is)(l,e.StrictHexStruct)}e.isStrictHexString=o;function i(l){(0,r.assert)(n(l),"Value must be a hexadecimal string.")}e.assertIsHexString=i;function s(l){(0,r.assert)(o(l),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=s;function c(l){return l.startsWith("0x")?l:l.startsWith("0X")?`0x${l.substring(2)}`:`0x${l}`}e.add0x=c;function f(l){return l.startsWith("0x")||l.startsWith("0X")?l.substring(2):l}e.remove0x=f})(Fn);Object.defineProperty(De,"__esModule",{value:!0});De.createDataView=De.concatBytes=De.valueToBytes=De.stringToBytes=De.numberToBytes=De.signedBigIntToBytes=De.bigIntToBytes=De.hexToBytes=De.bytesToString=De.bytesToNumber=De.bytesToSignedBigInt=De.bytesToBigInt=De.bytesToHex=De.assertIsBytes=De.isBytes=void 0;const Pt=dt,Es=Fn,Pf=48,Cf=58,Nf=87;function Mb(){const e=[];return()=>{if(e.length===0)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}const Fb=Mb();function Qs(e){return e instanceof Uint8Array}De.isBytes=Qs;function fn(e){(0,Pt.assert)(Qs(e),"Value must be a Uint8Array.")}De.assertIsBytes=fn;function Zc(e){if(fn(e),e.length===0)return"0x";const t=Fb(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,Es.add0x)(r.join(""))}De.bytesToHex=Zc;function Kc(e){fn(e);const t=Zc(e);return BigInt(t)}De.bytesToBigInt=Kc;function Ub(e){fn(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(e.length*8,t)}De.bytesToSignedBigInt=Ub;function Hb(e){fn(e);const t=Kc(e);return(0,Pt.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}De.bytesToNumber=Hb;function zb(e){return fn(e),new TextDecoder().decode(e)}De.bytesToString=zb;function Bi(e){var t;if(((t=e==null?void 0:e.toLowerCase)===null||t===void 0?void 0:t.call(e))==="0x")return new Uint8Array;(0,Es.assertIsHexString)(e);const r=(0,Es.remove0x)(e).toLowerCase(),n=r.length%2===0?r:`0${r}`,o=new Uint8Array(n.length/2);for(let i=0;i<o.length;i++){const s=n.charCodeAt(i*2),c=n.charCodeAt(i*2+1),f=s-(s<Cf?Pf:Nf),l=c-(c<Cf?Pf:Nf);o[i]=f*16+l}return o}De.hexToBytes=Bi;function Jc(e){(0,Pt.assert)(typeof e=="bigint","Value must be a bigint."),(0,Pt.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return Bi(t)}De.bigIntToBytes=Jc;function Wb(e,t){(0,Pt.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function Vb(e,t){(0,Pt.assert)(typeof e=="bigint","Value must be a bigint."),(0,Pt.assert)(typeof t=="number","Byte length must be a number."),(0,Pt.assert)(t>0,"Byte length must be greater than 0."),(0,Pt.assert)(Wb(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let o=0;o<n.length;o++)n[o]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()}De.signedBigIntToBytes=Vb;function Xc(e){(0,Pt.assert)(typeof e=="number","Value must be a number."),(0,Pt.assert)(e>=0,"Value must be a non-negative number."),(0,Pt.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return Bi(t)}De.numberToBytes=Xc;function Yc(e){return(0,Pt.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}De.stringToBytes=Yc;function Qc(e){if(typeof e=="bigint")return Jc(e);if(typeof e=="number")return Xc(e);if(typeof e=="string")return e.startsWith("0x")?Bi(e):Yc(e);if(Qs(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}De.valueToBytes=Qc;function qb(e){const t=new Array(e.length);let r=0;for(let o=0;o<e.length;o++){const i=Qc(e[o]);t[o]=i,r+=i.length}const n=new Uint8Array(r);for(let o=0,i=0;o<t.length;o++)n.set(t[o],i),i+=t[o].length;return n}De.concatBytes=qb;function Gb(e){if(typeof x.dist.Buffer<"u"&&e instanceof x.dist.Buffer){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}De.createDataView=Gb;var $i={};Object.defineProperty($i,"__esModule",{value:!0});$i.ChecksumStruct=void 0;const Bf=Mr,Zb=Mn;$i.ChecksumStruct=(0,Bf.size)((0,Zb.base64)((0,Bf.string)(),{paddingRequired:!0}),44,44);var Xt={};Object.defineProperty(Xt,"__esModule",{value:!0});Xt.createHex=Xt.createBytes=Xt.createBigInt=Xt.createNumber=void 0;const Ye=Mr,Kb=dt,eu=De,ki=Fn,tu=(0,Ye.union)([(0,Ye.number)(),(0,Ye.bigint)(),(0,Ye.string)(),ki.StrictHexStruct]),Jb=(0,Ye.coerce)((0,Ye.number)(),tu,Number),Xb=(0,Ye.coerce)((0,Ye.bigint)(),tu,BigInt);(0,Ye.union)([ki.StrictHexStruct,(0,Ye.instance)(Uint8Array)]);const Yb=(0,Ye.coerce)((0,Ye.instance)(Uint8Array),(0,Ye.union)([ki.StrictHexStruct]),eu.hexToBytes),Qb=(0,Ye.coerce)(ki.StrictHexStruct,(0,Ye.instance)(Uint8Array),eu.bytesToHex);function ep(e){try{const t=(0,Ye.create)(e,Jb);return(0,Kb.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){throw t instanceof Ye.StructError?new Error(`Expected a number-like value, got "${e}".`):t}}Xt.createNumber=ep;function tp(e){try{return(0,Ye.create)(e,Xb)}catch(t){throw t instanceof Ye.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}Xt.createBigInt=tp;function rp(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return(0,Ye.create)(e,Yb)}catch(t){throw t instanceof Ye.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Xt.createBytes=rp;function np(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return(0,Ye.create)(e,Qb)}catch(t){throw t instanceof Ye.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Xt.createHex=np;var Xr={},ru=x.commonjsGlobal&&x.commonjsGlobal.__classPrivateFieldSet||function(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r},wt=x.commonjsGlobal&&x.commonjsGlobal.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Ut,Zt;Object.defineProperty(Xr,"__esModule",{value:!0});Xr.FrozenSet=Xr.FrozenMap=void 0;class ea{constructor(t){Ut.set(this,void 0),ru(this,Ut,new Map(t),"f"),Object.freeze(this)}get size(){return wt(this,Ut,"f").size}[(Ut=new WeakMap,Symbol.iterator)](){return wt(this,Ut,"f")[Symbol.iterator]()}entries(){return wt(this,Ut,"f").entries()}forEach(t,r){return wt(this,Ut,"f").forEach((n,o,i)=>t.call(r,n,o,this))}get(t){return wt(this,Ut,"f").get(t)}has(t){return wt(this,Ut,"f").has(t)}keys(){return wt(this,Ut,"f").keys()}values(){return wt(this,Ut,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}Xr.FrozenMap=ea;class ta{constructor(t){Zt.set(this,void 0),ru(this,Zt,new Set(t),"f"),Object.freeze(this)}get size(){return wt(this,Zt,"f").size}[(Zt=new WeakMap,Symbol.iterator)](){return wt(this,Zt,"f")[Symbol.iterator]()}entries(){return wt(this,Zt,"f").entries()}forEach(t,r){return wt(this,Zt,"f").forEach((n,o,i)=>t.call(r,n,o,this))}has(t){return wt(this,Zt,"f").has(t)}keys(){return wt(this,Zt,"f").keys()}values(){return wt(this,Zt,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}Xr.FrozenSet=ta;Object.freeze(ea);Object.freeze(ea.prototype);Object.freeze(ta);Object.freeze(ta.prototype);var nu={};Object.defineProperty(nu,"__esModule",{value:!0});var iu={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const t=Mr,r=dt,n=()=>(0,t.define)("finite number",z=>(0,t.is)(z,(0,t.number)())&&Number.isFinite(z));e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),n(),(0,t.string)(),(0,t.array)((0,t.lazy)(()=>e.UnsafeJsonStruct)),(0,t.record)((0,t.string)(),(0,t.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,t.define)("Json",(z,Y)=>{function X(F,V){const ee=[...V.validator(F,Y)];return ee.length>0?ee:!0}try{const F=X(z,e.UnsafeJsonStruct);return F!==!0?F:X(JSON.parse(JSON.stringify(z)),e.UnsafeJsonStruct)}catch(F){return F instanceof RangeError?"Circular reference detected":!1}});function o(z){return(0,t.is)(z,e.JsonStruct)}e.isValidJson=o;function i(z){(0,r.assertStruct)(z,e.JsonStruct,"Invalid JSON value");const Y=JSON.stringify(z);return new TextEncoder().encode(Y).byteLength}e.getJsonSize=i,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]);function s(z){return(0,t.is)(z,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=s;function c(z,Y){(0,r.assertStruct)(z,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",Y)}e.assertIsJsonRpcNotification=c;function f(z){return(0,t.is)(z,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=f;function l(z,Y){(0,r.assertStruct)(z,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",Y)}e.assertIsJsonRpcRequest=l,e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function u(z){return(0,t.is)(z,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=u;function h(z,Y){(0,r.assertStruct)(z,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",Y)}e.assertIsPendingJsonRpcResponse=h;function b(z){return(0,t.is)(z,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=b;function _(z,Y){(0,r.assertStruct)(z,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",Y)}e.assertIsJsonRpcResponse=_;function R(z){return(0,t.is)(z,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=R;function T(z,Y){(0,r.assertStruct)(z,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",Y)}e.assertIsJsonRpcSuccess=T;function C(z){return(0,t.is)(z,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=C;function D(z,Y){(0,r.assertStruct)(z,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",Y)}e.assertIsJsonRpcFailure=D;function L(z){return(0,t.is)(z,e.JsonRpcErrorStruct)}e.isJsonRpcError=L;function O(z,Y){(0,r.assertStruct)(z,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",Y)}e.assertIsJsonRpcError=O;function S(z){const{permitEmptyString:Y,permitFractions:X,permitNull:F}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},z);return oe=>!!(typeof oe=="number"&&(X||Number.isInteger(oe))||typeof oe=="string"&&(Y||oe.length>0)||F&&oe===null)}e.getJsonRpcIdValidator=S})(iu);var ou={};Object.defineProperty(ou,"__esModule",{value:!0});var Yr={},ip=x.commonjsGlobal&&x.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Yr,"__esModule",{value:!0});Yr.createModuleLogger=Yr.createProjectLogger=void 0;const op=ip(Oh),sp=(0,op.default)("metamask");function ap(e){return sp.extend(e)}Yr.createProjectLogger=ap;function fp(e,t){return e.extend(t)}Yr.createModuleLogger=fp;var su={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0;function t(l){return Array.isArray(l)&&l.length>0}e.isNonEmptyArray=t;function r(l){return l==null}e.isNullOrUndefined=r;function n(l){return!!l&&typeof l=="object"&&!Array.isArray(l)}e.isObject=n;const o=(l,u)=>Object.hasOwnProperty.call(l,u);e.hasProperty=o,function(l){l[l.Null=4]="Null",l[l.Comma=1]="Comma",l[l.Wrapper=1]="Wrapper",l[l.True=4]="True",l[l.False=5]="False",l[l.Quote=1]="Quote",l[l.Colon=1]="Colon",l[l.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function i(l){if(typeof l!="object"||l===null)return!1;try{let u=l;for(;Object.getPrototypeOf(u)!==null;)u=Object.getPrototypeOf(u);return Object.getPrototypeOf(l)===u}catch{return!1}}e.isPlainObject=i;function s(l){return l.charCodeAt(0)<=127}e.isASCII=s;function c(l){var u;return l.split("").reduce((b,_)=>s(_)?b+1:b+2,0)+((u=l.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&u!==void 0?u:[]).length}e.calculateStringSize=c;function f(l){return l.toString().length}e.calculateNumberSize=f})(su);var Yt={};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.hexToBigInt=Yt.hexToNumber=Yt.bigIntToHex=Yt.numberToHex=void 0;const Zr=dt,Pn=Fn,lp=e=>((0,Zr.assert)(typeof e=="number","Value must be a number."),(0,Zr.assert)(e>=0,"Value must be a non-negative number."),(0,Zr.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Pn.add0x)(e.toString(16)));Yt.numberToHex=lp;const cp=e=>((0,Zr.assert)(typeof e=="bigint","Value must be a bigint."),(0,Zr.assert)(e>=0,"Value must be a non-negative bigint."),(0,Pn.add0x)(e.toString(16)));Yt.bigIntToHex=cp;const up=e=>{(0,Pn.assertIsHexString)(e);const t=parseInt(e,16);return(0,Zr.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};Yt.hexToNumber=up;const dp=e=>((0,Pn.assertIsHexString)(e),BigInt((0,Pn.add0x)(e)));Yt.hexToBigInt=dp;var au={};Object.defineProperty(au,"__esModule",{value:!0});var fu={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(i){i[i.Millisecond=1]="Millisecond",i[i.Second=1e3]="Second",i[i.Minute=6e4]="Minute",i[i.Hour=36e5]="Hour",i[i.Day=864e5]="Day",i[i.Week=6048e5]="Week",i[i.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const t=i=>Number.isInteger(i)&&i>=0,r=(i,s)=>{if(!t(i))throw new Error(`"${s}" must be a non-negative integer. Received: "${i}".`)};function n(i,s){return r(i,"count"),i*s}e.inMilliseconds=n;function o(i){return r(i,"timestamp"),Date.now()-i}e.timeSince=o})(fu);var lu={};Object.defineProperty(lu,"__esModule",{value:!0});var cu={},vs={exports:{}};const hp="2.0.0",uu=256,gp=Number.MAX_SAFE_INTEGER||9007199254740991,_p=16,bp=uu-6,pp=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var xi={MAX_LENGTH:uu,MAX_SAFE_COMPONENT_LENGTH:_p,MAX_SAFE_BUILD_LENGTH:bp,MAX_SAFE_INTEGER:gp,RELEASE_TYPES:pp,SEMVER_SPEC_VERSION:hp,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const yp=typeof x.dist.process=="object"&&x.dist.process.env&&x.dist.process.env.NODE_DEBUG&&/\bsemver\b/i.test(x.dist.process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var Di=yp;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:o}=xi,i=Di;t=e.exports={};const s=t.re=[],c=t.safeRe=[],f=t.src=[],l=t.t={};let u=0;const h="[a-zA-Z0-9-]",b=[["\\s",1],["\\d",o],[h,n]],_=T=>{for(const[C,D]of b)T=T.split(`${C}*`).join(`${C}{0,${D}}`).split(`${C}+`).join(`${C}{1,${D}}`);return T},R=(T,C,D)=>{const L=_(C),O=u++;i(T,O,C),l[T]=O,f[O]=C,s[O]=new RegExp(C,D?"g":void 0),c[O]=new RegExp(L,D?"g":void 0)};R("NUMERICIDENTIFIER","0|[1-9]\\d*"),R("NUMERICIDENTIFIERLOOSE","\\d+"),R("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),R("MAINVERSION",`(${f[l.NUMERICIDENTIFIER]})\\.(${f[l.NUMERICIDENTIFIER]})\\.(${f[l.NUMERICIDENTIFIER]})`),R("MAINVERSIONLOOSE",`(${f[l.NUMERICIDENTIFIERLOOSE]})\\.(${f[l.NUMERICIDENTIFIERLOOSE]})\\.(${f[l.NUMERICIDENTIFIERLOOSE]})`),R("PRERELEASEIDENTIFIER",`(?:${f[l.NUMERICIDENTIFIER]}|${f[l.NONNUMERICIDENTIFIER]})`),R("PRERELEASEIDENTIFIERLOOSE",`(?:${f[l.NUMERICIDENTIFIERLOOSE]}|${f[l.NONNUMERICIDENTIFIER]})`),R("PRERELEASE",`(?:-(${f[l.PRERELEASEIDENTIFIER]}(?:\\.${f[l.PRERELEASEIDENTIFIER]})*))`),R("PRERELEASELOOSE",`(?:-?(${f[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${f[l.PRERELEASEIDENTIFIERLOOSE]})*))`),R("BUILDIDENTIFIER",`${h}+`),R("BUILD",`(?:\\+(${f[l.BUILDIDENTIFIER]}(?:\\.${f[l.BUILDIDENTIFIER]})*))`),R("FULLPLAIN",`v?${f[l.MAINVERSION]}${f[l.PRERELEASE]}?${f[l.BUILD]}?`),R("FULL",`^${f[l.FULLPLAIN]}$`),R("LOOSEPLAIN",`[v=\\s]*${f[l.MAINVERSIONLOOSE]}${f[l.PRERELEASELOOSE]}?${f[l.BUILD]}?`),R("LOOSE",`^${f[l.LOOSEPLAIN]}$`),R("GTLT","((?:<|>)?=?)"),R("XRANGEIDENTIFIERLOOSE",`${f[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),R("XRANGEIDENTIFIER",`${f[l.NUMERICIDENTIFIER]}|x|X|\\*`),R("XRANGEPLAIN",`[v=\\s]*(${f[l.XRANGEIDENTIFIER]})(?:\\.(${f[l.XRANGEIDENTIFIER]})(?:\\.(${f[l.XRANGEIDENTIFIER]})(?:${f[l.PRERELEASE]})?${f[l.BUILD]}?)?)?`),R("XRANGEPLAINLOOSE",`[v=\\s]*(${f[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[l.XRANGEIDENTIFIERLOOSE]})(?:${f[l.PRERELEASELOOSE]})?${f[l.BUILD]}?)?)?`),R("XRANGE",`^${f[l.GTLT]}\\s*${f[l.XRANGEPLAIN]}$`),R("XRANGELOOSE",`^${f[l.GTLT]}\\s*${f[l.XRANGEPLAINLOOSE]}$`),R("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),R("COERCE",`${f[l.COERCEPLAIN]}(?:$|[^\\d])`),R("COERCEFULL",f[l.COERCEPLAIN]+`(?:${f[l.PRERELEASE]})?(?:${f[l.BUILD]})?(?:$|[^\\d])`),R("COERCERTL",f[l.COERCE],!0),R("COERCERTLFULL",f[l.COERCEFULL],!0),R("LONETILDE","(?:~>?)"),R("TILDETRIM",`(\\s*)${f[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",R("TILDE",`^${f[l.LONETILDE]}${f[l.XRANGEPLAIN]}$`),R("TILDELOOSE",`^${f[l.LONETILDE]}${f[l.XRANGEPLAINLOOSE]}$`),R("LONECARET","(?:\\^)"),R("CARETTRIM",`(\\s*)${f[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",R("CARET",`^${f[l.LONECARET]}${f[l.XRANGEPLAIN]}$`),R("CARETLOOSE",`^${f[l.LONECARET]}${f[l.XRANGEPLAINLOOSE]}$`),R("COMPARATORLOOSE",`^${f[l.GTLT]}\\s*(${f[l.LOOSEPLAIN]})$|^$`),R("COMPARATOR",`^${f[l.GTLT]}\\s*(${f[l.FULLPLAIN]})$|^$`),R("COMPARATORTRIM",`(\\s*)${f[l.GTLT]}\\s*(${f[l.LOOSEPLAIN]}|${f[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",R("HYPHENRANGE",`^\\s*(${f[l.XRANGEPLAIN]})\\s+-\\s+(${f[l.XRANGEPLAIN]})\\s*$`),R("HYPHENRANGELOOSE",`^\\s*(${f[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${f[l.XRANGEPLAINLOOSE]})\\s*$`),R("STAR","(<|>)?=?\\s*\\*"),R("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),R("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(vs,vs.exports);var Un=vs.exports;const wp=Object.freeze({loose:!0}),mp=Object.freeze({}),Ep=e=>e?typeof e!="object"?wp:e:mp;var ra=Ep;const $f=/^[0-9]+$/,du=(e,t)=>{const r=$f.test(e),n=$f.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},vp=(e,t)=>du(t,e);var hu={compareIdentifiers:du,rcompareIdentifiers:vp};const Qn=Di,{MAX_LENGTH:kf,MAX_SAFE_INTEGER:ei}=xi,{safeRe:xf,t:Df}=Un,Sp=ra,{compareIdentifiers:Ur}=hu;let Rp=class Kt{constructor(t,r){if(r=Sp(r),t instanceof Kt){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>kf)throw new TypeError(`version is longer than ${kf} characters`);Qn("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?xf[Df.LOOSE]:xf[Df.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>ei||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ei||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ei||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){const i=+o;if(i>=0&&i<ei)return i}return o}):this.prerelease=[],this.build=n[5]?n[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(t){if(Qn("SemVer.compare",this.version,this.options,t),!(t instanceof Kt)){if(typeof t=="string"&&t===this.version)return 0;t=new Kt(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof Kt||(t=new Kt(t,this.options)),Ur(this.major,t.major)||Ur(this.minor,t.minor)||Ur(this.patch,t.patch)}comparePre(t){if(t instanceof Kt||(t=new Kt(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],o=t.prerelease[r];if(Qn("prerelease compare",r,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n===o)continue;return Ur(n,o)}while(++r)}compareBuild(t){t instanceof Kt||(t=new Kt(t,this.options));let r=0;do{const n=this.build[r],o=t.build[r];if(Qn("build compare",r,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n===o)continue;return Ur(n,o)}while(++r)}inc(t,r,n){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const o=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[o];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(r){let i=[r,o];n===!1&&(i=[r]),Ur(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var Et=Rp;const jf=Et,Ap=(e,t,r=!1)=>{if(e instanceof jf)return e;try{return new jf(e,t)}catch(n){if(!r)return null;throw n}};var ln=Ap;const Ip=ln,Tp=(e,t)=>{const r=Ip(e,t);return r?r.version:null};var Op=Tp;const Lp=ln,Pp=(e,t)=>{const r=Lp(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var Cp=Pp;const Mf=Et,Np=(e,t,r,n,o)=>{typeof r=="string"&&(o=n,n=r,r=void 0);try{return new Mf(e instanceof Mf?e.version:e,r).inc(t,n,o).version}catch{return null}};var Bp=Np;const Ff=ln,$p=(e,t)=>{const r=Ff(e,null,!0),n=Ff(t,null,!0),o=r.compare(n);if(o===0)return null;const i=o>0,s=i?r:n,c=i?n:r,f=!!s.prerelease.length;if(!!c.prerelease.length&&!f)return!c.patch&&!c.minor?"major":s.patch?"patch":s.minor?"minor":"major";const u=f?"pre":"";return r.major!==n.major?u+"major":r.minor!==n.minor?u+"minor":r.patch!==n.patch?u+"patch":"prerelease"};var kp=$p;const xp=Et,Dp=(e,t)=>new xp(e,t).major;var jp=Dp;const Mp=Et,Fp=(e,t)=>new Mp(e,t).minor;var Up=Fp;const Hp=Et,zp=(e,t)=>new Hp(e,t).patch;var Wp=zp;const Vp=ln,qp=(e,t)=>{const r=Vp(e,t);return r&&r.prerelease.length?r.prerelease:null};var Gp=qp;const Uf=Et,Zp=(e,t,r)=>new Uf(e,r).compare(new Uf(t,r));var Vt=Zp;const Kp=Vt,Jp=(e,t,r)=>Kp(t,e,r);var Xp=Jp;const Yp=Vt,Qp=(e,t)=>Yp(e,t,!0);var ey=Qp;const Hf=Et,ty=(e,t,r)=>{const n=new Hf(e,r),o=new Hf(t,r);return n.compare(o)||n.compareBuild(o)};var na=ty;const ry=na,ny=(e,t)=>e.sort((r,n)=>ry(r,n,t));var iy=ny;const oy=na,sy=(e,t)=>e.sort((r,n)=>oy(n,r,t));var ay=sy;const fy=Vt,ly=(e,t,r)=>fy(e,t,r)>0;var ji=ly;const cy=Vt,uy=(e,t,r)=>cy(e,t,r)<0;var ia=uy;const dy=Vt,hy=(e,t,r)=>dy(e,t,r)===0;var gu=hy;const gy=Vt,_y=(e,t,r)=>gy(e,t,r)!==0;var _u=_y;const by=Vt,py=(e,t,r)=>by(e,t,r)>=0;var oa=py;const yy=Vt,wy=(e,t,r)=>yy(e,t,r)<=0;var sa=wy;const my=gu,Ey=_u,vy=ji,Sy=oa,Ry=ia,Ay=sa,Iy=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return my(e,r,n);case"!=":return Ey(e,r,n);case">":return vy(e,r,n);case">=":return Sy(e,r,n);case"<":return Ry(e,r,n);case"<=":return Ay(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var bu=Iy;const Ty=Et,Oy=ln,{safeRe:ti,t:ri}=Un,Ly=(e,t)=>{if(e instanceof Ty)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?ti[ri.COERCEFULL]:ti[ri.COERCE]);else{const f=t.includePrerelease?ti[ri.COERCERTLFULL]:ti[ri.COERCERTL];let l;for(;(l=f.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),f.lastIndex=l.index+l[1].length+l[2].length;f.lastIndex=-1}if(r===null)return null;const n=r[2],o=r[3]||"0",i=r[4]||"0",s=t.includePrerelease&&r[5]?`-${r[5]}`:"",c=t.includePrerelease&&r[6]?`+${r[6]}`:"";return Oy(`${n}.${o}.${i}${s}${c}`,t)};var Py=Ly;class Cy{constructor(){this.max=1e3,this.map=new Map}get(t){const r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){const o=this.map.keys().next().value;this.delete(o)}this.map.set(t,r)}return this}}var Ny=Cy,xo,zf;function qt(){if(zf)return xo;zf=1;class e{constructor(m,$){if($=n($),m instanceof e)return m.loose===!!$.loose&&m.includePrerelease===!!$.includePrerelease?m:new e(m.raw,$);if(m instanceof o)return this.raw=m.value,this.set=[[m]],this.format(),this;if(this.options=$,this.loose=!!$.loose,this.includePrerelease=!!$.includePrerelease,this.raw=m.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(M=>this.parseRange(M.trim())).filter(M=>M.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const M=this.set[0];if(this.set=this.set.filter(N=>!R(N[0])),this.set.length===0)this.set=[M];else if(this.set.length>1){for(const N of this.set)if(N.length===1&&T(N[0])){this.set=[N];break}}}this.format()}format(){return this.range=this.set.map(m=>m.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(m){const M=((this.options.includePrerelease&&b)|(this.options.loose&&_))+":"+m,N=r.get(M);if(N)return N;const U=this.options.loose,P=U?c[f.HYPHENRANGELOOSE]:c[f.HYPHENRANGE];m=m.replace(P,ee(this.options.includePrerelease)),i("hyphen replace",m),m=m.replace(c[f.COMPARATORTRIM],l),i("comparator trim",m),m=m.replace(c[f.TILDETRIM],u),i("tilde trim",m),m=m.replace(c[f.CARETTRIM],h),i("caret trim",m);let H=m.split(" ").map(ie=>D(ie,this.options)).join(" ").split(/\s+/).map(ie=>oe(ie,this.options));U&&(H=H.filter(ie=>(i("loose invalid filter",ie,this.options),!!ie.match(c[f.COMPARATORLOOSE])))),i("range list",H);const G=new Map,se=H.map(ie=>new o(ie,this.options));for(const ie of se){if(R(ie))return[ie];G.set(ie.value,ie)}G.size>1&&G.has("")&&G.delete("");const q=[...G.values()];return r.set(M,q),q}intersects(m,$){if(!(m instanceof e))throw new TypeError("a Range is required");return this.set.some(M=>C(M,$)&&m.set.some(N=>C(N,$)&&M.every(U=>N.every(P=>U.intersects(P,$)))))}test(m){if(!m)return!1;if(typeof m=="string")try{m=new s(m,this.options)}catch{return!1}for(let $=0;$<this.set.length;$++)if(w(this.set[$],m,this.options))return!0;return!1}}xo=e;const t=Ny,r=new t,n=ra,o=Mi(),i=Di,s=Et,{safeRe:c,t:f,comparatorTrimReplace:l,tildeTrimReplace:u,caretTrimReplace:h}=Un,{FLAG_INCLUDE_PRERELEASE:b,FLAG_LOOSE:_}=xi,R=d=>d.value==="<0.0.0-0",T=d=>d.value==="",C=(d,m)=>{let $=!0;const M=d.slice();let N=M.pop();for(;$&&M.length;)$=M.every(U=>N.intersects(U,m)),N=M.pop();return $},D=(d,m)=>(i("comp",d,m),d=z(d,m),i("caret",d),d=O(d,m),i("tildes",d),d=X(d,m),i("xrange",d),d=V(d,m),i("stars",d),d),L=d=>!d||d.toLowerCase()==="x"||d==="*",O=(d,m)=>d.trim().split(/\s+/).map($=>S($,m)).join(" "),S=(d,m)=>{const $=m.loose?c[f.TILDELOOSE]:c[f.TILDE];return d.replace($,(M,N,U,P,H)=>{i("tilde",d,M,N,U,P,H);let G;return L(N)?G="":L(U)?G=`>=${N}.0.0 <${+N+1}.0.0-0`:L(P)?G=`>=${N}.${U}.0 <${N}.${+U+1}.0-0`:H?(i("replaceTilde pr",H),G=`>=${N}.${U}.${P}-${H} <${N}.${+U+1}.0-0`):G=`>=${N}.${U}.${P} <${N}.${+U+1}.0-0`,i("tilde return",G),G})},z=(d,m)=>d.trim().split(/\s+/).map($=>Y($,m)).join(" "),Y=(d,m)=>{i("caret",d,m);const $=m.loose?c[f.CARETLOOSE]:c[f.CARET],M=m.includePrerelease?"-0":"";return d.replace($,(N,U,P,H,G)=>{i("caret",d,N,U,P,H,G);let se;return L(U)?se="":L(P)?se=`>=${U}.0.0${M} <${+U+1}.0.0-0`:L(H)?U==="0"?se=`>=${U}.${P}.0${M} <${U}.${+P+1}.0-0`:se=`>=${U}.${P}.0${M} <${+U+1}.0.0-0`:G?(i("replaceCaret pr",G),U==="0"?P==="0"?se=`>=${U}.${P}.${H}-${G} <${U}.${P}.${+H+1}-0`:se=`>=${U}.${P}.${H}-${G} <${U}.${+P+1}.0-0`:se=`>=${U}.${P}.${H}-${G} <${+U+1}.0.0-0`):(i("no pr"),U==="0"?P==="0"?se=`>=${U}.${P}.${H}${M} <${U}.${P}.${+H+1}-0`:se=`>=${U}.${P}.${H}${M} <${U}.${+P+1}.0-0`:se=`>=${U}.${P}.${H} <${+U+1}.0.0-0`),i("caret return",se),se})},X=(d,m)=>(i("replaceXRanges",d,m),d.split(/\s+/).map($=>F($,m)).join(" ")),F=(d,m)=>{d=d.trim();const $=m.loose?c[f.XRANGELOOSE]:c[f.XRANGE];return d.replace($,(M,N,U,P,H,G)=>{i("xRange",d,M,N,U,P,H,G);const se=L(U),q=se||L(P),ie=q||L(H),ce=ie;return N==="="&&ce&&(N=""),G=m.includePrerelease?"-0":"",se?N===">"||N==="<"?M="<0.0.0-0":M="*":N&&ce?(q&&(P=0),H=0,N===">"?(N=">=",q?(U=+U+1,P=0,H=0):(P=+P+1,H=0)):N==="<="&&(N="<",q?U=+U+1:P=+P+1),N==="<"&&(G="-0"),M=`${N+U}.${P}.${H}${G}`):q?M=`>=${U}.0.0${G} <${+U+1}.0.0-0`:ie&&(M=`>=${U}.${P}.0${G} <${U}.${+P+1}.0-0`),i("xRange return",M),M})},V=(d,m)=>(i("replaceStars",d,m),d.trim().replace(c[f.STAR],"")),oe=(d,m)=>(i("replaceGTE0",d,m),d.trim().replace(c[m.includePrerelease?f.GTE0PRE:f.GTE0],"")),ee=d=>(m,$,M,N,U,P,H,G,se,q,ie,ce)=>(L(M)?$="":L(N)?$=`>=${M}.0.0${d?"-0":""}`:L(U)?$=`>=${M}.${N}.0${d?"-0":""}`:P?$=`>=${$}`:$=`>=${$}${d?"-0":""}`,L(se)?G="":L(q)?G=`<${+se+1}.0.0-0`:L(ie)?G=`<${se}.${+q+1}.0-0`:ce?G=`<=${se}.${q}.${ie}-${ce}`:d?G=`<${se}.${q}.${+ie+1}-0`:G=`<=${G}`,`${$} ${G}`.trim()),w=(d,m,$)=>{for(let M=0;M<d.length;M++)if(!d[M].test(m))return!1;if(m.prerelease.length&&!$.includePrerelease){for(let M=0;M<d.length;M++)if(i(d[M].semver),d[M].semver!==o.ANY&&d[M].semver.prerelease.length>0){const N=d[M].semver;if(N.major===m.major&&N.minor===m.minor&&N.patch===m.patch)return!0}return!1}return!0};return xo}var Do,Wf;function Mi(){if(Wf)return Do;Wf=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(u,h){if(h=r(h),u instanceof t){if(u.loose===!!h.loose)return u;u=u.value}u=u.trim().split(/\s+/).join(" "),s("comparator",u,h),this.options=h,this.loose=!!h.loose,this.parse(u),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(u){const h=this.options.loose?n[o.COMPARATORLOOSE]:n[o.COMPARATOR],b=u.match(h);if(!b)throw new TypeError(`Invalid comparator: ${u}`);this.operator=b[1]!==void 0?b[1]:"",this.operator==="="&&(this.operator=""),b[2]?this.semver=new c(b[2],this.options.loose):this.semver=e}toString(){return this.value}test(u){if(s("Comparator.test",u,this.options.loose),this.semver===e||u===e)return!0;if(typeof u=="string")try{u=new c(u,this.options)}catch{return!1}return i(u,this.operator,this.semver,this.options)}intersects(u,h){if(!(u instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new f(u.value,h).test(this.value):u.operator===""?u.value===""?!0:new f(this.value,h).test(u.semver):(h=r(h),h.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!h.includePrerelease&&(this.value.startsWith("<0.0.0")||u.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&u.operator.startsWith(">")||this.operator.startsWith("<")&&u.operator.startsWith("<")||this.semver.version===u.semver.version&&this.operator.includes("=")&&u.operator.includes("=")||i(this.semver,"<",u.semver,h)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||i(this.semver,">",u.semver,h)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}Do=t;const r=ra,{safeRe:n,t:o}=Un,i=bu,s=Di,c=Et,f=qt();return Do}const By=qt(),$y=(e,t,r)=>{try{t=new By(t,r)}catch{return!1}return t.test(e)};var Fi=$y;const ky=qt(),xy=(e,t)=>new ky(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var Dy=xy;const jy=Et,My=qt(),Fy=(e,t,r)=>{let n=null,o=null,i=null;try{i=new My(t,r)}catch{return null}return e.forEach(s=>{i.test(s)&&(!n||o.compare(s)===-1)&&(n=s,o=new jy(n,r))}),n};var Uy=Fy;const Hy=Et,zy=qt(),Wy=(e,t,r)=>{let n=null,o=null,i=null;try{i=new zy(t,r)}catch{return null}return e.forEach(s=>{i.test(s)&&(!n||o.compare(s)===1)&&(n=s,o=new Hy(n,r))}),n};var Vy=Wy;const jo=Et,qy=qt(),Vf=ji,Gy=(e,t)=>{e=new qy(e,t);let r=new jo("0.0.0");if(e.test(r)||(r=new jo("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){const o=e.set[n];let i=null;o.forEach(s=>{const c=new jo(s.semver.version);switch(s.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!i||Vf(c,i))&&(i=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),i&&(!r||Vf(r,i))&&(r=i)}return r&&e.test(r)?r:null};var Zy=Gy;const Ky=qt(),Jy=(e,t)=>{try{return new Ky(e,t).range||"*"}catch{return null}};var Xy=Jy;const Yy=Et,pu=Mi(),{ANY:Qy}=pu,ew=qt(),tw=Fi,qf=ji,Gf=ia,rw=sa,nw=oa,iw=(e,t,r,n)=>{e=new Yy(e,n),t=new ew(t,n);let o,i,s,c,f;switch(r){case">":o=qf,i=rw,s=Gf,c=">",f=">=";break;case"<":o=Gf,i=nw,s=qf,c="<",f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(tw(e,t,n))return!1;for(let l=0;l<t.set.length;++l){const u=t.set[l];let h=null,b=null;if(u.forEach(_=>{_.semver===Qy&&(_=new pu(">=0.0.0")),h=h||_,b=b||_,o(_.semver,h.semver,n)?h=_:s(_.semver,b.semver,n)&&(b=_)}),h.operator===c||h.operator===f||(!b.operator||b.operator===c)&&i(e,b.semver))return!1;if(b.operator===f&&s(e,b.semver))return!1}return!0};var aa=iw;const ow=aa,sw=(e,t,r)=>ow(e,t,">",r);var aw=sw;const fw=aa,lw=(e,t,r)=>fw(e,t,"<",r);var cw=lw;const Zf=qt(),uw=(e,t,r)=>(e=new Zf(e,r),t=new Zf(t,r),e.intersects(t,r));var dw=uw;const hw=Fi,gw=Vt;var _w=(e,t,r)=>{const n=[];let o=null,i=null;const s=e.sort((u,h)=>gw(u,h,r));for(const u of s)hw(u,t,r)?(i=u,o||(o=u)):(i&&n.push([o,i]),i=null,o=null);o&&n.push([o,null]);const c=[];for(const[u,h]of n)u===h?c.push(u):!h&&u===s[0]?c.push("*"):h?u===s[0]?c.push(`<=${h}`):c.push(`${u} - ${h}`):c.push(`>=${u}`);const f=c.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return f.length<l.length?f:t};const Kf=qt(),fa=Mi(),{ANY:Mo}=fa,bn=Fi,la=Vt,bw=(e,t,r={})=>{if(e===t)return!0;e=new Kf(e,r),t=new Kf(t,r);let n=!1;e:for(const o of e.set){for(const i of t.set){const s=yw(o,i,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},pw=[new fa(">=0.0.0-0")],Jf=[new fa(">=0.0.0")],yw=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Mo){if(t.length===1&&t[0].semver===Mo)return!0;r.includePrerelease?e=pw:e=Jf}if(t.length===1&&t[0].semver===Mo){if(r.includePrerelease)return!0;t=Jf}const n=new Set;let o,i;for(const _ of e)_.operator===">"||_.operator===">="?o=Xf(o,_,r):_.operator==="<"||_.operator==="<="?i=Yf(i,_,r):n.add(_.semver);if(n.size>1)return null;let s;if(o&&i){if(s=la(o.semver,i.semver,r),s>0)return null;if(s===0&&(o.operator!==">="||i.operator!=="<="))return null}for(const _ of n){if(o&&!bn(_,String(o),r)||i&&!bn(_,String(i),r))return null;for(const R of t)if(!bn(_,String(R),r))return!1;return!0}let c,f,l,u,h=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,b=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1;h&&h.prerelease.length===1&&i.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(const _ of t){if(u=u||_.operator===">"||_.operator===">=",l=l||_.operator==="<"||_.operator==="<=",o){if(b&&_.semver.prerelease&&_.semver.prerelease.length&&_.semver.major===b.major&&_.semver.minor===b.minor&&_.semver.patch===b.patch&&(b=!1),_.operator===">"||_.operator===">="){if(c=Xf(o,_,r),c===_&&c!==o)return!1}else if(o.operator===">="&&!bn(o.semver,String(_),r))return!1}if(i){if(h&&_.semver.prerelease&&_.semver.prerelease.length&&_.semver.major===h.major&&_.semver.minor===h.minor&&_.semver.patch===h.patch&&(h=!1),_.operator==="<"||_.operator==="<="){if(f=Yf(i,_,r),f===_&&f!==i)return!1}else if(i.operator==="<="&&!bn(i.semver,String(_),r))return!1}if(!_.operator&&(i||o)&&s!==0)return!1}return!(o&&l&&!i&&s!==0||i&&u&&!o&&s!==0||b||h)},Xf=(e,t,r)=>{if(!e)return t;const n=la(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},Yf=(e,t,r)=>{if(!e)return t;const n=la(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var ww=bw;const Fo=Un,Qf=xi,mw=Et,el=hu,Ew=ln,vw=Op,Sw=Cp,Rw=Bp,Aw=kp,Iw=jp,Tw=Up,Ow=Wp,Lw=Gp,Pw=Vt,Cw=Xp,Nw=ey,Bw=na,$w=iy,kw=ay,xw=ji,Dw=ia,jw=gu,Mw=_u,Fw=oa,Uw=sa,Hw=bu,zw=Py,Ww=Mi(),Vw=qt(),qw=Fi,Gw=Dy,Zw=Uy,Kw=Vy,Jw=Zy,Xw=Xy,Yw=aa,Qw=aw,em=cw,tm=dw,rm=_w,nm=ww;var im={parse:Ew,valid:vw,clean:Sw,inc:Rw,diff:Aw,major:Iw,minor:Tw,patch:Ow,prerelease:Lw,compare:Pw,rcompare:Cw,compareLoose:Nw,compareBuild:Bw,sort:$w,rsort:kw,gt:xw,lt:Dw,eq:jw,neq:Mw,gte:Fw,lte:Uw,cmp:Hw,coerce:zw,Comparator:Ww,Range:Vw,satisfies:qw,toComparators:Gw,maxSatisfying:Zw,minSatisfying:Kw,minVersion:Jw,validRange:Xw,outside:Yw,gtr:Qw,ltr:em,intersects:tm,simplifyRange:rm,subset:nm,SemVer:mw,re:Fo.re,src:Fo.src,tokens:Fo.t,SEMVER_SPEC_VERSION:Qf.SEMVER_SPEC_VERSION,RELEASE_TYPES:Qf.RELEASE_TYPES,compareIdentifiers:el.compareIdentifiers,rcompareIdentifiers:el.rcompareIdentifiers};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const t=im,r=Mr,n=dt;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",h=>(0,t.valid)(h)===null?`Expected SemVer version, got "${h}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",h=>(0,t.validRange)(h)===null?`Expected SemVer range, got "${h}"`:!0);function o(h){return(0,r.is)(h,e.VersionStruct)}e.isValidSemVerVersion=o;function i(h){return(0,r.is)(h,e.VersionRangeStruct)}e.isValidSemVerRange=i;function s(h){(0,n.assertStruct)(h,e.VersionStruct)}e.assertIsSemVerVersion=s;function c(h){(0,n.assertStruct)(h,e.VersionRangeStruct)}e.assertIsSemVerRange=c;function f(h,b){return(0,t.gt)(h,b)}e.gtVersion=f;function l(h,b){return(0,t.gtr)(h,b)}e.gtRange=l;function u(h,b){return(0,t.satisfies)(h,b,{includePrerelease:!0})}e.satisfiesVersionRange=u})(cu);(function(e){var t=x.commonjsGlobal&&x.commonjsGlobal.__createBinding||(Object.create?function(n,o,i,s){s===void 0&&(s=i);var c=Object.getOwnPropertyDescriptor(o,i);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return o[i]}}),Object.defineProperty(n,s,c)}:function(n,o,i,s){s===void 0&&(s=i),n[s]=o[i]}),r=x.commonjsGlobal&&x.commonjsGlobal.__exportStar||function(n,o){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(o,i)&&t(o,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(dt,e),r(Mn,e),r(De,e),r($i,e),r(Xt,e),r(Xr,e),r(nu,e),r(Fn,e),r(iu,e),r(ou,e),r(Yr,e),r(su,e),r(Yt,e),r(au,e),r(fu,e),r(lu,e),r(cu,e)})(Gs);var Ui={},vr={};Object.defineProperty(vr,"__esModule",{value:!0});vr.errorValues=vr.errorCodes=void 0;vr.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}};vr.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."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeCause=e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Gs,r=vr,n=r.errorCodes.rpc.internal,o="Unspecified error message. This is a bug, please report it.",i={code:n,message:s(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function s(_,R=o){if(c(_)){const T=_.toString();if((0,t.hasProperty)(r.errorValues,T))return r.errorValues[T].message;if(u(_))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return R}e.getMessageFromCode=s;function c(_){return Number.isInteger(_)}e.isValidCode=c;function f(_,{fallbackError:R=i,shouldIncludeStack:T=!0}={}){if(!(0,t.isJsonRpcError)(R))throw new Error("Must provide fallback error with integer number code and string message.");const C=l(_,R);return T||delete C.stack,C}e.serializeError=f;function l(_,R){if(_&&typeof _=="object"&&"serialize"in _&&typeof _.serialize=="function")return _.serialize();if((0,t.isJsonRpcError)(_))return _;const T=h(_);return{...R,data:{cause:T}}}function u(_){return _>=-32099&&_<=-32e3}function h(_){return Array.isArray(_)?_.map(R=>(0,t.isValidJson)(R)?R:(0,t.isObject)(R)?b(R):null):(0,t.isObject)(_)?b(_):(0,t.isValidJson)(_)?_:null}e.serializeCause=h;function b(_){return Object.getOwnPropertyNames(_).reduce((R,T)=>{const C=_[T];return(0,t.isValidJson)(C)&&(R[T]=C),R},{})}})(Ui);var om=x.commonjsGlobal&&x.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Br,"__esModule",{value:!0});Br.EthereumProviderError=Br.JsonRpcError=void 0;const sm=Gs,am=om(Bs),fm=Ui;class yu extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a non-empty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data,(0,sm.isPlainObject)(this.data)&&(t.data.cause=(0,fm.serializeCause)(this.data.cause))),this.stack&&(t.stack=this.stack),t}toString(){return(0,am.default)(this.serialize(),um,2)}}Br.JsonRpcError=yu;class lm extends yu{constructor(t,r,n){if(!cm(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}}Br.EthereumProviderError=lm;function cm(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function um(e,t){if(t!=="[Circular]")return t}var Qr={};Object.defineProperty(Qr,"__esModule",{value:!0});Qr.providerErrors=Qr.rpcErrors=void 0;const ca=Br,bt=vr,wu=Ui;Qr.rpcErrors={parse:e=>Nt(bt.errorCodes.rpc.parse,e),invalidRequest:e=>Nt(bt.errorCodes.rpc.invalidRequest,e),invalidParams:e=>Nt(bt.errorCodes.rpc.invalidParams,e),methodNotFound:e=>Nt(bt.errorCodes.rpc.methodNotFound,e),internal:e=>Nt(bt.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||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 Nt(t,e)},invalidInput:e=>Nt(bt.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>Nt(bt.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Nt(bt.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Nt(bt.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Nt(bt.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Nt(bt.errorCodes.rpc.limitExceeded,e)};Qr.providerErrors={userRejectedRequest:e=>pn(bt.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>pn(bt.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>pn(bt.errorCodes.provider.unsupportedMethod,e),disconnected:e=>pn(bt.errorCodes.provider.disconnected,e),chainDisconnected:e=>pn(bt.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new ca.EthereumProviderError(t,r,n)}};function Nt(e,t){const[r,n]=mu(t);return new ca.JsonRpcError(e,r??(0,wu.getMessageFromCode)(e),n)}function pn(e,t){const[r,n]=mu(t);return new ca.EthereumProviderError(e,r??(0,wu.getMessageFromCode)(e),n)}function mu(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t??void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.errorCodes=e.providerErrors=e.rpcErrors=e.getMessageFromCode=e.serializeError=e.serializeCause=e.EthereumProviderError=e.JsonRpcError=void 0;var t=Br;Object.defineProperty(e,"JsonRpcError",{enumerable:!0,get:function(){return t.JsonRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});var r=Ui;Object.defineProperty(e,"serializeCause",{enumerable:!0,get:function(){return r.serializeCause}}),Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});var n=Qr;Object.defineProperty(e,"rpcErrors",{enumerable:!0,get:function(){return n.rpcErrors}}),Object.defineProperty(e,"providerErrors",{enumerable:!0,get:function(){return n.providerErrors}});var o=vr;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return o.errorCodes}})})(z_);var ua={exports:{}},dm=Eu;function Eu(e,t){if(e&&t)return Eu(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(n){r[n]=e[n]}),r;function r(){for(var n=new Array(arguments.length),o=0;o<n.length;o++)n[o]=arguments[o];var i=e.apply(this,n),s=n[n.length-1];return typeof i=="function"&&i!==s&&Object.keys(s).forEach(function(c){i[c]=s[c]}),i}}var vu=dm;ua.exports=vu(li);ua.exports.strict=vu(Su);li.proto=li(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return li(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return Su(this)},configurable:!0})});function li(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function Su(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}var da=ua.exports;const hm=x.getDefaultExportFromCjs(da);var gm=da,_m=function(){},bm=function(e){return e.setHeader&&typeof e.abort=="function"},pm=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},Ru=function(e,t,r){if(typeof t=="function")return Ru(e,null,t);t||(t={}),r=gm(r||_m);var n=e._writableState,o=e._readableState,i=t.readable||t.readable!==!1&&e.readable,s=t.writable||t.writable!==!1&&e.writable,c=!1,f=function(){e.writable||l()},l=function(){s=!1,i||r.call(e)},u=function(){i=!1,s||r.call(e)},h=function(C){r.call(e,C?new Error("exited with error code: "+C):null)},b=function(C){r.call(e,C)},_=function(){x.dist.process.nextTick(R)},R=function(){if(!c){if(i&&!(o&&o.ended&&!o.destroyed))return r.call(e,new Error("premature close"));if(s&&!(n&&n.ended&&!n.destroyed))return r.call(e,new Error("premature close"))}},T=function(){e.req.on("finish",l)};return bm(e)?(e.on("complete",l),e.on("abort",_),e.req?T():e.on("request",T)):s&&!n&&(e.on("end",f),e.on("close",f)),pm(e)&&e.on("exit",h),e.on("end",u),e.on("finish",l),t.error!==!1&&e.on("error",b),e.on("close",_),function(){c=!0,e.removeListener("complete",l),e.removeListener("abort",_),e.removeListener("request",T),e.req&&e.req.removeListener("finish",l),e.removeListener("end",f),e.removeListener("close",f),e.removeListener("finish",l),e.removeListener("exit",h),e.removeListener("end",u),e.removeListener("error",b),e.removeListener("close",_)}},Au=Ru;const tl=x.getDefaultExportFromCjs(Au);var ym=da,wm=Au,Uo=x.require$$2,Cn=function(){},mm=/^v?\.0/.test(x.dist.process.version),Hi=function(e){return typeof e=="function"},Em=function(e){return!mm||!Uo?!1:(e instanceof(Uo.ReadStream||Cn)||e instanceof(Uo.WriteStream||Cn))&&Hi(e.close)},vm=function(e){return e.setHeader&&Hi(e.abort)},Sm=function(e,t,r,n){n=ym(n);var o=!1;e.on("close",function(){o=!0}),wm(e,{readable:t,writable:r},function(s){if(s)return n(s);o=!0,n()});var i=!1;return function(s){if(!o&&!i){if(i=!0,Em(e))return e.close(Cn);if(vm(e))return e.abort();if(Hi(e.destroy))return e.destroy();n(s||new Error("stream was destroyed"))}}},rl=function(e){e()},Rm=function(e,t){return e.pipe(t)},Am=function(){var e=Array.prototype.slice.call(arguments),t=Hi(e[e.length-1]||Cn)&&e.pop()||Cn;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Error("pump requires two streams per minimum");var r,n=e.map(function(o,i){var s=i<e.length-1,c=i>0;return Sm(o,s,c,function(f){r||(r=f),f&&n.forEach(rl),!s&&(n.forEach(rl),t(r))})});return e.reduce(Rm)},Im=Am;const nl=x.getDefaultExportFromCjs(Im);var Tm={},zi={},Wi={},Iu={},en={},Vi={},lt={};Object.defineProperty(lt,"__esModule",{value:!0});lt.output=lt.exists=lt.hash=lt.bytes=lt.bool=lt.number=void 0;function _i(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}lt.number=_i;function Tu(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}lt.bool=Tu;function Om(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function ha(e,...t){if(!Om(e))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}`)}lt.bytes=ha;function Ou(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");_i(e.outputLen),_i(e.blockLen)}lt.hash=Ou;function Lu(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")}lt.exists=Lu;function Pu(e,t){ha(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}lt.output=Pu;const Lm={number:_i,bool:Tu,bytes:ha,hash:Ou,exists:Lu,output:Pu};lt.default=Lm;var dr={},qi={};Object.defineProperty(qi,"__esModule",{value:!0});qi.crypto=void 0;qi.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;(function(e){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.randomBytes=e.wrapXOFConstructorWithOpts=e.wrapConstructorWithOpts=e.wrapConstructor=e.checkOpts=e.Hash=e.concatBytes=e.toBytes=e.utf8ToBytes=e.asyncLoop=e.nextTick=e.hexToBytes=e.bytesToHex=e.isLE=e.rotr=e.createView=e.u32=e.u8=void 0;const t=qi,r=F=>new Uint8Array(F.buffer,F.byteOffset,F.byteLength);e.u8=r;const n=F=>new Uint32Array(F.buffer,F.byteOffset,Math.floor(F.byteLength/4));e.u32=n;function o(F){return F instanceof Uint8Array||F!=null&&typeof F=="object"&&F.constructor.name==="Uint8Array"}const i=F=>new DataView(F.buffer,F.byteOffset,F.byteLength);e.createView=i;const s=(F,V)=>F<<32-V|F>>>V;if(e.rotr=s,e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,!e.isLE)throw new Error("Non little-endian hardware is not supported");const c=Array.from({length:256},(F,V)=>V.toString(16).padStart(2,"0"));function f(F){if(!o(F))throw new Error("Uint8Array expected");let V="";for(let oe=0;oe<F.length;oe++)V+=c[F[oe]];return V}e.bytesToHex=f;const l={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function u(F){if(F>=l._0&&F<=l._9)return F-l._0;if(F>=l._A&&F<=l._F)return F-(l._A-10);if(F>=l._a&&F<=l._f)return F-(l._a-10)}function h(F){if(typeof F!="string")throw new Error("hex string expected, got "+typeof F);const V=F.length,oe=V/2;if(V%2)throw new Error("padded hex string expected, got unpadded hex of length "+V);const ee=new Uint8Array(oe);for(let w=0,d=0;w<oe;w++,d+=2){const m=u(F.charCodeAt(d)),$=u(F.charCodeAt(d+1));if(m===void 0||$===void 0){const M=F[d]+F[d+1];throw new Error('hex string expected, got non-hex character "'+M+'" at index '+d)}ee[w]=m*16+$}return ee}e.hexToBytes=h;const b=async()=>{};e.nextTick=b;async function _(F,V,oe){let ee=Date.now();for(let w=0;w<F;w++){oe(w);const d=Date.now()-ee;d>=0&&d<V||(await(0,e.nextTick)(),ee+=d)}}e.asyncLoop=_;function R(F){if(typeof F!="string")throw new Error(`utf8ToBytes expected string, got ${typeof F}`);return new Uint8Array(new TextEncoder().encode(F))}e.utf8ToBytes=R;function T(F){if(typeof F=="string"&&(F=R(F)),!o(F))throw new Error(`expected Uint8Array, got ${typeof F}`);return F}e.toBytes=T;function C(...F){let V=0;for(let ee=0;ee<F.length;ee++){const w=F[ee];if(!o(w))throw new Error("Uint8Array expected");V+=w.length}const oe=new Uint8Array(V);for(let ee=0,w=0;ee<F.length;ee++){const d=F[ee];oe.set(d,w),w+=d.length}return oe}e.concatBytes=C;class D{clone(){return this._cloneInto()}}e.Hash=D;const L={}.toString;function O(F,V){if(V!==void 0&&L.call(V)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(F,V)}e.checkOpts=O;function S(F){const V=ee=>F().update(T(ee)).digest(),oe=F();return V.outputLen=oe.outputLen,V.blockLen=oe.blockLen,V.create=()=>F(),V}e.wrapConstructor=S;function z(F){const V=(ee,w)=>F(w).update(T(ee)).digest(),oe=F({});return V.outputLen=oe.outputLen,V.blockLen=oe.blockLen,V.create=ee=>F(ee),V}e.wrapConstructorWithOpts=z;function Y(F){const V=(ee,w)=>F(w).update(T(ee)).digest(),oe=F({});return V.outputLen=oe.outputLen,V.blockLen=oe.blockLen,V.create=ee=>F(ee),V}e.wrapXOFConstructorWithOpts=Y;function X(F=32){if(t.crypto&&typeof t.crypto.getRandomValues=="function")return t.crypto.getRandomValues(new Uint8Array(F));throw new Error("crypto.getRandomValues must be defined")}e.randomBytes=X})(dr);Object.defineProperty(Vi,"__esModule",{value:!0});Vi.SHA2=void 0;const Ho=lt,yn=dr;function Pm(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);const o=BigInt(32),i=BigInt(4294967295),s=Number(r>>o&i),c=Number(r&i),f=n?4:0,l=n?0:4;e.setUint32(t+f,s,n),e.setUint32(t+l,c,n)}class Cm extends yn.Hash{constructor(t,r,n,o){super(),this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=(0,yn.createView)(this.buffer)}update(t){(0,Ho.exists)(this);const{view:r,buffer:n,blockLen:o}=this;t=(0,yn.toBytes)(t);const i=t.length;for(let s=0;s<i;){const c=Math.min(o-this.pos,i-s);if(c===o){const f=(0,yn.createView)(t);for(;o<=i-s;s+=o)this.process(f,s);continue}n.set(t.subarray(s,s+c),this.pos),this.pos+=c,s+=c,this.pos===o&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){(0,Ho.exists)(this),(0,Ho.output)(t,this),this.finished=!0;const{buffer:r,view:n,blockLen:o,isLE:i}=this;let{pos:s}=this;r[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>o-s&&(this.process(n,0),s=0);for(let h=s;h<o;h++)r[h]=0;Pm(n,o-8,BigInt(this.length*8),i),this.process(n,0);const c=(0,yn.createView)(t),f=this.outputLen;if(f%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=f/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h<l;h++)c.setUint32(4*h,u[h],i)}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:r,buffer:n,length:o,finished:i,destroyed:s,pos:c}=this;return t.length=o,t.pos=c,t.finished=i,t.destroyed=s,o%r&&t.buffer.set(n),t}}Vi.SHA2=Cm;Object.defineProperty(en,"__esModule",{value:!0});en.sha224=en.sha256=void 0;const Nm=Vi,$t=dr,Bm=(e,t,r)=>e&t^~e&r,$m=(e,t,r)=>e&t^e&r^t&r,km=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),_r=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),br=new Uint32Array(64);class Cu extends Nm.SHA2{constructor(){super(64,32,8,!1),this.A=_r[0]|0,this.B=_r[1]|0,this.C=_r[2]|0,this.D=_r[3]|0,this.E=_r[4]|0,this.F=_r[5]|0,this.G=_r[6]|0,this.H=_r[7]|0}get(){const{A:t,B:r,C:n,D:o,E:i,F:s,G:c,H:f}=this;return[t,r,n,o,i,s,c,f]}set(t,r,n,o,i,s,c,f){this.A=t|0,this.B=r|0,this.C=n|0,this.D=o|0,this.E=i|0,this.F=s|0,this.G=c|0,this.H=f|0}process(t,r){for(let h=0;h<16;h++,r+=4)br[h]=t.getUint32(r,!1);for(let h=16;h<64;h++){const b=br[h-15],_=br[h-2],R=(0,$t.rotr)(b,7)^(0,$t.rotr)(b,18)^b>>>3,T=(0,$t.rotr)(_,17)^(0,$t.rotr)(_,19)^_>>>10;br[h]=T+br[h-7]+R+br[h-16]|0}let{A:n,B:o,C:i,D:s,E:c,F:f,G:l,H:u}=this;for(let h=0;h<64;h++){const b=(0,$t.rotr)(c,6)^(0,$t.rotr)(c,11)^(0,$t.rotr)(c,25),_=u+b+Bm(c,f,l)+km[h]+br[h]|0,T=((0,$t.rotr)(n,2)^(0,$t.rotr)(n,13)^(0,$t.rotr)(n,22))+$m(n,o,i)|0;u=l,l=f,f=c,c=s+_|0,s=i,i=o,o=n,n=_+T|0}n=n+this.A|0,o=o+this.B|0,i=i+this.C|0,s=s+this.D|0,c=c+this.E|0,f=f+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(n,o,i,s,c,f,l,u)}roundClean(){br.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class xm extends Cu{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}en.sha256=(0,$t.wrapConstructor)(()=>new Cu);en.sha224=(0,$t.wrapConstructor)(()=>new xm);var Be={},Pe={};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.validateObject=Pe.createHmacDrbg=Pe.bitMask=Pe.bitSet=Pe.bitGet=Pe.bitLen=Pe.utf8ToBytes=Pe.equalBytes=Pe.concatBytes=Pe.ensureBytes=Pe.numberToVarBytesBE=Pe.numberToBytesLE=Pe.numberToBytesBE=Pe.bytesToNumberLE=Pe.bytesToNumberBE=Pe.hexToBytes=Pe.hexToNumber=Pe.numberToHexUnpadded=Pe.bytesToHex=Pe.isBytes=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Nu=BigInt(0),Gi=BigInt(1),Dm=BigInt(2);function cn(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}Pe.isBytes=cn;const jm=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ga(e){if(!cn(e))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=jm[e[r]];return t}Pe.bytesToHex=ga;function Bu(e){const t=e.toString(16);return t.length&1?`0${t}`:t}Pe.numberToHexUnpadded=Bu;function _a(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return BigInt(e===""?"0":`0x${e}`)}Pe.hexToNumber=_a;const ar={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function il(e){if(e>=ar._0&&e<=ar._9)return e-ar._0;if(e>=ar._A&&e<=ar._F)return e-(ar._A-10);if(e>=ar._a&&e<=ar._f)return e-(ar._a-10)}function Zi(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let o=0,i=0;o<r;o++,i+=2){const s=il(e.charCodeAt(i)),c=il(e.charCodeAt(i+1));if(s===void 0||c===void 0){const f=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+f+'" at index '+i)}n[o]=s*16+c}return n}Pe.hexToBytes=Zi;function Mm(e){return _a(ga(e))}Pe.bytesToNumberBE=Mm;function Fm(e){if(!cn(e))throw new Error("Uint8Array expected");return _a(ga(Uint8Array.from(e).reverse()))}Pe.bytesToNumberLE=Fm;function $u(e,t){return Zi(e.toString(16).padStart(t*2,"0"))}Pe.numberToBytesBE=$u;function Um(e,t){return $u(e,t).reverse()}Pe.numberToBytesLE=Um;function Hm(e){return Zi(Bu(e))}Pe.numberToVarBytesBE=Hm;function zm(e,t,r){let n;if(typeof t=="string")try{n=Zi(t)}catch(i){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${i}`)}else if(cn(t))n=Uint8Array.from(t);else throw new Error(`${e} must be hex string or Uint8Array`);const o=n.length;if(typeof r=="number"&&o!==r)throw new Error(`${e} expected ${r} bytes, got ${o}`);return n}Pe.ensureBytes=zm;function ku(...e){let t=0;for(let o=0;o<e.length;o++){const i=e[o];if(!cn(i))throw new Error("Uint8Array expected");t+=i.length}let r=new Uint8Array(t),n=0;for(let o=0;o<e.length;o++){const i=e[o];r.set(i,n),n+=i.length}return r}Pe.concatBytes=ku;function Wm(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return r===0}Pe.equalBytes=Wm;function Vm(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}Pe.utf8ToBytes=Vm;function qm(e){let t;for(t=0;e>Nu;e>>=Gi,t+=1);return t}Pe.bitLen=qm;function Gm(e,t){return e>>BigInt(t)&Gi}Pe.bitGet=Gm;const Zm=(e,t,r)=>e|(r?Gi:Nu)<<BigInt(t);Pe.bitSet=Zm;const Km=e=>(Dm<<BigInt(e-1))-Gi;Pe.bitMask=Km;const zo=e=>new Uint8Array(e),ol=e=>Uint8Array.from(e);function Jm(e,t,r){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=zo(e),o=zo(e),i=0;const s=()=>{n.fill(1),o.fill(0),i=0},c=(...h)=>r(o,n,...h),f=(h=zo())=>{o=c(ol([0]),h),n=c(),h.length!==0&&(o=c(ol([1]),h),n=c())},l=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let h=0;const b=[];for(;h<t;){n=c();const _=n.slice();b.push(_),h+=n.length}return ku(...b)};return(h,b)=>{s(),f(h);let _;for(;!(_=b(l()));)f();return s(),_}}Pe.createHmacDrbg=Jm;const Xm={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||cn(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Ym(e,t,r={}){const n=(o,i,s)=>{const c=Xm[i];if(typeof c!="function")throw new Error(`Invalid validator "${i}", expected function`);const f=e[o];if(!(s&&f===void 0)&&!c(f,e))throw new Error(`Invalid param ${String(o)}=${f} (${typeof f}), expected ${i}`)};for(const[o,i]of Object.entries(t))n(o,i,!1);for(const[o,i]of Object.entries(r))n(o,i,!0);return e}Pe.validateObject=Ym;Object.defineProperty(Be,"__esModule",{value:!0});Be.mapHashToField=Be.getMinHashLength=Be.getFieldBytesLength=Be.hashToPrivateScalar=Be.FpSqrtEven=Be.FpSqrtOdd=Be.Field=Be.nLength=Be.FpIsSquare=Be.FpDiv=Be.FpInvertBatch=Be.FpPow=Be.validateField=Be.isNegativeLE=Be.FpSqrt=Be.tonelliShanks=Be.invert=Be.pow2=Be.pow=Be.mod=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Lt=Pe,ct=BigInt(0),qe=BigInt(1),wr=BigInt(2),Qm=BigInt(3),Ss=BigInt(4),sl=BigInt(5),al=BigInt(8);BigInt(9);BigInt(16);function Tt(e,t){const r=e%t;return r>=ct?r:t+r}Be.mod=Tt;function xu(e,t,r){if(r<=ct||t<ct)throw new Error("Expected power/modulo > 0");if(r===qe)return ct;let n=qe;for(;t>ct;)t&qe&&(n=n*e%r),e=e*e%r,t>>=qe;return n}Be.pow=xu;function eE(e,t,r){let n=e;for(;t-- >ct;)n*=n,n%=r;return n}Be.pow2=eE;function bi(e,t){if(e===ct||t<=ct)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=Tt(e,t),n=t,o=ct,i=qe;for(;r!==ct;){const c=n/r,f=n%r,l=o-i*c;n=r,r=f,o=i,i=l}if(n!==qe)throw new Error("invert: does not exist");return Tt(o,t)}Be.invert=bi;function Du(e){const t=(e-qe)/wr;let r,n,o;for(r=e-qe,n=0;r%wr===ct;r/=wr,n++);for(o=wr;o<e&&xu(o,t,e)!==e-qe;o++);if(n===1){const s=(e+qe)/Ss;return function(f,l){const u=f.pow(l,s);if(!f.eql(f.sqr(u),l))throw new Error("Cannot find square root");return u}}const i=(r+qe)/wr;return function(c,f){if(c.pow(f,t)===c.neg(c.ONE))throw new Error("Cannot find square root");let l=n,u=c.pow(c.mul(c.ONE,o),r),h=c.pow(f,i),b=c.pow(f,r);for(;!c.eql(b,c.ONE);){if(c.eql(b,c.ZERO))return c.ZERO;let _=1;for(let T=c.sqr(b);_<l&&!c.eql(T,c.ONE);_++)T=c.sqr(T);const R=c.pow(u,qe<<BigInt(l-_-1));u=c.sqr(R),h=c.mul(h,R),b=c.mul(b,u),l=_}return h}}Be.tonelliShanks=Du;function ju(e){if(e%Ss===Qm){const t=(e+qe)/Ss;return function(n,o){const i=n.pow(o,t);if(!n.eql(n.sqr(i),o))throw new Error("Cannot find square root");return i}}if(e%al===sl){const t=(e-sl)/al;return function(n,o){const i=n.mul(o,wr),s=n.pow(i,t),c=n.mul(o,s),f=n.mul(n.mul(c,wr),s),l=n.mul(c,n.sub(f,n.ONE));if(!n.eql(n.sqr(l),o))throw new Error("Cannot find square root");return l}}return Du(e)}Be.FpSqrt=ju;const tE=(e,t)=>(Tt(e,t)&qe)===qe;Be.isNegativeLE=tE;const rE=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function nE(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=rE.reduce((n,o)=>(n[o]="function",n),t);return(0,Lt.validateObject)(e,r)}Be.validateField=nE;function Mu(e,t,r){if(r<ct)throw new Error("Expected power > 0");if(r===ct)return e.ONE;if(r===qe)return t;let n=e.ONE,o=t;for(;r>ct;)r&qe&&(n=e.mul(n,o)),o=e.sqr(o),r>>=qe;return n}Be.FpPow=Mu;function Fu(e,t){const r=new Array(t.length),n=t.reduce((i,s,c)=>e.is0(s)?i:(r[c]=i,e.mul(i,s)),e.ONE),o=e.inv(n);return t.reduceRight((i,s,c)=>e.is0(s)?i:(r[c]=e.mul(i,r[c]),e.mul(i,s)),o),r}Be.FpInvertBatch=Fu;function iE(e,t,r){return e.mul(t,typeof r=="bigint"?bi(r,e.ORDER):e.inv(r))}Be.FpDiv=iE;function oE(e){const t=(e.ORDER-qe)/wr;return r=>{const n=e.pow(r,t);return e.eql(n,e.ZERO)||e.eql(n,e.ONE)}}Be.FpIsSquare=oE;function ba(e,t){const r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}Be.nLength=ba;function sE(e,t,r=!1,n={}){if(e<=ct)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:o,nByteLength:i}=ba(e,t);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const s=ju(e),c=Object.freeze({ORDER:e,BITS:o,BYTES:i,MASK:(0,Lt.bitMask)(o),ZERO:ct,ONE:qe,create:f=>Tt(f,e),isValid:f=>{if(typeof f!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof f}`);return ct<=f&&f<e},is0:f=>f===ct,isOdd:f=>(f&qe)===qe,neg:f=>Tt(-f,e),eql:(f,l)=>f===l,sqr:f=>Tt(f*f,e),add:(f,l)=>Tt(f+l,e),sub:(f,l)=>Tt(f-l,e),mul:(f,l)=>Tt(f*l,e),pow:(f,l)=>Mu(c,f,l),div:(f,l)=>Tt(f*bi(l,e),e),sqrN:f=>f*f,addN:(f,l)=>f+l,subN:(f,l)=>f-l,mulN:(f,l)=>f*l,inv:f=>bi(f,e),sqrt:n.sqrt||(f=>s(c,f)),invertBatch:f=>Fu(c,f),cmov:(f,l,u)=>u?l:f,toBytes:f=>r?(0,Lt.numberToBytesLE)(f,i):(0,Lt.numberToBytesBE)(f,i),fromBytes:f=>{if(f.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${f.length}`);return r?(0,Lt.bytesToNumberLE)(f):(0,Lt.bytesToNumberBE)(f)}});return Object.freeze(c)}Be.Field=sE;function aE(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?r:e.neg(r)}Be.FpSqrtOdd=aE;function fE(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r}Be.FpSqrtEven=fE;function lE(e,t,r=!1){e=(0,Lt.ensureBytes)("privateHash",e);const n=e.length,o=ba(t).nByteLength+8;if(o<24||n<o||n>1024)throw new Error(`hashToPrivateScalar: expected ${o}-1024 bytes of input, got ${n}`);const i=r?(0,Lt.bytesToNumberLE)(e):(0,Lt.bytesToNumberBE)(e);return Tt(i,t-qe)+qe}Be.hashToPrivateScalar=lE;function pa(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}Be.getFieldBytesLength=pa;function Uu(e){const t=pa(e);return t+Math.ceil(t/2)}Be.getMinHashLength=Uu;function cE(e,t,r=!1){const n=e.length,o=pa(t),i=Uu(t);if(n<16||n<i||n>1024)throw new Error(`expected ${i}-1024 bytes of input, got ${n}`);const s=r?(0,Lt.bytesToNumberBE)(e):(0,Lt.bytesToNumberLE)(e),c=Tt(s,t-qe)+qe;return r?(0,Lt.numberToBytesLE)(c,o):(0,Lt.numberToBytesBE)(c,o)}Be.mapHashToField=cE;var ya={},tn={};Object.defineProperty(tn,"__esModule",{value:!0});tn.validateBasic=tn.wNAF=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const fl=Be,uE=Pe,dE=BigInt(0),Wo=BigInt(1);function hE(e,t){const r=(o,i)=>{const s=i.negate();return o?s:i},n=o=>{const i=Math.ceil(t/o)+1,s=2**(o-1);return{windows:i,windowSize:s}};return{constTimeNegate:r,unsafeLadder(o,i){let s=e.ZERO,c=o;for(;i>dE;)i&Wo&&(s=s.add(c)),c=c.double(),i>>=Wo;return s},precomputeWindow(o,i){const{windows:s,windowSize:c}=n(i),f=[];let l=o,u=l;for(let h=0;h<s;h++){u=l,f.push(u);for(let b=1;b<c;b++)u=u.add(l),f.push(u);l=u.double()}return f},wNAF(o,i,s){const{windows:c,windowSize:f}=n(o);let l=e.ZERO,u=e.BASE;const h=BigInt(2**o-1),b=2**o,_=BigInt(o);for(let R=0;R<c;R++){const T=R*f;let C=Number(s&h);s>>=_,C>f&&(C-=b,s+=Wo);const D=T,L=T+Math.abs(C)-1,O=R%2!==0,S=C<0;C===0?u=u.add(r(O,i[D])):l=l.add(r(S,i[L]))}return{p:l,f:u}},wNAFCached(o,i,s,c){const f=o._WINDOW_SIZE||1;let l=i.get(o);return l||(l=this.precomputeWindow(o,f),f!==1&&i.set(o,c(l))),this.wNAF(f,l,s)}}}tn.wNAF=hE;function gE(e){return(0,fl.validateField)(e.Fp),(0,uE.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,fl.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}tn.validateBasic=gE;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mapToCurveSimpleSWU=e.SWUFpSqrtRatio=e.weierstrass=e.weierstrassPoints=e.DER=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=Be,r=Pe,n=Pe,o=tn;function i(L){const O=(0,o.validateBasic)(L);r.validateObject(O,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:S,Fp:z,a:Y}=O;if(S){if(!z.eql(Y,z.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof S!="object"||typeof S.beta!="bigint"||typeof S.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...O})}const{bytesToNumberBE:s,hexToBytes:c}=r;e.DER={Err:class extends Error{constructor(O=""){super(O)}},_parseInt(L){const{Err:O}=e.DER;if(L.length<2||L[0]!==2)throw new O("Invalid signature integer tag");const S=L[1],z=L.subarray(2,S+2);if(!S||z.length!==S)throw new O("Invalid signature integer: wrong length");if(z[0]&128)throw new O("Invalid signature integer: negative");if(z[0]===0&&!(z[1]&128))throw new O("Invalid signature integer: unnecessary leading zero");return{d:s(z),l:L.subarray(S+2)}},toSig(L){const{Err:O}=e.DER,S=typeof L=="string"?c(L):L;if(!r.isBytes(S))throw new Error("ui8a expected");let z=S.length;if(z<2||S[0]!=48)throw new O("Invalid signature tag");if(S[1]!==z-2)throw new O("Invalid signature: incorrect length");const{d:Y,l:X}=e.DER._parseInt(S.subarray(2)),{d:F,l:V}=e.DER._parseInt(X);if(V.length)throw new O("Invalid signature: left bytes after parsing");return{r:Y,s:F}},hexFromSig(L){const O=ee=>Number.parseInt(ee[0],16)&8?"00"+ee:ee,S=ee=>{const w=ee.toString(16);return w.length&1?`0${w}`:w},z=O(S(L.s)),Y=O(S(L.r)),X=z.length/2,F=Y.length/2,V=S(X),oe=S(F);return`30${S(F+X+4)}02${oe}${Y}02${V}${z}`}};const f=BigInt(0),l=BigInt(1),u=BigInt(2),h=BigInt(3),b=BigInt(4);function _(L){const O=i(L),{Fp:S}=O,z=O.toBytes||((M,N,U)=>{const P=N.toAffine();return r.concatBytes(Uint8Array.from([4]),S.toBytes(P.x),S.toBytes(P.y))}),Y=O.fromBytes||(M=>{const N=M.subarray(1),U=S.fromBytes(N.subarray(0,S.BYTES)),P=S.fromBytes(N.subarray(S.BYTES,2*S.BYTES));return{x:U,y:P}});function X(M){const{a:N,b:U}=O,P=S.sqr(M),H=S.mul(P,M);return S.add(S.add(H,S.mul(M,N)),U)}if(!S.eql(S.sqr(O.Gy),X(O.Gx)))throw new Error("bad generator point: equation left != right");function F(M){return typeof M=="bigint"&&f<M&&M<O.n}function V(M){if(!F(M))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function oe(M){const{allowedPrivateKeyLengths:N,nByteLength:U,wrapPrivateKey:P,n:H}=O;if(N&&typeof M!="bigint"){if(r.isBytes(M)&&(M=r.bytesToHex(M)),typeof M!="string"||!N.includes(M.length))throw new Error("Invalid key");M=M.padStart(U*2,"0")}let G;try{G=typeof M=="bigint"?M:r.bytesToNumberBE((0,n.ensureBytes)("private key",M,U))}catch{throw new Error(`private key must be ${U} bytes, hex or bigint, not ${typeof M}`)}return P&&(G=t.mod(G,H)),V(G),G}const ee=new Map;function w(M){if(!(M instanceof d))throw new Error("ProjectivePoint expected")}class d{constructor(N,U,P){if(this.px=N,this.py=U,this.pz=P,N==null||!S.isValid(N))throw new Error("x required");if(U==null||!S.isValid(U))throw new Error("y required");if(P==null||!S.isValid(P))throw new Error("z required")}static fromAffine(N){const{x:U,y:P}=N||{};if(!N||!S.isValid(U)||!S.isValid(P))throw new Error("invalid affine point");if(N instanceof d)throw new Error("projective point not allowed");const H=G=>S.eql(G,S.ZERO);return H(U)&&H(P)?d.ZERO:new d(U,P,S.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(N){const U=S.invertBatch(N.map(P=>P.pz));return N.map((P,H)=>P.toAffine(U[H])).map(d.fromAffine)}static fromHex(N){const U=d.fromAffine(Y((0,n.ensureBytes)("pointHex",N)));return U.assertValidity(),U}static fromPrivateKey(N){return d.BASE.multiply(oe(N))}_setWindowSize(N){this._WINDOW_SIZE=N,ee.delete(this)}assertValidity(){if(this.is0()){if(O.allowInfinityPoint&&!S.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:N,y:U}=this.toAffine();if(!S.isValid(N)||!S.isValid(U))throw new Error("bad point: x or y not FE");const P=S.sqr(U),H=X(N);if(!S.eql(P,H))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:N}=this.toAffine();if(S.isOdd)return!S.isOdd(N);throw new Error("Field doesn't support isOdd")}equals(N){w(N);const{px:U,py:P,pz:H}=this,{px:G,py:se,pz:q}=N,ie=S.eql(S.mul(U,q),S.mul(G,H)),ce=S.eql(S.mul(P,q),S.mul(se,H));return ie&&ce}negate(){return new d(this.px,S.neg(this.py),this.pz)}double(){const{a:N,b:U}=O,P=S.mul(U,h),{px:H,py:G,pz:se}=this;let q=S.ZERO,ie=S.ZERO,ce=S.ZERO,de=S.mul(H,H),Ee=S.mul(G,G),_e=S.mul(se,se),ye=S.mul(H,G);return ye=S.add(ye,ye),ce=S.mul(H,se),ce=S.add(ce,ce),q=S.mul(N,ce),ie=S.mul(P,_e),ie=S.add(q,ie),q=S.sub(Ee,ie),ie=S.add(Ee,ie),ie=S.mul(q,ie),q=S.mul(ye,q),ce=S.mul(P,ce),_e=S.mul(N,_e),ye=S.sub(de,_e),ye=S.mul(N,ye),ye=S.add(ye,ce),ce=S.add(de,de),de=S.add(ce,de),de=S.add(de,_e),de=S.mul(de,ye),ie=S.add(ie,de),_e=S.mul(G,se),_e=S.add(_e,_e),de=S.mul(_e,ye),q=S.sub(q,de),ce=S.mul(_e,Ee),ce=S.add(ce,ce),ce=S.add(ce,ce),new d(q,ie,ce)}add(N){w(N);const{px:U,py:P,pz:H}=this,{px:G,py:se,pz:q}=N;let ie=S.ZERO,ce=S.ZERO,de=S.ZERO;const Ee=O.a,_e=S.mul(O.b,h);let ye=S.mul(U,G),Ce=S.mul(P,se),Ne=S.mul(H,q),Re=S.add(U,P),I=S.add(G,se);Re=S.mul(Re,I),I=S.add(ye,Ce),Re=S.sub(Re,I),I=S.add(U,H);let B=S.add(G,q);return I=S.mul(I,B),B=S.add(ye,Ne),I=S.sub(I,B),B=S.add(P,H),ie=S.add(se,q),B=S.mul(B,ie),ie=S.add(Ce,Ne),B=S.sub(B,ie),de=S.mul(Ee,I),ie=S.mul(_e,Ne),de=S.add(ie,de),ie=S.sub(Ce,de),de=S.add(Ce,de),ce=S.mul(ie,de),Ce=S.add(ye,ye),Ce=S.add(Ce,ye),Ne=S.mul(Ee,Ne),I=S.mul(_e,I),Ce=S.add(Ce,Ne),Ne=S.sub(ye,Ne),Ne=S.mul(Ee,Ne),I=S.add(I,Ne),ye=S.mul(Ce,I),ce=S.add(ce,ye),ye=S.mul(B,I),ie=S.mul(Re,ie),ie=S.sub(ie,ye),ye=S.mul(Re,Ce),de=S.mul(B,de),de=S.add(de,ye),new d(ie,ce,de)}subtract(N){return this.add(N.negate())}is0(){return this.equals(d.ZERO)}wNAF(N){return $.wNAFCached(this,ee,N,U=>{const P=S.invertBatch(U.map(H=>H.pz));return U.map((H,G)=>H.toAffine(P[G])).map(d.fromAffine)})}multiplyUnsafe(N){const U=d.ZERO;if(N===f)return U;if(V(N),N===l)return this;const{endo:P}=O;if(!P)return $.unsafeLadder(this,N);let{k1neg:H,k1:G,k2neg:se,k2:q}=P.splitScalar(N),ie=U,ce=U,de=this;for(;G>f||q>f;)G&l&&(ie=ie.add(de)),q&l&&(ce=ce.add(de)),de=de.double(),G>>=l,q>>=l;return H&&(ie=ie.negate()),se&&(ce=ce.negate()),ce=new d(S.mul(ce.px,P.beta),ce.py,ce.pz),ie.add(ce)}multiply(N){V(N);let U=N,P,H;const{endo:G}=O;if(G){const{k1neg:se,k1:q,k2neg:ie,k2:ce}=G.splitScalar(U);let{p:de,f:Ee}=this.wNAF(q),{p:_e,f:ye}=this.wNAF(ce);de=$.constTimeNegate(se,de),_e=$.constTimeNegate(ie,_e),_e=new d(S.mul(_e.px,G.beta),_e.py,_e.pz),P=de.add(_e),H=Ee.add(ye)}else{const{p:se,f:q}=this.wNAF(U);P=se,H=q}return d.normalizeZ([P,H])[0]}multiplyAndAddUnsafe(N,U,P){const H=d.BASE,G=(q,ie)=>ie===f||ie===l||!q.equals(H)?q.multiplyUnsafe(ie):q.multiply(ie),se=G(this,U).add(G(N,P));return se.is0()?void 0:se}toAffine(N){const{px:U,py:P,pz:H}=this,G=this.is0();N==null&&(N=G?S.ONE:S.inv(H));const se=S.mul(U,N),q=S.mul(P,N),ie=S.mul(H,N);if(G)return{x:S.ZERO,y:S.ZERO};if(!S.eql(ie,S.ONE))throw new Error("invZ was invalid");return{x:se,y:q}}isTorsionFree(){const{h:N,isTorsionFree:U}=O;if(N===l)return!0;if(U)return U(d,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:N,clearCofactor:U}=O;return N===l?this:U?U(d,this):this.multiplyUnsafe(O.h)}toRawBytes(N=!0){return this.assertValidity(),z(d,this,N)}toHex(N=!0){return r.bytesToHex(this.toRawBytes(N))}}d.BASE=new d(O.Gx,O.Gy,S.ONE),d.ZERO=new d(S.ZERO,S.ONE,S.ZERO);const m=O.nBitLength,$=(0,o.wNAF)(d,O.endo?Math.ceil(m/2):m);return{CURVE:O,ProjectivePoint:d,normPrivateKeyToScalar:oe,weierstrassEquation:X,isWithinCurveOrder:F}}e.weierstrassPoints=_;function R(L){const O=(0,o.validateBasic)(L);return r.validateObject(O,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...O})}function T(L){const O=R(L),{Fp:S,n:z}=O,Y=S.BYTES+1,X=2*S.BYTES+1;function F(I){return f<I&&I<S.ORDER}function V(I){return t.mod(I,z)}function oe(I){return t.invert(I,z)}const{ProjectivePoint:ee,normPrivateKeyToScalar:w,weierstrassEquation:d,isWithinCurveOrder:m}=_({...O,toBytes(I,B,K){const ue=B.toAffine(),ae=S.toBytes(ue.x),be=r.concatBytes;return K?be(Uint8Array.from([B.hasEvenY()?2:3]),ae):be(Uint8Array.from([4]),ae,S.toBytes(ue.y))},fromBytes(I){const B=I.length,K=I[0],ue=I.subarray(1);if(B===Y&&(K===2||K===3)){const ae=r.bytesToNumberBE(ue);if(!F(ae))throw new Error("Point is not on curve");const be=d(ae);let Ae=S.sqrt(be);const Ie=(Ae&l)===l;return(K&1)===1!==Ie&&(Ae=S.neg(Ae)),{x:ae,y:Ae}}else if(B===X&&K===4){const ae=S.fromBytes(ue.subarray(0,S.BYTES)),be=S.fromBytes(ue.subarray(S.BYTES,2*S.BYTES));return{x:ae,y:be}}else throw new Error(`Point of length ${B} was invalid. Expected ${Y} compressed bytes or ${X} uncompressed bytes`)}}),$=I=>r.bytesToHex(r.numberToBytesBE(I,O.nByteLength));function M(I){const B=z>>l;return I>B}function N(I){return M(I)?V(-I):I}const U=(I,B,K)=>r.bytesToNumberBE(I.slice(B,K));class P{constructor(B,K,ue){this.r=B,this.s=K,this.recovery=ue,this.assertValidity()}static fromCompact(B){const K=O.nByteLength;return B=(0,n.ensureBytes)("compactSignature",B,K*2),new P(U(B,0,K),U(B,K,2*K))}static fromDER(B){const{r:K,s:ue}=e.DER.toSig((0,n.ensureBytes)("DER",B));return new P(K,ue)}assertValidity(){if(!m(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!m(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(B){return new P(this.r,this.s,B)}recoverPublicKey(B){const{r:K,s:ue,recovery:ae}=this,be=ce((0,n.ensureBytes)("msgHash",B));if(ae==null||![0,1,2,3].includes(ae))throw new Error("recovery id invalid");const Ae=ae===2||ae===3?K+O.n:K;if(Ae>=S.ORDER)throw new Error("recovery id 2 or 3 invalid");const Ie=ae&1?"03":"02",$e=ee.fromHex(Ie+$(Ae)),me=oe(Ae),je=V(-be*me),tt=V(ue*me),Ge=ee.BASE.multiplyAndAddUnsafe($e,je,tt);if(!Ge)throw new Error("point at infinify");return Ge.assertValidity(),Ge}hasHighS(){return M(this.s)}normalizeS(){return this.hasHighS()?new P(this.r,V(-this.s),this.recovery):this}toDERRawBytes(){return r.hexToBytes(this.toDERHex())}toDERHex(){return e.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return r.hexToBytes(this.toCompactHex())}toCompactHex(){return $(this.r)+$(this.s)}}const H={isValidPrivateKey(I){try{return w(I),!0}catch{return!1}},normPrivateKeyToScalar:w,randomPrivateKey:()=>{const I=t.getMinHashLength(O.n);return t.mapHashToField(O.randomBytes(I),O.n)},precompute(I=8,B=ee.BASE){return B._setWindowSize(I),B.multiply(BigInt(3)),B}};function G(I,B=!0){return ee.fromPrivateKey(I).toRawBytes(B)}function se(I){const B=r.isBytes(I),K=typeof I=="string",ue=(B||K)&&I.length;return B?ue===Y||ue===X:K?ue===2*Y||ue===2*X:I instanceof ee}function q(I,B,K=!0){if(se(I))throw new Error("first arg must be private key");if(!se(B))throw new Error("second arg must be public key");return ee.fromHex(B).multiply(w(I)).toRawBytes(K)}const ie=O.bits2int||function(I){const B=r.bytesToNumberBE(I),K=I.length*8-O.nBitLength;return K>0?B>>BigInt(K):B},ce=O.bits2int_modN||function(I){return V(ie(I))},de=r.bitMask(O.nBitLength);function Ee(I){if(typeof I!="bigint")throw new Error("bigint expected");if(!(f<=I&&I<de))throw new Error(`bigint expected < 2^${O.nBitLength}`);return r.numberToBytesBE(I,O.nByteLength)}function _e(I,B,K=ye){if(["recovered","canonical"].some(rt=>rt in K))throw new Error("sign() legacy options not supported");const{hash:ue,randomBytes:ae}=O;let{lowS:be,prehash:Ae,extraEntropy:Ie}=K;be==null&&(be=!0),I=(0,n.ensureBytes)("msgHash",I),Ae&&(I=(0,n.ensureBytes)("prehashed msgHash",ue(I)));const $e=ce(I),me=w(B),je=[Ee(me),Ee($e)];if(Ie!=null){const rt=Ie===!0?ae(S.BYTES):Ie;je.push((0,n.ensureBytes)("extraEntropy",rt))}const tt=r.concatBytes(...je),Ge=$e;function vt(rt){const Fe=ie(rt);if(!m(Fe))return;const nt=oe(Fe),at=ee.BASE.multiply(Fe).toAffine(),E=V(at.x);if(E===f)return;const fe=V(nt*V(Ge+E*me));if(fe===f)return;let he=(at.x===E?0:2)|Number(at.y&l),we=fe;return be&&M(fe)&&(we=N(fe),he^=1),new P(E,we,he)}return{seed:tt,k2sig:vt}}const ye={lowS:O.lowS,prehash:!1},Ce={lowS:O.lowS,prehash:!1};function Ne(I,B,K=ye){const{seed:ue,k2sig:ae}=_e(I,B,K),be=O;return r.createHmacDrbg(be.hash.outputLen,be.nByteLength,be.hmac)(ue,ae)}ee.BASE._setWindowSize(8);function Re(I,B,K,ue=Ce){var at;const ae=I;if(B=(0,n.ensureBytes)("msgHash",B),K=(0,n.ensureBytes)("publicKey",K),"strict"in ue)throw new Error("options.strict was renamed to lowS");const{lowS:be,prehash:Ae}=ue;let Ie,$e;try{if(typeof ae=="string"||r.isBytes(ae))try{Ie=P.fromDER(ae)}catch(E){if(!(E instanceof e.DER.Err))throw E;Ie=P.fromCompact(ae)}else if(typeof ae=="object"&&typeof ae.r=="bigint"&&typeof ae.s=="bigint"){const{r:E,s:fe}=ae;Ie=new P(E,fe)}else throw new Error("PARSE");$e=ee.fromHex(K)}catch(E){if(E.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(be&&Ie.hasHighS())return!1;Ae&&(B=O.hash(B));const{r:me,s:je}=Ie,tt=ce(B),Ge=oe(je),vt=V(tt*Ge),rt=V(me*Ge),Fe=(at=ee.BASE.multiplyAndAddUnsafe($e,vt,rt))==null?void 0:at.toAffine();return Fe?V(Fe.x)===me:!1}return{CURVE:O,getPublicKey:G,getSharedSecret:q,sign:Ne,verify:Re,ProjectivePoint:ee,Signature:P,utils:H}}e.weierstrass=T;function C(L,O){const S=L.ORDER;let z=f;for(let M=S-l;M%u===f;M/=u)z+=l;const Y=z,X=u<<Y-l-l,F=X*u,V=(S-l)/F,oe=(V-l)/u,ee=F-l,w=X,d=L.pow(O,V),m=L.pow(O,(V+l)/u);let $=(M,N)=>{let U=d,P=L.pow(N,ee),H=L.sqr(P);H=L.mul(H,N);let G=L.mul(M,H);G=L.pow(G,oe),G=L.mul(G,P),P=L.mul(G,N),H=L.mul(G,M);let se=L.mul(H,P);G=L.pow(se,w);let q=L.eql(G,L.ONE);P=L.mul(H,m),G=L.mul(se,U),H=L.cmov(P,H,q),se=L.cmov(G,se,q);for(let ie=Y;ie>l;ie--){let ce=ie-u;ce=u<<ce-l;let de=L.pow(se,ce);const Ee=L.eql(de,L.ONE);P=L.mul(H,U),U=L.mul(U,U),de=L.mul(se,U),H=L.cmov(P,H,Ee),se=L.cmov(de,se,Ee)}return{isValid:q,value:H}};if(L.ORDER%b===h){const M=(L.ORDER-h)/b,N=L.sqrt(L.neg(O));$=(U,P)=>{let H=L.sqr(P);const G=L.mul(U,P);H=L.mul(H,G);let se=L.pow(H,M);se=L.mul(se,G);const q=L.mul(se,N),ie=L.mul(L.sqr(se),P),ce=L.eql(ie,U);let de=L.cmov(q,se,ce);return{isValid:ce,value:de}}}return $}e.SWUFpSqrtRatio=C;function D(L,O){if(t.validateField(L),!L.isValid(O.A)||!L.isValid(O.B)||!L.isValid(O.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const S=C(L,O.Z);if(!L.isOdd)throw new Error("Fp.isOdd is not implemented!");return z=>{let Y,X,F,V,oe,ee,w,d;Y=L.sqr(z),Y=L.mul(Y,O.Z),X=L.sqr(Y),X=L.add(X,Y),F=L.add(X,L.ONE),F=L.mul(F,O.B),V=L.cmov(O.Z,L.neg(X),!L.eql(X,L.ZERO)),V=L.mul(V,O.A),X=L.sqr(F),ee=L.sqr(V),oe=L.mul(ee,O.A),X=L.add(X,oe),X=L.mul(X,F),ee=L.mul(ee,V),oe=L.mul(ee,O.B),X=L.add(X,oe),w=L.mul(Y,F);const{isValid:m,value:$}=S(X,ee);d=L.mul(Y,z),d=L.mul(d,$),w=L.cmov(w,F,m),d=L.cmov(d,$,m);const M=L.isOdd(z)===L.isOdd(d);return d=L.cmov(L.neg(d),d,M),w=L.div(w,V),{x:w,y:d}}}e.mapToCurveSimpleSWU=D})(ya);var kt={};Object.defineProperty(kt,"__esModule",{value:!0});kt.createHasher=kt.isogenyMap=kt.hash_to_field=kt.expand_message_xof=kt.expand_message_xmd=void 0;const _E=Be,Ot=Pe;function bE(e){if((0,Ot.isBytes)(e))return e;if(typeof e=="string")return(0,Ot.utf8ToBytes)(e);throw new Error("DST must be Uint8Array or string")}const pE=Ot.bytesToNumberBE;function yr(e,t){if(e<0||e>=1<<8*t)throw new Error(`bad I2OSP call: value=${e} length=${t}`);const r=Array.from({length:t}).fill(0);for(let n=t-1;n>=0;n--)r[n]=e&255,e>>>=8;return new Uint8Array(r)}function yE(e,t){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e[n]^t[n];return r}function Nn(e){if(!(0,Ot.isBytes)(e))throw new Error("Uint8Array expected")}function wa(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function Hu(e,t,r,n){Nn(e),Nn(t),wa(r),t.length>255&&(t=n((0,Ot.concatBytes)((0,Ot.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));const{outputLen:o,blockLen:i}=n,s=Math.ceil(r/o);if(s>255)throw new Error("Invalid xmd length");const c=(0,Ot.concatBytes)(t,yr(t.length,1)),f=yr(0,i),l=yr(r,2),u=new Array(s),h=n((0,Ot.concatBytes)(f,e,l,yr(0,1),c));u[0]=n((0,Ot.concatBytes)(h,yr(1,1),c));for(let _=1;_<=s;_++){const R=[yE(h,u[_-1]),yr(_+1,1),c];u[_]=n((0,Ot.concatBytes)(...R))}return(0,Ot.concatBytes)(...u).slice(0,r)}kt.expand_message_xmd=Hu;function zu(e,t,r,n,o){if(Nn(e),Nn(t),wa(r),t.length>255){const i=Math.ceil(2*n/8);t=o.create({dkLen:i}).update((0,Ot.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return o.create({dkLen:r}).update(e).update(yr(r,2)).update(t).update(yr(t.length,1)).digest()}kt.expand_message_xof=zu;function Rs(e,t,r){(0,Ot.validateObject)(r,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:n,k:o,m:i,hash:s,expand:c,DST:f}=r;Nn(e),wa(t);const l=bE(f),u=n.toString(2).length,h=Math.ceil((u+o)/8),b=t*i*h;let _;if(c==="xmd")_=Hu(e,l,b,s);else if(c==="xof")_=zu(e,l,b,o,s);else if(c==="_internal_pass")_=e;else throw new Error('expand must be "xmd" or "xof"');const R=new Array(t);for(let T=0;T<t;T++){const C=new Array(i);for(let D=0;D<i;D++){const L=h*(D+T*i),O=_.subarray(L,L+h);C[D]=(0,_E.mod)(pE(O),n)}R[T]=C}return R}kt.hash_to_field=Rs;function wE(e,t){const r=t.map(n=>Array.from(n).reverse());return(n,o)=>{const[i,s,c,f]=r.map(l=>l.reduce((u,h)=>e.add(e.mul(u,n),h)));return n=e.div(i,s),o=e.mul(o,e.div(c,f)),{x:n,y:o}}}kt.isogenyMap=wE;function mE(e,t,r){if(typeof t!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(n,o){const i=Rs(n,2,{...r,DST:r.DST,...o}),s=e.fromAffine(t(i[0])),c=e.fromAffine(t(i[1])),f=s.add(c).clearCofactor();return f.assertValidity(),f},encodeToCurve(n,o){const i=Rs(n,1,{...r,DST:r.encodeDST,...o}),s=e.fromAffine(t(i[0])).clearCofactor();return s.assertValidity(),s}}}kt.createHasher=mE;var rn={},Wu={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hmac=e.HMAC=void 0;const t=lt,r=dr;class n extends r.Hash{constructor(s,c){super(),this.finished=!1,this.destroyed=!1,(0,t.hash)(s);const f=(0,r.toBytes)(c);if(this.iHash=s.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const l=this.blockLen,u=new Uint8Array(l);u.set(f.length>l?s.create().update(f).digest():f);for(let h=0;h<u.length;h++)u[h]^=54;this.iHash.update(u),this.oHash=s.create();for(let h=0;h<u.length;h++)u[h]^=106;this.oHash.update(u),u.fill(0)}update(s){return(0,t.exists)(this),this.iHash.update(s),this}digestInto(s){(0,t.exists)(this),(0,t.bytes)(s,this.outputLen),this.finished=!0,this.iHash.digestInto(s),this.oHash.update(s),this.oHash.digestInto(s),this.destroy()}digest(){const s=new Uint8Array(this.oHash.outputLen);return this.digestInto(s),s}_cloneInto(s){s||(s=Object.create(Object.getPrototypeOf(this),{}));const{oHash:c,iHash:f,finished:l,destroyed:u,blockLen:h,outputLen:b}=this;return s=s,s.finished=l,s.destroyed=u,s.blockLen=h,s.outputLen=b,s.oHash=c._cloneInto(s.oHash),s.iHash=f._cloneInto(s.iHash),s}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}e.HMAC=n;const o=(i,s,c)=>new n(i,s).update(c).digest();e.hmac=o,e.hmac.create=(i,s)=>new n(i,s)})(Wu);Object.defineProperty(rn,"__esModule",{value:!0});rn.createCurve=rn.getHash=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const EE=Wu,ll=dr,vE=ya;function Vu(e){return{hash:e,hmac:(t,...r)=>(0,EE.hmac)(e,t,(0,ll.concatBytes)(...r)),randomBytes:ll.randomBytes}}rn.getHash=Vu;function SE(e,t){const r=n=>(0,vE.weierstrass)({...e,...Vu(n)});return Object.freeze({...r(t),create:r})}rn.createCurve=SE;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.encodeToCurve=e.hashToCurve=e.schnorr=e.secp256k1=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=en,r=dr,n=Be,o=ya,i=Pe,s=kt,c=rn,f=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),l=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),u=BigInt(1),h=BigInt(2),b=(P,H)=>(P+H/h)/H;function _(P){const H=f,G=BigInt(3),se=BigInt(6),q=BigInt(11),ie=BigInt(22),ce=BigInt(23),de=BigInt(44),Ee=BigInt(88),_e=P*P*P%H,ye=_e*_e*P%H,Ce=(0,n.pow2)(ye,G,H)*ye%H,Ne=(0,n.pow2)(Ce,G,H)*ye%H,Re=(0,n.pow2)(Ne,h,H)*_e%H,I=(0,n.pow2)(Re,q,H)*Re%H,B=(0,n.pow2)(I,ie,H)*I%H,K=(0,n.pow2)(B,de,H)*B%H,ue=(0,n.pow2)(K,Ee,H)*K%H,ae=(0,n.pow2)(ue,de,H)*B%H,be=(0,n.pow2)(ae,G,H)*ye%H,Ae=(0,n.pow2)(be,ce,H)*I%H,Ie=(0,n.pow2)(Ae,se,H)*_e%H,$e=(0,n.pow2)(Ie,h,H);if(!R.eql(R.sqr($e),P))throw new Error("Cannot find square root");return $e}const R=(0,n.Field)(f,void 0,void 0,{sqrt:_});e.secp256k1=(0,c.createCurve)({a:BigInt(0),b:BigInt(7),Fp:R,n:l,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:P=>{const H=l,G=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),se=-u*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),q=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),ie=G,ce=BigInt("0x100000000000000000000000000000000"),de=b(ie*P,H),Ee=b(-se*P,H);let _e=(0,n.mod)(P-de*G-Ee*q,H),ye=(0,n.mod)(-de*se-Ee*ie,H);const Ce=_e>ce,Ne=ye>ce;if(Ce&&(_e=H-_e),Ne&&(ye=H-ye),_e>ce||ye>ce)throw new Error("splitScalar: Endomorphism failed, k="+P);return{k1neg:Ce,k1:_e,k2neg:Ne,k2:ye}}}},t.sha256);const T=BigInt(0),C=P=>typeof P=="bigint"&&T<P&&P<f,D=P=>typeof P=="bigint"&&T<P&&P<l,L={};function O(P,...H){let G=L[P];if(G===void 0){const se=(0,t.sha256)(Uint8Array.from(P,q=>q.charCodeAt(0)));G=(0,i.concatBytes)(se,se),L[P]=G}return(0,t.sha256)((0,i.concatBytes)(G,...H))}const S=P=>P.toRawBytes(!0).slice(1),z=P=>(0,i.numberToBytesBE)(P,32),Y=P=>(0,n.mod)(P,f),X=P=>(0,n.mod)(P,l),F=e.secp256k1.ProjectivePoint,V=(P,H,G)=>F.BASE.multiplyAndAddUnsafe(P,H,G);function oe(P){let H=e.secp256k1.utils.normPrivateKeyToScalar(P),G=F.fromPrivateKey(H);return{scalar:G.hasEvenY()?H:X(-H),bytes:S(G)}}function ee(P){if(!C(P))throw new Error("bad x: need 0 < x < p");const H=Y(P*P),G=Y(H*P+BigInt(7));let se=_(G);se%h!==T&&(se=Y(-se));const q=new F(P,se,u);return q.assertValidity(),q}function w(...P){return X((0,i.bytesToNumberBE)(O("BIP0340/challenge",...P)))}function d(P){return oe(P).bytes}function m(P,H,G=(0,r.randomBytes)(32)){const se=(0,i.ensureBytes)("message",P),{bytes:q,scalar:ie}=oe(H),ce=(0,i.ensureBytes)("auxRand",G,32),de=z(ie^(0,i.bytesToNumberBE)(O("BIP0340/aux",ce))),Ee=O("BIP0340/nonce",de,q,se),_e=X((0,i.bytesToNumberBE)(Ee));if(_e===T)throw new Error("sign failed: k is zero");const{bytes:ye,scalar:Ce}=oe(_e),Ne=w(ye,q,se),Re=new Uint8Array(64);if(Re.set(ye,0),Re.set(z(X(Ce+Ne*ie)),32),!$(Re,se,q))throw new Error("sign: Invalid signature produced");return Re}function $(P,H,G){const se=(0,i.ensureBytes)("signature",P,64),q=(0,i.ensureBytes)("message",H),ie=(0,i.ensureBytes)("publicKey",G,32);try{const ce=ee((0,i.bytesToNumberBE)(ie)),de=(0,i.bytesToNumberBE)(se.subarray(0,32));if(!C(de))return!1;const Ee=(0,i.bytesToNumberBE)(se.subarray(32,64));if(!D(Ee))return!1;const _e=w(z(de),S(ce),q),ye=V(ce,Ee,X(-_e));return!(!ye||!ye.hasEvenY()||ye.toAffine().x!==de)}catch{return!1}}e.schnorr={getPublicKey:d,sign:m,verify:$,utils:{randomPrivateKey:e.secp256k1.utils.randomPrivateKey,lift_x:ee,pointToBytes:S,numberToBytesBE:i.numberToBytesBE,bytesToNumberBE:i.bytesToNumberBE,taggedHash:O,mod:n.mod}};const M=(0,s.isogenyMap)(R,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(P=>P.map(H=>BigInt(H)))),N=(0,o.mapToCurveSimpleSWU)(R,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:R.create(BigInt("-11"))}),U=(0,s.createHasher)(e.secp256k1.ProjectivePoint,P=>{const{x:H,y:G}=N(R.create(P[0]));return M(H,G)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:R.ORDER,m:1,k:128,expand:"xmd",hash:t.sha256});e.hashToCurve=U.hashToCurve,e.encodeToCurve=U.encodeToCurve})(Iu);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.secp256k1=void 0;var t=Iu;Object.defineProperty(e,"secp256k1",{enumerable:!0,get:function(){return t.secp256k1}})})(Wi);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MAX_WITHDRAWALS_PER_PAYLOAD=e.RLP_EMPTY_STRING=e.KECCAK256_RLP=e.KECCAK256_RLP_S=e.KECCAK256_RLP_ARRAY=e.KECCAK256_RLP_ARRAY_S=e.KECCAK256_NULL=e.KECCAK256_NULL_S=e.TWO_POW256=e.SECP256K1_ORDER_DIV_2=e.SECP256K1_ORDER=e.MAX_INTEGER_BIGINT=e.MAX_INTEGER=e.MAX_UINT64=void 0;const t=x.bufferPolyfill,r=Wi;e.MAX_UINT64=BigInt("0xffffffffffffffff"),e.MAX_INTEGER=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),e.MAX_INTEGER_BIGINT=BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),e.SECP256K1_ORDER=r.secp256k1.CURVE.n,e.SECP256K1_ORDER_DIV_2=r.secp256k1.CURVE.n/BigInt(2),e.TWO_POW256=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),e.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",e.KECCAK256_NULL=t.Buffer.from(e.KECCAK256_NULL_S,"hex"),e.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",e.KECCAK256_RLP_ARRAY=t.Buffer.from(e.KECCAK256_RLP_ARRAY_S,"hex"),e.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",e.KECCAK256_RLP=t.Buffer.from(e.KECCAK256_RLP_S,"hex"),e.RLP_EMPTY_STRING=t.Buffer.from([128]),e.MAX_WITHDRAWALS_PER_PAYLOAD=16})(zi);var Ki={};Object.defineProperty(Ki,"__esModule",{value:!0});Ki.GWEI_TO_WEI=void 0;Ki.GWEI_TO_WEI=BigInt(1e9);var ma={},Qt={};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.RLP=Qt.utils=Qt.decode=Qt.encode=void 0;function Ea(e){if(Array.isArray(e)){const r=[];let n=0;for(let o=0;o<e.length;o++){const i=Ea(e[o]);r.push(i),n+=i.length}return Is(ul(n,192),...r)}const t=Xu(e);return t.length===1&&t[0]<128?t:Is(ul(t.length,128),t)}Qt.encode=Ea;function Hr(e,t,r){if(r>e.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(t,r)}function cl(e){if(e[0]===0)throw new Error("invalid RLP: extra zeros");return Zu(Gu(e))}function ul(e,t){if(e<56)return Uint8Array.from([e+t]);const r=Ts(e),n=r.length/2,o=Ts(t+55+n);return Uint8Array.from(pi(o+r))}function qu(e,t=!1){if(typeof e>"u"||e===null||e.length===0)return Uint8Array.from([]);const r=Xu(e),n=As(r);if(t)return n;if(n.remainder.length!==0)throw new Error("invalid RLP: remainder must be zero");return n.data}Qt.decode=qu;function As(e){let t,r,n,o,i;const s=[],c=e[0];if(c<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(c<=183){if(t=c-127,c===128?n=Uint8Array.from([]):n=Hr(e,1,t),t===2&&n[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:n,remainder:e.slice(t)}}else if(c<=191){if(r=c-182,e.length-1<r)throw new Error("invalid RLP: not enough bytes for string length");if(t=cl(Hr(e,1,r)),t<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return n=Hr(e,r,t+r),{data:n,remainder:e.slice(t+r)}}else if(c<=247){for(t=c-191,o=Hr(e,1,t);o.length;)i=As(o),s.push(i.data),o=i.remainder;return{data:s,remainder:e.slice(t)}}else{if(r=c-246,t=cl(Hr(e,1,r)),t<56)throw new Error("invalid RLP: encoded list too short");const f=r+t;if(f>e.length)throw new Error("invalid RLP: total length is larger than the data");for(o=Hr(e,r,f);o.length;)i=As(o),s.push(i.data),o=i.remainder;return{data:s,remainder:e.slice(f)}}}const RE=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Gu(e){let t="";for(let r=0;r<e.length;r++)t+=RE[e[r]];return t}function Zu(e){const t=Number.parseInt(e,16);if(Number.isNaN(t))throw new Error("Invalid byte sequence");return t}function pi(e){if(typeof e!="string")throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=r*2;t[r]=Zu(e.slice(n,n+2))}return t}function Is(...e){if(e.length===1)return e[0];const t=e.reduce((n,o)=>n+o.length,0),r=new Uint8Array(t);for(let n=0,o=0;n<e.length;n++){const i=e[n];r.set(i,o),o+=i.length}return r}function Ku(e){return new TextEncoder().encode(e)}function Ts(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");const t=e.toString(16);return t.length%2?`0${t}`:t}function AE(e){return e.length%2?`0${e}`:e}function Ju(e){return e.length>=2&&e[0]==="0"&&e[1]==="x"}function IE(e){return typeof e!="string"?e:Ju(e)?e.slice(2):e}function Xu(e){if(e instanceof Uint8Array)return e;if(typeof e=="string")return Ju(e)?pi(AE(IE(e))):Ku(e);if(typeof e=="number"||typeof e=="bigint")return e?pi(Ts(e)):Uint8Array.from([]);if(e==null)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof e)}Qt.utils={bytesToHex:Gu,concatBytes:Is,hexToBytes:pi,utf8ToBytes:Ku};Qt.RLP={encode:Ea,decode:qu};var zt={},We={},Le={};Object.defineProperty(Le,"__esModule",{value:!0});Le.add5L=Le.add5H=Le.add4H=Le.add4L=Le.add3H=Le.add3L=Le.add=Le.rotlBL=Le.rotlBH=Le.rotlSL=Le.rotlSH=Le.rotr32L=Le.rotr32H=Le.rotrBL=Le.rotrBH=Le.rotrSL=Le.rotrSH=Le.shrSL=Le.shrSH=Le.toBig=Le.split=Le.fromBig=void 0;const ni=BigInt(2**32-1),Os=BigInt(32);function va(e,t=!1){return t?{h:Number(e&ni),l:Number(e>>Os&ni)}:{h:Number(e>>Os&ni)|0,l:Number(e&ni)|0}}Le.fromBig=va;function Yu(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;o<e.length;o++){const{h:i,l:s}=va(e[o],t);[r[o],n[o]]=[i,s]}return[r,n]}Le.split=Yu;const Qu=(e,t)=>BigInt(e>>>0)<<Os|BigInt(t>>>0);Le.toBig=Qu;const ed=(e,t,r)=>e>>>r;Le.shrSH=ed;const td=(e,t,r)=>e<<32-r|t>>>r;Le.shrSL=td;const rd=(e,t,r)=>e>>>r|t<<32-r;Le.rotrSH=rd;const nd=(e,t,r)=>e<<32-r|t>>>r;Le.rotrSL=nd;const id=(e,t,r)=>e<<64-r|t>>>r-32;Le.rotrBH=id;const od=(e,t,r)=>e>>>r-32|t<<64-r;Le.rotrBL=od;const sd=(e,t)=>t;Le.rotr32H=sd;const ad=(e,t)=>e;Le.rotr32L=ad;const fd=(e,t,r)=>e<<r|t>>>32-r;Le.rotlSH=fd;const ld=(e,t,r)=>t<<r|e>>>32-r;Le.rotlSL=ld;const cd=(e,t,r)=>t<<r-32|e>>>64-r;Le.rotlBH=cd;const ud=(e,t,r)=>e<<r-32|t>>>64-r;Le.rotlBL=ud;function dd(e,t,r,n){const o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:o|0}}Le.add=dd;const hd=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);Le.add3L=hd;const gd=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;Le.add3H=gd;const _d=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);Le.add4L=_d;const bd=(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0;Le.add4H=bd;const pd=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0);Le.add5L=pd;const yd=(e,t,r,n,o,i)=>t+r+n+o+i+(e/2**32|0)|0;Le.add5H=yd;const TE={fromBig:va,split:Yu,toBig:Qu,shrSH:ed,shrSL:td,rotrSH:rd,rotrSL:nd,rotrBH:id,rotrBL:od,rotr32H:sd,rotr32L:ad,rotlSH:fd,rotlSL:ld,rotlBH:cd,rotlBL:ud,add:dd,add3L:hd,add3H:gd,add4L:_d,add4H:bd,add5H:yd,add5L:pd};Le.default=TE;Object.defineProperty(We,"__esModule",{value:!0});We.shake256=We.shake128=We.keccak_512=We.keccak_384=We.keccak_256=We.keccak_224=We.sha3_512=We.sha3_384=We.sha3_256=We.sha3_224=We.Keccak=We.keccakP=void 0;const zr=lt,Bn=Le,An=dr,[wd,md,Ed]=[[],[],[]],OE=BigInt(0),wn=BigInt(1),LE=BigInt(2),PE=BigInt(7),CE=BigInt(256),NE=BigInt(113);for(let e=0,t=wn,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],wd.push(2*(5*n+r)),md.push((e+1)*(e+2)/2%64);let o=OE;for(let i=0;i<7;i++)t=(t<<wn^(t>>PE)*NE)%CE,t&LE&&(o^=wn<<(wn<<BigInt(i))-wn);Ed.push(o)}const[BE,$E]=(0,Bn.split)(Ed,!0),dl=(e,t,r)=>r>32?(0,Bn.rotlBH)(e,t,r):(0,Bn.rotlSH)(e,t,r),hl=(e,t,r)=>r>32?(0,Bn.rotlBL)(e,t,r):(0,Bn.rotlSL)(e,t,r);function vd(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let s=0;s<10;s++)r[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){const c=(s+8)%10,f=(s+2)%10,l=r[f],u=r[f+1],h=dl(l,u,1)^r[c],b=hl(l,u,1)^r[c+1];for(let _=0;_<50;_+=10)e[s+_]^=h,e[s+_+1]^=b}let o=e[2],i=e[3];for(let s=0;s<24;s++){const c=md[s],f=dl(o,i,c),l=hl(o,i,c),u=wd[s];o=e[u],i=e[u+1],e[u]=f,e[u+1]=l}for(let s=0;s<50;s+=10){for(let c=0;c<10;c++)r[c]=e[s+c];for(let c=0;c<10;c++)e[s+c]^=~r[(c+2)%10]&r[(c+4)%10]}e[0]^=BE[n],e[1]^=$E[n]}r.fill(0)}We.keccakP=vd;class Hn extends An.Hash{constructor(t,r,n,o=!1,i=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=o,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,zr.number)(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,An.u32)(this.state)}keccak(){vd(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){(0,zr.exists)(this);const{blockLen:r,state:n}=this;t=(0,An.toBytes)(t);const o=t.length;for(let i=0;i<o;){const s=Math.min(r-this.pos,o-i);for(let c=0;c<s;c++)n[this.pos++]^=t[i++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:r,pos:n,blockLen:o}=this;t[n]^=r,r&128&&n===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){(0,zr.exists)(this,!1),(0,zr.bytes)(t),this.finish();const r=this.state,{blockLen:n}=this;for(let o=0,i=t.length;o<i;){this.posOut>=n&&this.keccak();const s=Math.min(n-this.posOut,i-o);t.set(r.subarray(this.posOut,this.posOut+s),o),this.posOut+=s,o+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,zr.number)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,zr.output)(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:r,suffix:n,outputLen:o,rounds:i,enableXOF:s}=this;return t||(t=new Hn(r,n,o,s,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=n,t.outputLen=o,t.enableXOF=s,t.destroyed=this.destroyed,t}}We.Keccak=Hn;const Rr=(e,t,r)=>(0,An.wrapConstructor)(()=>new Hn(t,e,r));We.sha3_224=Rr(6,144,224/8);We.sha3_256=Rr(6,136,256/8);We.sha3_384=Rr(6,104,384/8);We.sha3_512=Rr(6,72,512/8);We.keccak_224=Rr(1,144,224/8);We.keccak_256=Rr(1,136,256/8);We.keccak_384=Rr(1,104,384/8);We.keccak_512=Rr(1,72,512/8);const Sd=(e,t,r)=>(0,An.wrapXOFConstructorWithOpts)((n={})=>new Hn(t,e,n.dkLen===void 0?r:n.dkLen,!0));We.shake128=Sd(31,168,128/8);We.shake256=Sd(31,136,256/8);var yi={exports:{}};yi.exports;(function(e,t){var r=x.commonjsGlobal&&x.commonjsGlobal.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=t.wrapHash=t.equalsBytes=t.hexToBytes=t.bytesToUtf8=t.utf8ToBytes=t.createView=t.concatBytes=t.toHex=t.bytesToHex=t.assertBytes=t.assertBool=void 0;const n=r(lt),o=dr,i=n.default.bool;t.assertBool=i;const s=n.default.bytes;t.assertBytes=s;var c=dr;Object.defineProperty(t,"bytesToHex",{enumerable:!0,get:function(){return c.bytesToHex}}),Object.defineProperty(t,"toHex",{enumerable:!0,get:function(){return c.bytesToHex}}),Object.defineProperty(t,"concatBytes",{enumerable:!0,get:function(){return c.concatBytes}}),Object.defineProperty(t,"createView",{enumerable:!0,get:function(){return c.createView}}),Object.defineProperty(t,"utf8ToBytes",{enumerable:!0,get:function(){return c.utf8ToBytes}});function f(b){if(!(b instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof b}`);return new TextDecoder().decode(b)}t.bytesToUtf8=f;function l(b){const _=b.startsWith("0x")?b.substring(2):b;return(0,o.hexToBytes)(_)}t.hexToBytes=l;function u(b,_){if(b.length!==_.length)return!1;for(let R=0;R<b.length;R++)if(b[R]!==_[R])return!1;return!0}t.equalsBytes=u;function h(b){return _=>(n.default.bytes(_),b(_))}t.wrapHash=h,t.crypto=(()=>{const b=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,_=typeof x.commonjsRequire=="function"&&x.commonjsRequire.bind(e);return{node:_&&!b?_("crypto"):void 0,web:b}})()})(yi,yi.exports);var Rd=yi.exports;Object.defineProperty(zt,"__esModule",{value:!0});zt.keccak512=zt.keccak384=zt.keccak256=zt.keccak224=void 0;const $n=We,Ji=Rd;zt.keccak224=(0,Ji.wrapHash)($n.keccak_224);zt.keccak256=(()=>{const e=(0,Ji.wrapHash)($n.keccak_256);return e.create=$n.keccak_256.create,e})();zt.keccak384=(0,Ji.wrapHash)($n.keccak_384);zt.keccak512=(0,Ji.wrapHash)($n.keccak_512);var Fr={},xt={},Ve={};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.isHexString=Ve.getKeys=Ve.fromAscii=Ve.fromUtf8=Ve.toAscii=Ve.arrayContainsArray=Ve.getBinarySize=Ve.padToEven=Ve.stripHexPrefix=Ve.isHexPrefixed=void 0;function Ad(e){if(typeof e!="string")throw new Error(`[isHexPrefixed] input must be type 'string', received type ${typeof e}`);return e[0]==="0"&&e[1]==="x"}Ve.isHexPrefixed=Ad;const kE=e=>{if(typeof e!="string")throw new Error(`[stripHexPrefix] input must be type 'string', received ${typeof e}`);return Ad(e)?e.slice(2):e};Ve.stripHexPrefix=kE;function Id(e){let t=e;if(typeof t!="string")throw new Error(`[padToEven] value must be type 'string', received ${typeof t}`);return t.length%2&&(t=`0${t}`),t}Ve.padToEven=Id;function xE(e){if(typeof e!="string")throw new Error(`[getBinarySize] method requires input type 'string', received ${typeof e}`);return x.dist.Buffer.byteLength(e,"utf8")}Ve.getBinarySize=xE;function DE(e,t,r){if(Array.isArray(e)!==!0)throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof e}'`);if(Array.isArray(t)!==!0)throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof t}'`);return t[r===!0?"some":"every"](n=>e.indexOf(n)>=0)}Ve.arrayContainsArray=DE;function jE(e){let t="",r=0;const n=e.length;for(e.substring(0,2)==="0x"&&(r=2);r<n;r+=2){const o=parseInt(e.substr(r,2),16);t+=String.fromCharCode(o)}return t}Ve.toAscii=jE;function ME(e){const t=x.dist.Buffer.from(e,"utf8");return`0x${Id(t.toString("hex")).replace(/^0+|0+$/g,"")}`}Ve.fromUtf8=ME;function FE(e){let t="";for(let r=0;r<e.length;r++){const o=e.charCodeAt(r).toString(16);t+=o.length<2?`0${o}`:o}return`0x${t}`}Ve.fromAscii=FE;function UE(e,t,r){if(!Array.isArray(e))throw new Error(`[getKeys] method expects input 'params' to be an array, got ${typeof e}`);if(typeof t!="string")throw new Error(`[getKeys] method expects input 'key' to be type 'string', got ${typeof e}`);const n=[];for(let o=0;o<e.length;o++){let i=e[o][t];if(r===!0&&!i)i="";else if(typeof i!="string")throw new Error(`invalid abi - expected type 'string', received ${typeof i}`);n.push(i)}return n}Ve.getKeys=UE;function HE(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||typeof t<"u"&&t>0&&e.length!==2+2*t)}Ve.isHexString=HE;Object.defineProperty(xt,"__esModule",{value:!0});xt.assertIsString=xt.assertIsArray=xt.assertIsBuffer=xt.assertIsHexString=void 0;const zE=Ve,WE=function(e){if(!(0,zE.isHexString)(e)){const t=`This method only supports 0x-prefixed hex strings but input was: ${e}`;throw new Error(t)}};xt.assertIsHexString=WE;const VE=function(e){if(!x.dist.Buffer.isBuffer(e)){const t=`This method only supports Buffer but input was: ${e}`;throw new Error(t)}};xt.assertIsBuffer=VE;const qE=function(e){if(!Array.isArray(e)){const t=`This method only supports number arrays but input was: ${e}`;throw new Error(t)}};xt.assertIsArray=qE;const GE=function(e){if(typeof e!="string"){const t=`This method only supports strings but input was: ${e}`;throw new Error(t)}};xt.assertIsString=GE;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.intToUnpaddedBuffer=e.bigIntToUnpaddedBuffer=e.bigIntToHex=e.bufArrToArr=e.arrToBufArr=e.validateNoLeadingZeroes=e.baToJSON=e.toUtf8=e.short=e.addHexPrefix=e.toUnsigned=e.fromSigned=e.bufferToInt=e.bigIntToBuffer=e.bufferToBigInt=e.bufferToHex=e.toBuffer=e.unpadHexString=e.unpadArray=e.unpadBuffer=e.setLengthRight=e.setLengthLeft=e.zeros=e.intToBuffer=e.intToHex=void 0;const t=xt,r=Ve,n=function(m){if(!Number.isSafeInteger(m)||m<0)throw new Error(`Received an invalid integer type: ${m}`);return`0x${m.toString(16)}`};e.intToHex=n;const o=function(m){const $=(0,e.intToHex)(m);return x.dist.Buffer.from((0,r.padToEven)($.slice(2)),"hex")};e.intToBuffer=o;const i=function(m){return x.dist.Buffer.allocUnsafe(m).fill(0)};e.zeros=i;const s=function(m,$,M){const N=(0,e.zeros)($);return M?m.length<$?(m.copy(N),N):m.slice(0,$):m.length<$?(m.copy(N,$-m.length),N):m.slice(-$)},c=function(m,$){return(0,t.assertIsBuffer)(m),s(m,$,!1)};e.setLengthLeft=c;const f=function(m,$){return(0,t.assertIsBuffer)(m),s(m,$,!0)};e.setLengthRight=f;const l=function(m){let $=m[0];for(;m.length>0&&$.toString()==="0";)m=m.slice(1),$=m[0];return m},u=function(m){return(0,t.assertIsBuffer)(m),l(m)};e.unpadBuffer=u;const h=function(m){return(0,t.assertIsArray)(m),l(m)};e.unpadArray=h;const b=function(m){return(0,t.assertIsHexString)(m),m=(0,r.stripHexPrefix)(m),"0x"+l(m)};e.unpadHexString=b;const _=function(m){if(m==null)return x.dist.Buffer.allocUnsafe(0);if(x.dist.Buffer.isBuffer(m)||Array.isArray(m)||m instanceof Uint8Array)return x.dist.Buffer.from(m);if(typeof m=="string"){if(!(0,r.isHexString)(m))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${m}`);return x.dist.Buffer.from((0,r.padToEven)((0,r.stripHexPrefix)(m)),"hex")}if(typeof m=="number")return(0,e.intToBuffer)(m);if(typeof m=="bigint"){if(m<BigInt(0))throw new Error(`Cannot convert negative bigint to buffer. Given: ${m}`);let $=m.toString(16);return $.length%2&&($="0"+$),x.dist.Buffer.from($,"hex")}if(m.toArray)return x.dist.Buffer.from(m.toArray());if(m.toBuffer)return x.dist.Buffer.from(m.toBuffer());throw new Error("invalid type")};e.toBuffer=_;const R=function(m){return m=(0,e.toBuffer)(m),"0x"+m.toString("hex")};e.bufferToHex=R;function T(m){const $=(0,e.bufferToHex)(m);return BigInt($==="0x"?0:$)}e.bufferToBigInt=T;function C(m){return(0,e.toBuffer)("0x"+m.toString(16))}e.bigIntToBuffer=C;const D=function(m){const $=Number(T(m));if(!Number.isSafeInteger($))throw new Error("Number exceeds 53 bits");return $};e.bufferToInt=D;const L=function(m){return BigInt.asIntN(256,T(m))};e.fromSigned=L;const O=function(m){return C(BigInt.asUintN(256,m))};e.toUnsigned=O;const S=function(m){return typeof m!="string"||(0,r.isHexPrefixed)(m)?m:"0x"+m};e.addHexPrefix=S;function z(m,$=50){const M=x.dist.Buffer.isBuffer(m)?m.toString("hex"):m;return M.length<=$?M:M.slice(0,$)+"…"}e.short=z;const Y=function(m){const $=/^(00)+|(00)+$/g;if(m=(0,r.stripHexPrefix)(m),m.length%2!==0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return x.dist.Buffer.from(m.replace($,""),"hex").toString("utf8")};e.toUtf8=Y;const X=function(m){if(x.dist.Buffer.isBuffer(m))return`0x${m.toString("hex")}`;if(m instanceof Array){const $=[];for(let M=0;M<m.length;M++)$.push((0,e.baToJSON)(m[M]));return $}};e.baToJSON=X;const F=function(m){for(const[$,M]of Object.entries(m))if(M!==void 0&&M.length>0&&M[0]===0)throw new Error(`${$} cannot have leading zeroes, received: ${M.toString("hex")}`)};e.validateNoLeadingZeroes=F;function V(m){return Array.isArray(m)?m.map($=>V($)):x.dist.Buffer.from(m)}e.arrToBufArr=V;function oe(m){return Array.isArray(m)?m.map($=>oe($)):Uint8Array.from(m??[])}e.bufArrToArr=oe;const ee=m=>"0x"+m.toString(16);e.bigIntToHex=ee;function w(m){return(0,e.unpadBuffer)(C(m))}e.bigIntToUnpaddedBuffer=w;function d(m){return(0,e.unpadBuffer)((0,e.intToBuffer)(m))}e.intToUnpaddedBuffer=d})(Fr);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.accountBodyToRLP=e.accountBodyToSlim=e.accountBodyFromSlim=e.isZeroAddress=e.zeroAddress=e.importPublic=e.privateToAddress=e.privateToPublic=e.publicToAddress=e.pubToAddress=e.isValidPublic=e.isValidPrivate=e.generateAddress2=e.generateAddress=e.isValidChecksumAddress=e.toChecksumAddress=e.isValidAddress=e.Account=void 0;const t=Qt,r=zt,n=Wi,o=Rd,i=Fr,s=zi,c=xt,f=Ve,l=BigInt(0);class u{constructor(d=l,m=l,$=s.KECCAK256_RLP,M=s.KECCAK256_NULL){this.nonce=d,this.balance=m,this.storageRoot=$,this.codeHash=M,this._validate()}static fromAccountData(d){const{nonce:m,balance:$,storageRoot:M,codeHash:N}=d;return new u(m!==void 0?(0,i.bufferToBigInt)((0,i.toBuffer)(m)):void 0,$!==void 0?(0,i.bufferToBigInt)((0,i.toBuffer)($)):void 0,M!==void 0?(0,i.toBuffer)(M):void 0,N!==void 0?(0,i.toBuffer)(N):void 0)}static fromRlpSerializedAccount(d){const m=(0,i.arrToBufArr)(t.RLP.decode(Uint8Array.from(d)));if(!Array.isArray(m))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(m)}static fromValuesArray(d){const[m,$,M,N]=d;return new u((0,i.bufferToBigInt)(m),(0,i.bufferToBigInt)($),M,N)}_validate(){if(this.nonce<l)throw new Error("nonce must be greater than zero");if(this.balance<l)throw new Error("balance must be greater than zero");if(this.storageRoot.length!==32)throw new Error("storageRoot must have a length of 32");if(this.codeHash.length!==32)throw new Error("codeHash must have a length of 32")}raw(){return[(0,i.bigIntToUnpaddedBuffer)(this.nonce),(0,i.bigIntToUnpaddedBuffer)(this.balance),this.storageRoot,this.codeHash]}serialize(){return x.dist.Buffer.from(t.RLP.encode((0,i.bufArrToArr)(this.raw())))}isContract(){return!this.codeHash.equals(s.KECCAK256_NULL)}isEmpty(){return this.balance===l&&this.nonce===l&&this.codeHash.equals(s.KECCAK256_NULL)}}e.Account=u;const h=function(w){try{(0,c.assertIsString)(w)}catch{return!1}return/^0x[0-9a-fA-F]{40}$/.test(w)};e.isValidAddress=h;const b=function(w,d){(0,c.assertIsHexString)(w);const m=(0,f.stripHexPrefix)(w).toLowerCase();let $="";d!==void 0&&($=(0,i.bufferToBigInt)((0,i.toBuffer)(d)).toString()+"0x");const M=x.dist.Buffer.from($+m,"utf8"),N=(0,o.bytesToHex)((0,r.keccak256)(M));let U="0x";for(let P=0;P<m.length;P++)parseInt(N[P],16)>=8?U+=m[P].toUpperCase():U+=m[P];return U};e.toChecksumAddress=b;const _=function(w,d){return(0,e.isValidAddress)(w)&&(0,e.toChecksumAddress)(w,d)===w};e.isValidChecksumAddress=_;const R=function(w,d){return(0,c.assertIsBuffer)(w),(0,c.assertIsBuffer)(d),(0,i.bufferToBigInt)(d)===BigInt(0)?x.dist.Buffer.from((0,r.keccak256)(t.RLP.encode((0,i.bufArrToArr)([w,null])))).slice(-20):x.dist.Buffer.from((0,r.keccak256)(t.RLP.encode((0,i.bufArrToArr)([w,d])))).slice(-20)};e.generateAddress=R;const T=function(w,d,m){if((0,c.assertIsBuffer)(w),(0,c.assertIsBuffer)(d),(0,c.assertIsBuffer)(m),w.length!==20)throw new Error("Expected from to be of length 20");if(d.length!==32)throw new Error("Expected salt to be of length 32");const $=(0,r.keccak256)(x.dist.Buffer.concat([x.dist.Buffer.from("ff","hex"),w,d,(0,r.keccak256)(m)]));return(0,i.toBuffer)($).slice(-20)};e.generateAddress2=T;const C=function(w){return n.secp256k1.utils.isValidPrivateKey(w)};e.isValidPrivate=C;const D=function(w,d=!1){if((0,c.assertIsBuffer)(w),w.length===64)try{return n.secp256k1.ProjectivePoint.fromHex(x.dist.Buffer.concat([x.dist.Buffer.from([4]),w])),!0}catch{return!1}if(!d)return!1;try{return n.secp256k1.ProjectivePoint.fromHex(w),!0}catch{return!1}};e.isValidPublic=D;const L=function(w,d=!1){if((0,c.assertIsBuffer)(w),d&&w.length!==64&&(w=x.dist.Buffer.from(n.secp256k1.ProjectivePoint.fromHex(w).toRawBytes(!1).slice(1))),w.length!==64)throw new Error("Expected pubKey to be of length 64");return x.dist.Buffer.from((0,r.keccak256)(w)).slice(-20)};e.pubToAddress=L,e.publicToAddress=e.pubToAddress;const O=function(w){return(0,c.assertIsBuffer)(w),x.dist.Buffer.from(n.secp256k1.ProjectivePoint.fromPrivateKey(w).toRawBytes(!1).slice(1))};e.privateToPublic=O;const S=function(w){return(0,e.publicToAddress)((0,e.privateToPublic)(w))};e.privateToAddress=S;const z=function(w){return(0,c.assertIsBuffer)(w),w.length!==64&&(w=x.dist.Buffer.from(n.secp256k1.ProjectivePoint.fromHex(w).toRawBytes(!1).slice(1))),w};e.importPublic=z;const Y=function(){const d=(0,i.zeros)(20);return(0,i.bufferToHex)(d)};e.zeroAddress=Y;const X=function(w){try{(0,c.assertIsString)(w)}catch{return!1}return(0,e.zeroAddress)()===w};e.isZeroAddress=X;function F(w){const[d,m,$,M]=w;return[d,m,(0,i.arrToBufArr)($).length===0?s.KECCAK256_RLP:$,(0,i.arrToBufArr)(M).length===0?s.KECCAK256_NULL:M]}e.accountBodyFromSlim=F;const V=new Uint8Array(0);function oe(w){const[d,m,$,M]=w;return[d,m,(0,i.arrToBufArr)($).equals(s.KECCAK256_RLP)?V:$,(0,i.arrToBufArr)(M).equals(s.KECCAK256_NULL)?V:M]}e.accountBodyToSlim=oe;function ee(w,d=!0){const m=d?F(w):w;return(0,i.arrToBufArr)(t.RLP.encode(m))}e.accountBodyToRLP=ee})(ma);var zn={};Object.defineProperty(zn,"__esModule",{value:!0});zn.Address=void 0;const mn=ma,ii=Fr;class fr{constructor(t){if(t.length!==20)throw new Error("Invalid address length");this.buf=t}static zero(){return new fr((0,ii.zeros)(20))}static fromString(t){if(!(0,mn.isValidAddress)(t))throw new Error("Invalid address");return new fr((0,ii.toBuffer)(t))}static fromPublicKey(t){if(!x.dist.Buffer.isBuffer(t))throw new Error("Public key should be Buffer");const r=(0,mn.pubToAddress)(t);return new fr(r)}static fromPrivateKey(t){if(!x.dist.Buffer.isBuffer(t))throw new Error("Private key should be Buffer");const r=(0,mn.privateToAddress)(t);return new fr(r)}static generate(t,r){if(typeof r!="bigint")throw new Error("Expected nonce to be a bigint");return new fr((0,mn.generateAddress)(t.buf,(0,ii.bigIntToBuffer)(r)))}static generate2(t,r,n){if(!x.dist.Buffer.isBuffer(r))throw new Error("Expected salt to be a Buffer");if(!x.dist.Buffer.isBuffer(n))throw new Error("Expected initCode to be a Buffer");return new fr((0,mn.generateAddress2)(t.buf,r,n))}equals(t){return this.buf.equals(t.buf)}isZero(){return this.equals(fr.zero())}isPrecompileOrSystemAddress(){const t=(0,ii.bufferToBigInt)(this.buf),r=BigInt(0),n=BigInt("0xffff");return t>=r&&t<=n}toString(){return"0x"+this.buf.toString("hex")}toBuffer(){return x.dist.Buffer.from(this.buf)}}zn.Address=fr;var Xi={},Sa={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toType=e.TypeOutput=void 0;const t=Fr,r=Ve;var n;(function(i){i[i.Number=0]="Number",i[i.BigInt=1]="BigInt",i[i.Buffer=2]="Buffer",i[i.PrefixedHexString=3]="PrefixedHexString"})(n=e.TypeOutput||(e.TypeOutput={}));function o(i,s){if(i===null)return null;if(i===void 0)return;if(typeof i=="string"&&!(0,r.isHexString)(i))throw new Error(`A string must be provided with a 0x-prefix, given: ${i}`);if(typeof i=="number"&&!Number.isSafeInteger(i))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const c=(0,t.toBuffer)(i);switch(s){case n.Buffer:return c;case n.BigInt:return(0,t.bufferToBigInt)(c);case n.Number:{const f=(0,t.bufferToBigInt)(c);if(f>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(f)}case n.PrefixedHexString:return(0,t.bufferToHex)(c);default:throw new Error("unknown outputType")}}e.toType=o})(Sa);Object.defineProperty(Xi,"__esModule",{value:!0});Xi.Withdrawal=void 0;const gl=zn,Vo=Fr,Qe=Sa;class In{constructor(t,r,n,o){this.index=t,this.validatorIndex=r,this.address=n,this.amount=o}static fromWithdrawalData(t){const{index:r,validatorIndex:n,address:o,amount:i}=t,s=(0,Qe.toType)(r,Qe.TypeOutput.BigInt),c=(0,Qe.toType)(n,Qe.TypeOutput.BigInt),f=new gl.Address((0,Qe.toType)(o,Qe.TypeOutput.Buffer)),l=(0,Qe.toType)(i,Qe.TypeOutput.BigInt);return new In(s,c,f,l)}static fromValuesArray(t){if(t.length!==4)throw Error(`Invalid withdrawalArray length expected=4 actual=${t.length}`);const[r,n,o,i]=t;return In.fromWithdrawalData({index:r,validatorIndex:n,address:o,amount:i})}static toBufferArray(t){const{index:r,validatorIndex:n,address:o,amount:i}=t,s=(0,Qe.toType)(r,Qe.TypeOutput.BigInt)===BigInt(0)?x.dist.Buffer.alloc(0):(0,Qe.toType)(r,Qe.TypeOutput.Buffer),c=(0,Qe.toType)(n,Qe.TypeOutput.BigInt)===BigInt(0)?x.dist.Buffer.alloc(0):(0,Qe.toType)(n,Qe.TypeOutput.Buffer);let f;o instanceof gl.Address?f=o.buf:f=(0,Qe.toType)(o,Qe.TypeOutput.Buffer);const l=(0,Qe.toType)(i,Qe.TypeOutput.BigInt)===BigInt(0)?x.dist.Buffer.alloc(0):(0,Qe.toType)(i,Qe.TypeOutput.Buffer);return[s,c,f,l]}raw(){return In.toBufferArray(this)}toValue(){return{index:this.index,validatorIndex:this.validatorIndex,address:this.address.buf,amount:this.amount}}toJSON(){return{index:(0,Vo.bigIntToHex)(this.index),validatorIndex:(0,Vo.bigIntToHex)(this.validatorIndex),address:"0x"+this.address.buf.toString("hex"),amount:(0,Vo.bigIntToHex)(this.amount)}}}Xi.Withdrawal=In;var pt={};Object.defineProperty(pt,"__esModule",{value:!0});pt.hashPersonalMessage=pt.isValidSignature=pt.fromRpcSig=pt.toCompactSig=pt.toRpcSig=pt.ecrecover=pt.ecsign=void 0;const ZE=zt,Td=Wi,St=Fr,qo=zi,KE=xt;function JE(e,t,r){const n=Td.secp256k1.sign(e,t),o=n.toCompactRawBytes(),i=x.dist.Buffer.from(o.slice(0,32)),s=x.dist.Buffer.from(o.slice(32,64)),c=r===void 0?BigInt(n.recovery+27):BigInt(n.recovery+35)+BigInt(r)*BigInt(2);return{r:i,s,v:c}}pt.ecsign=JE;function Yi(e,t){return e===BigInt(0)||e===BigInt(1)?e:t===void 0?e-BigInt(27):e-(t*BigInt(2)+BigInt(35))}function Qi(e){return e===BigInt(0)||e===BigInt(1)}const XE=function(e,t,r,n,o){const i=x.dist.Buffer.concat([(0,St.setLengthLeft)(r,32),(0,St.setLengthLeft)(n,32)],64),s=Yi(t,o);if(!Qi(s))throw new Error("Invalid signature v value");const f=Td.secp256k1.Signature.fromCompact(i).addRecoveryBit(Number(s)).recoverPublicKey(e);return x.dist.Buffer.from(f.toRawBytes(!1).slice(1))};pt.ecrecover=XE;const YE=function(e,t,r,n){const o=Yi(e,n);if(!Qi(o))throw new Error("Invalid signature v value");return(0,St.bufferToHex)(x.dist.Buffer.concat([(0,St.setLengthLeft)(t,32),(0,St.setLengthLeft)(r,32),(0,St.toBuffer)(e)]))};pt.toRpcSig=YE;const QE=function(e,t,r,n){const o=Yi(e,n);if(!Qi(o))throw new Error("Invalid signature v value");let i=r;return(e>BigInt(28)&&e%BigInt(2)===BigInt(1)||e===BigInt(1)||e===BigInt(28))&&(i=x.dist.Buffer.from(r),i[0]|=128),(0,St.bufferToHex)(x.dist.Buffer.concat([(0,St.setLengthLeft)(t,32),(0,St.setLengthLeft)(i,32)]))};pt.toCompactSig=QE;const ev=function(e){const t=(0,St.toBuffer)(e);let r,n,o;if(t.length>=65)r=t.slice(0,32),n=t.slice(32,64),o=(0,St.bufferToBigInt)(t.slice(64));else if(t.length===64)r=t.slice(0,32),n=t.slice(32,64),o=BigInt((0,St.bufferToInt)(t.slice(32,33))>>7),n[0]&=127;else throw new Error("Invalid signature length");return o<27&&(o=o+BigInt(27)),{v:o,r,s:n}};pt.fromRpcSig=ev;const tv=function(e,t,r,n=!0,o){if(t.length!==32||r.length!==32||!Qi(Yi(e,o)))return!1;const i=(0,St.bufferToBigInt)(t),s=(0,St.bufferToBigInt)(r);return!(i===BigInt(0)||i>=qo.SECP256K1_ORDER||s===BigInt(0)||s>=qo.SECP256K1_ORDER||n&&s>=qo.SECP256K1_ORDER_DIV_2)};pt.isValidSignature=tv;const rv=function(e){(0,KE.assertIsBuffer)(e);const t=x.dist.Buffer.from(`Ethereum Signed Message:
3
3
  ${e.length}`,"utf-8");return x.dist.Buffer.from((0,ZE.keccak256)(x.dist.Buffer.concat([t,e])))};pt.hashPersonalMessage=rv;var Od={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.compactBytesToNibbles=e.bytesToNibbles=e.nibblesToCompactBytes=e.nibblesToBytes=e.hasTerminator=void 0;const t=s=>s.length>0&&s[s.length-1]===16;e.hasTerminator=t;const r=(s,c)=>{for(let f=0,l=0;l<s.length;f+=1,l+=2)c[f]=s[l]<<4|s[l+1]};e.nibblesToBytes=r;const n=s=>{let c=0;(0,e.hasTerminator)(s)&&(c=1,s=s.subarray(0,s.length-1));const f=new Uint8Array(s.length/2+1);return f[0]=c<<5,(s.length&1)===1&&(f[0]|=16,f[0]|=s[0],s=s.subarray(1)),(0,e.nibblesToBytes)(s,f.subarray(1)),f};e.nibblesToCompactBytes=n;const o=s=>{const c=s.length*2+1,f=new Uint8Array(c);for(let l=0;l<s.length;l++){const u=s[l];f[l*2]=u/16,f[l*2+1]=u%16}return f[c-1]=16,f};e.bytesToNibbles=o;const i=s=>{if(s.length===0)return s;let c=(0,e.bytesToNibbles)(s);c[0]<2&&(c=c.subarray(0,c.length-1));const f=2-(c[0]&1);return c.subarray(f)};e.compactBytesToNibbles=i})(Od);var eo={};Object.defineProperty(eo,"__esModule",{value:!0});eo.AsyncEventEmitter=void 0;const nv=x.eventsExports;async function iv(e,t,r){let n;for await(const o of t)try{o.length<2?o.call(e,r):await new Promise((i,s)=>{o.call(e,r,c=>{c?s(c):i()})})}catch(i){n=i}if(n)throw n}class ov extends nv.EventEmitter{emit(t,...r){let[n,o]=r;const i=this;let s=i._events[t]??[];return o===void 0&&typeof n=="function"&&(o=n,n=void 0),(t==="newListener"||t==="removeListener")&&(n={event:n,fn:o},o=void 0),s=Array.isArray(s)?s:[s],iv(i,s.slice(),n).then(o).catch(o),i.listenerCount(t)>0}once(t,r){const n=this;let o;if(typeof r!="function")throw new TypeError("listener must be a function");return r.length>=2?o=function(i,s){n.removeListener(t,o),r(i,s)}:o=function(i){n.removeListener(t,o),r(i,o)},n.on(t,o),n}first(t,r){let n=this._events[t]??[];if(typeof r!="function")throw new TypeError("listener must be a function");return Array.isArray(n)||(this._events[t]=n=[n]),n.unshift(r),this}before(t,r,n){return this.beforeOrAfter(t,r,n)}after(t,r,n){return this.beforeOrAfter(t,r,n,"after")}beforeOrAfter(t,r,n,o){let i=this._events[t]??[],s,c;const f=o==="after"?1:0;if(typeof n!="function")throw new TypeError("listener must be a function");if(typeof r!="function")throw new TypeError("target must be a function");for(Array.isArray(i)||(this._events[t]=i=[i]),c=i.length,s=i.length;s--;)if(i[s]===r){c=s+f;break}return i.splice(c,0,n),this}on(t,r){return super.on(t,r)}addListener(t,r){return super.addListener(t,r)}prependListener(t,r){return super.prependListener(t,r)}prependOnceListener(t,r){return super.prependOnceListener(t,r)}removeAllListeners(t){return super.removeAllListeners(t)}removeListener(t,r){return super.removeListener(t,r)}eventNames(){return super.eventNames()}listeners(t){return super.listeners(t)}listenerCount(t){return super.listenerCount(t)}getMaxListeners(){return super.getMaxListeners()}setMaxListeners(t){return super.setMaxListeners(t)}}eo.AsyncEventEmitter=ov;var to={};Object.defineProperty(to,"__esModule",{value:!0});to.Lock=void 0;class sv{constructor(){this.permits=1,this.promiseResolverQueue=[]}async acquire(){return this.permits>0?(this.permits-=1,Promise.resolve(!0)):new Promise(t=>this.promiseResolverQueue.push(t))}release(){if(this.permits+=1,this.permits>1&&this.promiseResolverQueue.length>0)console.warn("Lock.permits should never be > 0 when there is someone waiting.");else if(this.permits===1&&this.promiseResolverQueue.length>0){this.permits-=1;const t=this.promiseResolverQueue.shift();t&&t(!0)}}}to.Lock=sv;var nn={},$r={},Go={},Zo={},Ko,_l;function av(){if(_l)return Ko;_l=1;function e(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}return Ko=e,Ko}var Ht={},Jo={},bl;function ro(){return bl||(bl=1,function(e){var t=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function r(i,s){return Object.prototype.hasOwnProperty.call(i,s)}e.assign=function(i){for(var s=Array.prototype.slice.call(arguments,1);s.length;){var c=s.shift();if(c){if(typeof c!="object")throw new TypeError(c+"must be non-object");for(var f in c)r(c,f)&&(i[f]=c[f])}}return i},e.shrinkBuf=function(i,s){return i.length===s?i:i.subarray?i.subarray(0,s):(i.length=s,i)};var n={arraySet:function(i,s,c,f,l){if(s.subarray&&i.subarray){i.set(s.subarray(c,c+f),l);return}for(var u=0;u<f;u++)i[l+u]=s[c+u]},flattenChunks:function(i){var s,c,f,l,u,h;for(f=0,s=0,c=i.length;s<c;s++)f+=i[s].length;for(h=new Uint8Array(f),l=0,s=0,c=i.length;s<c;s++)u=i[s],h.set(u,l),l+=u.length;return h}},o={arraySet:function(i,s,c,f,l){for(var u=0;u<f;u++)i[l+u]=s[c+u]},flattenChunks:function(i){return[].concat.apply([],i)}};e.setTyped=function(i){i?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,n)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,o))},e.setTyped(t)}(Jo)),Jo}var Tr={},pl;function fv(){if(pl)return Tr;pl=1;var e=ro(),t=4,r=0,n=1,o=2;function i(E){for(var fe=E.length;--fe>=0;)E[fe]=0}var s=0,c=1,f=2,l=3,u=258,h=29,b=256,_=b+1+h,R=30,T=19,C=2*_+1,D=15,L=16,O=7,S=256,z=16,Y=17,X=18,F=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],V=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],oe=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ee=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],w=512,d=new Array((_+2)*2);i(d);var m=new Array(R*2);i(m);var $=new Array(w);i($);var M=new Array(u-l+1);i(M);var N=new Array(h);i(N);var U=new Array(R);i(U);function P(E,fe,he,we,j){this.static_tree=E,this.extra_bits=fe,this.extra_base=he,this.elems=we,this.max_length=j,this.has_stree=E&&E.length}var H,G,se;function q(E,fe){this.dyn_tree=E,this.max_code=0,this.stat_desc=fe}function ie(E){return E<256?$[E]:$[256+(E>>>7)]}function ce(E,fe){E.pending_buf[E.pending++]=fe&255,E.pending_buf[E.pending++]=fe>>>8&255}function de(E,fe,he){E.bi_valid>L-he?(E.bi_buf|=fe<<E.bi_valid&65535,ce(E,E.bi_buf),E.bi_buf=fe>>L-E.bi_valid,E.bi_valid+=he-L):(E.bi_buf|=fe<<E.bi_valid&65535,E.bi_valid+=he)}function Ee(E,fe,he){de(E,he[fe*2],he[fe*2+1])}function _e(E,fe){var he=0;do he|=E&1,E>>>=1,he<<=1;while(--fe>0);return he>>>1}function ye(E){E.bi_valid===16?(ce(E,E.bi_buf),E.bi_buf=0,E.bi_valid=0):E.bi_valid>=8&&(E.pending_buf[E.pending++]=E.bi_buf&255,E.bi_buf>>=8,E.bi_valid-=8)}function Ce(E,fe){var he=fe.dyn_tree,we=fe.max_code,j=fe.stat_desc.static_tree,re=fe.stat_desc.has_stree,g=fe.stat_desc.extra_bits,le=fe.stat_desc.extra_base,Te=fe.stat_desc.max_length,a,J,Q,y,k,Z,ve=0;for(y=0;y<=D;y++)E.bl_count[y]=0;for(he[E.heap[E.heap_max]*2+1]=0,a=E.heap_max+1;a<C;a++)J=E.heap[a],y=he[he[J*2+1]*2+1]+1,y>Te&&(y=Te,ve++),he[J*2+1]=y,!(J>we)&&(E.bl_count[y]++,k=0,J>=le&&(k=g[J-le]),Z=he[J*2],E.opt_len+=Z*(y+k),re&&(E.static_len+=Z*(j[J*2+1]+k)));if(ve!==0){do{for(y=Te-1;E.bl_count[y]===0;)y--;E.bl_count[y]--,E.bl_count[y+1]+=2,E.bl_count[Te]--,ve-=2}while(ve>0);for(y=Te;y!==0;y--)for(J=E.bl_count[y];J!==0;)Q=E.heap[--a],!(Q>we)&&(he[Q*2+1]!==y&&(E.opt_len+=(y-he[Q*2+1])*he[Q*2],he[Q*2+1]=y),J--)}}function Ne(E,fe,he){var we=new Array(D+1),j=0,re,g;for(re=1;re<=D;re++)we[re]=j=j+he[re-1]<<1;for(g=0;g<=fe;g++){var le=E[g*2+1];le!==0&&(E[g*2]=_e(we[le]++,le))}}function Re(){var E,fe,he,we,j,re=new Array(D+1);for(he=0,we=0;we<h-1;we++)for(N[we]=he,E=0;E<1<<F[we];E++)M[he++]=we;for(M[he-1]=we,j=0,we=0;we<16;we++)for(U[we]=j,E=0;E<1<<V[we];E++)$[j++]=we;for(j>>=7;we<R;we++)for(U[we]=j<<7,E=0;E<1<<V[we]-7;E++)$[256+j++]=we;for(fe=0;fe<=D;fe++)re[fe]=0;for(E=0;E<=143;)d[E*2+1]=8,E++,re[8]++;for(;E<=255;)d[E*2+1]=9,E++,re[9]++;for(;E<=279;)d[E*2+1]=7,E++,re[7]++;for(;E<=287;)d[E*2+1]=8,E++,re[8]++;for(Ne(d,_+1,re),E=0;E<R;E++)m[E*2+1]=5,m[E*2]=_e(E,5);H=new P(d,F,b+1,_,D),G=new P(m,V,0,R,D),se=new P(new Array(0),oe,0,T,O)}function I(E){var fe;for(fe=0;fe<_;fe++)E.dyn_ltree[fe*2]=0;for(fe=0;fe<R;fe++)E.dyn_dtree[fe*2]=0;for(fe=0;fe<T;fe++)E.bl_tree[fe*2]=0;E.dyn_ltree[S*2]=1,E.opt_len=E.static_len=0,E.last_lit=E.matches=0}function B(E){E.bi_valid>8?ce(E,E.bi_buf):E.bi_valid>0&&(E.pending_buf[E.pending++]=E.bi_buf),E.bi_buf=0,E.bi_valid=0}function K(E,fe,he,we){B(E),ce(E,he),ce(E,~he),e.arraySet(E.pending_buf,E.window,fe,he,E.pending),E.pending+=he}function ue(E,fe,he,we){var j=fe*2,re=he*2;return E[j]<E[re]||E[j]===E[re]&&we[fe]<=we[he]}function ae(E,fe,he){for(var we=E.heap[he],j=he<<1;j<=E.heap_len&&(j<E.heap_len&&ue(fe,E.heap[j+1],E.heap[j],E.depth)&&j++,!ue(fe,we,E.heap[j],E.depth));)E.heap[he]=E.heap[j],he=j,j<<=1;E.heap[he]=we}function be(E,fe,he){var we,j,re=0,g,le;if(E.last_lit!==0)do we=E.pending_buf[E.d_buf+re*2]<<8|E.pending_buf[E.d_buf+re*2+1],j=E.pending_buf[E.l_buf+re],re++,we===0?Ee(E,j,fe):(g=M[j],Ee(E,g+b+1,fe),le=F[g],le!==0&&(j-=N[g],de(E,j,le)),we--,g=ie(we),Ee(E,g,he),le=V[g],le!==0&&(we-=U[g],de(E,we,le)));while(re<E.last_lit);Ee(E,S,fe)}function Ae(E,fe){var he=fe.dyn_tree,we=fe.stat_desc.static_tree,j=fe.stat_desc.has_stree,re=fe.stat_desc.elems,g,le,Te=-1,a;for(E.heap_len=0,E.heap_max=C,g=0;g<re;g++)he[g*2]!==0?(E.heap[++E.heap_len]=Te=g,E.depth[g]=0):he[g*2+1]=0;for(;E.heap_len<2;)a=E.heap[++E.heap_len]=Te<2?++Te:0,he[a*2]=1,E.depth[a]=0,E.opt_len--,j&&(E.static_len-=we[a*2+1]);for(fe.max_code=Te,g=E.heap_len>>1;g>=1;g--)ae(E,he,g);a=re;do g=E.heap[1],E.heap[1]=E.heap[E.heap_len--],ae(E,he,1),le=E.heap[1],E.heap[--E.heap_max]=g,E.heap[--E.heap_max]=le,he[a*2]=he[g*2]+he[le*2],E.depth[a]=(E.depth[g]>=E.depth[le]?E.depth[g]:E.depth[le])+1,he[g*2+1]=he[le*2+1]=a,E.heap[1]=a++,ae(E,he,1);while(E.heap_len>=2);E.heap[--E.heap_max]=E.heap[1],Ce(E,fe),Ne(he,Te,E.bl_count)}function Ie(E,fe,he){var we,j=-1,re,g=fe[0*2+1],le=0,Te=7,a=4;for(g===0&&(Te=138,a=3),fe[(he+1)*2+1]=65535,we=0;we<=he;we++)re=g,g=fe[(we+1)*2+1],!(++le<Te&&re===g)&&(le<a?E.bl_tree[re*2]+=le:re!==0?(re!==j&&E.bl_tree[re*2]++,E.bl_tree[z*2]++):le<=10?E.bl_tree[Y*2]++:E.bl_tree[X*2]++,le=0,j=re,g===0?(Te=138,a=3):re===g?(Te=6,a=3):(Te=7,a=4))}function $e(E,fe,he){var we,j=-1,re,g=fe[0*2+1],le=0,Te=7,a=4;for(g===0&&(Te=138,a=3),we=0;we<=he;we++)if(re=g,g=fe[(we+1)*2+1],!(++le<Te&&re===g)){if(le<a)do Ee(E,re,E.bl_tree);while(--le!==0);else re!==0?(re!==j&&(Ee(E,re,E.bl_tree),le--),Ee(E,z,E.bl_tree),de(E,le-3,2)):le<=10?(Ee(E,Y,E.bl_tree),de(E,le-3,3)):(Ee(E,X,E.bl_tree),de(E,le-11,7));le=0,j=re,g===0?(Te=138,a=3):re===g?(Te=6,a=3):(Te=7,a=4)}}function me(E){var fe;for(Ie(E,E.dyn_ltree,E.l_desc.max_code),Ie(E,E.dyn_dtree,E.d_desc.max_code),Ae(E,E.bl_desc),fe=T-1;fe>=3&&E.bl_tree[ee[fe]*2+1]===0;fe--);return E.opt_len+=3*(fe+1)+5+5+4,fe}function je(E,fe,he,we){var j;for(de(E,fe-257,5),de(E,he-1,5),de(E,we-4,4),j=0;j<we;j++)de(E,E.bl_tree[ee[j]*2+1],3);$e(E,E.dyn_ltree,fe-1),$e(E,E.dyn_dtree,he-1)}function tt(E){var fe=4093624447,he;for(he=0;he<=31;he++,fe>>>=1)if(fe&1&&E.dyn_ltree[he*2]!==0)return r;if(E.dyn_ltree[9*2]!==0||E.dyn_ltree[10*2]!==0||E.dyn_ltree[13*2]!==0)return n;for(he=32;he<b;he++)if(E.dyn_ltree[he*2]!==0)return n;return r}var Ge=!1;function vt(E){Ge||(Re(),Ge=!0),E.l_desc=new q(E.dyn_ltree,H),E.d_desc=new q(E.dyn_dtree,G),E.bl_desc=new q(E.bl_tree,se),E.bi_buf=0,E.bi_valid=0,I(E)}function rt(E,fe,he,we){de(E,(s<<1)+(we?1:0),3),K(E,fe,he)}function Fe(E){de(E,c<<1,3),Ee(E,S,d),ye(E)}function nt(E,fe,he,we){var j,re,g=0;E.level>0?(E.strm.data_type===o&&(E.strm.data_type=tt(E)),Ae(E,E.l_desc),Ae(E,E.d_desc),g=me(E),j=E.opt_len+3+7>>>3,re=E.static_len+3+7>>>3,re<=j&&(j=re)):j=re=he+5,he+4<=j&&fe!==-1?rt(E,fe,he,we):E.strategy===t||re===j?(de(E,(c<<1)+(we?1:0),3),be(E,d,m)):(de(E,(f<<1)+(we?1:0),3),je(E,E.l_desc.max_code+1,E.d_desc.max_code+1,g+1),be(E,E.dyn_ltree,E.dyn_dtree)),I(E),we&&B(E)}function at(E,fe,he){return E.pending_buf[E.d_buf+E.last_lit*2]=fe>>>8&255,E.pending_buf[E.d_buf+E.last_lit*2+1]=fe&255,E.pending_buf[E.l_buf+E.last_lit]=he&255,E.last_lit++,fe===0?E.dyn_ltree[he*2]++:(E.matches++,fe--,E.dyn_ltree[(M[he]+b+1)*2]++,E.dyn_dtree[ie(fe)*2]++),E.last_lit===E.lit_bufsize-1}return Tr._tr_init=vt,Tr._tr_stored_block=rt,Tr._tr_flush_block=nt,Tr._tr_tally=at,Tr._tr_align=Fe,Tr}var Xo,yl;function Ld(){if(yl)return Xo;yl=1;function e(t,r,n,o){for(var i=t&65535|0,s=t>>>16&65535|0,c=0;n!==0;){c=n>2e3?2e3:n,n-=c;do i=i+r[o++]|0,s=s+i|0;while(--c);i%=65521,s%=65521}return i|s<<16|0}return Xo=e,Xo}var Yo,wl;function Pd(){if(wl)return Yo;wl=1;function e(){for(var n,o=[],i=0;i<256;i++){n=i;for(var s=0;s<8;s++)n=n&1?3988292384^n>>>1:n>>>1;o[i]=n}return o}var t=e();function r(n,o,i,s){var c=t,f=s+i;n^=-1;for(var l=s;l<f;l++)n=n>>>8^c[(n^o[l])&255];return n^-1}return Yo=r,Yo}var Qo,ml;function lv(){return ml||(ml=1,Qo={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}),Qo}var El;function cv(){if(El)return Ht;El=1;var e=ro(),t=fv(),r=Ld(),n=Pd(),o=lv(),i=0,s=1,c=3,f=4,l=5,u=0,h=1,b=-2,_=-3,R=-5,T=-1,C=1,D=2,L=3,O=4,S=0,z=2,Y=8,X=9,F=15,V=8,oe=29,ee=256,w=ee+1+oe,d=30,m=19,$=2*w+1,M=15,N=3,U=258,P=U+N+1,H=32,G=42,se=69,q=73,ie=91,ce=103,de=113,Ee=666,_e=1,ye=2,Ce=3,Ne=4,Re=3;function I(a,J){return a.msg=o[J],J}function B(a){return(a<<1)-(a>4?9:0)}function K(a){for(var J=a.length;--J>=0;)a[J]=0}function ue(a){var J=a.state,Q=J.pending;Q>a.avail_out&&(Q=a.avail_out),Q!==0&&(e.arraySet(a.output,J.pending_buf,J.pending_out,Q,a.next_out),a.next_out+=Q,J.pending_out+=Q,a.total_out+=Q,a.avail_out-=Q,J.pending-=Q,J.pending===0&&(J.pending_out=0))}function ae(a,J){t._tr_flush_block(a,a.block_start>=0?a.block_start:-1,a.strstart-a.block_start,J),a.block_start=a.strstart,ue(a.strm)}function be(a,J){a.pending_buf[a.pending++]=J}function Ae(a,J){a.pending_buf[a.pending++]=J>>>8&255,a.pending_buf[a.pending++]=J&255}function Ie(a,J,Q,y){var k=a.avail_in;return k>y&&(k=y),k===0?0:(a.avail_in-=k,e.arraySet(J,a.input,a.next_in,k,Q),a.state.wrap===1?a.adler=r(a.adler,J,k,Q):a.state.wrap===2&&(a.adler=n(a.adler,J,k,Q)),a.next_in+=k,a.total_in+=k,k)}function $e(a,J){var Q=a.max_chain_length,y=a.strstart,k,Z,ve=a.prev_length,p=a.nice_match,v=a.strstart>a.w_size-P?a.strstart-(a.w_size-P):0,ne=a.window,ge=a.w_mask,pe=a.prev,Oe=a.strstart+U,ke=ne[y+ve-1],it=ne[y+ve];a.prev_length>=a.good_match&&(Q>>=2),p>a.lookahead&&(p=a.lookahead);do if(k=J,!(ne[k+ve]!==it||ne[k+ve-1]!==ke||ne[k]!==ne[y]||ne[++k]!==ne[y+1])){y+=2,k++;do;while(ne[++y]===ne[++k]&&ne[++y]===ne[++k]&&ne[++y]===ne[++k]&&ne[++y]===ne[++k]&&ne[++y]===ne[++k]&&ne[++y]===ne[++k]&&ne[++y]===ne[++k]&&ne[++y]===ne[++k]&&y<Oe);if(Z=U-(Oe-y),y=Oe-U,Z>ve){if(a.match_start=J,ve=Z,Z>=p)break;ke=ne[y+ve-1],it=ne[y+ve]}}while((J=pe[J&ge])>v&&--Q!==0);return ve<=a.lookahead?ve:a.lookahead}function me(a){var J=a.w_size,Q,y,k,Z,ve;do{if(Z=a.window_size-a.lookahead-a.strstart,a.strstart>=J+(J-P)){e.arraySet(a.window,a.window,J,J,0),a.match_start-=J,a.strstart-=J,a.block_start-=J,y=a.hash_size,Q=y;do k=a.head[--Q],a.head[Q]=k>=J?k-J:0;while(--y);y=J,Q=y;do k=a.prev[--Q],a.prev[Q]=k>=J?k-J:0;while(--y);Z+=J}if(a.strm.avail_in===0)break;if(y=Ie(a.strm,a.window,a.strstart+a.lookahead,Z),a.lookahead+=y,a.lookahead+a.insert>=N)for(ve=a.strstart-a.insert,a.ins_h=a.window[ve],a.ins_h=(a.ins_h<<a.hash_shift^a.window[ve+1])&a.hash_mask;a.insert&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[ve+N-1])&a.hash_mask,a.prev[ve&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=ve,ve++,a.insert--,!(a.lookahead+a.insert<N)););}while(a.lookahead<P&&a.strm.avail_in!==0)}function je(a,J){var Q=65535;for(Q>a.pending_buf_size-5&&(Q=a.pending_buf_size-5);;){if(a.lookahead<=1){if(me(a),a.lookahead===0&&J===i)return _e;if(a.lookahead===0)break}a.strstart+=a.lookahead,a.lookahead=0;var y=a.block_start+Q;if((a.strstart===0||a.strstart>=y)&&(a.lookahead=a.strstart-y,a.strstart=y,ae(a,!1),a.strm.avail_out===0)||a.strstart-a.block_start>=a.w_size-P&&(ae(a,!1),a.strm.avail_out===0))return _e}return a.insert=0,J===f?(ae(a,!0),a.strm.avail_out===0?Ce:Ne):(a.strstart>a.block_start&&(ae(a,!1),a.strm.avail_out===0),_e)}function tt(a,J){for(var Q,y;;){if(a.lookahead<P){if(me(a),a.lookahead<P&&J===i)return _e;if(a.lookahead===0)break}if(Q=0,a.lookahead>=N&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+N-1])&a.hash_mask,Q=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart),Q!==0&&a.strstart-Q<=a.w_size-P&&(a.match_length=$e(a,Q)),a.match_length>=N)if(y=t._tr_tally(a,a.strstart-a.match_start,a.match_length-N),a.lookahead-=a.match_length,a.match_length<=a.max_lazy_match&&a.lookahead>=N){a.match_length--;do a.strstart++,a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+N-1])&a.hash_mask,Q=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart;while(--a.match_length!==0);a.strstart++}else a.strstart+=a.match_length,a.match_length=0,a.ins_h=a.window[a.strstart],a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+1])&a.hash_mask;else y=t._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++;if(y&&(ae(a,!1),a.strm.avail_out===0))return _e}return a.insert=a.strstart<N-1?a.strstart:N-1,J===f?(ae(a,!0),a.strm.avail_out===0?Ce:Ne):a.last_lit&&(ae(a,!1),a.strm.avail_out===0)?_e:ye}function Ge(a,J){for(var Q,y,k;;){if(a.lookahead<P){if(me(a),a.lookahead<P&&J===i)return _e;if(a.lookahead===0)break}if(Q=0,a.lookahead>=N&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+N-1])&a.hash_mask,Q=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart),a.prev_length=a.match_length,a.prev_match=a.match_start,a.match_length=N-1,Q!==0&&a.prev_length<a.max_lazy_match&&a.strstart-Q<=a.w_size-P&&(a.match_length=$e(a,Q),a.match_length<=5&&(a.strategy===C||a.match_length===N&&a.strstart-a.match_start>4096)&&(a.match_length=N-1)),a.prev_length>=N&&a.match_length<=a.prev_length){k=a.strstart+a.lookahead-N,y=t._tr_tally(a,a.strstart-1-a.prev_match,a.prev_length-N),a.lookahead-=a.prev_length-1,a.prev_length-=2;do++a.strstart<=k&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+N-1])&a.hash_mask,Q=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);while(--a.prev_length!==0);if(a.match_available=0,a.match_length=N-1,a.strstart++,y&&(ae(a,!1),a.strm.avail_out===0))return _e}else if(a.match_available){if(y=t._tr_tally(a,0,a.window[a.strstart-1]),y&&ae(a,!1),a.strstart++,a.lookahead--,a.strm.avail_out===0)return _e}else a.match_available=1,a.strstart++,a.lookahead--}return a.match_available&&(y=t._tr_tally(a,0,a.window[a.strstart-1]),a.match_available=0),a.insert=a.strstart<N-1?a.strstart:N-1,J===f?(ae(a,!0),a.strm.avail_out===0?Ce:Ne):a.last_lit&&(ae(a,!1),a.strm.avail_out===0)?_e:ye}function vt(a,J){for(var Q,y,k,Z,ve=a.window;;){if(a.lookahead<=U){if(me(a),a.lookahead<=U&&J===i)return _e;if(a.lookahead===0)break}if(a.match_length=0,a.lookahead>=N&&a.strstart>0&&(k=a.strstart-1,y=ve[k],y===ve[++k]&&y===ve[++k]&&y===ve[++k])){Z=a.strstart+U;do;while(y===ve[++k]&&y===ve[++k]&&y===ve[++k]&&y===ve[++k]&&y===ve[++k]&&y===ve[++k]&&y===ve[++k]&&y===ve[++k]&&k<Z);a.match_length=U-(Z-k),a.match_length>a.lookahead&&(a.match_length=a.lookahead)}if(a.match_length>=N?(Q=t._tr_tally(a,1,a.match_length-N),a.lookahead-=a.match_length,a.strstart+=a.match_length,a.match_length=0):(Q=t._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++),Q&&(ae(a,!1),a.strm.avail_out===0))return _e}return a.insert=0,J===f?(ae(a,!0),a.strm.avail_out===0?Ce:Ne):a.last_lit&&(ae(a,!1),a.strm.avail_out===0)?_e:ye}function rt(a,J){for(var Q;;){if(a.lookahead===0&&(me(a),a.lookahead===0)){if(J===i)return _e;break}if(a.match_length=0,Q=t._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++,Q&&(ae(a,!1),a.strm.avail_out===0))return _e}return a.insert=0,J===f?(ae(a,!0),a.strm.avail_out===0?Ce:Ne):a.last_lit&&(ae(a,!1),a.strm.avail_out===0)?_e:ye}function Fe(a,J,Q,y,k){this.good_length=a,this.max_lazy=J,this.nice_length=Q,this.max_chain=y,this.func=k}var nt;nt=[new Fe(0,0,0,0,je),new Fe(4,4,8,4,tt),new Fe(4,5,16,8,tt),new Fe(4,6,32,32,tt),new Fe(4,4,16,16,Ge),new Fe(8,16,32,32,Ge),new Fe(8,16,128,128,Ge),new Fe(8,32,128,256,Ge),new Fe(32,128,258,1024,Ge),new Fe(32,258,258,4096,Ge)];function at(a){a.window_size=2*a.w_size,K(a.head),a.max_lazy_match=nt[a.level].max_lazy,a.good_match=nt[a.level].good_length,a.nice_match=nt[a.level].nice_length,a.max_chain_length=nt[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=N-1,a.match_available=0,a.ins_h=0}function E(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Y,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new e.Buf16($*2),this.dyn_dtree=new e.Buf16((2*d+1)*2),this.bl_tree=new e.Buf16((2*m+1)*2),K(this.dyn_ltree),K(this.dyn_dtree),K(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new e.Buf16(M+1),this.heap=new e.Buf16(2*w+1),K(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new e.Buf16(2*w+1),K(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function fe(a){var J;return!a||!a.state?I(a,b):(a.total_in=a.total_out=0,a.data_type=z,J=a.state,J.pending=0,J.pending_out=0,J.wrap<0&&(J.wrap=-J.wrap),J.status=J.wrap?G:de,a.adler=J.wrap===2?0:1,J.last_flush=i,t._tr_init(J),u)}function he(a){var J=fe(a);return J===u&&at(a.state),J}function we(a,J){return!a||!a.state||a.state.wrap!==2?b:(a.state.gzhead=J,u)}function j(a,J,Q,y,k,Z){if(!a)return b;var ve=1;if(J===T&&(J=6),y<0?(ve=0,y=-y):y>15&&(ve=2,y-=16),k<1||k>X||Q!==Y||y<8||y>15||J<0||J>9||Z<0||Z>O)return I(a,b);y===8&&(y=9);var p=new E;return a.state=p,p.strm=a,p.wrap=ve,p.gzhead=null,p.w_bits=y,p.w_size=1<<p.w_bits,p.w_mask=p.w_size-1,p.hash_bits=k+7,p.hash_size=1<<p.hash_bits,p.hash_mask=p.hash_size-1,p.hash_shift=~~((p.hash_bits+N-1)/N),p.window=new e.Buf8(p.w_size*2),p.head=new e.Buf16(p.hash_size),p.prev=new e.Buf16(p.w_size),p.lit_bufsize=1<<k+6,p.pending_buf_size=p.lit_bufsize*4,p.pending_buf=new e.Buf8(p.pending_buf_size),p.d_buf=1*p.lit_bufsize,p.l_buf=3*p.lit_bufsize,p.level=J,p.strategy=Z,p.method=Q,he(a)}function re(a,J){return j(a,J,Y,F,V,S)}function g(a,J){var Q,y,k,Z;if(!a||!a.state||J>l||J<0)return a?I(a,b):b;if(y=a.state,!a.output||!a.input&&a.avail_in!==0||y.status===Ee&&J!==f)return I(a,a.avail_out===0?R:b);if(y.strm=a,Q=y.last_flush,y.last_flush=J,y.status===G)if(y.wrap===2)a.adler=0,be(y,31),be(y,139),be(y,8),y.gzhead?(be(y,(y.gzhead.text?1:0)+(y.gzhead.hcrc?2:0)+(y.gzhead.extra?4:0)+(y.gzhead.name?8:0)+(y.gzhead.comment?16:0)),be(y,y.gzhead.time&255),be(y,y.gzhead.time>>8&255),be(y,y.gzhead.time>>16&255),be(y,y.gzhead.time>>24&255),be(y,y.level===9?2:y.strategy>=D||y.level<2?4:0),be(y,y.gzhead.os&255),y.gzhead.extra&&y.gzhead.extra.length&&(be(y,y.gzhead.extra.length&255),be(y,y.gzhead.extra.length>>8&255)),y.gzhead.hcrc&&(a.adler=n(a.adler,y.pending_buf,y.pending,0)),y.gzindex=0,y.status=se):(be(y,0),be(y,0),be(y,0),be(y,0),be(y,0),be(y,y.level===9?2:y.strategy>=D||y.level<2?4:0),be(y,Re),y.status=de);else{var ve=Y+(y.w_bits-8<<4)<<8,p=-1;y.strategy>=D||y.level<2?p=0:y.level<6?p=1:y.level===6?p=2:p=3,ve|=p<<6,y.strstart!==0&&(ve|=H),ve+=31-ve%31,y.status=de,Ae(y,ve),y.strstart!==0&&(Ae(y,a.adler>>>16),Ae(y,a.adler&65535)),a.adler=1}if(y.status===se)if(y.gzhead.extra){for(k=y.pending;y.gzindex<(y.gzhead.extra.length&65535)&&!(y.pending===y.pending_buf_size&&(y.gzhead.hcrc&&y.pending>k&&(a.adler=n(a.adler,y.pending_buf,y.pending-k,k)),ue(a),k=y.pending,y.pending===y.pending_buf_size));)be(y,y.gzhead.extra[y.gzindex]&255),y.gzindex++;y.gzhead.hcrc&&y.pending>k&&(a.adler=n(a.adler,y.pending_buf,y.pending-k,k)),y.gzindex===y.gzhead.extra.length&&(y.gzindex=0,y.status=q)}else y.status=q;if(y.status===q)if(y.gzhead.name){k=y.pending;do{if(y.pending===y.pending_buf_size&&(y.gzhead.hcrc&&y.pending>k&&(a.adler=n(a.adler,y.pending_buf,y.pending-k,k)),ue(a),k=y.pending,y.pending===y.pending_buf_size)){Z=1;break}y.gzindex<y.gzhead.name.length?Z=y.gzhead.name.charCodeAt(y.gzindex++)&255:Z=0,be(y,Z)}while(Z!==0);y.gzhead.hcrc&&y.pending>k&&(a.adler=n(a.adler,y.pending_buf,y.pending-k,k)),Z===0&&(y.gzindex=0,y.status=ie)}else y.status=ie;if(y.status===ie)if(y.gzhead.comment){k=y.pending;do{if(y.pending===y.pending_buf_size&&(y.gzhead.hcrc&&y.pending>k&&(a.adler=n(a.adler,y.pending_buf,y.pending-k,k)),ue(a),k=y.pending,y.pending===y.pending_buf_size)){Z=1;break}y.gzindex<y.gzhead.comment.length?Z=y.gzhead.comment.charCodeAt(y.gzindex++)&255:Z=0,be(y,Z)}while(Z!==0);y.gzhead.hcrc&&y.pending>k&&(a.adler=n(a.adler,y.pending_buf,y.pending-k,k)),Z===0&&(y.status=ce)}else y.status=ce;if(y.status===ce&&(y.gzhead.hcrc?(y.pending+2>y.pending_buf_size&&ue(a),y.pending+2<=y.pending_buf_size&&(be(y,a.adler&255),be(y,a.adler>>8&255),a.adler=0,y.status=de)):y.status=de),y.pending!==0){if(ue(a),a.avail_out===0)return y.last_flush=-1,u}else if(a.avail_in===0&&B(J)<=B(Q)&&J!==f)return I(a,R);if(y.status===Ee&&a.avail_in!==0)return I(a,R);if(a.avail_in!==0||y.lookahead!==0||J!==i&&y.status!==Ee){var v=y.strategy===D?rt(y,J):y.strategy===L?vt(y,J):nt[y.level].func(y,J);if((v===Ce||v===Ne)&&(y.status=Ee),v===_e||v===Ce)return a.avail_out===0&&(y.last_flush=-1),u;if(v===ye&&(J===s?t._tr_align(y):J!==l&&(t._tr_stored_block(y,0,0,!1),J===c&&(K(y.head),y.lookahead===0&&(y.strstart=0,y.block_start=0,y.insert=0))),ue(a),a.avail_out===0))return y.last_flush=-1,u}return J!==f?u:y.wrap<=0?h:(y.wrap===2?(be(y,a.adler&255),be(y,a.adler>>8&255),be(y,a.adler>>16&255),be(y,a.adler>>24&255),be(y,a.total_in&255),be(y,a.total_in>>8&255),be(y,a.total_in>>16&255),be(y,a.total_in>>24&255)):(Ae(y,a.adler>>>16),Ae(y,a.adler&65535)),ue(a),y.wrap>0&&(y.wrap=-y.wrap),y.pending!==0?u:h)}function le(a){var J;return!a||!a.state?b:(J=a.state.status,J!==G&&J!==se&&J!==q&&J!==ie&&J!==ce&&J!==de&&J!==Ee?I(a,b):(a.state=null,J===de?I(a,_):u))}function Te(a,J){var Q=J.length,y,k,Z,ve,p,v,ne,ge;if(!a||!a.state||(y=a.state,ve=y.wrap,ve===2||ve===1&&y.status!==G||y.lookahead))return b;for(ve===1&&(a.adler=r(a.adler,J,Q,0)),y.wrap=0,Q>=y.w_size&&(ve===0&&(K(y.head),y.strstart=0,y.block_start=0,y.insert=0),ge=new e.Buf8(y.w_size),e.arraySet(ge,J,Q-y.w_size,y.w_size,0),J=ge,Q=y.w_size),p=a.avail_in,v=a.next_in,ne=a.input,a.avail_in=Q,a.next_in=0,a.input=J,me(y);y.lookahead>=N;){k=y.strstart,Z=y.lookahead-(N-1);do y.ins_h=(y.ins_h<<y.hash_shift^y.window[k+N-1])&y.hash_mask,y.prev[k&y.w_mask]=y.head[y.ins_h],y.head[y.ins_h]=k,k++;while(--Z);y.strstart=k,y.lookahead=N-1,me(y)}return y.strstart+=y.lookahead,y.block_start=y.strstart,y.insert=y.lookahead,y.lookahead=0,y.match_length=y.prev_length=N-1,y.match_available=0,a.next_in=v,a.input=ne,a.avail_in=p,y.wrap=ve,u}return Ht.deflateInit=re,Ht.deflateInit2=j,Ht.deflateReset=he,Ht.deflateResetKeep=fe,Ht.deflateSetHeader=we,Ht.deflate=g,Ht.deflateEnd=le,Ht.deflateSetDictionary=Te,Ht.deflateInfo="pako deflate (from Nodeca project)",Ht}var Bt={},es,vl;function uv(){if(vl)return es;vl=1;var e=30,t=12;return es=function(n,o){var i,s,c,f,l,u,h,b,_,R,T,C,D,L,O,S,z,Y,X,F,V,oe,ee,w,d;i=n.state,s=n.next_in,w=n.input,c=s+(n.avail_in-5),f=n.next_out,d=n.output,l=f-(o-n.avail_out),u=f+(n.avail_out-257),h=i.dmax,b=i.wsize,_=i.whave,R=i.wnext,T=i.window,C=i.hold,D=i.bits,L=i.lencode,O=i.distcode,S=(1<<i.lenbits)-1,z=(1<<i.distbits)-1;e:do{D<15&&(C+=w[s++]<<D,D+=8,C+=w[s++]<<D,D+=8),Y=L[C&S];t:for(;;){if(X=Y>>>24,C>>>=X,D-=X,X=Y>>>16&255,X===0)d[f++]=Y&65535;else if(X&16){F=Y&65535,X&=15,X&&(D<X&&(C+=w[s++]<<D,D+=8),F+=C&(1<<X)-1,C>>>=X,D-=X),D<15&&(C+=w[s++]<<D,D+=8,C+=w[s++]<<D,D+=8),Y=O[C&z];r:for(;;){if(X=Y>>>24,C>>>=X,D-=X,X=Y>>>16&255,X&16){if(V=Y&65535,X&=15,D<X&&(C+=w[s++]<<D,D+=8,D<X&&(C+=w[s++]<<D,D+=8)),V+=C&(1<<X)-1,V>h){n.msg="invalid distance too far back",i.mode=e;break e}if(C>>>=X,D-=X,X=f-l,V>X){if(X=V-X,X>_&&i.sane){n.msg="invalid distance too far back",i.mode=e;break e}if(oe=0,ee=T,R===0){if(oe+=b-X,X<F){F-=X;do d[f++]=T[oe++];while(--X);oe=f-V,ee=d}}else if(R<X){if(oe+=b+R-X,X-=R,X<F){F-=X;do d[f++]=T[oe++];while(--X);if(oe=0,R<F){X=R,F-=X;do d[f++]=T[oe++];while(--X);oe=f-V,ee=d}}}else if(oe+=R-X,X<F){F-=X;do d[f++]=T[oe++];while(--X);oe=f-V,ee=d}for(;F>2;)d[f++]=ee[oe++],d[f++]=ee[oe++],d[f++]=ee[oe++],F-=3;F&&(d[f++]=ee[oe++],F>1&&(d[f++]=ee[oe++]))}else{oe=f-V;do d[f++]=d[oe++],d[f++]=d[oe++],d[f++]=d[oe++],F-=3;while(F>2);F&&(d[f++]=d[oe++],F>1&&(d[f++]=d[oe++]))}}else if(X&64){n.msg="invalid distance code",i.mode=e;break e}else{Y=O[(Y&65535)+(C&(1<<X)-1)];continue r}break}}else if(X&64)if(X&32){i.mode=t;break e}else{n.msg="invalid literal/length code",i.mode=e;break e}else{Y=L[(Y&65535)+(C&(1<<X)-1)];continue t}break}}while(s<c&&f<u);F=D>>3,s-=F,D-=F<<3,C&=(1<<D)-1,n.next_in=s,n.next_out=f,n.avail_in=s<c?5+(c-s):5-(s-c),n.avail_out=f<u?257+(u-f):257-(f-u),i.hold=C,i.bits=D},es}var ts,Sl;function dv(){if(Sl)return ts;Sl=1;var e=ro(),t=15,r=852,n=592,o=0,i=1,s=2,c=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],f=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],u=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];return ts=function(b,_,R,T,C,D,L,O){var S=O.bits,z=0,Y=0,X=0,F=0,V=0,oe=0,ee=0,w=0,d=0,m=0,$,M,N,U,P,H=null,G=0,se,q=new e.Buf16(t+1),ie=new e.Buf16(t+1),ce=null,de=0,Ee,_e,ye;for(z=0;z<=t;z++)q[z]=0;for(Y=0;Y<T;Y++)q[_[R+Y]]++;for(V=S,F=t;F>=1&&q[F]===0;F--);if(V>F&&(V=F),F===0)return C[D++]=1<<24|64<<16|0,C[D++]=1<<24|64<<16|0,O.bits=1,0;for(X=1;X<F&&q[X]===0;X++);for(V<X&&(V=X),w=1,z=1;z<=t;z++)if(w<<=1,w-=q[z],w<0)return-1;if(w>0&&(b===o||F!==1))return-1;for(ie[1]=0,z=1;z<t;z++)ie[z+1]=ie[z]+q[z];for(Y=0;Y<T;Y++)_[R+Y]!==0&&(L[ie[_[R+Y]]++]=Y);if(b===o?(H=ce=L,se=19):b===i?(H=c,G-=257,ce=f,de-=257,se=256):(H=l,ce=u,se=-1),m=0,Y=0,z=X,P=D,oe=V,ee=0,N=-1,d=1<<V,U=d-1,b===i&&d>r||b===s&&d>n)return 1;for(;;){Ee=z-ee,L[Y]<se?(_e=0,ye=L[Y]):L[Y]>se?(_e=ce[de+L[Y]],ye=H[G+L[Y]]):(_e=96,ye=0),$=1<<z-ee,M=1<<oe,X=M;do M-=$,C[P+(m>>ee)+M]=Ee<<24|_e<<16|ye|0;while(M!==0);for($=1<<z-1;m&$;)$>>=1;if($!==0?(m&=$-1,m+=$):m=0,Y++,--q[z]===0){if(z===F)break;z=_[R+L[Y]]}if(z>V&&(m&U)!==N){for(ee===0&&(ee=V),P+=X,oe=z-ee,w=1<<oe;oe+ee<F&&(w-=q[oe+ee],!(w<=0));)oe++,w<<=1;if(d+=1<<oe,b===i&&d>r||b===s&&d>n)return 1;N=m&U,C[N]=V<<24|oe<<16|P-D|0}}return m!==0&&(C[P+m]=z-ee<<24|64<<16|0),O.bits=V,0},ts}var Rl;function hv(){if(Rl)return Bt;Rl=1;var e=ro(),t=Ld(),r=Pd(),n=uv(),o=dv(),i=0,s=1,c=2,f=4,l=5,u=6,h=0,b=1,_=2,R=-2,T=-3,C=-4,D=-5,L=8,O=1,S=2,z=3,Y=4,X=5,F=6,V=7,oe=8,ee=9,w=10,d=11,m=12,$=13,M=14,N=15,U=16,P=17,H=18,G=19,se=20,q=21,ie=22,ce=23,de=24,Ee=25,_e=26,ye=27,Ce=28,Ne=29,Re=30,I=31,B=32,K=852,ue=592,ae=15,be=ae;function Ae(j){return(j>>>24&255)+(j>>>8&65280)+((j&65280)<<8)+((j&255)<<24)}function Ie(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new e.Buf16(320),this.work=new e.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function $e(j){var re;return!j||!j.state?R:(re=j.state,j.total_in=j.total_out=re.total=0,j.msg="",re.wrap&&(j.adler=re.wrap&1),re.mode=O,re.last=0,re.havedict=0,re.dmax=32768,re.head=null,re.hold=0,re.bits=0,re.lencode=re.lendyn=new e.Buf32(K),re.distcode=re.distdyn=new e.Buf32(ue),re.sane=1,re.back=-1,h)}function me(j){var re;return!j||!j.state?R:(re=j.state,re.wsize=0,re.whave=0,re.wnext=0,$e(j))}function je(j,re){var g,le;return!j||!j.state||(le=j.state,re<0?(g=0,re=-re):(g=(re>>4)+1,re<48&&(re&=15)),re&&(re<8||re>15))?R:(le.window!==null&&le.wbits!==re&&(le.window=null),le.wrap=g,le.wbits=re,me(j))}function tt(j,re){var g,le;return j?(le=new Ie,j.state=le,le.window=null,g=je(j,re),g!==h&&(j.state=null),g):R}function Ge(j){return tt(j,be)}var vt=!0,rt,Fe;function nt(j){if(vt){var re;for(rt=new e.Buf32(512),Fe=new e.Buf32(32),re=0;re<144;)j.lens[re++]=8;for(;re<256;)j.lens[re++]=9;for(;re<280;)j.lens[re++]=7;for(;re<288;)j.lens[re++]=8;for(o(s,j.lens,0,288,rt,0,j.work,{bits:9}),re=0;re<32;)j.lens[re++]=5;o(c,j.lens,0,32,Fe,0,j.work,{bits:5}),vt=!1}j.lencode=rt,j.lenbits=9,j.distcode=Fe,j.distbits=5}function at(j,re,g,le){var Te,a=j.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new e.Buf8(a.wsize)),le>=a.wsize?(e.arraySet(a.window,re,g-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(Te=a.wsize-a.wnext,Te>le&&(Te=le),e.arraySet(a.window,re,g-le,Te,a.wnext),le-=Te,le?(e.arraySet(a.window,re,g-le,le,0),a.wnext=le,a.whave=a.wsize):(a.wnext+=Te,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=Te))),0}function E(j,re){var g,le,Te,a,J,Q,y,k,Z,ve,p,v,ne,ge,pe=0,Oe,ke,it,Ue,or,gr,Ze,ut,Xe=new e.Buf8(4),st,gt,Gt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!j||!j.state||!j.output||!j.input&&j.avail_in!==0)return R;g=j.state,g.mode===m&&(g.mode=$),J=j.next_out,Te=j.output,y=j.avail_out,a=j.next_in,le=j.input,Q=j.avail_in,k=g.hold,Z=g.bits,ve=Q,p=y,ut=h;e:for(;;)switch(g.mode){case O:if(g.wrap===0){g.mode=$;break}for(;Z<16;){if(Q===0)break e;Q--,k+=le[a++]<<Z,Z+=8}if(g.wrap&2&&k===35615){g.check=0,Xe[0]=k&255,Xe[1]=k>>>8&255,g.check=r(g.check,Xe,2,0),k=0,Z=0,g.mode=S;break}if(g.flags=0,g.head&&(g.head.done=!1),!(g.wrap&1)||(((k&255)<<8)+(k>>8))%31){j.msg="incorrect header check",g.mode=Re;break}if((k&15)!==L){j.msg="unknown compression method",g.mode=Re;break}if(k>>>=4,Z-=4,Ze=(k&15)+8,g.wbits===0)g.wbits=Ze;else if(Ze>g.wbits){j.msg="invalid window size",g.mode=Re;break}g.dmax=1<<Ze,j.adler=g.check=1,g.mode=k&512?w:m,k=0,Z=0;break;case S:for(;Z<16;){if(Q===0)break e;Q--,k+=le[a++]<<Z,Z+=8}if(g.flags=k,(g.flags&255)!==L){j.msg="unknown compression method",g.mode=Re;break}if(g.flags&57344){j.msg="unknown header flags set",g.mode=Re;break}g.head&&(g.head.text=k>>8&1),g.flags&512&&(Xe[0]=k&255,Xe[1]=k>>>8&255,g.check=r(g.check,Xe,2,0)),k=0,Z=0,g.mode=z;case z:for(;Z<32;){if(Q===0)break e;Q--,k+=le[a++]<<Z,Z+=8}g.head&&(g.head.time=k),g.flags&512&&(Xe[0]=k&255,Xe[1]=k>>>8&255,Xe[2]=k>>>16&255,Xe[3]=k>>>24&255,g.check=r(g.check,Xe,4,0)),k=0,Z=0,g.mode=Y;case Y:for(;Z<16;){if(Q===0)break e;Q--,k+=le[a++]<<Z,Z+=8}g.head&&(g.head.xflags=k&255,g.head.os=k>>8),g.flags&512&&(Xe[0]=k&255,Xe[1]=k>>>8&255,g.check=r(g.check,Xe,2,0)),k=0,Z=0,g.mode=X;case X:if(g.flags&1024){for(;Z<16;){if(Q===0)break e;Q--,k+=le[a++]<<Z,Z+=8}g.length=k,g.head&&(g.head.extra_len=k),g.flags&512&&(Xe[0]=k&255,Xe[1]=k>>>8&255,g.check=r(g.check,Xe,2,0)),k=0,Z=0}else g.head&&(g.head.extra=null);g.mode=F;case F:if(g.flags&1024&&(v=g.length,v>Q&&(v=Q),v&&(g.head&&(Ze=g.head.extra_len-g.length,g.head.extra||(g.head.extra=new Array(g.head.extra_len)),e.arraySet(g.head.extra,le,a,v,Ze)),g.flags&512&&(g.check=r(g.check,le,v,a)),Q-=v,a+=v,g.length-=v),g.length))break e;g.length=0,g.mode=V;case V:if(g.flags&2048){if(Q===0)break e;v=0;do Ze=le[a+v++],g.head&&Ze&&g.length<65536&&(g.head.name+=String.fromCharCode(Ze));while(Ze&&v<Q);if(g.flags&512&&(g.check=r(g.check,le,v,a)),Q-=v,a+=v,Ze)break e}else g.head&&(g.head.name=null);g.length=0,g.mode=oe;case oe:if(g.flags&4096){if(Q===0)break e;v=0;do Ze=le[a+v++],g.head&&Ze&&g.length<65536&&(g.head.comment+=String.fromCharCode(Ze));while(Ze&&v<Q);if(g.flags&512&&(g.check=r(g.check,le,v,a)),Q-=v,a+=v,Ze)break e}else g.head&&(g.head.comment=null);g.mode=ee;case ee:if(g.flags&512){for(;Z<16;){if(Q===0)break e;Q--,k+=le[a++]<<Z,Z+=8}if(k!==(g.check&65535)){j.msg="header crc mismatch",g.mode=Re;break}k=0,Z=0}g.head&&(g.head.hcrc=g.flags>>9&1,g.head.done=!0),j.adler=g.check=0,g.mode=m;break;case w:for(;Z<32;){if(Q===0)break e;Q--,k+=le[a++]<<Z,Z+=8}j.adler=g.check=Ae(k),k=0,Z=0,g.mode=d;case d:if(g.havedict===0)return j.next_out=J,j.avail_out=y,j.next_in=a,j.avail_in=Q,g.hold=k,g.bits=Z,_;j.adler=g.check=1,g.mode=m;case m:if(re===l||re===u)break e;case $:if(g.last){k>>>=Z&7,Z-=Z&7,g.mode=ye;break}for(;Z<3;){if(Q===0)break e;Q--,k+=le[a++]<<Z,Z+=8}switch(g.last=k&1,k>>>=1,Z-=1,k&3){case 0:g.mode=M;break;case 1:if(nt(g),g.mode=se,re===u){k>>>=2,Z-=2;break e}break;case 2:g.mode=P;break;case 3:j.msg="invalid block type",g.mode=Re}k>>>=2,Z-=2;break;case M:for(k>>>=Z&7,Z-=Z&7;Z<32;){if(Q===0)break e;Q--,k+=le[a++]<<Z,Z+=8}if((k&65535)!==(k>>>16^65535)){j.msg="invalid stored block lengths",g.mode=Re;break}if(g.length=k&65535,k=0,Z=0,g.mode=N,re===u)break e;case N:g.mode=U;case U:if(v=g.length,v){if(v>Q&&(v=Q),v>y&&(v=y),v===0)break e;e.arraySet(Te,le,a,v,J),Q-=v,a+=v,y-=v,J+=v,g.length-=v;break}g.mode=m;break;case P:for(;Z<14;){if(Q===0)break e;Q--,k+=le[a++]<<Z,Z+=8}if(g.nlen=(k&31)+257,k>>>=5,Z-=5,g.ndist=(k&31)+1,k>>>=5,Z-=5,g.ncode=(k&15)+4,k>>>=4,Z-=4,g.nlen>286||g.ndist>30){j.msg="too many length or distance symbols",g.mode=Re;break}g.have=0,g.mode=H;case H:for(;g.have<g.ncode;){for(;Z<3;){if(Q===0)break e;Q--,k+=le[a++]<<Z,Z+=8}g.lens[Gt[g.have++]]=k&7,k>>>=3,Z-=3}for(;g.have<19;)g.lens[Gt[g.have++]]=0;if(g.lencode=g.lendyn,g.lenbits=7,st={bits:g.lenbits},ut=o(i,g.lens,0,19,g.lencode,0,g.work,st),g.lenbits=st.bits,ut){j.msg="invalid code lengths set",g.mode=Re;break}g.have=0,g.mode=G;case G:for(;g.have<g.nlen+g.ndist;){for(;pe=g.lencode[k&(1<<g.lenbits)-1],Oe=pe>>>24,ke=pe>>>16&255,it=pe&65535,!(Oe<=Z);){if(Q===0)break e;Q--,k+=le[a++]<<Z,Z+=8}if(it<16)k>>>=Oe,Z-=Oe,g.lens[g.have++]=it;else{if(it===16){for(gt=Oe+2;Z<gt;){if(Q===0)break e;Q--,k+=le[a++]<<Z,Z+=8}if(k>>>=Oe,Z-=Oe,g.have===0){j.msg="invalid bit length repeat",g.mode=Re;break}Ze=g.lens[g.have-1],v=3+(k&3),k>>>=2,Z-=2}else if(it===17){for(gt=Oe+3;Z<gt;){if(Q===0)break e;Q--,k+=le[a++]<<Z,Z+=8}k>>>=Oe,Z-=Oe,Ze=0,v=3+(k&7),k>>>=3,Z-=3}else{for(gt=Oe+7;Z<gt;){if(Q===0)break e;Q--,k+=le[a++]<<Z,Z+=8}k>>>=Oe,Z-=Oe,Ze=0,v=11+(k&127),k>>>=7,Z-=7}if(g.have+v>g.nlen+g.ndist){j.msg="invalid bit length repeat",g.mode=Re;break}for(;v--;)g.lens[g.have++]=Ze}}if(g.mode===Re)break;if(g.lens[256]===0){j.msg="invalid code -- missing end-of-block",g.mode=Re;break}if(g.lenbits=9,st={bits:g.lenbits},ut=o(s,g.lens,0,g.nlen,g.lencode,0,g.work,st),g.lenbits=st.bits,ut){j.msg="invalid literal/lengths set",g.mode=Re;break}if(g.distbits=6,g.distcode=g.distdyn,st={bits:g.distbits},ut=o(c,g.lens,g.nlen,g.ndist,g.distcode,0,g.work,st),g.distbits=st.bits,ut){j.msg="invalid distances set",g.mode=Re;break}if(g.mode=se,re===u)break e;case se:g.mode=q;case q:if(Q>=6&&y>=258){j.next_out=J,j.avail_out=y,j.next_in=a,j.avail_in=Q,g.hold=k,g.bits=Z,n(j,p),J=j.next_out,Te=j.output,y=j.avail_out,a=j.next_in,le=j.input,Q=j.avail_in,k=g.hold,Z=g.bits,g.mode===m&&(g.back=-1);break}for(g.back=0;pe=g.lencode[k&(1<<g.lenbits)-1],Oe=pe>>>24,ke=pe>>>16&255,it=pe&65535,!(Oe<=Z);){if(Q===0)break e;Q--,k+=le[a++]<<Z,Z+=8}if(ke&&!(ke&240)){for(Ue=Oe,or=ke,gr=it;pe=g.lencode[gr+((k&(1<<Ue+or)-1)>>Ue)],Oe=pe>>>24,ke=pe>>>16&255,it=pe&65535,!(Ue+Oe<=Z);){if(Q===0)break e;Q--,k+=le[a++]<<Z,Z+=8}k>>>=Ue,Z-=Ue,g.back+=Ue}if(k>>>=Oe,Z-=Oe,g.back+=Oe,g.length=it,ke===0){g.mode=_e;break}if(ke&32){g.back=-1,g.mode=m;break}if(ke&64){j.msg="invalid literal/length code",g.mode=Re;break}g.extra=ke&15,g.mode=ie;case ie:if(g.extra){for(gt=g.extra;Z<gt;){if(Q===0)break e;Q--,k+=le[a++]<<Z,Z+=8}g.length+=k&(1<<g.extra)-1,k>>>=g.extra,Z-=g.extra,g.back+=g.extra}g.was=g.length,g.mode=ce;case ce:for(;pe=g.distcode[k&(1<<g.distbits)-1],Oe=pe>>>24,ke=pe>>>16&255,it=pe&65535,!(Oe<=Z);){if(Q===0)break e;Q--,k+=le[a++]<<Z,Z+=8}if(!(ke&240)){for(Ue=Oe,or=ke,gr=it;pe=g.distcode[gr+((k&(1<<Ue+or)-1)>>Ue)],Oe=pe>>>24,ke=pe>>>16&255,it=pe&65535,!(Ue+Oe<=Z);){if(Q===0)break e;Q--,k+=le[a++]<<Z,Z+=8}k>>>=Ue,Z-=Ue,g.back+=Ue}if(k>>>=Oe,Z-=Oe,g.back+=Oe,ke&64){j.msg="invalid distance code",g.mode=Re;break}g.offset=it,g.extra=ke&15,g.mode=de;case de:if(g.extra){for(gt=g.extra;Z<gt;){if(Q===0)break e;Q--,k+=le[a++]<<Z,Z+=8}g.offset+=k&(1<<g.extra)-1,k>>>=g.extra,Z-=g.extra,g.back+=g.extra}if(g.offset>g.dmax){j.msg="invalid distance too far back",g.mode=Re;break}g.mode=Ee;case Ee:if(y===0)break e;if(v=p-y,g.offset>v){if(v=g.offset-v,v>g.whave&&g.sane){j.msg="invalid distance too far back",g.mode=Re;break}v>g.wnext?(v-=g.wnext,ne=g.wsize-v):ne=g.wnext-v,v>g.length&&(v=g.length),ge=g.window}else ge=Te,ne=J-g.offset,v=g.length;v>y&&(v=y),y-=v,g.length-=v;do Te[J++]=ge[ne++];while(--v);g.length===0&&(g.mode=q);break;case _e:if(y===0)break e;Te[J++]=g.length,y--,g.mode=q;break;case ye:if(g.wrap){for(;Z<32;){if(Q===0)break e;Q--,k|=le[a++]<<Z,Z+=8}if(p-=y,j.total_out+=p,g.total+=p,p&&(j.adler=g.check=g.flags?r(g.check,Te,p,J-p):t(g.check,Te,p,J-p)),p=y,(g.flags?k:Ae(k))!==g.check){j.msg="incorrect data check",g.mode=Re;break}k=0,Z=0}g.mode=Ce;case Ce:if(g.wrap&&g.flags){for(;Z<32;){if(Q===0)break e;Q--,k+=le[a++]<<Z,Z+=8}if(k!==(g.total&4294967295)){j.msg="incorrect length check",g.mode=Re;break}k=0,Z=0}g.mode=Ne;case Ne:ut=b;break e;case Re:ut=T;break e;case I:return C;case B:default:return R}return j.next_out=J,j.avail_out=y,j.next_in=a,j.avail_in=Q,g.hold=k,g.bits=Z,(g.wsize||p!==j.avail_out&&g.mode<Re&&(g.mode<ye||re!==f))&&at(j,j.output,j.next_out,p-j.avail_out),ve-=j.avail_in,p-=j.avail_out,j.total_in+=ve,j.total_out+=p,g.total+=p,g.wrap&&p&&(j.adler=g.check=g.flags?r(g.check,Te,p,j.next_out-p):t(g.check,Te,p,j.next_out-p)),j.data_type=g.bits+(g.last?64:0)+(g.mode===m?128:0)+(g.mode===se||g.mode===N?256:0),(ve===0&&p===0||re===f)&&ut===h&&(ut=D),ut}function fe(j){if(!j||!j.state)return R;var re=j.state;return re.window&&(re.window=null),j.state=null,h}function he(j,re){var g;return!j||!j.state||(g=j.state,!(g.wrap&2))?R:(g.head=re,re.done=!1,h)}function we(j,re){var g=re.length,le,Te,a;return!j||!j.state||(le=j.state,le.wrap!==0&&le.mode!==d)?R:le.mode===d&&(Te=1,Te=t(Te,re,g,0),Te!==le.check)?T:(a=at(j,re,g,g),a?(le.mode=I,C):(le.havedict=1,h))}return Bt.inflateReset=me,Bt.inflateReset2=je,Bt.inflateResetKeep=$e,Bt.inflateInit=Ge,Bt.inflateInit2=tt,Bt.inflate=E,Bt.inflateEnd=fe,Bt.inflateGetHeader=he,Bt.inflateSetDictionary=we,Bt.inflateInfo="pako inflate (from Nodeca project)",Bt}var rs,Al;function gv(){return Al||(Al=1,rs={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}),rs}var Il;function _v(){return Il||(Il=1,function(e){var t=x.requireAssert(),r=av(),n=cv(),o=hv(),i=gv();for(var s in i)e[s]=i[s];e.NONE=0,e.DEFLATE=1,e.INFLATE=2,e.GZIP=3,e.GUNZIP=4,e.DEFLATERAW=5,e.INFLATERAW=6,e.UNZIP=7;var c=31,f=139;function l(u){if(typeof u!="number"||u<e.DEFLATE||u>e.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=u,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}l.prototype.close=function(){if(this.write_in_progress){this.pending_close=!0;return}this.pending_close=!1,t(this.init_done,"close before init"),t(this.mode<=e.UNZIP),this.mode===e.DEFLATE||this.mode===e.GZIP||this.mode===e.DEFLATERAW?n.deflateEnd(this.strm):(this.mode===e.INFLATE||this.mode===e.GUNZIP||this.mode===e.INFLATERAW||this.mode===e.UNZIP)&&o.inflateEnd(this.strm),this.mode=e.NONE,this.dictionary=null},l.prototype.write=function(u,h,b,_,R,T,C){return this._write(!0,u,h,b,_,R,T,C)},l.prototype.writeSync=function(u,h,b,_,R,T,C){return this._write(!1,u,h,b,_,R,T,C)},l.prototype._write=function(u,h,b,_,R,T,C,D){if(t.equal(arguments.length,8),t(this.init_done,"write before init"),t(this.mode!==e.NONE,"already finalized"),t.equal(!1,this.write_in_progress,"write already in progress"),t.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,t.equal(!1,h===void 0,"must provide flush value"),this.write_in_progress=!0,h!==e.Z_NO_FLUSH&&h!==e.Z_PARTIAL_FLUSH&&h!==e.Z_SYNC_FLUSH&&h!==e.Z_FULL_FLUSH&&h!==e.Z_FINISH&&h!==e.Z_BLOCK)throw new Error("Invalid flush value");if(b==null&&(b=x.dist.Buffer.alloc(0),R=0,_=0),this.strm.avail_in=R,this.strm.input=b,this.strm.next_in=_,this.strm.avail_out=D,this.strm.output=T,this.strm.next_out=C,this.flush=h,!u)return this._process(),this._checkError()?this._afterSync():void 0;var L=this;return x.dist.process.nextTick(function(){L._process(),L._after()}),this},l.prototype._afterSync=function(){var u=this.strm.avail_out,h=this.strm.avail_in;return this.write_in_progress=!1,[h,u]},l.prototype._process=function(){var u=null;switch(this.mode){case e.DEFLATE:case e.GZIP:case e.DEFLATERAW:this.err=n.deflate(this.strm,this.flush);break;case e.UNZIP:switch(this.strm.avail_in>0&&(u=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(u===null)break;if(this.strm.input[u]===c){if(this.gzip_id_bytes_read=1,u++,this.strm.avail_in===1)break}else{this.mode=e.INFLATE;break}case 1:if(u===null)break;this.strm.input[u]===f?(this.gzip_id_bytes_read=2,this.mode=e.GUNZIP):this.mode=e.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case e.INFLATE:case e.GUNZIP:case e.INFLATERAW:for(this.err=o.inflate(this.strm,this.flush),this.err===e.Z_NEED_DICT&&this.dictionary&&(this.err=o.inflateSetDictionary(this.strm,this.dictionary),this.err===e.Z_OK?this.err=o.inflate(this.strm,this.flush):this.err===e.Z_DATA_ERROR&&(this.err=e.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===e.GUNZIP&&this.err===e.Z_STREAM_END&&this.strm.next_in[0]!==0;)this.reset(),this.err=o.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},l.prototype._checkError=function(){switch(this.err){case e.Z_OK:case e.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===e.Z_FINISH)return this._error("unexpected end of file"),!1;break;case e.Z_STREAM_END:break;case e.Z_NEED_DICT:return this.dictionary==null?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},l.prototype._after=function(){if(this._checkError()){var u=this.strm.avail_out,h=this.strm.avail_in;this.write_in_progress=!1,this.callback(h,u),this.pending_close&&this.close()}},l.prototype._error=function(u){this.strm.msg&&(u=this.strm.msg),this.onerror(u,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},l.prototype.init=function(u,h,b,_,R){t(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])"),t(u>=8&&u<=15,"invalid windowBits"),t(h>=-1&&h<=9,"invalid compression level"),t(b>=1&&b<=9,"invalid memlevel"),t(_===e.Z_FILTERED||_===e.Z_HUFFMAN_ONLY||_===e.Z_RLE||_===e.Z_FIXED||_===e.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(h,u,b,_,R),this._setDictionary()},l.prototype.params=function(){throw new Error("deflateParams Not supported")},l.prototype.reset=function(){this._reset(),this._setDictionary()},l.prototype._init=function(u,h,b,_,R){switch(this.level=u,this.windowBits=h,this.memLevel=b,this.strategy=_,this.flush=e.Z_NO_FLUSH,this.err=e.Z_OK,(this.mode===e.GZIP||this.mode===e.GUNZIP)&&(this.windowBits+=16),this.mode===e.UNZIP&&(this.windowBits+=32),(this.mode===e.DEFLATERAW||this.mode===e.INFLATERAW)&&(this.windowBits=-1*this.windowBits),this.strm=new r,this.mode){case e.DEFLATE:case e.GZIP:case e.DEFLATERAW:this.err=n.deflateInit2(this.strm,this.level,e.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case e.INFLATE:case e.GUNZIP:case e.INFLATERAW:case e.UNZIP:this.err=o.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==e.Z_OK&&this._error("Init error"),this.dictionary=R,this.write_in_progress=!1,this.init_done=!0},l.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=e.Z_OK,this.mode){case e.DEFLATE:case e.DEFLATERAW:this.err=n.deflateSetDictionary(this.strm,this.dictionary);break}this.err!==e.Z_OK&&this._error("Failed to set dictionary")}},l.prototype._reset=function(){switch(this.err=e.Z_OK,this.mode){case e.DEFLATE:case e.DEFLATERAW:case e.GZIP:this.err=n.deflateReset(this.strm);break;case e.INFLATE:case e.INFLATERAW:case e.GUNZIP:this.err=o.inflateReset(this.strm);break}this.err!==e.Z_OK&&this._error("Failed to reset stream")},e.Zlib=l}(Zo)),Zo}var Tl;function bv(){return Tl||(Tl=1,function(e){var t=x.bufferPolyfill.Buffer,r=x.requireStreamBrowserify().Transform,n=_v(),o=x.util,i=x.requireAssert().ok,s=x.bufferPolyfill.kMaxLength,c="Cannot create final Buffer. It would be larger than 0x"+s.toString(16)+" bytes";n.Z_MIN_WINDOWBITS=8,n.Z_MAX_WINDOWBITS=15,n.Z_DEFAULT_WINDOWBITS=15,n.Z_MIN_CHUNK=64,n.Z_MAX_CHUNK=1/0,n.Z_DEFAULT_CHUNK=16*1024,n.Z_MIN_MEMLEVEL=1,n.Z_MAX_MEMLEVEL=9,n.Z_DEFAULT_MEMLEVEL=8,n.Z_MIN_LEVEL=-1,n.Z_MAX_LEVEL=9,n.Z_DEFAULT_LEVEL=n.Z_DEFAULT_COMPRESSION;for(var f=Object.keys(n),l=0;l<f.length;l++){var u=f[l];u.match(/^Z/)&&Object.defineProperty(e,u,{enumerable:!0,value:n[u],writable:!1})}for(var h={Z_OK:n.Z_OK,Z_STREAM_END:n.Z_STREAM_END,Z_NEED_DICT:n.Z_NEED_DICT,Z_ERRNO:n.Z_ERRNO,Z_STREAM_ERROR:n.Z_STREAM_ERROR,Z_DATA_ERROR:n.Z_DATA_ERROR,Z_MEM_ERROR:n.Z_MEM_ERROR,Z_BUF_ERROR:n.Z_BUF_ERROR,Z_VERSION_ERROR:n.Z_VERSION_ERROR},b=Object.keys(h),_=0;_<b.length;_++){var R=b[_];h[h[R]]=R}Object.defineProperty(e,"codes",{enumerable:!0,value:Object.freeze(h),writable:!1}),e.Deflate=D,e.Inflate=L,e.Gzip=O,e.Gunzip=S,e.DeflateRaw=z,e.InflateRaw=Y,e.Unzip=X,e.createDeflate=function(w){return new D(w)},e.createInflate=function(w){return new L(w)},e.createDeflateRaw=function(w){return new z(w)},e.createInflateRaw=function(w){return new Y(w)},e.createGzip=function(w){return new O(w)},e.createGunzip=function(w){return new S(w)},e.createUnzip=function(w){return new X(w)},e.deflate=function(w,d,m){return typeof d=="function"&&(m=d,d={}),T(new D(d),w,m)},e.deflateSync=function(w,d){return C(new D(d),w)},e.gzip=function(w,d,m){return typeof d=="function"&&(m=d,d={}),T(new O(d),w,m)},e.gzipSync=function(w,d){return C(new O(d),w)},e.deflateRaw=function(w,d,m){return typeof d=="function"&&(m=d,d={}),T(new z(d),w,m)},e.deflateRawSync=function(w,d){return C(new z(d),w)},e.unzip=function(w,d,m){return typeof d=="function"&&(m=d,d={}),T(new X(d),w,m)},e.unzipSync=function(w,d){return C(new X(d),w)},e.inflate=function(w,d,m){return typeof d=="function"&&(m=d,d={}),T(new L(d),w,m)},e.inflateSync=function(w,d){return C(new L(d),w)},e.gunzip=function(w,d,m){return typeof d=="function"&&(m=d,d={}),T(new S(d),w,m)},e.gunzipSync=function(w,d){return C(new S(d),w)},e.inflateRaw=function(w,d,m){return typeof d=="function"&&(m=d,d={}),T(new Y(d),w,m)},e.inflateRawSync=function(w,d){return C(new Y(d),w)};function T(w,d,m){var $=[],M=0;w.on("error",U),w.on("end",P),w.end(d),N();function N(){for(var H;(H=w.read())!==null;)$.push(H),M+=H.length;w.once("readable",N)}function U(H){w.removeListener("end",P),w.removeListener("readable",N),m(H)}function P(){var H,G=null;M>=s?G=new RangeError(c):H=t.concat($,M),$=[],w.close(),m(G,H)}}function C(w,d){if(typeof d=="string"&&(d=t.from(d)),!t.isBuffer(d))throw new TypeError("Not a string or buffer");var m=w._finishFlushFlag;return w._processChunk(d,m)}function D(w){if(!(this instanceof D))return new D(w);V.call(this,w,n.DEFLATE)}function L(w){if(!(this instanceof L))return new L(w);V.call(this,w,n.INFLATE)}function O(w){if(!(this instanceof O))return new O(w);V.call(this,w,n.GZIP)}function S(w){if(!(this instanceof S))return new S(w);V.call(this,w,n.GUNZIP)}function z(w){if(!(this instanceof z))return new z(w);V.call(this,w,n.DEFLATERAW)}function Y(w){if(!(this instanceof Y))return new Y(w);V.call(this,w,n.INFLATERAW)}function X(w){if(!(this instanceof X))return new X(w);V.call(this,w,n.UNZIP)}function F(w){return w===n.Z_NO_FLUSH||w===n.Z_PARTIAL_FLUSH||w===n.Z_SYNC_FLUSH||w===n.Z_FULL_FLUSH||w===n.Z_FINISH||w===n.Z_BLOCK}function V(w,d){var m=this;if(this._opts=w=w||{},this._chunkSize=w.chunkSize||e.Z_DEFAULT_CHUNK,r.call(this,w),w.flush&&!F(w.flush))throw new Error("Invalid flush flag: "+w.flush);if(w.finishFlush&&!F(w.finishFlush))throw new Error("Invalid flush flag: "+w.finishFlush);if(this._flushFlag=w.flush||n.Z_NO_FLUSH,this._finishFlushFlag=typeof w.finishFlush<"u"?w.finishFlush:n.Z_FINISH,w.chunkSize&&(w.chunkSize<e.Z_MIN_CHUNK||w.chunkSize>e.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+w.chunkSize);if(w.windowBits&&(w.windowBits<e.Z_MIN_WINDOWBITS||w.windowBits>e.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+w.windowBits);if(w.level&&(w.level<e.Z_MIN_LEVEL||w.level>e.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+w.level);if(w.memLevel&&(w.memLevel<e.Z_MIN_MEMLEVEL||w.memLevel>e.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+w.memLevel);if(w.strategy&&w.strategy!=e.Z_FILTERED&&w.strategy!=e.Z_HUFFMAN_ONLY&&w.strategy!=e.Z_RLE&&w.strategy!=e.Z_FIXED&&w.strategy!=e.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+w.strategy);if(w.dictionary&&!t.isBuffer(w.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new n.Zlib(d);var $=this;this._hadError=!1,this._handle.onerror=function(U,P){oe($),$._hadError=!0;var H=new Error(U);H.errno=P,H.code=e.codes[P],$.emit("error",H)};var M=e.Z_DEFAULT_COMPRESSION;typeof w.level=="number"&&(M=w.level);var N=e.Z_DEFAULT_STRATEGY;typeof w.strategy=="number"&&(N=w.strategy),this._handle.init(w.windowBits||e.Z_DEFAULT_WINDOWBITS,M,w.memLevel||e.Z_DEFAULT_MEMLEVEL,N,w.dictionary),this._buffer=t.allocUnsafe(this._chunkSize),this._offset=0,this._level=M,this._strategy=N,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!m._handle},configurable:!0,enumerable:!0})}o.inherits(V,r),V.prototype.params=function(w,d,m){if(w<e.Z_MIN_LEVEL||w>e.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+w);if(d!=e.Z_FILTERED&&d!=e.Z_HUFFMAN_ONLY&&d!=e.Z_RLE&&d!=e.Z_FIXED&&d!=e.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+d);if(this._level!==w||this._strategy!==d){var $=this;this.flush(n.Z_SYNC_FLUSH,function(){i($._handle,"zlib binding closed"),$._handle.params(w,d),$._hadError||($._level=w,$._strategy=d,m&&m())})}else x.dist.process.nextTick(m)},V.prototype.reset=function(){return i(this._handle,"zlib binding closed"),this._handle.reset()},V.prototype._flush=function(w){this._transform(t.alloc(0),"",w)},V.prototype.flush=function(w,d){var m=this,$=this._writableState;(typeof w=="function"||w===void 0&&!d)&&(d=w,w=n.Z_FULL_FLUSH),$.ended?d&&x.dist.process.nextTick(d):$.ending?d&&this.once("end",d):$.needDrain?d&&this.once("drain",function(){return m.flush(w,d)}):(this._flushFlag=w,this.write(t.alloc(0),"",d))},V.prototype.close=function(w){oe(this,w),x.dist.process.nextTick(ee,this)};function oe(w,d){d&&x.dist.process.nextTick(d),w._handle&&(w._handle.close(),w._handle=null)}function ee(w){w.emit("close")}V.prototype._transform=function(w,d,m){var $,M=this._writableState,N=M.ending||M.ended,U=N&&(!w||M.length===w.length);if(w!==null&&!t.isBuffer(w))return m(new Error("invalid input"));if(!this._handle)return m(new Error("zlib binding closed"));U?$=this._finishFlushFlag:($=this._flushFlag,w.length>=M.length&&(this._flushFlag=this._opts.flush||n.Z_NO_FLUSH)),this._processChunk(w,$,m)},V.prototype._processChunk=function(w,d,m){var $=w&&w.length,M=this._chunkSize-this._offset,N=0,U=this,P=typeof m=="function";if(!P){var H=[],G=0,se;this.on("error",function(Ee){se=Ee}),i(this._handle,"zlib binding closed");do var q=this._handle.writeSync(d,w,N,$,this._buffer,this._offset,M);while(!this._hadError&&de(q[0],q[1]));if(this._hadError)throw se;if(G>=s)throw oe(this),new RangeError(c);var ie=t.concat(H,G);return oe(this),ie}i(this._handle,"zlib binding closed");var ce=this._handle.write(d,w,N,$,this._buffer,this._offset,M);ce.buffer=w,ce.callback=de;function de(Ee,_e){if(this&&(this.buffer=null,this.callback=null),!U._hadError){var ye=M-_e;if(i(ye>=0,"have should not go down"),ye>0){var Ce=U._buffer.slice(U._offset,U._offset+ye);U._offset+=ye,P?U.push(Ce):(H.push(Ce),G+=Ce.length)}if((_e===0||U._offset>=U._chunkSize)&&(M=U._chunkSize,U._offset=0,U._buffer=t.allocUnsafe(U._chunkSize)),_e===0){if(N+=$-Ee,$=Ee,!P)return!0;var Ne=U._handle.write(d,w,N,$,U._buffer,U._offset,U._chunkSize);Ne.callback=de,Ne.buffer=w;return}if(!P)return!1;m()}}},o.inherits(D,V),o.inherits(L,V),o.inherits(O,V),o.inherits(S,V),o.inherits(z,V),o.inherits(Y,V),o.inherits(X,V)}(Go)),Go}Object.defineProperty($r,"__esModule",{value:!0});$r.InvalidStatusCodeError=$r.InvalidCertError=void 0;const Cd=Object.freeze({redirect:!0,expectStatusCode:200,headers:{},full:!1,keepAlive:!0,cors:!1,referrer:!1,sslAllowSelfSigned:!1,_redirectCount:0});class Ls extends Error{constructor(t,r){super(t),this.fingerprint256=r}}$r.InvalidCertError=Ls;class Ra extends Error{constructor(t){super(`Request Failed. Status Code: ${t}`),this.statusCode=t}}$r.InvalidStatusCodeError=Ra;function Nd(e,t){if(!t||t==="text"||t==="json")try{let r=new TextDecoder("utf8",{fatal:!0}).decode(e);if(t==="text")return r;try{return JSON.parse(r)}catch(n){if(t==="json")throw n;return r}}catch(r){if(t==="text"||t==="json")throw r}return e}let Ol={};function Ps(e,t){var b;let r={...Cd,...t};const n=bo.streamHttp,o=bo.httpsBrowserifyExports,i=bv(),{promisify:s}=x.util,{resolve:c}=bo.urlExports,f=!!/^https/.test(e);let l={method:r.method||"GET",headers:{"Accept-Encoding":"gzip, deflate, br"}};const u=_=>_.replace(/:| /g,"").toLowerCase();if(r.keepAlive){const _={keepAlive:!0,keepAliveMsecs:3e4,maxFreeSockets:1024,maxCachedSessions:1024},R=[f,f&&((b=r.sslPinnedCertificates)==null?void 0:b.map(T=>u(T)).sort())].join();l.agent=Ol[R]||(Ol[R]=new(f?o:n).Agent(_))}r.type==="json"&&(l.headers["Content-Type"]="application/json"),r.data&&(r.method||(l.method="POST"),l.body=r.type==="json"?JSON.stringify(r.data):r.data),l.headers={...l.headers,...r.headers},r.sslAllowSelfSigned&&(l.rejectUnauthorized=!1);const h=async _=>{const R=_.statusCode;if(r.redirect&&300<=R&&R<400&&_.headers.location){if(r._redirectCount==10)throw new Error("Request failed. Too much redirects.");return r._redirectCount+=1,await Ps(c(e,_.headers.location),r)}if(r.expectStatusCode&&R!==r.expectStatusCode)throw _.resume(),new Ra(R);let T=[];for await(const O of _)T.push(O);let C=x.dist.Buffer.concat(T);const D=_.headers["content-encoding"];D==="br"&&(C=await s(i.brotliDecompress)(C)),(D==="gzip"||D==="deflate")&&(C=await s(i.unzip)(C));const L=Nd(C,r.type);return r.full?{headers:_.headers,status:R,body:L}:L};return new Promise((_,R)=>{var O;const T=async S=>{if(S&&S.code==="DEPTH_ZERO_SELF_SIGNED_CERT")try{await Ps(e,{...r,sslAllowSelfSigned:!0,sslPinnedCertificates:[]})}catch(z){z&&z.fingerprint256&&(S=new Ls(`Self-signed SSL certificate: ${z.fingerprint256}`,z.fingerprint256))}R(S)},C=(f?o:n).request(e,l,S=>{S.on("error",T),(async()=>{try{_(await h(S))}catch(z){R(z)}})()});C.on("error",T);const D=(O=r.sslPinnedCertificates)==null?void 0:O.map(S=>u(S)),L=S=>{var Y;const z=u(((Y=S.getPeerCertificate())==null?void 0:Y.fingerprint256)||"");if(!(!z&&S.isSessionReused())&&!D.includes(z))return C.emit("error",new Ls(`Invalid SSL certificate: ${z} Expected: ${D}`,z)),C.abort()};r.sslPinnedCertificates&&C.on("socket",S=>{S.listeners("secureConnect").map(Y=>(Y.name||"").replace("bound ","")).includes("mfetchSecureConnect")||S.on("secureConnect",L.bind(null,S))}),r.keepAlive&&C.setNoDelay(!0),l.body&&C.write(l.body),C.end()})}const pv=new Set(["Accept","Accept-Language","Content-Language","Content-Type"].map(e=>e.toLowerCase())),yv=new Set(["Accept-Charset","Accept-Encoding","Access-Control-Request-Headers","Access-Control-Request-Method","Connection","Content-Length","Cookie","Cookie2","Date","DNT","Expect","Host","Keep-Alive","Origin","Referer","TE","Trailer","Transfer-Encoding","Upgrade","Via"].map(e=>e.toLowerCase()));async function wv(e,t){let r={...Cd,...t};const n=new Headers;r.type==="json"&&n.set("Content-Type","application/json");let o=new URL(e);if(o.username){const f=btoa(`${o.username}:${o.password}`);n.set("Authorization",`Basic ${f}`),o.username="",o.password=""}e=""+o;for(let f in r.headers){const l=f.toLowerCase();(pv.has(l)||r.cors&&!yv.has(l))&&n.set(f,r.headers[f])}let i={headers:n,redirect:r.redirect?"follow":"manual"};r.referrer||(i.referrerPolicy="no-referrer"),r.cors&&(i.mode="cors"),r.data&&(r.method||(i.method="POST"),i.body=r.type==="json"?JSON.stringify(r.data):r.data);const s=await fetch(e,i);if(r.expectStatusCode&&s.status!==r.expectStatusCode)throw new Ra(s.status);const c=Nd(new Uint8Array(await s.arrayBuffer()),r.type);return r.full?{headers:Object.fromEntries(s.headers.entries()),status:s.status,body:c}:c}const mv=!!(typeof x.dist.process=="object"&&x.dist.process.versions&&x.dist.process.versions.node&&x.dist.process.versions.v8);function Ev(e,t){return(mv?Ps:wv)(e,t)}$r.default=Ev;Object.defineProperty(nn,"__esModule",{value:!0});nn.getProvider=nn.fetchFromProvider=void 0;const vv=$r,Sv=async(e,t)=>(await(0,vv.default)(e,{headers:{"content-type":"application/json"},type:"json",data:{method:t.method,params:t.params,jsonrpc:"2.0",id:1}})).result;nn.fetchFromProvider=Sv;const Rv=e=>{var t;if(typeof e=="string")return e;if(((t=e==null?void 0:e.connection)==null?void 0:t.url)!==void 0)return e.connection.url;throw new Error("Must provide valid provider URL or Web3Provider")};nn.getProvider=Rv;(function(e){var t=x.commonjsGlobal&&x.commonjsGlobal.__createBinding||(Object.create?function(o,i,s,c){c===void 0&&(c=s);var f=Object.getOwnPropertyDescriptor(i,s);(!f||("get"in f?!i.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(o,c,f)}:function(o,i,s,c){c===void 0&&(c=s),o[c]=i[s]}),r=x.commonjsGlobal&&x.commonjsGlobal.__exportStar||function(o,i){for(var s in o)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,o,s)};Object.defineProperty(e,"__esModule",{value:!0}),e.toAscii=e.stripHexPrefix=e.padToEven=e.isHexString=e.isHexPrefixed=e.getKeys=e.getBinarySize=e.fromUtf8=e.fromAscii=e.arrayContainsArray=void 0,r(zi,e),r(Ki,e),r(ma,e),r(zn,e),r(Xi,e),r(pt,e),r(Fr,e),r(Sa,e),r(Od,e),r(eo,e);var n=Ve;Object.defineProperty(e,"arrayContainsArray",{enumerable:!0,get:function(){return n.arrayContainsArray}}),Object.defineProperty(e,"fromAscii",{enumerable:!0,get:function(){return n.fromAscii}}),Object.defineProperty(e,"fromUtf8",{enumerable:!0,get:function(){return n.fromUtf8}}),Object.defineProperty(e,"getBinarySize",{enumerable:!0,get:function(){return n.getBinarySize}}),Object.defineProperty(e,"getKeys",{enumerable:!0,get:function(){return n.getKeys}}),Object.defineProperty(e,"isHexPrefixed",{enumerable:!0,get:function(){return n.isHexPrefixed}}),Object.defineProperty(e,"isHexString",{enumerable:!0,get:function(){return n.isHexString}}),Object.defineProperty(e,"padToEven",{enumerable:!0,get:function(){return n.padToEven}}),Object.defineProperty(e,"stripHexPrefix",{enumerable:!0,get:function(){return n.stripHexPrefix}}),Object.defineProperty(e,"toAscii",{enumerable:!0,get:function(){return n.toAscii}}),r(to,e),r(nn,e)})(Tm);var Bd={exports:{}};(function(e){(function(t,r){e.exports?e.exports=r():t.log=r()})(x.commonjsGlobal,function(){var t=function(){},r="undefined",n=typeof window!==r&&typeof window.navigator!==r&&/Trident\/|MSIE /.test(window.navigator.userAgent),o=["trace","debug","info","warn","error"],i={},s=null;function c(T,C){var D=T[C];if(typeof D.bind=="function")return D.bind(T);try{return Function.prototype.bind.call(D,T)}catch{return function(){return Function.prototype.apply.apply(D,[T,arguments])}}}function f(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function l(T){return T==="debug"&&(T="log"),typeof console===r?!1:T==="trace"&&n?f:console[T]!==void 0?c(console,T):console.log!==void 0?c(console,"log"):t}function u(){for(var T=this.getLevel(),C=0;C<o.length;C++){var D=o[C];this[D]=C<T?t:this.methodFactory(D,T,this.name)}if(this.log=this.debug,typeof console===r&&T<this.levels.SILENT)return"No console available for logging"}function h(T){return function(){typeof console!==r&&(u.call(this),this[T].apply(this,arguments))}}function b(T,C,D){return l(T)||h.apply(this,arguments)}function _(T,C){var D=this,L,O,S,z="loglevel";typeof T=="string"?z+=":"+T:typeof T=="symbol"&&(z=void 0);function Y(ee){var w=(o[ee]||"silent").toUpperCase();if(!(typeof window===r||!z)){try{window.localStorage[z]=w;return}catch{}try{window.document.cookie=encodeURIComponent(z)+"="+w+";"}catch{}}}function X(){var ee;if(!(typeof window===r||!z)){try{ee=window.localStorage[z]}catch{}if(typeof ee===r)try{var w=window.document.cookie,d=encodeURIComponent(z),m=w.indexOf(d+"=");m!==-1&&(ee=/^([^;]+)/.exec(w.slice(m+d.length+1))[1])}catch{}return D.levels[ee]===void 0&&(ee=void 0),ee}}function F(){if(!(typeof window===r||!z)){try{window.localStorage.removeItem(z)}catch{}try{window.document.cookie=encodeURIComponent(z)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function V(ee){var w=ee;if(typeof w=="string"&&D.levels[w.toUpperCase()]!==void 0&&(w=D.levels[w.toUpperCase()]),typeof w=="number"&&w>=0&&w<=D.levels.SILENT)return w;throw new TypeError("log.setLevel() called with invalid level: "+ee)}D.name=T,D.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},D.methodFactory=C||b,D.getLevel=function(){return S??O??L},D.setLevel=function(ee,w){return S=V(ee),w!==!1&&Y(S),u.call(D)},D.setDefaultLevel=function(ee){O=V(ee),X()||D.setLevel(ee,!1)},D.resetLevel=function(){S=null,F(),u.call(D)},D.enableAll=function(ee){D.setLevel(D.levels.TRACE,ee)},D.disableAll=function(ee){D.setLevel(D.levels.SILENT,ee)},D.rebuild=function(){if(s!==D&&(L=V(s.getLevel())),u.call(D),s===D)for(var ee in i)i[ee].rebuild()},L=V(s?s.getLevel():"WARN");var oe=X();oe!=null&&(S=V(oe)),u.call(D)}s=new _,s.getLogger=function(C){if(typeof C!="symbol"&&typeof C!="string"||C==="")throw new TypeError("You must supply a name when creating a logger.");var D=i[C];return D||(D=i[C]=new _(C,s.methodFactory)),D};var R=typeof window!==r?window.log:void 0;return s.noConflict=function(){return typeof window!==r&&window.log===s&&(window.log=R),s},s.getLoggers=function(){return i},s.default=s,s})})(Bd);var $d=Bd.exports;const wi=x.getDefaultExportFromCjs($d);var mi={exports:{}};mi.exports;(function(e,t){var r=200,n="__lodash_hash_undefined__",o=800,i=16,s=9007199254740991,c="[object Arguments]",f="[object Array]",l="[object AsyncFunction]",u="[object Boolean]",h="[object Date]",b="[object Error]",_="[object Function]",R="[object GeneratorFunction]",T="[object Map]",C="[object Number]",D="[object Null]",L="[object Object]",O="[object Proxy]",S="[object RegExp]",z="[object Set]",Y="[object String]",X="[object Undefined]",F="[object WeakMap]",V="[object ArrayBuffer]",oe="[object DataView]",ee="[object Float32Array]",w="[object Float64Array]",d="[object Int8Array]",m="[object Int16Array]",$="[object Int32Array]",M="[object Uint8Array]",N="[object Uint8ClampedArray]",U="[object Uint16Array]",P="[object Uint32Array]",H=/[\\^$.*+?()[\]{}|]/g,G=/^\[object .+?Constructor\]$/,se=/^(?:0|[1-9]\d*)$/,q={};q[ee]=q[w]=q[d]=q[m]=q[$]=q[M]=q[N]=q[U]=q[P]=!0,q[c]=q[f]=q[V]=q[u]=q[oe]=q[h]=q[b]=q[_]=q[T]=q[C]=q[L]=q[S]=q[z]=q[Y]=q[F]=!1;var ie=typeof x.commonjsGlobal=="object"&&x.commonjsGlobal&&x.commonjsGlobal.Object===Object&&x.commonjsGlobal,ce=typeof self=="object"&&self&&self.Object===Object&&self,de=ie||ce||Function("return this")(),Ee=t&&!t.nodeType&&t,_e=Ee&&!0&&e&&!e.nodeType&&e,ye=_e&&_e.exports===Ee,Ce=ye&&ie.process,Ne=function(){try{var A=_e&&_e.require&&_e.require("util").types;return A||Ce&&Ce.binding&&Ce.binding("util")}catch{}}(),Re=Ne&&Ne.isTypedArray;function I(A,W,te){switch(te.length){case 0:return A.call(W);case 1:return A.call(W,te[0]);case 2:return A.call(W,te[0],te[1]);case 3:return A.call(W,te[0],te[1],te[2])}return A.apply(W,te)}function B(A,W){for(var te=-1,Se=Array(A);++te<A;)Se[te]=W(te);return Se}function K(A){return function(W){return A(W)}}function ue(A,W){return A==null?void 0:A[W]}function ae(A,W){return function(te){return A(W(te))}}var be=Array.prototype,Ae=Function.prototype,Ie=Object.prototype,$e=de["__core-js_shared__"],me=Ae.toString,je=Ie.hasOwnProperty,tt=function(){var A=/[^.]+$/.exec($e&&$e.keys&&$e.keys.IE_PROTO||"");return A?"Symbol(src)_1."+A:""}(),Ge=Ie.toString,vt=me.call(Object),rt=RegExp("^"+me.call(je).replace(H,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Fe=ye?de.Buffer:void 0,nt=de.Symbol,at=de.Uint8Array;Fe&&Fe.allocUnsafe;var E=ae(Object.getPrototypeOf,Object),fe=Object.create,he=Ie.propertyIsEnumerable,we=be.splice,j=nt?nt.toStringTag:void 0,re=function(){try{var A=ao(Object,"defineProperty");return A({},"",{}),A}catch{}}(),g=Fe?Fe.isBuffer:void 0,le=Math.max,Te=Date.now,a=ao(de,"Map"),J=ao(Object,"create"),Q=function(){function A(){}return function(W){if(!Ar(W))return{};if(fe)return fe(W);A.prototype=W;var te=new A;return A.prototype=void 0,te}}();function y(A){var W=-1,te=A==null?0:A.length;for(this.clear();++W<te;){var Se=A[W];this.set(Se[0],Se[1])}}function k(){this.__data__=J?J(null):{},this.size=0}function Z(A){var W=this.has(A)&&delete this.__data__[A];return this.size-=W?1:0,W}function ve(A){var W=this.__data__;if(J){var te=W[A];return te===n?void 0:te}return je.call(W,A)?W[A]:void 0}function p(A){var W=this.__data__;return J?W[A]!==void 0:je.call(W,A)}function v(A,W){var te=this.__data__;return this.size+=this.has(A)?0:1,te[A]=J&&W===void 0?n:W,this}y.prototype.clear=k,y.prototype.delete=Z,y.prototype.get=ve,y.prototype.has=p,y.prototype.set=v;function ne(A){var W=-1,te=A==null?0:A.length;for(this.clear();++W<te;){var Se=A[W];this.set(Se[0],Se[1])}}function ge(){this.__data__=[],this.size=0}function pe(A){var W=this.__data__,te=Vn(W,A);if(te<0)return!1;var Se=W.length-1;return te==Se?W.pop():we.call(W,te,1),--this.size,!0}function Oe(A){var W=this.__data__,te=Vn(W,A);return te<0?void 0:W[te][1]}function ke(A){return Vn(this.__data__,A)>-1}function it(A,W){var te=this.__data__,Se=Vn(te,A);return Se<0?(++this.size,te.push([A,W])):te[Se][1]=W,this}ne.prototype.clear=ge,ne.prototype.delete=pe,ne.prototype.get=Oe,ne.prototype.has=ke,ne.prototype.set=it;function Ue(A){var W=-1,te=A==null?0:A.length;for(this.clear();++W<te;){var Se=A[W];this.set(Se[0],Se[1])}}function or(){this.size=0,this.__data__={hash:new y,map:new(a||ne),string:new y}}function gr(A){var W=Gn(this,A).delete(A);return this.size-=W?1:0,W}function Ze(A){return Gn(this,A).get(A)}function ut(A){return Gn(this,A).has(A)}function Xe(A,W){var te=Gn(this,A),Se=te.size;return te.set(A,W),this.size+=te.size==Se?0:1,this}Ue.prototype.clear=or,Ue.prototype.delete=gr,Ue.prototype.get=Ze,Ue.prototype.has=ut,Ue.prototype.set=Xe;function st(A){var W=this.__data__=new ne(A);this.size=W.size}function gt(){this.__data__=new ne,this.size=0}function Gt(A){var W=this.__data__,te=W.delete(A);return this.size=W.size,te}function sr(A){return this.__data__.get(A)}function Mt(A){return this.__data__.has(A)}function Hd(A,W){var te=this.__data__;if(te instanceof ne){var Se=te.__data__;if(!a||Se.length<r-1)return Se.push([A,W]),this.size=++te.size,this;te=this.__data__=new Ue(Se)}return te.set(A,W),this.size=te.size,this}st.prototype.clear=gt,st.prototype.delete=Gt,st.prototype.get=sr,st.prototype.has=Mt,st.prototype.set=Hd;function zd(A,W){var te=co(A),Se=!te&&lo(A),xe=!te&&!Se&&Ba(A),He=!te&&!Se&&!xe&&ka(A),Ke=te||Se||xe||He,Me=Ke?B(A.length,String):[],Je=Me.length;for(var Ft in A)Ke&&(Ft=="length"||xe&&(Ft=="offset"||Ft=="parent")||He&&(Ft=="buffer"||Ft=="byteLength"||Ft=="byteOffset")||Ca(Ft,Je))||Me.push(Ft);return Me}function oo(A,W,te){(te!==void 0&&!Zn(A[W],te)||te===void 0&&!(W in A))&&so(A,W,te)}function Wd(A,W,te){var Se=A[W];(!(je.call(A,W)&&Zn(Se,te))||te===void 0&&!(W in A))&&so(A,W,te)}function Vn(A,W){for(var te=A.length;te--;)if(Zn(A[te][0],W))return te;return-1}function so(A,W,te){W=="__proto__"&&re?re(A,W,{configurable:!0,enumerable:!0,value:te,writable:!0}):A[W]=te}var Vd=ih();function qn(A){return A==null?A===void 0?X:D:j&&j in Object(A)?oh(A):uh(A)}function La(A){return dn(A)&&qn(A)==c}function qd(A){if(!Ar(A)||lh(A))return!1;var W=ho(A)?rt:G;return W.test(_h(A))}function Gd(A){return dn(A)&&$a(A.length)&&!!q[qn(A)]}function Zd(A){if(!Ar(A))return ch(A);var W=Na(A),te=[];for(var Se in A)Se=="constructor"&&(W||!je.call(A,Se))||te.push(Se);return te}function Pa(A,W,te,Se,xe){A!==W&&Vd(W,function(He,Ke){if(xe||(xe=new st),Ar(He))Kd(A,W,Ke,te,Pa,Se,xe);else{var Me=Se?Se(fo(A,Ke),He,Ke+"",A,W,xe):void 0;Me===void 0&&(Me=He),oo(A,Ke,Me)}},xa)}function Kd(A,W,te,Se,xe,He,Ke){var Me=fo(A,te),Je=fo(W,te),Ft=Ke.get(Je);if(Ft){oo(A,te,Ft);return}var It=He?He(Me,Je,te+"",A,W,Ke):void 0,hn=It===void 0;if(hn){var go=co(Je),_o=!go&&Ba(Je),ja=!go&&!_o&&ka(Je);It=Je,go||_o||ja?co(Me)?It=Me:bh(Me)?It=th(Me):_o?(hn=!1,It=Yd(Je)):ja?(hn=!1,It=eh(Je)):It=[]:ph(Je)||lo(Je)?(It=Me,lo(Me)?It=yh(Me):(!Ar(Me)||ho(Me))&&(It=sh(Je))):hn=!1}hn&&(Ke.set(Je,It),xe(It,Je,Se,He,Ke),Ke.delete(Je)),oo(A,te,It)}function Jd(A,W){return hh(dh(A,W,Da),A+"")}var Xd=re?function(A,W){return re(A,"toString",{configurable:!0,enumerable:!1,value:mh(W),writable:!0})}:Da;function Yd(A,W){return A.slice()}function Qd(A){var W=new A.constructor(A.byteLength);return new at(W).set(new at(A)),W}function eh(A,W){var te=Qd(A.buffer);return new A.constructor(te,A.byteOffset,A.length)}function th(A,W){var te=-1,Se=A.length;for(W||(W=Array(Se));++te<Se;)W[te]=A[te];return W}function rh(A,W,te,Se){var xe=!te;te||(te={});for(var He=-1,Ke=W.length;++He<Ke;){var Me=W[He],Je=void 0;Je===void 0&&(Je=A[Me]),xe?so(te,Me,Je):Wd(te,Me,Je)}return te}function nh(A){return Jd(function(W,te){var Se=-1,xe=te.length,He=xe>1?te[xe-1]:void 0,Ke=xe>2?te[2]:void 0;for(He=A.length>3&&typeof He=="function"?(xe--,He):void 0,Ke&&ah(te[0],te[1],Ke)&&(He=xe<3?void 0:He,xe=1),W=Object(W);++Se<xe;){var Me=te[Se];Me&&A(W,Me,Se,He)}return W})}function ih(A){return function(W,te,Se){for(var xe=-1,He=Object(W),Ke=Se(W),Me=Ke.length;Me--;){var Je=Ke[++xe];if(te(He[Je],Je,He)===!1)break}return W}}function Gn(A,W){var te=A.__data__;return fh(W)?te[typeof W=="string"?"string":"hash"]:te.map}function ao(A,W){var te=ue(A,W);return qd(te)?te:void 0}function oh(A){var W=je.call(A,j),te=A[j];try{A[j]=void 0;var Se=!0}catch{}var xe=Ge.call(A);return Se&&(W?A[j]=te:delete A[j]),xe}function sh(A){return typeof A.constructor=="function"&&!Na(A)?Q(E(A)):{}}function Ca(A,W){var te=typeof A;return W=W??s,!!W&&(te=="number"||te!="symbol"&&se.test(A))&&A>-1&&A%1==0&&A<W}function ah(A,W,te){if(!Ar(te))return!1;var Se=typeof W;return(Se=="number"?uo(te)&&Ca(W,te.length):Se=="string"&&W in te)?Zn(te[W],A):!1}function fh(A){var W=typeof A;return W=="string"||W=="number"||W=="symbol"||W=="boolean"?A!=="__proto__":A===null}function lh(A){return!!tt&&tt in A}function Na(A){var W=A&&A.constructor,te=typeof W=="function"&&W.prototype||Ie;return A===te}function ch(A){var W=[];if(A!=null)for(var te in Object(A))W.push(te);return W}function uh(A){return Ge.call(A)}function dh(A,W,te){return W=le(W===void 0?A.length-1:W,0),function(){for(var Se=arguments,xe=-1,He=le(Se.length-W,0),Ke=Array(He);++xe<He;)Ke[xe]=Se[W+xe];xe=-1;for(var Me=Array(W+1);++xe<W;)Me[xe]=Se[xe];return Me[W]=te(Ke),I(A,this,Me)}}function fo(A,W){if(!(W==="constructor"&&typeof A[W]=="function")&&W!="__proto__")return A[W]}var hh=gh(Xd);function gh(A){var W=0,te=0;return function(){var Se=Te(),xe=i-(Se-te);if(te=Se,xe>0){if(++W>=o)return arguments[0]}else W=0;return A.apply(void 0,arguments)}}function _h(A){if(A!=null){try{return me.call(A)}catch{}try{return A+""}catch{}}return""}function Zn(A,W){return A===W||A!==A&&W!==W}var lo=La(function(){return arguments}())?La:function(A){return dn(A)&&je.call(A,"callee")&&!he.call(A,"callee")},co=Array.isArray;function uo(A){return A!=null&&$a(A.length)&&!ho(A)}function bh(A){return dn(A)&&uo(A)}var Ba=g||Eh;function ho(A){if(!Ar(A))return!1;var W=qn(A);return W==_||W==R||W==l||W==O}function $a(A){return typeof A=="number"&&A>-1&&A%1==0&&A<=s}function Ar(A){var W=typeof A;return A!=null&&(W=="object"||W=="function")}function dn(A){return A!=null&&typeof A=="object"}function ph(A){if(!dn(A)||qn(A)!=L)return!1;var W=E(A);if(W===null)return!0;var te=je.call(W,"constructor")&&W.constructor;return typeof te=="function"&&te instanceof te&&me.call(te)==vt}var ka=Re?K(Re):Gd;function yh(A){return rh(A,xa(A))}function xa(A){return uo(A)?zd(A):Zd(A)}var wh=nh(function(A,W,te){Pa(A,W,te)});function mh(A){return function(){return A}}function Da(A){return A}function Eh(){return!1}e.exports=wh})(mi,mi.exports);mi.exports;const Av=wi.getLogger("http-helpers");Av.setLevel($d.levels.INFO);Rh();const En={IFRAME_STATUS:"iframe_status",CREATE_WINDOW:"create_window",CLOSE_WINDOW:"close_window",USER_LOGGED_IN:"user_logged_in",USER_LOGGED_OUT:"user_logged_out"},Jt={LOGOUT:"logout",WALLET_INSTANCE_ID:"wallet_instance_id",USER_INFO:"user_info",SET_PROVIDER:"set_provider",TOPUP:"topup",IFRAME_STATUS:"iframe_status",OPENED_WINDOW:"opened_window",CLOSED_WINDOW:"closed_window",GET_PROVIDER_STATE:"get_provider_state",LOGIN_WITH_PRIVATE_KEY:"login_with_private_key"},Iv={GET_PROVIDER_STATE:"wallet_get_provider_state"},ns={ACCOUNTS_CHANGED:"wallet_accounts_changed",CHAIN_CHANGED:"wallet_chain_changed",UNLOCK_STATE_CHANGED:"wallet_unlock_state_changed"};function Tv(e){return function(r,n,o){o(i=>{n.error&&wi.warn(`Error in RPC response:
4
4
  `,n),!r.isTorusInternal&&(wi.info(`RPC (${e.origin}):`,r,"->",n),i())})}}var Ll;(function(e){e.approved="approved",e.cancelled="cancelled",e.confirmed="confirmed",e.failed="failed",e.finalized="finalized",e.processed="processed",e.rejected="rejected",e.signed="signed",e.submitted="submitted",e.unapproved="unapproved",e.dropped="dropped",e.expired="expired"})(Ll||(Ll={}));var Ov=x.requireBrowser();const Lv=x.getDefaultExportFromCjs(Ov);var Pv={exports:{}},Aa={},Ia={};Object.defineProperty(Ia,"__esModule",{value:!0});function Cv(e){var t=4,r=e.length,n=r%t;if(!n)return e;var o=r,i=t-n,s=r+i,c=x.dist.Buffer.alloc(s);for(c.write(e);i--;)c.write("=",o++);return c.toString()}Ia.default=Cv;Object.defineProperty(Aa,"__esModule",{value:!0});var Nv=Ia;function kd(e,t){return t===void 0&&(t="utf8"),x.dist.Buffer.isBuffer(e)?Cs(e.toString("base64")):Cs(x.dist.Buffer.from(e,t).toString("base64"))}function Bv(e,t){return t===void 0&&(t="utf8"),x.dist.Buffer.from(Ta(e),"base64").toString(t)}function Ta(e){return e=e.toString(),Nv.default(e).replace(/\-/g,"+").replace(/_/g,"/")}function Cs(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function $v(e){return x.dist.Buffer.from(Ta(e),"base64")}var un=kd;un.encode=kd;un.decode=Bv;un.toBase64=Ta;un.fromBase64=Cs;un.toBuffer=$v;Aa.default=un;(function(e){e.exports=Aa.default,e.exports.default=e.exports})(Pv);const kv=()=>Lv(32).toString("hex");function oi(){}const Pl="SYN",is="ACK",Cl="BRK";class Nl extends x.readableBrowserExports.Duplex{constructor(t){let{name:r,target:n,targetWindow:o=window,targetOrigin:i="*"}=t;if(super({objectMode:!0}),x._defineProperty(this,"_init",void 0),x._defineProperty(this,"_haveSyn",void 0),x._defineProperty(this,"_name",void 0),x._defineProperty(this,"_target",void 0),x._defineProperty(this,"_targetWindow",void 0),x._defineProperty(this,"_targetOrigin",void 0),x._defineProperty(this,"_onMessage",void 0),x._defineProperty(this,"_synIntervalId",void 0),!r||!n)throw new Error("Invalid input.");this._init=!1,this._haveSyn=!1,this._name=r,this._target=n,this._targetWindow=o,this._targetOrigin=i,this._onMessage=this.onMessage.bind(this),this._synIntervalId=null,window.addEventListener("message",this._onMessage,!1),this._handShake()}_break(){this.cork(),this._write(Cl,null,oi),this._haveSyn=!1,this._init=!1}_handShake(){this._write(Pl,null,oi),this.cork()}_onData(t){if(!this._init)t===Pl?(this._haveSyn=!0,this._write(is,null,oi)):t===is&&(this._init=!0,this._haveSyn||this._write(is,null,oi),this.uncork());else if(t===Cl)this._break();else try{this.push(t)}catch(r){this.emit("error",r)}}_postMessage(t){const r=this._targetOrigin;this._targetWindow.postMessage({target:this._target,data:t},r)}onMessage(t){const r=t.data;this._targetOrigin!=="*"&&t.origin!==this._targetOrigin||t.source!==this._targetWindow||typeof r!="object"||r.target!==this._name||!r.data||this._onData(r.data)}_read(){}_write(t,r,n){this._postMessage(t),n()}_destroy(){window.removeEventListener("message",this._onMessage,!1)}}function Bl(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function xv(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}class no extends x.eventsExports.EventEmitter{emit(t){let r=t==="error";const n=this._events;if(n!==void 0)r=r&&n.error===void 0;else if(!r)return!1;for(var o=arguments.length,i=new Array(o>1?o-1:0),s=1;s<o;s++)i[s-1]=arguments[s];if(r){let f;if(i.length>0&&([f]=i),f instanceof Error)throw f;const l=new Error(`Unhandled error.${f?` (${f.message})`:""}`);throw l.context=f,l}const c=n[t];if(c===void 0)return!1;if(typeof c=="function")Bl(c,this,i);else{const f=c.length,l=xv(c);for(let u=0;u<f;u+=1)Bl(l[u],this,i)}return!0}}class vn extends Error{constructor(t){let{code:r,message:n,data:o}=t;if(!Number.isInteger(r))throw new Error("code must be an integer");if(!n||typeof n!="string")throw new Error("message must be string");super(n),x._defineProperty(this,"code",void 0),x._defineProperty(this,"data",void 0),this.code=r,o!==void 0&&(this.data=o)}toString(){return Ph({code:this.code,message:this.message,data:this.data,stack:this.stack})}}const Ns=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return(n,o)=>{n||o.error?t(n||o.error):!r||Array.isArray(o)?e(o):e(o.result)}};function Dv(){const e={};function t(){return!1}const r=new no;function n(f){const l=e[f.id];if(!l)throw new Error(`StreamMiddleware - Unknown response id "${f.id}"`);delete e[f.id],Object.assign(l.res,f),setTimeout(l.end)}function o(f){r.emit("notification",f)}function i(f,l,u){let h;try{!f.id?o(f):n(f)}catch(b){h=b}u(h)}const s=new x.readableBrowserExports.Duplex({objectMode:!0,read:t,write:i});return{events:r,middleware:(f,l,u,h)=>{s.push(f),e[f.id]={req:f,res:l,next:u,end:h}},stream:s}}function jv(){return(e,t,r,n)=>{const o=e.id,i=kv();e.id=i,t.id=i,r(s=>{e.id=o,t.id=o,s()})}}function $l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Mv(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$l(Object(r),!0).forEach(function(n){x._defineProperty(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$l(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}class lr extends no{constructor(){super(),x._defineProperty(this,"_middleware",void 0),this._middleware=[]}static async _runAllMiddleware(t,r,n){const o=[];let i=null,s=!1;for(const c of n)if([i,s]=await lr._runMiddleware(t,r,c,o),s)break;return[i,s,o.reverse()]}static _runMiddleware(t,r,n,o){return new Promise(i=>{const s=f=>{const l=f||r.error;l&&(r.error=Wt.serializeError(l)),i([l,!0])},c=f=>{r.error?s(r.error):(f&&(typeof f!="function"&&s(new vn({code:-32603,message:"JRPCEngine: 'next' return handlers must be functions"})),o.push(f)),i([null,!1]))};try{n(t,r,c,s)}catch(f){s(f)}})}static async _runReturnHandlers(t){for(const r of t)await new Promise((n,o)=>{r(i=>i?o(i):n())})}static _checkForCompletion(t,r,n){if(!("result"in r)&&!("error"in r))throw new vn({code:-32603,message:"Response has no error or result for request"});if(!n)throw new vn({code:-32603,message:"Nothing ended request"})}push(t){this._middleware.push(t)}handle(t,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?r?this._handleBatch(t,r):this._handleBatch(t):r?this._handle(t,r):this._promiseHandle(t)}asMiddleware(){return async(t,r,n,o)=>{try{const[i,s,c]=await lr._runAllMiddleware(t,r,this._middleware);return s?(await lr._runReturnHandlers(c),o(i)):n(async f=>{try{await lr._runReturnHandlers(c)}catch(l){return f(l)}return f()})}catch(i){return o(i)}}}async _handleBatch(t,r){try{const n=await Promise.all(t.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(t){return new Promise(r=>{this._handle(t,(n,o)=>{r(o)})})}async _handle(t,r){if(!t||Array.isArray(t)||typeof t!="object"){const s=new vn({code:-32603,message:"request must be plain object"});return r(s,{id:void 0,jsonrpc:"2.0",error:s})}if(typeof t.method!="string"){const s=new vn({code:-32603,message:"method must be string"});return r(s,{id:t.id,jsonrpc:"2.0",error:s})}const n=Mv({},t),o={id:n.id,jsonrpc:n.jsonrpc};let i=null;try{await this._processRequest(n,o)}catch(s){i=s}return i&&(delete o.result,o.error||(o.error=Wt.serializeError(i))),r(i,o)}async _processRequest(t,r){const[n,o,i]=await lr._runAllMiddleware(t,r,this._middleware);if(lr._checkForCompletion(t,r,o),await lr._runReturnHandlers(i),n)throw n}}class Fv extends x.readableBrowserExports.Duplex{constructor(t){let{parent:r,name:n}=t;super({objectMode:!0}),x._defineProperty(this,"_parent",void 0),x._defineProperty(this,"_name",void 0),this._parent=r,this._name=n}_read(){}_write(t,r,n){this._parent.push({name:this._name,data:t}),n()}}function kl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function xl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kl(Object(r),!0).forEach(function(n){x._defineProperty(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kl(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}const Dl=Symbol("IGNORE_SUBSTREAM");class Uv extends x.readableBrowserExports.Duplex{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(xl(xl({},t),{},{objectMode:!0})),x._defineProperty(this,"_substreams",void 0),x._defineProperty(this,"getStream",void 0),this._substreams={}}createStream(t){if(!t)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[t])throw new Error(`ObjectMultiplex - Substream for name "${t}" already exists`);const r=new Fv({parent:this,name:t});return this._substreams[t]=r,Hv(this,n=>r.destroy(n||void 0)),r}ignoreStream(t){if(!t)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[t])throw new Error(`ObjectMultiplex - Substream for name "${t}" already exists`);this._substreams[t]=Dl}_read(){}_write(t,r,n){const{name:o,data:i}=t;if(!o)return window.console.warn(`ObjectMultiplex - malformed chunk without name "${t}"`),n();const s=this._substreams[o];return s?(s!==Dl&&s.push(i),n()):(window.console.warn(`ObjectMultiplex - orphaned data for stream "${o}"`),n())}}function Hv(e,t){const r=hm(t);tl(e,{readable:!1},r),tl(e,{writable:!1},r)}const rr=e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function";rr.writable=e=>rr(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object";rr.readable=e=>rr(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object";rr.duplex=e=>rr.writable(e)&&rr.readable(e);rr.transform=e=>rr.duplex(e)&&typeof e._transform=="function";var zv=rr,Wv=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))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(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;o--!==0;){var s=i[o];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r};const Vv=x.getDefaultExportFromCjs(Wv);var qv="0.3.4",er={errors:{disconnected:()=>"Torus: Lost connection to Torus.",permanentlyDisconnected:()=>"Torus: Disconnected from iframe. Page reload required.",unsupportedSync:e=>`Torus: The Torus Ethereum provider does not support synchronous methods like ${e} without a callback parameter.`,invalidDuplexStream:()=>"Must provide a Node.js-style duplex stream.",invalidOptions:e=>`Invalid options. Received: { maxEventListeners: ${e}}`,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=>`Torus: Connected to chain with ID "${e}".`},warnings:{}};const xd={PRODUCTION:"production",DEVELOPMENT:"development",TESTING:"testing"},Vr={BOTTOM_LEFT:"bottom-left",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",TOP_RIGHT:"top-right"},ci={GOOGLE:"google",FACEBOOK:"facebook",REDDIT:"reddit",DISCORD:"discord",TWITCH:"twitch",APPLE:"apple",LINE:"line",GITHUB:"github",KAKAO:"kakao",LINKEDIN:"linkedin",TWITTER:"twitter",WEIBO:"weibo",WECHAT:"wechat",EMAIL_PASSWORDLESS:"email_passwordless"},Gv={en:{embed:{continue:"Continue",actionRequired:"Authorization required",pendingAction:"Click continue to proceed with your request in a popup",cookiesRequired:"Cookies Required",enableCookies:"Please enable cookies in your browser preferences to access Torus",clickHere:"More Info"}},de:{embed:{continue:"Fortsetzen",actionRequired:"Autorisierung erforderlich",pendingAction:"Klicken Sie in einem Popup auf Weiter, um mit Ihrer Anfrage fortzufahren",cookiesRequired:"Cookies benötigt",enableCookies:"Bitte aktivieren Sie Cookies in Ihren Browsereinstellungen, um auf Torus zuzugreifen",clickHere:"Mehr Info"}},ja:{embed:{continue:"継続する",actionRequired:"認証が必要です",pendingAction:"続行をクリックして、ポップアップでリクエストを続行します",cookiesRequired:"必要なクッキー",enableCookies:"Torusにアクセスするには、ブラウザの設定でCookieを有効にしてください。",clickHere:"詳しくは"}},ko:{embed:{continue:"계속하다",actionRequired:"승인 필요",pendingAction:"팝업에서 요청을 진행하려면 계속을 클릭하십시오.",cookiesRequired:"쿠키 필요",enableCookies:"브라우저 환경 설정에서 쿠키를 활성화하여 Torus에 액세스하십시오.",clickHere:"더 많은 정보"}},zh:{embed:{continue:"继续",actionRequired:"需要授权",pendingAction:"单击继续以在弹出窗口中继续您的请求",cookiesRequired:"必填Cookie",enableCookies:"请在您的浏览器首选项中启用cookie以访问Torus。",clickHere:"更多信息"}}};var Oa={supportedVerifierList:[ci.GOOGLE,ci.REDDIT,ci.DISCORD],api:"https://api.tor.us",translations:Gv,prodTorusUrl:"",localStorageKeyPrefix:"torus-"},ze=wi.getLogger("solana-embed");function Zv(){return(e,t,r)=>{(typeof e.method!="string"||!e.method)&&(t.error=Wt.ethErrors.rpc.invalidRequest({message:"The request 'method' must be a non-empty string.",data:e})),r(n=>{const{error:o}=t;return o&&ze.error(`Torus - RPC Error: ${o.message}`,o),n()})}}function Kv(e,t,r){let n=`Torus: Lost connection to "${e}".`;t!=null&&t.stack&&(n+=`