10 lines
179 KiB
JavaScript
10 lines
179 KiB
JavaScript
import{h as tl,i as ff}from"./chunk-OHC7JEN2.js";import{a as Da}from"./chunk-M7TGCWSZ.js";import{a as Vw,b as af,g as sf}from"./chunk-34E6L7G3.js";import{N as el}from"./chunk-DJOOIXGY.js";import{e as Zs}from"./chunk-HIJKLBHN.js";import{j as Xs}from"./chunk-FPW2NZ4O.js";import{a as Ju,v as Zu}from"./chunk-TGDAHAHX.js";import{a as lf}from"./chunk-DFBPQGWF.js";import{a as Qr}from"./chunk-GHFEB7VX.js";import"./chunk-JVRKTUTZ.js";import{a as nf,y as of}from"./chunk-FZ7Z5GOP.js";import{a as jf}from"./chunk-HM6LPBUT.js";import"./chunk-ANZC7WDS.js";import{a as hi}from"./chunk-O5MB3D6U.js";import{a as Mf,b as Lf,c as Wf}from"./chunk-CUXNS7JP.js";import{a as Tf}from"./chunk-MOP2JKYH.js";import{a as qf}from"./chunk-72DOYHVA.js";import{a as Of}from"./chunk-2OJILR25.js";import{a as Qu,d as ef}from"./chunk-NQUUR33Y.js";import{d as ol}from"./chunk-JASWD2YT.js";import{a as Js}from"./chunk-LOMWXWNV.js";import{a as xf}from"./chunk-7LFOODSP.js";import{b as zs,d as Uf}from"./chunk-JTPEFBI3.js";import{a as cf}from"./chunk-RMJHHAGY.js";import"./chunk-JCUHDXG7.js";import{g as uf}from"./chunk-33UMYP6I.js";import"./chunk-T7U3BDSN.js";import{a as Rf,b as Df,c as Nf,d as kf}from"./chunk-N7LSPGCT.js";import{a as _e}from"./chunk-ZVF3P7HR.js";import{a as qu}from"./chunk-STEXG2FS.js";import{i as Qs}from"./chunk-253CJIAC.js";import"./chunk-PS4OWL66.js";import"./chunk-QWVZ4QKA.js";import{c as Ca}from"./chunk-K2RAJRJE.js";import"./chunk-E35WNJF3.js";import"./chunk-EH7ZH6JN.js";import{e as Sf}from"./chunk-2XWBMUQE.js";import"./chunk-2KNTS2L6.js";import{a as Cf}from"./chunk-6J3LTABS.js";import{b as _f,c as yf}from"./chunk-EGBVJRLU.js";import{g as wf}from"./chunk-SRU356TJ.js";import{S as Gf,a as pi}from"./chunk-53ASQHN6.js";import"./chunk-XWZU3PMQ.js";import{b as Bf}from"./chunk-7CUZ3SRN.js";import"./chunk-AZADQVKT.js";import"./chunk-UDCQANGP.js";import{a as Xu}from"./chunk-6JM5XQBI.js";import{a as Hf}from"./chunk-J5KTP6HO.js";import{c as rl}from"./chunk-PLJ5EWJ7.js";import{a as ju,b as Fu,c as Hu}from"./chunk-SHC62I4N.js";import{a as vf}from"./chunk-TYKWHAGM.js";import{f as il}from"./chunk-Y4FRJ65V.js";import"./chunk-OEA32XBL.js";import"./chunk-QJYQ2X4V.js";import"./chunk-X3ZHB7JM.js";import"./chunk-3KQ34RWP.js";import"./chunk-LU2D434E.js";import{c as is,d as ws,e as _s,g as xt,h as vs}from"./chunk-CFT2L6ZK.js";import"./chunk-WON3Y3M2.js";import"./chunk-L6GOGUAK.js";import{a as xs,qa as Ts}from"./chunk-OMHNNHX7.js";import{b as If}from"./chunk-RBSWB7WT.js";import"./chunk-BLOI6ELB.js";import"./chunk-VE37AOMS.js";import{e as Jt}from"./chunk-VPE2MWMC.js";import{b as Kf,c as $f}from"./chunk-GJD7BOGY.js";import{n as zu}from"./chunk-F3L6CNFV.js";import"./chunk-PJ6KUX4N.js";import"./chunk-4HG7ASV5.js";import{b as nl}from"./chunk-PICDHKDX.js";import"./chunk-OAGA5BMQ.js";import"./chunk-EEMLAAZE.js";import{a as Ef}from"./chunk-BE7FSICB.js";import"./chunk-P7P6BTNA.js";import"./chunk-AQIHWDAU.js";import{a as de}from"./chunk-WTL7ZNDU.js";import"./chunk-XVK3ARDV.js";import"./chunk-4KGA7XOD.js";import{a as tn,b as se}from"./chunk-KLHHIGOV.js";import{a as Et,c as ys,d as bs}from"./chunk-W7A5FWPW.js";import{f as tf,j as rf}from"./chunk-IGR6VWMP.js";import"./chunk-Y7SOKHUW.js";import"./chunk-G4DJRPOF.js";import{a as Vs,b as Ys}from"./chunk-R5MAVLF4.js";import"./chunk-P65JCIKD.js";import"./chunk-PBTGMEA7.js";import"./chunk-Y72I2ZNN.js";import{a as Vu,d as Yu}from"./chunk-ZRWFLJZO.js";import"./chunk-JJLCPFOT.js";import"./chunk-3LQNHFPG.js";import"./chunk-GCMU27NA.js";import"./chunk-FATNH5YG.js";import{b as bf}from"./chunk-WJQFOAEI.js";import{b as Pf,d as Ff}from"./chunk-NYJ253PY.js";import{b as Af}from"./chunk-TWCNNRNT.js";import"./chunk-G2ZWAK2X.js";import"./chunk-ND6CCRJ3.js";import"./chunk-7NQREVCE.js";import"./chunk-QUMWPJOI.js";import"./chunk-R4MS7GF2.js";import{a as Ss,b as Es}from"./chunk-JYK46VHM.js";import{q as $s}from"./chunk-26NG6ZCB.js";import"./chunk-32C2WARN.js";import"./chunk-E3AYW2TV.js";import"./chunk-PDFW622M.js";import"./chunk-FKDP23RV.js";import"./chunk-5HVC4MM2.js";import{b as ae}from"./chunk-BKENFTY2.js";import"./chunk-YYLTB5E4.js";import"./chunk-AY2G62SN.js";import"./chunk-BEDX3WPF.js";import"./chunk-PYB7SS7C.js";import{$ as $l,$a as Su,A as Tt,Aa as hu,B as bl,Ba as mu,C as vl,Ca as gu,D as Sl,Da as wu,E as El,Ea as _u,F as xl,G as Tl,H as Cl,I as Pl,J as Al,K as Ol,L as Il,M as Ml,N as Rl,O as Dl,P as Nl,Q as kl,Qa as yu,R as Ll,S as Wl,T as Ul,U as Bl,V as ql,Va as bu,W as jl,X as Fl,Y as Hl,Z as Gl,_ as Kl,_a as vu,a as fe,aa as Vl,ab as Eu,b as Ze,ba as Yl,c as Yr,ca as zl,d as al,da as Xl,db as Xr,e as zr,ea as Jl,f as sl,fa as Zl,fb as xu,g as ll,ga as Ql,gb as Tu,h as ul,ha as eu,hb as Cu,i as fl,ia as tu,ib as Pu,j as dl,ja as ru,jb as Au,ka as nu,kb as Ou,l as cl,la as iu,lb as Iu,m as pl,ma as ou,mb as Mu,n as hl,na as au,nb as Ru,oa as su,ob as Du,pa as ci,qa as lu,ra as uu,sa as fu,tb as Nu,ub as ku,v as ml,vb as Lu,w as gl,wa as du,wb as Wu,x as wl,xb as Uu,y as _l,ya as cu,yb as Bu,z as yl,za as pu}from"./chunk-ZASBKUPD.js";import"./chunk-5XAZ5MJZ.js";import"./chunk-4FLAC4IK.js";import"./chunk-BRAZV5TR.js";import{b as Gu,c as Ku,d as $u,e as Jr}from"./chunk-3GRVNJC2.js";import{o as Xt}from"./chunk-64WUUNDB.js";import{Ab as cs,Cb as xe,Kb as ps,N as vt,Pb as hs,R as ls,Tb as ms,Ub as gs,jc as ee,qb as fs,rb as ds,yb as St,zb as $r}from"./chunk-QY24TFF7.js";import"./chunk-RL2JAB2F.js";import"./chunk-OV5ZOYAY.js";import"./chunk-DGSDDTNV.js";import{a as we}from"./chunk-62FSCPM5.js";import{a as qs,b as a_,c as Vr,d as js,e as s_,h as Fs,i as di,k as Hs,m as Gs,p as Ks}from"./chunk-OD4NRGBW.js";import"./chunk-AEW3GAWG.js";import{G as Ls,H as Ws,R as Us,S as Bs,U as o_,b as Cs,e as Ps,f as As,g as Os,h as Is,i as Ms,j as Rs,k as Ds,n as Ns,o as ks}from"./chunk-3O7LGTTV.js";import{a as $w,g as os,i as as,j as n_,k as Je,l as Kr}from"./chunk-GCB5X3BF.js";import{a as us,c as Re,e as zt}from"./chunk-Z36WOTFJ.js";import"./chunk-SS7VQZYW.js";import"./chunk-D7YI6SRK.js";import"./chunk-5PYIEIB7.js";import"./chunk-3XZTE2DB.js";import"./chunk-BXKNNBFT.js";import"./chunk-BOM6ZF3Z.js";import"./chunk-HN3IBJKK.js";import"./chunk-TUSK34X6.js";import"./chunk-BD75ZX4I.js";import"./chunk-AMW3INUA.js";import"./chunk-GQ3SEXRL.js";import"./chunk-S5RMPAYX.js";import"./chunk-Z3XU47FL.js";import"./chunk-NU6HC2VM.js";import"./chunk-W7MN3VJC.js";import{a as pf,c as hf,d as mf,f as gf}from"./chunk-3MBHSNRN.js";import{b as en}from"./chunk-CU62K6VE.js";import{a as Zr}from"./chunk-2NSYI7QP.js";import{c as mi}from"./chunk-DS3RNNYF.js";import{a as df}from"./chunk-J5JOI62E.js";import{Ab as Yt,Bb as Xa,Cb as Ja,Db as Za,Dd as ss,Eb as Qa,Fb as es,G as oi,Gb as ts,Hb as rs,I as bt,Ia as Ba,Ib as ns,Ja as Xw,Jb as fi,Ka as Qw,Ma as Gr,Na as Ga,Pd as i_,Qa as Ka,Ra as $a,Sa as Va,a as Ye,b as Lr,c as ze,d as pe,e as Xe,f as ei,g as Me,j as ti,ja as Fr,ka as zw,la as me,m as Sa,n as Ea,p as xa,pa as Wa,pb as Ya,q as Ta,qa as Ua,qb as t_,r as Ht,ra as Kt,rb as ui,s as ri,t as Br,u as qr,v as Na,w as ii,wb as r_,x as jr,y as ka,yb as za,z as La}from"./chunk-I5E2ION7.js";import{A as Ra,B as G,H as he,c as Aa,n as Oa,q as Ia,w as Ma,y as O}from"./chunk-SQMXULWT.js";import"./chunk-KBSRU77R.js";import{D as Fa,G as oe,H as Ha,I as Vt,a as Jw,b as ai,c as qa,d as ja,h as si,k as Hr,o as ge,r as li,y as Ee}from"./chunk-GQZAGQSC.js";import"./chunk-STCDRFCQ.js";import"./chunk-3LLV5FBU.js";import"./chunk-6JFRAZNP.js";import"./chunk-XWM5BVMO.js";import"./chunk-L625DEVK.js";import{f as Wr,j as Gt,n as Pa,ra as Ur}from"./chunk-GSIHKWLV.js";import"./chunk-4XEB4VJJ.js";import"./chunk-FVWN5TXY.js";import"./chunk-23X4YN5A.js";import"./chunk-SSLLOJNR.js";import"./chunk-OKJNV4PS.js";import"./chunk-OV7WPFRA.js";import{C as $t,ka as Q}from"./chunk-RC6UR2LL.js";import{a as Zw}from"./chunk-XTEVCKH7.js";import{b as P}from"./chunk-BF2V36QE.js";import"./chunk-E735URDA.js";import{b as ni}from"./chunk-QYQXMBK3.js";import{a as e_}from"./chunk-EFTDVKCQ.js";import{a as Yw}from"./chunk-XA6CAVFO.js";import"./chunk-QQYGNHB4.js";import"./chunk-VLDGNBD7.js";import"./chunk-W2A2E62R.js";import"./chunk-5KLUABHD.js";import"./chunk-GIEGURG2.js";import"./chunk-RVWD7D4B.js";import"./chunk-TSXM5GQV.js";import"./chunk-JXBOQGEG.js";import"./chunk-PXW3NTQX.js";import"./chunk-QWOR3C5W.js";import"./chunk-KQL2BBUZ.js";import"./chunk-YUSIJWOC.js";import"./chunk-YHVKZE66.js";import"./chunk-2DSLTDTL.js";import"./chunk-UVIVAH5I.js";import"./chunk-ALIHWT7Z.js";import"./chunk-T4BSRFB6.js";import"./chunk-IAFVNOEB.js";import{a as X,b as _t,c as Ve,d as J,q as yt,r as Qn}from"./chunk-DUYWEMAT.js";import{d as Zn}from"./chunk-WMCBVXPA.js";import{c as x,f as m,h as $e,n as process,o as a,p as f,q as s}from"./chunk-QTLWQ5AJ.js";var Yf=x((HE,Vf)=>{a();s();var l_={}.toString;Vf.exports=Array.isArray||function(e){return l_.call(e)=="[object Array]"}});var gi=x(($E,zf)=>{a();s();zf.exports=_t().EventEmitter});var Zt=x((wi,Jf)=>{a();s();var rn=Zn(),De=rn.Buffer;function Xf(e,t){for(var r in e)t[r]=e[r]}De.from&&De.alloc&&De.allocUnsafe&&De.allocUnsafeSlow?Jf.exports=rn:(Xf(rn,wi),wi.Buffer=Ct);function Ct(e,t,r){return De(e,t,r)}Xf(De,Ct);Ct.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return De(e,t,r)};Ct.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=De(e);return t!==void 0?typeof r=="string"?n.fill(t,r):n.fill(t):n.fill(0),n};Ct.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return De(e)};Ct.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return rn.SlowBuffer(e)}});var Qf=x((JE,_i)=>{"use strict";a();s();function u_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Zf=Zt().Buffer,Qt=yt();function f_(e,t,r){e.copy(t,r)}_i.exports=function(){function e(){u_(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length},e.prototype.unshift=function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length},e.prototype.shift=function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i},e.prototype.concat=function(r){if(this.length===0)return Zf.alloc(0);if(this.length===1)return this.head.data;for(var n=Zf.allocUnsafe(r>>>0),i=this.head,o=0;i;)f_(i.data,n,o),o+=i.data.length,i=i.next;return n},e}();Qt&&Qt.inspect&&Qt.inspect.custom&&(_i.exports.prototype[Qt.inspect.custom]=function(){var e=Qt.inspect({length:this.length});return this.constructor.name+" "+e})});var yi=x((ex,rd)=>{"use strict";a();s();var ed=Ve();function d_(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(!this._writableState||!this._writableState.errorEmitted)&&ed.nextTick(td,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(o){!t&&o?(ed.nextTick(td,r,o),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(o)}),this)}function c_(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function td(e,t){e.emit("error",t)}rd.exports={destroy:d_,undestroy:c_}});var vi=x((nx,fd)=>{"use strict";a();s();var dt=Ve();fd.exports=B;function id(e){var t=this;this.next=null,this.entry=null,this.finish=function(){I_(t,e)}}var p_=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:dt.nextTick,Pt;B.WritableState=tr;var od=Object.create(J());od.inherits=X();var h_={deprecate:Qn()},ad=gi(),on=Zt().Buffer,m_=globalThis.Uint8Array||function(){};function g_(e){return on.from(e)}function w_(e){return on.isBuffer(e)||e instanceof m_}var sd=yi();od.inherits(B,ad);function __(){}function tr(e,t){Pt=Pt||ct(),e=e||{};var r=t instanceof Pt;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,i=e.writableHighWaterMark,o=this.objectMode?16:16*1024;n||n===0?this.highWaterMark=n:r&&(i||i===0)?this.highWaterMark=i:this.highWaterMark=o,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=e.decodeStrings===!1;this.decodeStrings=!l,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(u){T_(t,u)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new id(this)}tr.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(tr.prototype,"buffer",{get:h_.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var nn;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(nn=Function.prototype[Symbol.hasInstance],Object.defineProperty(B,Symbol.hasInstance,{value:function(e){return nn.call(this,e)?!0:this!==B?!1:e&&e._writableState instanceof tr}})):nn=function(e){return e instanceof this};function B(e){if(Pt=Pt||ct(),!nn.call(B,this)&&!(this instanceof Pt))return new B(e);this._writableState=new tr(e,this),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),ad.call(this)}B.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function y_(e,t){var r=new Error("write after end");e.emit("error",r),dt.nextTick(t,r)}function b_(e,t,r,n){var i=!0,o=!1;return r===null?o=new TypeError("May not write null values to stream"):typeof r!="string"&&r!==void 0&&!t.objectMode&&(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),dt.nextTick(n,o),i=!1),i}B.prototype.write=function(e,t,r){var n=this._writableState,i=!1,o=!n.objectMode&&w_(e);return o&&!on.isBuffer(e)&&(e=g_(e)),typeof t=="function"&&(r=t,t=null),o?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=__),n.ended?y_(this,r):(o||b_(this,n,e,r))&&(n.pendingcb++,i=S_(this,n,o,e,t,r)),i};B.prototype.cork=function(){var e=this._writableState;e.corked++};B.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.finished&&!e.bufferProcessing&&e.bufferedRequest&&ld(this,e))};B.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this};function v_(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=on.from(t,r)),t}Object.defineProperty(B.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function S_(e,t,r,n,i,o){if(!r){var l=v_(t,n,i);n!==l&&(r=!0,i="buffer",n=l)}var u=t.objectMode?1:n.length;t.length+=u;var d=t.length<t.highWaterMark;if(d||(t.needDrain=!0),t.writing||t.corked){var p=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},p?p.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else bi(e,t,!1,u,n,i,o);return d}function bi(e,t,r,n,i,o,l){t.writelen=n,t.writecb=l,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function E_(e,t,r,n,i){--t.pendingcb,r?(dt.nextTick(i,n),dt.nextTick(er,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),er(e,t))}function x_(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function T_(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(x_(r),t)E_(e,r,n,t,i);else{var o=ud(r);!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&ld(e,r),n?p_(nd,e,r,o,i):nd(e,r,o,i)}}function nd(e,t,r,n){r||C_(e,t),t.pendingcb--,n(),er(e,t)}function C_(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function ld(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var l=0,u=!0;r;)i[l]=r,r.isBuf||(u=!1),r=r.next,l+=1;i.allBuffers=u,bi(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new id(t),t.bufferedRequestCount=0}else{for(;r;){var d=r.chunk,p=r.encoding,v=r.callback,b=t.objectMode?1:d.length;if(bi(e,t,!1,b,d,p,v),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}B.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))};B.prototype._writev=null;B.prototype.end=function(e,t,r){var n=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),!n.ending&&!n.finished&&O_(this,n,r)};function ud(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function P_(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),er(e,t)})}function A_(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"?(t.pendingcb++,t.finalCalled=!0,dt.nextTick(P_,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function er(e,t){var r=ud(t);return r&&(A_(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"))),r}function O_(e,t,r){t.ending=!0,er(e,t),r&&(t.finished?dt.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function I_(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}Object.defineProperty(B.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){!this._writableState||(this._writableState.destroyed=e)}});B.prototype.destroy=sd.destroy;B.prototype._undestroy=sd.undestroy;B.prototype._destroy=function(e,t){this.end(),t(e)}});var ct=x((ax,hd)=>{"use strict";a();s();var dd=Ve(),M_=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};hd.exports=Ne;var cd=Object.create(J());cd.inherits=X();var pd=xi(),Ei=vi();cd.inherits(Ne,pd);for(Si=M_(Ei.prototype),an=0;an<Si.length;an++)sn=Si[an],Ne.prototype[sn]||(Ne.prototype[sn]=Ei.prototype[sn]);var Si,sn,an;function Ne(e){if(!(this instanceof Ne))return new Ne(e);pd.call(this,e),Ei.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",R_)}Object.defineProperty(Ne.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function R_(){this.allowHalfOpen||this._writableState.ended||dd.nextTick(D_,this)}function D_(e){e.end()}Object.defineProperty(Ne.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}});Ne.prototype._destroy=function(e,t){this.push(null),this.end(),dd.nextTick(t,e)}});var Pi=x(gd=>{"use strict";a();s();var Ci=Zt().Buffer,md=Ci.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function N_(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function k_(e){var t=N_(e);if(typeof t!="string"&&(Ci.isEncoding===md||!md(e)))throw new Error("Unknown encoding: "+e);return t||e}gd.StringDecoder=rr;function rr(e){this.encoding=k_(e);var t;switch(this.encoding){case"utf16le":this.text=j_,this.end=F_,t=4;break;case"utf8":this.fillLast=U_,t=4;break;case"base64":this.text=H_,this.end=G_,t=3;break;default:this.write=K_,this.end=$_;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ci.allocUnsafe(t)}rr.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};rr.prototype.end=q_;rr.prototype.text=B_;rr.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function Ti(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function L_(e,t,r){var n=t.length-1;if(n<r)return 0;var i=Ti(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=Ti(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=Ti(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function W_(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function U_(e){var t=this.lastTotal-this.lastNeed,r=W_(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function B_(e,t){var r=L_(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function q_(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function j_(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function F_(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function H_(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function G_(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function K_(e){return e.toString(this.encoding)}function $_(e){return e&&e.length?this.write(e):""}});var xi=x((px,Ad)=>{"use strict";a();s();var Ot=Ve();Ad.exports=N;var V_=Yf(),nr;N.ReadableState=Ed;var cx=_t().EventEmitter,bd=function(e,t){return e.listeners(t).length},Ri=gi(),ir=Zt().Buffer,Y_=globalThis.Uint8Array||function(){};function z_(e){return ir.from(e)}function X_(e){return ir.isBuffer(e)||e instanceof Y_}var vd=Object.create(J());vd.inherits=X();var Ai=yt(),I=void 0;Ai&&Ai.debuglog?I=Ai.debuglog("stream"):I=function(){};var J_=Qf(),Sd=yi(),At;vd.inherits(N,Ri);var Oi=["error","close","destroy","pause","resume"];function Z_(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):V_(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function Ed(e,t){nr=nr||ct(),e=e||{};var r=t instanceof nr;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,i=e.readableHighWaterMark,o=this.objectMode?16:16*1024;n||n===0?this.highWaterMark=n:r&&(i||i===0)?this.highWaterMark=i:this.highWaterMark=o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new J_,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(At||(At=Pi().StringDecoder),this.decoder=new At(e.encoding),this.encoding=e.encoding)}function N(e){if(nr=nr||ct(),!(this instanceof N))return new N(e);this._readableState=new Ed(e,this),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),Ri.call(this)}Object.defineProperty(N.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){!this._readableState||(this._readableState.destroyed=e)}});N.prototype.destroy=Sd.destroy;N.prototype._undestroy=Sd.undestroy;N.prototype._destroy=function(e,t){this.push(null),t(e)};N.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=ir.from(e,t),t=""),n=!0),xd(this,e,t,!1,n)};N.prototype.unshift=function(e){return xd(this,e,null,!0,!1)};function xd(e,t,r,n,i){var o=e._readableState;if(t===null)o.reading=!1,ry(e,o);else{var l;i||(l=Q_(o,t)),l?e.emit("error",l):o.objectMode||t&&t.length>0?(typeof t!="string"&&!o.objectMode&&Object.getPrototypeOf(t)!==ir.prototype&&(t=z_(t)),n?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):Ii(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||t.length!==0?Ii(e,o,t,!1):Td(e,o)):Ii(e,o,t,!1))):n||(o.reading=!1)}return ey(o)}function Ii(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&ln(e)),Td(e,t)}function Q_(e,t){var r;return!X_(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new TypeError("Invalid non-string/buffer chunk")),r}function ey(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}N.prototype.isPaused=function(){return this._readableState.flowing===!1};N.prototype.setEncoding=function(e){return At||(At=Pi().StringDecoder),this._readableState.decoder=new At(e),this._readableState.encoding=e,this};var wd=8388608;function ty(e){return e>=wd?e=wd:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function _d(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=ty(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}N.prototype.read=function(e){I("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return I("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?Mi(this):ln(this),null;if(e=_d(e,t),e===0&&t.ended)return t.length===0&&Mi(this),null;var n=t.needReadable;I("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,I("length less than watermark",n)),t.ended||t.reading?(n=!1,I("reading or ended",n)):n&&(I("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=_d(r,t)));var i;return e>0?i=Cd(e,t):i=null,i===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&Mi(this)),i!==null&&this.emit("data",i),i};function ry(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,ln(e)}}function ln(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(I("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Ot.nextTick(yd,e):yd(e))}function yd(e){I("emit readable"),e.emit("readable"),Di(e)}function Td(e,t){t.readingMore||(t.readingMore=!0,Ot.nextTick(ny,e,t))}function ny(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(I("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}N.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))};N.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,I("pipe count=%d opts=%j",n.pipesCount,t);var i=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,o=i?u:_;n.endEmitted?Ot.nextTick(o):r.once("end",o),e.on("unpipe",l);function l(y,T){I("onunpipe"),y===r&&T&&T.hasUnpiped===!1&&(T.hasUnpiped=!0,v())}function u(){I("onend"),e.end()}var d=iy(r);e.on("drain",d);var p=!1;function v(){I("cleanup"),e.removeListener("close",C),e.removeListener("finish",g),e.removeListener("drain",d),e.removeListener("error",S),e.removeListener("unpipe",l),r.removeListener("end",u),r.removeListener("end",_),r.removeListener("data",E),p=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&d()}var b=!1;r.on("data",E);function E(y){I("ondata"),b=!1;var T=e.write(y);T===!1&&!b&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&Pd(n.pipes,e)!==-1)&&!p&&(I("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,b=!0),r.pause())}function S(y){I("onerror",y),_(),e.removeListener("error",S),bd(e,"error")===0&&e.emit("error",y)}Z_(e,"error",S);function C(){e.removeListener("finish",g),_()}e.once("close",C);function g(){I("onfinish"),e.removeListener("close",C),_()}e.once("finish",g);function _(){I("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(I("pipe resume"),r.resume()),e};function iy(e){return function(){var t=e._readableState;I("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&bd(e,"data")&&(t.flowing=!0,Di(e))}}N.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,r);return this}var l=Pd(t.pipes,e);return l===-1?this:(t.pipes.splice(l,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};N.prototype.on=function(e,t){var r=Ri.prototype.on.call(this,e,t);if(e==="data")this._readableState.flowing!==!1&&this.resume();else if(e==="readable"){var n=this._readableState;!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&ln(this):Ot.nextTick(oy,this))}return r};N.prototype.addListener=N.prototype.on;function oy(e){I("readable nexttick read 0"),e.read(0)}N.prototype.resume=function(){var e=this._readableState;return e.flowing||(I("resume"),e.flowing=!0,ay(this,e)),this};function ay(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Ot.nextTick(sy,e,t))}function sy(e,t){t.reading||(I("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),Di(e),t.flowing&&!t.reading&&e.read(0)}N.prototype.pause=function(){return I("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(I("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function Di(e){var t=e._readableState;for(I("flow",t.flowing);t.flowing&&e.read()!==null;);}N.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(I("wrapped end"),r.decoder&&!r.ended){var l=r.decoder.end();l&&l.length&&t.push(l)}t.push(null)}),e.on("data",function(l){if(I("wrapped data"),r.decoder&&(l=r.decoder.write(l)),!(r.objectMode&&l==null)&&!(!r.objectMode&&(!l||!l.length))){var u=t.push(l);u||(n=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=function(l){return function(){return e[l].apply(e,arguments)}}(i));for(var o=0;o<Oi.length;o++)e.on(Oi[o],this.emit.bind(this,Oi[o]));return this._read=function(l){I("wrapped _read",l),n&&(n=!1,e.resume())},this};Object.defineProperty(N.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});N._fromList=Cd;function Cd(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.head.data:r=t.buffer.concat(t.length),t.buffer.clear()):r=ly(e,t.buffer,t.decoder),r}function ly(e,t,r){var n;return e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):e===t.head.data.length?n=t.shift():n=r?uy(e,t):fy(e,t),n}function uy(e,t){var r=t.head,n=1,i=r.data;for(e-=i.length;r=r.next;){var o=r.data,l=e>o.length?o.length:e;if(l===o.length?i+=o:i+=o.slice(0,e),e-=l,e===0){l===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(l));break}++n}return t.length-=n,i}function fy(e,t){var r=ir.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var o=n.data,l=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,l),e-=l,e===0){l===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(l));break}++i}return t.length-=i,r}function Mi(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Ot.nextTick(dy,t,e))}function dy(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function Pd(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var Ni=x((gx,Md)=>{"use strict";a();s();Md.exports=ke;var un=ct(),Id=Object.create(J());Id.inherits=X();Id.inherits(ke,un);function cy(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function ke(e){if(!(this instanceof ke))return new ke(e);un.call(this,e),this._transformState={afterTransform:cy.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",py)}function py(){var e=this;typeof this._flush=="function"?this._flush(function(t,r){Od(e,t,r)}):Od(this,null,null)}ke.prototype.push=function(e,t){return this._transformState.needTransform=!1,un.prototype.push.call(this,e,t)};ke.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")};ke.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};ke.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};ke.prototype._destroy=function(e,t){var r=this;un.prototype._destroy.call(this,e,function(n){t(n),r.emit("close")})};function Od(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}});var kd=x((yx,Nd)=>{"use strict";a();s();Nd.exports=or;var Rd=Ni(),Dd=Object.create(J());Dd.inherits=X();Dd.inherits(or,Rd);function or(e){if(!(this instanceof or))return new or(e);Rd.call(this,e)}or.prototype._transform=function(e,t,r){r(null,e)}});var Wd=x((Te,Ld)=>{a();s();Te=Ld.exports=xi();Te.Stream=Te;Te.Readable=Te;Te.Writable=vi();Te.Duplex=ct();Te.Transform=Ni();Te.PassThrough=kd()});var Bd=x((xx,Wi)=>{a();s();var Ud=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof window.msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto);Ud?(ki=new Uint8Array(16),Wi.exports=function(){return Ud(ki),ki}):(Li=new Array(16),Wi.exports=function(){for(var t=0,r;t<16;t++)(t&3)===0&&(r=Math.random()*4294967296),Li[t]=r>>>((t&3)<<3)&255;return Li});var ki,Li});var Fd=x((Px,jd)=>{a();s();var qd=[];for(ar=0;ar<256;++ar)qd[ar]=(ar+256).toString(16).substr(1);var ar;function hy(e,t){var r=t||0,n=qd;return[n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]]].join("")}jd.exports=hy});var Gd=x((Ix,Hd)=>{a();s();var my=Bd(),gy=Fd();function wy(e,t,r){var n=t&&r||0;typeof e=="string"&&(t=e==="binary"?new Array(16):null,e=null),e=e||{};var i=e.random||(e.rng||my)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t)for(var o=0;o<16;++o)t[n+o]=i[o];return t||gy(i)}Hd.exports=wy});var Vd=x((Dx,$d)=>{a();s();var Kd=Wd().Duplex,_y=yt().inherits,yy=Gd();$d.exports=Qe;_y(Qe,Kd);function Qe(){Kd.call(this,{objectMode:!0}),this._payloads={}}Qe.prototype.send=function(e){throw new Error('StreamProvider - does not support synchronous RPC calls. called: "'+e.method+'"')};Qe.prototype.sendAsync=function(e,t){let r=e.id,n=yy();if(e.id=n,Array.isArray(e)&&e.length===0)return t(null,[]);this._payloads[n]=[t,r],this.push(e)};Qe.prototype.isConnected=function(){return!0};Qe.prototype._onResponse=function(e){let t=e.id,r=this._payloads[t];if(!r)throw new Error(`StreamProvider - Unknown response id for response: ${e}`);delete this._payloads[t];let n=r[0];e.id=r[1],setTimeout(function(){n(null,e)})};Qe.prototype._read=by;Qe.prototype._write=function(e,t,r){this._onResponse(e),r()};function by(){}});var sr=x((Lx,Ui)=>{"use strict";a();s();!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0?Ui.exports=vy:Ui.exports=process.nextTick;function vy(e,t,r,n){if(typeof e!="function")throw new TypeError('"callback" argument must be a function');var i=arguments.length,o,l;switch(i){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick(function(){e.call(null,t)});case 3:return process.nextTick(function(){e.call(null,t,r)});case 4:return process.nextTick(function(){e.call(null,t,r,n)});default:for(o=new Array(i-1),l=0;l<o.length;)o[l++]=arguments[l];return process.nextTick(function(){e.apply(null,o)})}}});var zd=x((Bx,Yd)=>{a();s();var Sy={}.toString;Yd.exports=Array.isArray||function(e){return Sy.call(e)=="[object Array]"}});var Bi=x((Fx,Xd)=>{a();s();Xd.exports=_t().EventEmitter});var lr=x((qi,Zd)=>{a();s();var fn=Zn(),Le=fn.Buffer;function Jd(e,t){for(var r in e)t[r]=e[r]}Le.from&&Le.alloc&&Le.allocUnsafe&&Le.allocUnsafeSlow?Zd.exports=fn:(Jd(fn,qi),qi.Buffer=It);function It(e,t,r){return Le(e,t,r)}Jd(Le,It);It.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return Le(e,t,r)};It.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=Le(e);return t!==void 0?typeof r=="string"?n.fill(t,r):n.fill(t):n.fill(0),n};It.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Le(e)};It.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return fn.SlowBuffer(e)}});var tc=x((Vx,ec)=>{"use strict";a();s();function Ey(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Qd=lr().Buffer;function xy(e,t,r){e.copy(t,r)}ec.exports=function(){function e(){Ey(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length},e.prototype.unshift=function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length},e.prototype.shift=function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i},e.prototype.concat=function(r){if(this.length===0)return Qd.alloc(0);if(this.length===1)return this.head.data;for(var n=Qd.allocUnsafe(r>>>0),i=this.head,o=0;i;)xy(i.data,n,o),o+=i.data.length,i=i.next;return n},e}()});var ji=x((Xx,ic)=>{"use strict";a();s();var rc=sr();function Ty(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;if(n||i){t?t(e):e&&(!this._writableState||!this._writableState.errorEmitted)&&rc(nc,this,e);return}this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(o){!t&&o?(rc(nc,r,o),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(o)})}function Cy(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function nc(e,t){e.emit("error",t)}ic.exports={destroy:Ty,undestroy:Cy}});var Hi=x((Qx,cc)=>{"use strict";a();s();var pt=sr();cc.exports=F;function ac(e){var t=this;this.next=null,this.entry=null,this.finish=function(){Gy(t,e)}}var Py=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:pt,Mt;F.WritableState=fr;var sc=J();sc.inherits=X();var Ay={deprecate:Qn()},lc=Bi(),cn=lr().Buffer,Oy=globalThis.Uint8Array||function(){};function Iy(e){return cn.from(e)}function My(e){return cn.isBuffer(e)||e instanceof Oy}var uc=ji();sc.inherits(F,lc);function Ry(){}function fr(e,t){Mt=Mt||ht(),e=e||{},this.objectMode=!!e.objectMode,t instanceof Mt&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var r=e.highWaterMark,n=this.objectMode?16:16*1024;this.highWaterMark=r||r===0?r:n,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=e.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(o){By(t,o)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new ac(this)}fr.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(fr.prototype,"buffer",{get:Ay.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var dn;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(dn=Function.prototype[Symbol.hasInstance],Object.defineProperty(F,Symbol.hasInstance,{value:function(e){return dn.call(this,e)?!0:e&&e._writableState instanceof fr}})):dn=function(e){return e instanceof this};function F(e){if(Mt=Mt||ht(),!dn.call(F,this)&&!(this instanceof Mt))return new F(e);this._writableState=new fr(e,this),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),lc.call(this)}F.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function Dy(e,t){var r=new Error("write after end");e.emit("error",r),pt(t,r)}function Ny(e,t,r,n){var i=!0,o=!1;return r===null?o=new TypeError("May not write null values to stream"):typeof r!="string"&&r!==void 0&&!t.objectMode&&(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),pt(n,o),i=!1),i}F.prototype.write=function(e,t,r){var n=this._writableState,i=!1,o=My(e)&&!n.objectMode;return o&&!cn.isBuffer(e)&&(e=Iy(e)),typeof t=="function"&&(r=t,t=null),o?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=Ry),n.ended?Dy(this,r):(o||Ny(this,n,e,r))&&(n.pendingcb++,i=Ly(this,n,o,e,t,r)),i};F.prototype.cork=function(){var e=this._writableState;e.corked++};F.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.finished&&!e.bufferProcessing&&e.bufferedRequest&&fc(this,e))};F.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this};function ky(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=cn.from(t,r)),t}function Ly(e,t,r,n,i,o){if(!r){var l=ky(t,n,i);n!==l&&(r=!0,i="buffer",n=l)}var u=t.objectMode?1:n.length;t.length+=u;var d=t.length<t.highWaterMark;if(d||(t.needDrain=!0),t.writing||t.corked){var p=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},p?p.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else Fi(e,t,!1,u,n,i,o);return d}function Fi(e,t,r,n,i,o,l){t.writelen=n,t.writecb=l,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function Wy(e,t,r,n,i){--t.pendingcb,r?(pt(i,n),pt(ur,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),ur(e,t))}function Uy(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function By(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(Uy(r),t)Wy(e,r,n,t,i);else{var o=dc(r);!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&fc(e,r),n?Py(oc,e,r,o,i):oc(e,r,o,i)}}function oc(e,t,r,n){r||qy(e,t),t.pendingcb--,n(),ur(e,t)}function qy(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function fc(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var l=0,u=!0;r;)i[l]=r,r.isBuf||(u=!1),r=r.next,l+=1;i.allBuffers=u,Fi(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new ac(t)}else{for(;r;){var d=r.chunk,p=r.encoding,v=r.callback,b=t.objectMode?1:d.length;if(Fi(e,t,!1,b,d,p,v),r=r.next,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=r,t.bufferProcessing=!1}F.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))};F.prototype._writev=null;F.prototype.end=function(e,t,r){var n=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),!n.ending&&!n.finished&&Hy(this,n,r)};function dc(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function jy(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),ur(e,t)})}function Fy(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"?(t.pendingcb++,t.finalCalled=!0,pt(jy,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function ur(e,t){var r=dc(t);return r&&(Fy(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"))),r}function Hy(e,t,r){t.ending=!0,ur(e,t),r&&(t.finished?pt(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function Gy(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}Object.defineProperty(F.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){!this._writableState||(this._writableState.destroyed=e)}});F.prototype.destroy=uc.destroy;F.prototype._undestroy=uc.undestroy;F.prototype._destroy=function(e,t){this.end(),t(e)}});var ht=x((rT,wc)=>{"use strict";a();s();var hc=sr(),Ky=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};wc.exports=et;var mc=J();mc.inherits=X();var gc=Ki(),Gi=Hi();mc.inherits(et,gc);var pc=Ky(Gi.prototype);for(pn=0;pn<pc.length;pn++)hn=pc[pn],et.prototype[hn]||(et.prototype[hn]=Gi.prototype[hn]);var hn,pn;function et(e){if(!(this instanceof et))return new et(e);gc.call(this,e),Gi.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",$y)}function $y(){this.allowHalfOpen||this._writableState.ended||hc(Vy,this)}function Vy(e){e.end()}Object.defineProperty(et.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}});et.prototype._destroy=function(e,t){this.push(null),this.end(),hc(t,e)}});var Yi=x(yc=>{"use strict";a();s();var Vi=lr().Buffer,_c=Vi.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Yy(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function zy(e){var t=Yy(e);if(typeof t!="string"&&(Vi.isEncoding===_c||!_c(e)))throw new Error("Unknown encoding: "+e);return t||e}yc.StringDecoder=dr;function dr(e){this.encoding=zy(e);var t;switch(this.encoding){case"utf16le":this.text=tb,this.end=rb,t=4;break;case"utf8":this.fillLast=Zy,t=4;break;case"base64":this.text=nb,this.end=ib,t=3;break;default:this.write=ob,this.end=ab;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Vi.allocUnsafe(t)}dr.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};dr.prototype.end=eb;dr.prototype.text=Qy;dr.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function $i(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:-1}function Xy(e,t,r){var n=t.length-1;if(n<r)return 0;var i=$i(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r?0:(i=$i(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r?0:(i=$i(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function Jy(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD".repeat(r);if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD".repeat(r+1);if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD".repeat(r+2)}}function Zy(e){var t=this.lastTotal-this.lastNeed,r=Jy(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function Qy(e,t){var r=Xy(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function eb(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD".repeat(this.lastTotal-this.lastNeed):t}function tb(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function rb(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function nb(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function ib(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function ob(e){return e.toString(this.encoding)}function ab(e){return e&&e.length?this.write(e):""}});var Ki=x((uT,Mc)=>{"use strict";a();s();var Dt=sr();Mc.exports=L;var sb=zd(),cr;L.ReadableState=Cc;var lT=_t().EventEmitter,Ec=function(e,t){return e.listeners(t).length},Qi=Bi(),pr=lr().Buffer,lb=globalThis.Uint8Array||function(){};function ub(e){return pr.from(e)}function fb(e){return pr.isBuffer(e)||e instanceof lb}var xc=J();xc.inherits=X();var zi=yt(),M=void 0;zi&&zi.debuglog?M=zi.debuglog("stream"):M=function(){};var db=tc(),Tc=ji(),Rt;xc.inherits(L,Qi);var Xi=["error","close","destroy","pause","resume"];function cb(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):sb(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function Cc(e,t){cr=cr||ht(),e=e||{},this.objectMode=!!e.objectMode,t instanceof cr&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,n=this.objectMode?16:16*1024;this.highWaterMark=r||r===0?r:n,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new db,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(Rt||(Rt=Yi().StringDecoder),this.decoder=new Rt(e.encoding),this.encoding=e.encoding)}function L(e){if(cr=cr||ht(),!(this instanceof L))return new L(e);this._readableState=new Cc(e,this),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),Qi.call(this)}Object.defineProperty(L.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){!this._readableState||(this._readableState.destroyed=e)}});L.prototype.destroy=Tc.destroy;L.prototype._undestroy=Tc.undestroy;L.prototype._destroy=function(e,t){this.push(null),t(e)};L.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=pr.from(e,t),t=""),n=!0),Pc(this,e,t,!1,n)};L.prototype.unshift=function(e){return Pc(this,e,null,!0,!1)};function Pc(e,t,r,n,i){var o=e._readableState;if(t===null)o.reading=!1,gb(e,o);else{var l;i||(l=pb(o,t)),l?e.emit("error",l):o.objectMode||t&&t.length>0?(typeof t!="string"&&!o.objectMode&&Object.getPrototypeOf(t)!==pr.prototype&&(t=ub(t)),n?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):Ji(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||t.length!==0?Ji(e,o,t,!1):Ac(e,o)):Ji(e,o,t,!1))):n||(o.reading=!1)}return hb(o)}function Ji(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&mn(e)),Ac(e,t)}function pb(e,t){var r;return!fb(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new TypeError("Invalid non-string/buffer chunk")),r}function hb(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}L.prototype.isPaused=function(){return this._readableState.flowing===!1};L.prototype.setEncoding=function(e){return Rt||(Rt=Yi().StringDecoder),this._readableState.decoder=new Rt(e),this._readableState.encoding=e,this};var bc=8388608;function mb(e){return e>=bc?e=bc:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function vc(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=mb(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}L.prototype.read=function(e){M("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return M("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?Zi(this):mn(this),null;if(e=vc(e,t),e===0&&t.ended)return t.length===0&&Zi(this),null;var n=t.needReadable;M("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,M("length less than watermark",n)),t.ended||t.reading?(n=!1,M("reading or ended",n)):n&&(M("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=vc(r,t)));var i;return e>0?i=Oc(e,t):i=null,i===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&Zi(this)),i!==null&&this.emit("data",i),i};function gb(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,mn(e)}}function mn(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(M("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Dt(Sc,e):Sc(e))}function Sc(e){M("emit readable"),e.emit("readable"),eo(e)}function Ac(e,t){t.readingMore||(t.readingMore=!0,Dt(wb,e,t))}function wb(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(M("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}L.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))};L.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,M("pipe count=%d opts=%j",n.pipesCount,t);var i=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,o=i?u:_;n.endEmitted?Dt(o):r.once("end",o),e.on("unpipe",l);function l(y,T){M("onunpipe"),y===r&&T&&T.hasUnpiped===!1&&(T.hasUnpiped=!0,v())}function u(){M("onend"),e.end()}var d=_b(r);e.on("drain",d);var p=!1;function v(){M("cleanup"),e.removeListener("close",C),e.removeListener("finish",g),e.removeListener("drain",d),e.removeListener("error",S),e.removeListener("unpipe",l),r.removeListener("end",u),r.removeListener("end",_),r.removeListener("data",E),p=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&d()}var b=!1;r.on("data",E);function E(y){M("ondata"),b=!1;var T=e.write(y);T===!1&&!b&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&Ic(n.pipes,e)!==-1)&&!p&&(M("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,b=!0),r.pause())}function S(y){M("onerror",y),_(),e.removeListener("error",S),Ec(e,"error")===0&&e.emit("error",y)}cb(e,"error",S);function C(){e.removeListener("finish",g),_()}e.once("close",C);function g(){M("onfinish"),e.removeListener("close",C),_()}e.once("finish",g);function _(){M("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(M("pipe resume"),r.resume()),e};function _b(e){return function(){var t=e._readableState;M("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&Ec(e,"data")&&(t.flowing=!0,eo(e))}}L.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,r);return this}var l=Ic(t.pipes,e);return l===-1?this:(t.pipes.splice(l,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};L.prototype.on=function(e,t){var r=Qi.prototype.on.call(this,e,t);if(e==="data")this._readableState.flowing!==!1&&this.resume();else if(e==="readable"){var n=this._readableState;!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&mn(this):Dt(yb,this))}return r};L.prototype.addListener=L.prototype.on;function yb(e){M("readable nexttick read 0"),e.read(0)}L.prototype.resume=function(){var e=this._readableState;return e.flowing||(M("resume"),e.flowing=!0,bb(this,e)),this};function bb(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Dt(vb,e,t))}function vb(e,t){t.reading||(M("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),eo(e),t.flowing&&!t.reading&&e.read(0)}L.prototype.pause=function(){return M("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(M("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function eo(e){var t=e._readableState;for(M("flow",t.flowing);t.flowing&&e.read()!==null;);}L.prototype.wrap=function(e){var t=this._readableState,r=!1,n=this;e.on("end",function(){if(M("wrapped end"),t.decoder&&!t.ended){var l=t.decoder.end();l&&l.length&&n.push(l)}n.push(null)}),e.on("data",function(l){if(M("wrapped data"),t.decoder&&(l=t.decoder.write(l)),!(t.objectMode&&l==null)&&!(!t.objectMode&&(!l||!l.length))){var u=n.push(l);u||(r=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=function(l){return function(){return e[l].apply(e,arguments)}}(i));for(var o=0;o<Xi.length;o++)e.on(Xi[o],n.emit.bind(n,Xi[o]));return n._read=function(l){M("wrapped _read",l),r&&(r=!1,e.resume())},n};L._fromList=Oc;function Oc(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.head.data:r=t.buffer.concat(t.length),t.buffer.clear()):r=Sb(e,t.buffer,t.decoder),r}function Sb(e,t,r){var n;return e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):e===t.head.data.length?n=t.shift():n=r?Eb(e,t):xb(e,t),n}function Eb(e,t){var r=t.head,n=1,i=r.data;for(e-=i.length;r=r.next;){var o=r.data,l=e>o.length?o.length:e;if(l===o.length?i+=o:i+=o.slice(0,e),e-=l,e===0){l===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(l));break}++n}return t.length-=n,i}function xb(e,t){var r=pr.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var o=n.data,l=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,l),e-=l,e===0){l===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(l));break}++i}return t.length-=i,r}function Zi(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Dt(Tb,t,e))}function Tb(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function Ic(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var to=x((cT,Nc)=>{"use strict";a();s();Nc.exports=We;var gn=ht(),Dc=J();Dc.inherits=X();Dc.inherits(We,gn);function Cb(e){this.afterTransform=function(t,r){return Pb(e,t,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function Pb(e,t,r){var n=e._transformState;n.transforming=!1;var i=n.writecb;if(!i)return e.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,r!=null&&e.push(r),i(t);var o=e._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&e._read(o.highWaterMark)}function We(e){if(!(this instanceof We))return new We(e);gn.call(this,e),this._transformState=new Cb(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.once("prefinish",function(){typeof this._flush=="function"?this._flush(function(r,n){Rc(t,r,n)}):Rc(t)})}We.prototype.push=function(e,t){return this._transformState.needTransform=!1,gn.prototype.push.call(this,e,t)};We.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")};We.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};We.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};We.prototype._destroy=function(e,t){var r=this;gn.prototype._destroy.call(this,e,function(n){t(n),r.emit("close")})};function Rc(e,t,r){if(t)return e.emit("error",t);r!=null&&e.push(r);var n=e._writableState,i=e._transformState;if(n.length)throw new Error("Calling transform done when ws.length != 0");if(i.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}});var Uc=x((mT,Wc)=>{"use strict";a();s();Wc.exports=hr;var kc=to(),Lc=J();Lc.inherits=X();Lc.inherits(hr,kc);function hr(e){if(!(this instanceof hr))return new hr(e);kc.call(this,e)}hr.prototype._transform=function(e,t,r){r(null,e)}});var qc=x((Ce,Bc)=>{a();s();Ce=Bc.exports=Ki();Ce.Stream=Ce;Ce.Readable=Ce;Ce.Writable=Hi();Ce.Duplex=ht();Ce.Transform=to();Ce.PassThrough=Uc()});var $c=x((xT,Kc)=>{a();s();Kc.exports=gr;gr.default=gr;gr.stable=Hc;gr.stableStringify=Hc;var Ue=[],tt=[];function gr(e,t,r){ro(e,"",[],void 0);var n;for(tt.length===0?n=JSON.stringify(e,t,r):n=JSON.stringify(e,Gc(t),r);Ue.length!==0;){var i=Ue.pop();i.length===4?Object.defineProperty(i[0],i[1],i[3]):i[0][i[1]]=i[2]}return n}function ro(e,t,r,n){var i;if(typeof e=="object"&&e!==null){for(i=0;i<r.length;i++)if(r[i]===e){var o=Object.getOwnPropertyDescriptor(n,t);o.get!==void 0?o.configurable?(Object.defineProperty(n,t,{value:"[Circular]"}),Ue.push([n,t,e,o])):tt.push([e,t]):(n[t]="[Circular]",Ue.push([n,t,e]));return}if(r.push(e),Array.isArray(e))for(i=0;i<e.length;i++)ro(e[i],i,r,e);else{var l=Object.keys(e);for(i=0;i<l.length;i++){var u=l[i];ro(e[u],u,r,e)}}r.pop()}}function Ab(e,t){return e<t?-1:e>t?1:0}function Hc(e,t,r){var n=no(e,"",[],void 0)||e,i;for(tt.length===0?i=JSON.stringify(n,t,r):i=JSON.stringify(n,Gc(t),r);Ue.length!==0;){var o=Ue.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}return i}function no(e,t,r,n){var i;if(typeof e=="object"&&e!==null){for(i=0;i<r.length;i++)if(r[i]===e){var o=Object.getOwnPropertyDescriptor(n,t);o.get!==void 0?o.configurable?(Object.defineProperty(n,t,{value:"[Circular]"}),Ue.push([n,t,e,o])):tt.push([e,t]):(n[t]="[Circular]",Ue.push([n,t,e]));return}if(typeof e.toJSON=="function")return;if(r.push(e),Array.isArray(e))for(i=0;i<e.length;i++)no(e[i],i,r,e);else{var l={},u=Object.keys(e).sort(Ab);for(i=0;i<u.length;i++){var d=u[i];no(e[d],d,r,e),l[d]=e[d]}if(n!==void 0)Ue.push([n,t,e]),n[t]=l;else return l}r.pop()}}function Gc(e){return e=e!==void 0?e:function(t,r){return r},function(t,r){if(tt.length>0)for(var n=0;n<tt.length;n++){var i=tt[n];if(i[1]===t&&i[0]===r){r="[Circular]",tt.splice(n,1);break}}return e.call(this,t,r)}}});var _n=x(Nt=>{"use strict";a();s();Object.defineProperty(Nt,"__esModule",{value:!0});Nt.EthereumProviderError=Nt.EthereumRpcError=void 0;var Ob=$c(),wn=class 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(){let 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 Ob.default(this.serialize(),Mb,2)}};Nt.EthereumRpcError=wn;var io=class extends wn{constructor(t,r,n){if(!Ib(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};Nt.EthereumProviderError=io;function Ib(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function Mb(e,t){if(t!=="[Circular]")return t}});var yn=x(kt=>{"use strict";a();s();Object.defineProperty(kt,"__esModule",{value:!0});kt.errorValues=kt.errorCodes=void 0;kt.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}};kt.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."}}});var so=x(ye=>{"use strict";a();s();Object.defineProperty(ye,"__esModule",{value:!0});ye.serializeError=ye.isValidCode=ye.getMessageFromCode=ye.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;var bn=yn(),Rb=_n(),Vc=bn.errorCodes.rpc.internal,Db="Unspecified error message. This is a bug, please report it.",Nb={code:Vc,message:ao(Vc)};ye.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function ao(e,t=Db){if(Number.isInteger(e)){let r=e.toString();if(oo(bn.errorValues,r))return bn.errorValues[r].message;if(Xc(e))return ye.JSON_RPC_SERVER_ERROR_MESSAGE}return t}ye.getMessageFromCode=ao;function zc(e){if(!Number.isInteger(e))return!1;let t=e.toString();return!!(bn.errorValues[t]||Xc(e))}ye.isValidCode=zc;function kb(e,{fallbackError:t=Nb,shouldIncludeStack:r=!1}={}){var n,i;if(!t||!Number.isInteger(t.code)||typeof t.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof Rb.EthereumRpcError)return e.serialize();let o={};if(e&&typeof e=="object"&&!Array.isArray(e)&&oo(e,"code")&&zc(e.code)){let u=e;o.code=u.code,u.message&&typeof u.message=="string"?(o.message=u.message,oo(u,"data")&&(o.data=u.data)):(o.message=ao(o.code),o.data={originalError:Yc(e)})}else{o.code=t.code;let u=(n=e)===null||n===void 0?void 0:n.message;o.message=u&&typeof u=="string"?u:t.message,o.data={originalError:Yc(e)}}let l=(i=e)===null||i===void 0?void 0:i.stack;return r&&e&&l&&typeof l=="string"&&(o.stack=l),o}ye.serializeError=kb;function Xc(e){return e>=-32099&&e<=-32e3}function Yc(e){return e&&typeof e=="object"&&!Array.isArray(e)?Object.assign({},e):e}function oo(e,t){return Object.prototype.hasOwnProperty.call(e,t)}});var Qc=x(vn=>{"use strict";a();s();Object.defineProperty(vn,"__esModule",{value:!0});vn.ethErrors=void 0;var lo=_n(),Jc=so(),$=yn();vn.ethErrors={rpc:{parse:e=>ce($.errorCodes.rpc.parse,e),invalidRequest:e=>ce($.errorCodes.rpc.invalidRequest,e),invalidParams:e=>ce($.errorCodes.rpc.invalidParams,e),methodNotFound:e=>ce($.errorCodes.rpc.methodNotFound,e),internal:e=>ce($.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("RPC Server errors must provide single object argument.");let{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 ce(t,e)},invalidInput:e=>ce($.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>ce($.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>ce($.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>ce($.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>ce($.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>ce($.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>wr($.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>wr($.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>wr($.errorCodes.provider.unsupportedMethod,e),disconnected:e=>wr($.errorCodes.provider.disconnected,e),chainDisconnected:e=>wr($.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Provider custom errors must provide single object argument.");let{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new lo.EthereumProviderError(t,r,n)}}};function ce(e,t){let[r,n]=Zc(t);return new lo.EthereumRpcError(e,r||Jc.getMessageFromCode(e),n)}function wr(e,t){let[r,n]=Zc(t);return new lo.EthereumProviderError(e,r||Jc.getMessageFromCode(e),n)}function Zc(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){let{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}});var rp=x(te=>{"use strict";a();s();Object.defineProperty(te,"__esModule",{value:!0});te.getMessageFromCode=te.serializeError=te.EthereumProviderError=te.EthereumRpcError=te.ethErrors=te.errorCodes=void 0;var ep=_n();Object.defineProperty(te,"EthereumRpcError",{enumerable:!0,get:function(){return ep.EthereumRpcError}});Object.defineProperty(te,"EthereumProviderError",{enumerable:!0,get:function(){return ep.EthereumProviderError}});var tp=so();Object.defineProperty(te,"serializeError",{enumerable:!0,get:function(){return tp.serializeError}});Object.defineProperty(te,"getMessageFromCode",{enumerable:!0,get:function(){return tp.getMessageFromCode}});var Lb=Qc();Object.defineProperty(te,"ethErrors",{enumerable:!0,get:function(){return Lb.ethErrors}});var Wb=yn();Object.defineProperty(te,"errorCodes",{enumerable:!0,get:function(){return Wb.errorCodes}})});var sp=x(($T,ap)=>{a();s();var Bb={}.toString;ap.exports=Array.isArray||function(e){return Bb.call(e)=="[object Array]"}});var fo=x((zT,lp)=>{a();s();lp.exports=_t().EventEmitter});var _r=x((co,fp)=>{a();s();var Sn=Zn(),Be=Sn.Buffer;function up(e,t){for(var r in e)t[r]=e[r]}Be.from&&Be.alloc&&Be.allocUnsafe&&Be.allocUnsafeSlow?fp.exports=Sn:(up(Sn,co),co.Buffer=Lt);function Lt(e,t,r){return Be(e,t,r)}up(Be,Lt);Lt.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return Be(e,t,r)};Lt.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=Be(e);return t!==void 0?typeof r=="string"?n.fill(t,r):n.fill(t):n.fill(0),n};Lt.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Be(e)};Lt.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Sn.SlowBuffer(e)}});var cp=x((eC,po)=>{"use strict";a();s();function qb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var dp=_r().Buffer,yr=yt();function jb(e,t,r){e.copy(t,r)}po.exports=function(){function e(){qb(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length},e.prototype.unshift=function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length},e.prototype.shift=function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i},e.prototype.concat=function(r){if(this.length===0)return dp.alloc(0);if(this.length===1)return this.head.data;for(var n=dp.allocUnsafe(r>>>0),i=this.head,o=0;i;)jb(i.data,n,o),o+=i.data.length,i=i.next;return n},e}();yr&&yr.inspect&&yr.inspect.custom&&(po.exports.prototype[yr.inspect.custom]=function(){var e=yr.inspect({length:this.length});return this.constructor.name+" "+e})});var ho=x((nC,mp)=>{"use strict";a();s();var pp=Ve();function Fb(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(!this._writableState||!this._writableState.errorEmitted)&&pp.nextTick(hp,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(o){!t&&o?(pp.nextTick(hp,r,o),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(o)}),this)}function Hb(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function hp(e,t){e.emit("error",t)}mp.exports={destroy:Fb,undestroy:Hb}});var go=x((aC,Ep)=>{"use strict";a();s();var mt=Ve();Ep.exports=q;function wp(e){var t=this;this.next=null,this.entry=null,this.finish=function(){sv(t,e)}}var Gb=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:mt.nextTick,Wt;q.WritableState=vr;var _p=Object.create(J());_p.inherits=X();var Kb={deprecate:Qn()},yp=fo(),xn=_r().Buffer,$b=globalThis.Uint8Array||function(){};function Vb(e){return xn.from(e)}function Yb(e){return xn.isBuffer(e)||e instanceof $b}var bp=ho();_p.inherits(q,yp);function zb(){}function vr(e,t){Wt=Wt||gt(),e=e||{};var r=t instanceof Wt;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,i=e.writableHighWaterMark,o=this.objectMode?16:16*1024;n||n===0?this.highWaterMark=n:r&&(i||i===0)?this.highWaterMark=i:this.highWaterMark=o,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=e.decodeStrings===!1;this.decodeStrings=!l,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(u){rv(t,u)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new wp(this)}vr.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(vr.prototype,"buffer",{get:Kb.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var En;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(En=Function.prototype[Symbol.hasInstance],Object.defineProperty(q,Symbol.hasInstance,{value:function(e){return En.call(this,e)?!0:this!==q?!1:e&&e._writableState instanceof vr}})):En=function(e){return e instanceof this};function q(e){if(Wt=Wt||gt(),!En.call(q,this)&&!(this instanceof Wt))return new q(e);this._writableState=new vr(e,this),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),yp.call(this)}q.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function Xb(e,t){var r=new Error("write after end");e.emit("error",r),mt.nextTick(t,r)}function Jb(e,t,r,n){var i=!0,o=!1;return r===null?o=new TypeError("May not write null values to stream"):typeof r!="string"&&r!==void 0&&!t.objectMode&&(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),mt.nextTick(n,o),i=!1),i}q.prototype.write=function(e,t,r){var n=this._writableState,i=!1,o=!n.objectMode&&Yb(e);return o&&!xn.isBuffer(e)&&(e=Vb(e)),typeof t=="function"&&(r=t,t=null),o?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=zb),n.ended?Xb(this,r):(o||Jb(this,n,e,r))&&(n.pendingcb++,i=Qb(this,n,o,e,t,r)),i};q.prototype.cork=function(){var e=this._writableState;e.corked++};q.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.finished&&!e.bufferProcessing&&e.bufferedRequest&&vp(this,e))};q.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this};function Zb(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=xn.from(t,r)),t}Object.defineProperty(q.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Qb(e,t,r,n,i,o){if(!r){var l=Zb(t,n,i);n!==l&&(r=!0,i="buffer",n=l)}var u=t.objectMode?1:n.length;t.length+=u;var d=t.length<t.highWaterMark;if(d||(t.needDrain=!0),t.writing||t.corked){var p=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},p?p.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else mo(e,t,!1,u,n,i,o);return d}function mo(e,t,r,n,i,o,l){t.writelen=n,t.writecb=l,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function ev(e,t,r,n,i){--t.pendingcb,r?(mt.nextTick(i,n),mt.nextTick(br,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),br(e,t))}function tv(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function rv(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(tv(r),t)ev(e,r,n,t,i);else{var o=Sp(r);!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&vp(e,r),n?Gb(gp,e,r,o,i):gp(e,r,o,i)}}function gp(e,t,r,n){r||nv(e,t),t.pendingcb--,n(),br(e,t)}function nv(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function vp(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var l=0,u=!0;r;)i[l]=r,r.isBuf||(u=!1),r=r.next,l+=1;i.allBuffers=u,mo(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new wp(t),t.bufferedRequestCount=0}else{for(;r;){var d=r.chunk,p=r.encoding,v=r.callback,b=t.objectMode?1:d.length;if(mo(e,t,!1,b,d,p,v),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}q.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))};q.prototype._writev=null;q.prototype.end=function(e,t,r){var n=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),!n.ending&&!n.finished&&av(this,n,r)};function Sp(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function iv(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),br(e,t)})}function ov(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"?(t.pendingcb++,t.finalCalled=!0,mt.nextTick(iv,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function br(e,t){var r=Sp(t);return r&&(ov(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"))),r}function av(e,t,r){t.ending=!0,br(e,t),r&&(t.finished?mt.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function sv(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}Object.defineProperty(q.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){!this._writableState||(this._writableState.destroyed=e)}});q.prototype.destroy=bp.destroy;q.prototype._undestroy=bp.undestroy;q.prototype._destroy=function(e,t){this.end(),t(e)}});var gt=x((uC,Pp)=>{"use strict";a();s();var xp=Ve(),lv=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};Pp.exports=qe;var Tp=Object.create(J());Tp.inherits=X();var Cp=yo(),_o=go();Tp.inherits(qe,Cp);for(wo=lv(_o.prototype),Tn=0;Tn<wo.length;Tn++)Cn=wo[Tn],qe.prototype[Cn]||(qe.prototype[Cn]=_o.prototype[Cn]);var wo,Cn,Tn;function qe(e){if(!(this instanceof qe))return new qe(e);Cp.call(this,e),_o.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",uv)}Object.defineProperty(qe.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function uv(){this.allowHalfOpen||this._writableState.ended||xp.nextTick(fv,this)}function fv(e){e.end()}Object.defineProperty(qe.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}});qe.prototype._destroy=function(e,t){this.push(null),this.end(),xp.nextTick(t,e)}});var So=x(Op=>{"use strict";a();s();var vo=_r().Buffer,Ap=vo.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function dv(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function cv(e){var t=dv(e);if(typeof t!="string"&&(vo.isEncoding===Ap||!Ap(e)))throw new Error("Unknown encoding: "+e);return t||e}Op.StringDecoder=Sr;function Sr(e){this.encoding=cv(e);var t;switch(this.encoding){case"utf16le":this.text=_v,this.end=yv,t=4;break;case"utf8":this.fillLast=mv,t=4;break;case"base64":this.text=bv,this.end=vv,t=3;break;default:this.write=Sv,this.end=Ev;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=vo.allocUnsafe(t)}Sr.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};Sr.prototype.end=wv;Sr.prototype.text=gv;Sr.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function bo(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function pv(e,t,r){var n=t.length-1;if(n<r)return 0;var i=bo(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=bo(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=bo(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function hv(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function mv(e){var t=this.lastTotal-this.lastNeed,r=hv(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function gv(e,t){var r=pv(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function wv(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function _v(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function yv(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function bv(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function vv(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function Sv(e){return e.toString(this.encoding)}function Ev(e){return e&&e.length?this.write(e):""}});var yo=x((gC,jp)=>{"use strict";a();s();var Bt=Ve();jp.exports=k;var xv=sp(),Er;k.ReadableState=Lp;var mC=_t().EventEmitter,Dp=function(e,t){return e.listeners(t).length},Po=fo(),xr=_r().Buffer,Tv=globalThis.Uint8Array||function(){};function Cv(e){return xr.from(e)}function Pv(e){return xr.isBuffer(e)||e instanceof Tv}var Np=Object.create(J());Np.inherits=X();var Eo=yt(),R=void 0;Eo&&Eo.debuglog?R=Eo.debuglog("stream"):R=function(){};var Av=cp(),kp=ho(),Ut;Np.inherits(k,Po);var xo=["error","close","destroy","pause","resume"];function Ov(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):xv(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function Lp(e,t){Er=Er||gt(),e=e||{};var r=t instanceof Er;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,i=e.readableHighWaterMark,o=this.objectMode?16:16*1024;n||n===0?this.highWaterMark=n:r&&(i||i===0)?this.highWaterMark=i:this.highWaterMark=o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new Av,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(Ut||(Ut=So().StringDecoder),this.decoder=new Ut(e.encoding),this.encoding=e.encoding)}function k(e){if(Er=Er||gt(),!(this instanceof k))return new k(e);this._readableState=new Lp(e,this),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),Po.call(this)}Object.defineProperty(k.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){!this._readableState||(this._readableState.destroyed=e)}});k.prototype.destroy=kp.destroy;k.prototype._undestroy=kp.undestroy;k.prototype._destroy=function(e,t){this.push(null),t(e)};k.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=xr.from(e,t),t=""),n=!0),Wp(this,e,t,!1,n)};k.prototype.unshift=function(e){return Wp(this,e,null,!0,!1)};function Wp(e,t,r,n,i){var o=e._readableState;if(t===null)o.reading=!1,Dv(e,o);else{var l;i||(l=Iv(o,t)),l?e.emit("error",l):o.objectMode||t&&t.length>0?(typeof t!="string"&&!o.objectMode&&Object.getPrototypeOf(t)!==xr.prototype&&(t=Cv(t)),n?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):To(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||t.length!==0?To(e,o,t,!1):Up(e,o)):To(e,o,t,!1))):n||(o.reading=!1)}return Mv(o)}function To(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&Pn(e)),Up(e,t)}function Iv(e,t){var r;return!Pv(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new TypeError("Invalid non-string/buffer chunk")),r}function Mv(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}k.prototype.isPaused=function(){return this._readableState.flowing===!1};k.prototype.setEncoding=function(e){return Ut||(Ut=So().StringDecoder),this._readableState.decoder=new Ut(e),this._readableState.encoding=e,this};var Ip=8388608;function Rv(e){return e>=Ip?e=Ip:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function Mp(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=Rv(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}k.prototype.read=function(e){R("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return R("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?Co(this):Pn(this),null;if(e=Mp(e,t),e===0&&t.ended)return t.length===0&&Co(this),null;var n=t.needReadable;R("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,R("length less than watermark",n)),t.ended||t.reading?(n=!1,R("reading or ended",n)):n&&(R("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=Mp(r,t)));var i;return e>0?i=Bp(e,t):i=null,i===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&Co(this)),i!==null&&this.emit("data",i),i};function Dv(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,Pn(e)}}function Pn(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(R("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Bt.nextTick(Rp,e):Rp(e))}function Rp(e){R("emit readable"),e.emit("readable"),Ao(e)}function Up(e,t){t.readingMore||(t.readingMore=!0,Bt.nextTick(Nv,e,t))}function Nv(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(R("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}k.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))};k.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,R("pipe count=%d opts=%j",n.pipesCount,t);var i=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,o=i?u:_;n.endEmitted?Bt.nextTick(o):r.once("end",o),e.on("unpipe",l);function l(y,T){R("onunpipe"),y===r&&T&&T.hasUnpiped===!1&&(T.hasUnpiped=!0,v())}function u(){R("onend"),e.end()}var d=kv(r);e.on("drain",d);var p=!1;function v(){R("cleanup"),e.removeListener("close",C),e.removeListener("finish",g),e.removeListener("drain",d),e.removeListener("error",S),e.removeListener("unpipe",l),r.removeListener("end",u),r.removeListener("end",_),r.removeListener("data",E),p=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&d()}var b=!1;r.on("data",E);function E(y){R("ondata"),b=!1;var T=e.write(y);T===!1&&!b&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&qp(n.pipes,e)!==-1)&&!p&&(R("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,b=!0),r.pause())}function S(y){R("onerror",y),_(),e.removeListener("error",S),Dp(e,"error")===0&&e.emit("error",y)}Ov(e,"error",S);function C(){e.removeListener("finish",g),_()}e.once("close",C);function g(){R("onfinish"),e.removeListener("close",C),_()}e.once("finish",g);function _(){R("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(R("pipe resume"),r.resume()),e};function kv(e){return function(){var t=e._readableState;R("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&Dp(e,"data")&&(t.flowing=!0,Ao(e))}}k.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,r);return this}var l=qp(t.pipes,e);return l===-1?this:(t.pipes.splice(l,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};k.prototype.on=function(e,t){var r=Po.prototype.on.call(this,e,t);if(e==="data")this._readableState.flowing!==!1&&this.resume();else if(e==="readable"){var n=this._readableState;!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&Pn(this):Bt.nextTick(Lv,this))}return r};k.prototype.addListener=k.prototype.on;function Lv(e){R("readable nexttick read 0"),e.read(0)}k.prototype.resume=function(){var e=this._readableState;return e.flowing||(R("resume"),e.flowing=!0,Wv(this,e)),this};function Wv(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Bt.nextTick(Uv,e,t))}function Uv(e,t){t.reading||(R("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),Ao(e),t.flowing&&!t.reading&&e.read(0)}k.prototype.pause=function(){return R("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(R("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function Ao(e){var t=e._readableState;for(R("flow",t.flowing);t.flowing&&e.read()!==null;);}k.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(R("wrapped end"),r.decoder&&!r.ended){var l=r.decoder.end();l&&l.length&&t.push(l)}t.push(null)}),e.on("data",function(l){if(R("wrapped data"),r.decoder&&(l=r.decoder.write(l)),!(r.objectMode&&l==null)&&!(!r.objectMode&&(!l||!l.length))){var u=t.push(l);u||(n=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=function(l){return function(){return e[l].apply(e,arguments)}}(i));for(var o=0;o<xo.length;o++)e.on(xo[o],this.emit.bind(this,xo[o]));return this._read=function(l){R("wrapped _read",l),n&&(n=!1,e.resume())},this};Object.defineProperty(k.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});k._fromList=Bp;function Bp(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.head.data:r=t.buffer.concat(t.length),t.buffer.clear()):r=Bv(e,t.buffer,t.decoder),r}function Bv(e,t,r){var n;return e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):e===t.head.data.length?n=t.shift():n=r?qv(e,t):jv(e,t),n}function qv(e,t){var r=t.head,n=1,i=r.data;for(e-=i.length;r=r.next;){var o=r.data,l=e>o.length?o.length:e;if(l===o.length?i+=o:i+=o.slice(0,e),e-=l,e===0){l===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(l));break}++n}return t.length-=n,i}function jv(e,t){var r=xr.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var o=n.data,l=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,l),e-=l,e===0){l===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(l));break}++i}return t.length-=i,r}function Co(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Bt.nextTick(Fv,t,e))}function Fv(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function qp(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var Oo=x((yC,Gp)=>{"use strict";a();s();Gp.exports=je;var An=gt(),Hp=Object.create(J());Hp.inherits=X();Hp.inherits(je,An);function Hv(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function je(e){if(!(this instanceof je))return new je(e);An.call(this,e),this._transformState={afterTransform:Hv.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Gv)}function Gv(){var e=this;typeof this._flush=="function"?this._flush(function(t,r){Fp(e,t,r)}):Fp(this,null,null)}je.prototype.push=function(e,t){return this._transformState.needTransform=!1,An.prototype.push.call(this,e,t)};je.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")};je.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};je.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};je.prototype._destroy=function(e,t){var r=this;An.prototype._destroy.call(this,e,function(n){t(n),r.emit("close")})};function Fp(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}});var Yp=x((SC,Vp)=>{"use strict";a();s();Vp.exports=Tr;var Kp=Oo(),$p=Object.create(J());$p.inherits=X();$p.inherits(Tr,Kp);function Tr(e){if(!(this instanceof Tr))return new Tr(e);Kp.call(this,e)}Tr.prototype._transform=function(e,t,r){r(null,e)}});var Xp=x((Pe,zp)=>{a();s();Pe=zp.exports=yo();Pe.Stream=Pe;Pe.Readable=Pe;Pe.Writable=go();Pe.Duplex=gt();Pe.Transform=Oo();Pe.PassThrough=Yp()});var Io=x((PC,Zp)=>{a();s();var Kv=ni(),$v=function(){},Vv=function(e){return e.setHeader&&typeof e.abort=="function"},Yv=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},Jp=function(e,t,r){if(typeof t=="function")return Jp(e,null,t);t||(t={}),r=Kv(r||$v);var n=e._writableState,i=e._readableState,o=t.readable||t.readable!==!1&&e.readable,l=t.writable||t.writable!==!1&&e.writable,u=!1,d=function(){e.writable||p()},p=function(){l=!1,o||r.call(e)},v=function(){o=!1,l||r.call(e)},b=function(_){r.call(e,_?new Error("exited with error code: "+_):null)},E=function(_){r.call(e,_)},S=function(){process.nextTick(C)},C=function(){if(!u){if(o&&!(i&&i.ended&&!i.destroyed))return r.call(e,new Error("premature close"));if(l&&!(n&&n.ended&&!n.destroyed))return r.call(e,new Error("premature close"))}},g=function(){e.req.on("finish",p)};return Vv(e)?(e.on("complete",p),e.on("abort",S),e.req?g():e.on("request",g)):l&&!n&&(e.on("end",d),e.on("close",d)),Yv(e)&&e.on("exit",b),e.on("end",v),e.on("finish",p),t.error!==!1&&e.on("error",E),e.on("close",S),function(){u=!0,e.removeListener("complete",p),e.removeListener("abort",S),e.removeListener("request",g),e.req&&e.req.removeListener("finish",p),e.removeListener("end",d),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("exit",b),e.removeListener("end",v),e.removeListener("error",E),e.removeListener("close",S)}};Zp.exports=Jp});var nh=x((IC,rh)=>{a();s();var{Duplex:th}=Xp(),Qp=Io(),zv=ni(),eh={},Mo=class extends th{constructor(t={}){let r=Object.assign({},t,{objectMode:!0});super(r),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 "${name}" already exists');let r=new Ro({parent:this,name:t});return this._substreams[t]=r,Xv(this,n=>{r.destroy(n)}),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 "${name}" already exists');this._substreams[t]=eh}_read(){}_write(t,r,n){let i=t.name,o=t.data;if(!i)return console.warn(`ObjectMultiplex - malformed chunk without name "${t}"`),n();let l=this._substreams[i];if(!l)return console.warn(`ObjectMultiplex - orphaned data for stream "${i}"`),n();l!==eh&&l.push(o),n()}},Ro=class extends th{constructor({parent:t,name:r}){super({objectMode:!0}),this._parent=t,this._name=r}_read(){}_write(t,r,n){this._parent.push({name:this._name,data:t}),n()}};rh.exports=Mo;function Xv(e,t){let r=zv(t);Qp(e,{readable:!1},r),Qp(e,{writable:!1},r)}});var ah=x((DC,oh)=>{a();s();var Jv=ni(),Zv=Io(),Do=Yw(),Cr=function(){},Qv=/^v?\.0/.test(process.version),On=function(e){return typeof e=="function"},eS=function(e){return!Qv||!Do?!1:(e instanceof(Do.ReadStream||Cr)||e instanceof(Do.WriteStream||Cr))&&On(e.close)},tS=function(e){return e.setHeader&&On(e.abort)},rS=function(e,t,r,n){n=Jv(n);var i=!1;e.on("close",function(){i=!0}),Zv(e,{readable:t,writable:r},function(l){if(l)return n(l);i=!0,n()});var o=!1;return function(l){if(!i&&!o){if(o=!0,eS(e))return e.close(Cr);if(tS(e))return e.abort();if(On(e.destroy))return e.destroy();n(l||new Error("stream was destroyed"))}}},ih=function(e){e()},nS=function(e,t){return e.pipe(t)},iS=function(){var e=Array.prototype.slice.call(arguments),t=On(e[e.length-1]||Cr)&&e.pop()||Cr;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(i,o){var l=o<e.length-1,u=o>0;return rS(i,l,u,function(d){r||(r=d),d&&n.forEach(ih),!l&&(n.forEach(ih),t(r))})});return e.reduce(nS)};oh.exports=iS});var zh=x((PI,Yh)=>{"use strict";a();s();Yh.exports={walletDefaultName:"\u94B1\u5305",accountDefaultName:"\u8D26\u6237",privateKeyDefaultName:"\u79C1\u94A5",mpcDefaultName:"\u65E0\u79C1\u94A5\u94B1\u5305",hardWalletDefaultName:"\u786C\u4EF6\u94B1\u5305",pre_environment:"\u9884\u53D1\u73AF\u5883",prod_environment:"\u751F\u4EA7\u73AF\u5883",development_environment:"\u5F00\u53D1\u73AF\u5883",normalMode:"\u6B63\u5E38\u6A21\u5F0F",keyMode:"key\u6A21\u5F0F",multilingualMode:"\u591A\u500D\u6587\u672C\u6A21\u5F0F",select_language_mode:"\u9009\u62E9\u591A\u8BED\u8A00\u6A21\u5F0F",current_api_environment:"\u5F53\u524D\u9009\u4E2D\u63A5\u53E3\u73AF\u5883",fullscreenMode:"\u5168\u5C4F\u5C55\u793A\u6A21\u5F0F",switchRtl:"rtl\u6A21\u5F0F\u5207\u6362",accelerateSetInterval:"setInterval \u52A0\u901F 100 \u500D\uFF0C\u5F00/\u5173\u540E\u4F1A\u91CD\u542F\u63D2\u4EF6",theme:"\u660E\u6697\u4E3B\u9898\u5207\u6362",language:"\u7B80\u4F53\u4E2D\u6587"}});a();s();a();s();Lr();globalThis.setupSentry=async()=>await Ca();globalThis.setupSentry();globalThis.sentry=Ye;a();s();(function(e){typeof define=="function"&&define.amd?define(e):e()})(function(){"use strict";function e(g,_){if(!(g instanceof _))throw new TypeError("Cannot call a class as a function")}function t(g,_){for(var y=0;y<_.length;y++){var T=_[y];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(g,T.key,T)}}function r(g,_,y){return _&&t(g.prototype,_),y&&t(g,y),g}function n(g,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(_&&_.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),_&&o(g,_)}function i(g){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(y){return y.__proto__||Object.getPrototypeOf(y)},i(g)}function o(g,_){return o=Object.setPrototypeOf||function(T,H){return T.__proto__=H,T},o(g,_)}function l(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function u(g,_){return _&&(typeof _=="object"||typeof _=="function")?_:l(g)}function d(g,_){for(;!Object.prototype.hasOwnProperty.call(g,_)&&(g=i(g),g!==null););return g}function p(g,_,y){return typeof Reflect<"u"&&Reflect.get?p=Reflect.get:p=function(H,Z,Y){var Ae=d(H,Z);if(!!Ae){var K=Object.getOwnPropertyDescriptor(Ae,Z);return K.get?K.get.call(Y):K.value}},p(g,_,y||g)}var v=function(){function g(){e(this,g),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return r(g,[{key:"addEventListener",value:function(y,T){y in this.listeners||(this.listeners[y]=[]),this.listeners[y].push(T)}},{key:"removeEventListener",value:function(y,T){if(y in this.listeners){for(var H=this.listeners[y],Z=0,Y=H.length;Z<Y;Z++)if(H[Z]===T){H.splice(Z,1);return}}}},{key:"dispatchEvent",value:function(y){var T=this;if(y.type in this.listeners){for(var H=function(lt){setTimeout(function(){return lt.call(T,y)})},Z=this.listeners[y.type],Y=0,Ae=Z.length;Y<Ae;Y++)H(Z[Y]);return!y.defaultPrevented}}}]),g}(),b=function(g){n(_,g);function _(){var y;return e(this,_),y=u(this,i(_).call(this)),y.listeners||v.call(l(y)),Object.defineProperty(l(y),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(l(y),"onabort",{value:null,writable:!0,configurable:!0}),y}return r(_,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(T){T.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,T)),p(i(_.prototype),"dispatchEvent",this).call(this,T)}}]),_}(v),E=function(){function g(){e(this,g),Object.defineProperty(this,"signal",{value:new b,writable:!0,configurable:!0})}return r(g,[{key:"abort",value:function(){var y;try{y=new Event("abort")}catch{typeof document<"u"?document.createEvent?(y=document.createEvent("Event"),y.initEvent("abort",!1,!1)):(y=document.createEventObject(),y.type="abort"):y={type:"abort",bubbles:!1,cancelable:!1}}this.signal.dispatchEvent(y)}},{key:"toString",value:function(){return"[object AbortController]"}}]),g}();typeof Symbol<"u"&&Symbol.toStringTag&&(E.prototype[Symbol.toStringTag]="AbortController",b.prototype[Symbol.toStringTag]="AbortSignal");function S(g){return g.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof g.Request=="function"&&!g.Request.prototype.hasOwnProperty("signal")||!g.AbortController}function C(g){typeof g=="function"&&(g={fetch:g});var _=g,y=_.fetch,T=_.Request,H=T===void 0?y.Request:T,Z=_.AbortController,Y=_.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,Ae=Y===void 0?!1:Y;if(!S({fetch:y,Request:H,AbortController:Z,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:Ae}))return{fetch:y,Request:K};var K=H;(K&&!K.prototype.hasOwnProperty("signal")||Ae)&&(K=function(Oe,z){var ve;z&&z.signal&&(ve=z.signal,delete z.signal);var Se=new H(Oe,z);return ve&&Object.defineProperty(Se,"signal",{writable:!1,enumerable:!1,configurable:!0,value:ve}),Se},K.prototype=H.prototype);var lt=y,Ft=function(Oe,z){var ve=K&&K.prototype.isPrototypeOf(Oe)?Oe.signal:z?z.signal:void 0;if(ve){var Se;try{Se=new DOMException("Aborted","AbortError")}catch{Se=new Error("Aborted"),Se.name="AbortError"}if(ve.aborted)return Promise.reject(Se);var Jn=new Promise(function(j,ie){ve.addEventListener("abort",function(){return ie(Se)},{once:!0})});return z&&z.signal&&delete z.signal,Promise.race([Jn,lt(Oe,z)])}return lt(Oe,z)};return{fetch:Ft,Request:K}}(function(g){if(!!S(g)){if(!g.fetch){console.warn("fetch() is not available, cannot install abortcontroller-polyfill");return}var _=C(g),y=_.fetch,T=_.Request;g.fetch=y,g.Request=T,Object.defineProperty(g,"AbortController",{writable:!0,enumerable:!1,configurable:!0,value:E}),Object.defineProperty(g,"AbortSignal",{writable:!0,enumerable:!1,configurable:!0,value:b})}})(typeof self<"u"?self:globalThis)});Ur();var jw=m($w()),Fw=m(Vd()),ba=m(ze());a();s();var jc=m(ze()),Fc=m(qc());var mr=class extends Fc.Duplex{constructor(r){super({objectMode:!0});$e(this,"onMessage",r=>{if(f.Buffer.isBuffer(r)){let n=f.Buffer.from(r);this.push(n)}else this.push(r)});$e(this,"onDisconnect",()=>{let{lastError:r}=jc.default.runtime;r&&typeof this.opts.port=="function"?this.init():this.destroy()});this.opts={port:r},this.init()}init(){this.removePortListener(),this.port=typeof this.opts.port=="function"?this.opts.port():this.opts.port,this.port.onMessage.addListener(this.onMessage),this.port.onDisconnect.addListener(this.onDisconnect)}removePortListener(){this.port&&(this.port.onMessage.removeListener(this.onMessage),this.port.onDisconnect.removeListener(this.onDisconnect))}_read(){}_write(r,n,i){try{if(f.Buffer.isBuffer(r)){let o=r.toJSON();o._isBuffer=!0,this.port.postMessage(o)}else this.port.postMessage(r)}catch{return i(new Error("PortDuplexStream - disconnected"))}return i()}};a();s();var np=m(rp()),ip=m(Vw());var uo=class{constructor(t){this.connectionStream=t,this.notificationChannel=new ip.default,this.requests=new Map,this.connectionStream.on("data",this.handleResponse.bind(this)),this.connectionStream.on("end",this.close.bind(this))}onNotification(t){this.notificationChannel.addListener("notification",r=>{t(r)})}close(){this.notificationChannel.removeAllListeners()}handleResponse(t){let{id:r,result:n,error:i,method:o,params:l}=t,u=this.requests.get(r);if(!(o&&l&&r)){if(o&&l&&!r){this.notificationChannel.emit("notification",t);return}if(!!u){if(i){let d=new np.EthereumRpcError(i.code,i.message,i.data);d.stack=i.stack,this.requests.delete(r),u(d);return}this.requests.delete(r),typeof u=="function"&&u(null,n)}}}},Ub=e=>{let t=new uo(e);return new Proxy(t,{get:(r,n)=>r[n]?r[n]:(...i)=>{let o=i[i.length-1],l=i.slice(0,-1),u=Da();r.requests.set(u,o),r.connectionStream.write({jsonrpc:"2.0",method:n,params:l,id:u})}})},op=Ub;a();s();var sh=m(nh()),lh=m(ah()),oS=()=>{};function uh(e){let t=new sh.default;return(0,lh.default)(e,t,e,r=>{r&&oS(r)}),t}Kt();a();s();a();s();a();s();var fh=360;Kt();bt();var W=m(ze());a();s();var ko=m(ze());async function dh(e){return"getContexts"in ko.default.runtime?(await ko.default.runtime.getContexts({contextTypes:["OFFSCREEN_DOCUMENT"],documentUrls:[e]})).length>0:(await clients.matchAll()).some(r=>r.url.includes(chrome.runtime.id))}var Pr=class{reload(){W.default.runtime.reload()}openTab(t){return new Promise((r,n)=>{W.default.tabs.create(t).then(i=>{let o=pe();return o?n(o):r(i)}).catch(i=>{n(i)})})}openWindow(t){return new Promise((r,n)=>{W.default.windows.create(t).then(i=>{let o=pe();return o?n(o):(this.lastOkPopupId=i.id,r(i))}).catch(i=>{n(i)})})}closeWindow(t){return new Promise((r,n)=>{W.default.windows.remove(t).then(()=>{let i=pe();return i?n(i):r()}).catch(i=>{n(i)})})}focusLastOkPopup(){this.lastOkPopupId&&this.getAllWindows().then(t=>{t.some(r=>r.id===this.lastOkPopupId)?this.focusWindow(this.lastOkPopupId):this.lastOkPopupId=""}).catch(()=>{})}async focusCurrentWindow(){let r=(await this.currentTab())?.windowId;await this.focusWindow(r)}focusWindow(t){return new Promise((r,n)=>{W.default.windows.update(t,{focused:!0}).then(()=>{let i=pe();return i?n(i):r()}).catch(i=>{n(i)})})}updateWindowPosition(t,r,n){return new Promise((i,o)=>{W.default.windows.update(t,{left:r,top:n}).then(()=>{let l=pe();return l?o(l):i()}).catch(l=>{o(l)})})}getLastFocusedWindow(t){return new Promise((r,n)=>{W.default.windows.getLastFocused(t).then(i=>{let o=pe();return o?n(o):r(i)}).catch(i=>{n(i)})})}closeCurrentWindow(){return W.default?.windows?.getCurrent?W.default.windows.getCurrent().then(t=>W.default.windows.remove(t.id)):Promise.resolve()}getVersion(){return W.default.runtime.getManifest().version}openExtensionInBrowser(t=null,r=null){let n=W.default.runtime.getURL("/home.html");r&&(n+=`?${r}`),t&&(n+=`#${t}`),this.openTab({url:n}),me()!==ii&&window.close()}async openExtensionInPopup(t=null,r=null,n=!0){let i=W.default.runtime.getURL("/notification.html");r&&(i+=`?${r}`),t&&(i+=`#${t}`);let o=0,l=0,d=(await Ua())?.width||fh,p=120;try{let v=await this.getLastFocusedWindow();l=v.top,o=Math.max(v.left+(v.width-d)-p,0)}catch{let{screenX:b,screenY:E,outerWidth:S}=window;l=Math.max(E,0),o=Math.max(b+(S-d)-p,0)}this.openWindow({url:i,type:"popup",width:d,height:700,top:l,left:o}),me()!==ii&&n&&window.close()}getPlatformInfo(){return new Promise((t,r)=>{try{W.default.runtime.getPlatformInfo().then(n=>{t(n)}).catch(n=>{r(n)})}catch(n){r(n)}})}getAllWindows(){return new Promise((t,r)=>{W.default.windows.getAll().then(n=>{let i=pe();return i?r(i):t(n)}).catch(n=>{r(n)})})}getActiveTabs(){return new Promise((t,r)=>{W.default.tabs.query({active:!0}).then(n=>{let i=pe();return i?r(i):t(n)}).catch(n=>{r(n)})})}currentTab(){return new Promise((t,r)=>{W.default.tabs.getCurrent().then(n=>{let i=pe();i?r(i):t(n)}).catch(n=>{r(n)})})}closeTab(t){return new Promise((r,n)=>{W.default.tabs.remove(t).then(()=>{let i=pe();i?n(i):r()}).catch(i=>{n(i)})})}getCpuInfoName(){return new Promise((t,r)=>{try{W.default.system.cpu.getInfo(n=>{t(n.modelName)})}catch(n){r(n)}})}setPanelBehavior(t){return new Promise((r,n)=>{try{chrome.sidePanel.setPanelBehavior({openPanelOnActionClick:t}),r()}catch(i){n(i)}})}setSidepanelPath(t){return new Promise((r,n)=>{t?chrome.sidePanel.setOptions({path:t},()=>{r()}):n()})}openSidepanelWithWindowId(t){return new Promise((r,n)=>{t?chrome.sidePanel.open({windowId:t},()=>{r()}):n()})}async openSidepanel(t){let n=(await this.getLastFocusedWindow())?.id;t&&await this.setSidepanelPath(`sidepanel.html#${t}`),await this.openSidepanelWithWindowId(n),t&&await this.setSidepanelPath("sidepanel.html")}async createOffscreen(){let t="offscreen.html",r=chrome.runtime.getURL(t);await dh(r)||(this.creatingOffscreen?await this.creatingOffscreen:(this.creatingOffscreen=W.default.offscreen.createDocument({url:t,reasons:["LOCAL_STORAGE"],justification:""}),await this.creatingOffscreen,this.creatingOffscreen=null))}};var No=Pr;bt();Xw();a();s();a();s();var Bw=m(P());Ur();var qw=m(Jw()),Yn=m(ze());he();a();s();var ch="SET_ACTIVE_TAB";function Lo(e={},t){let r={...e};switch(t.type){case ch:return t.value;default:return r}}function ph(e){return{type:ch,value:e}}a();s();Ur();ei();var hh=async()=>{try{let{authMap:e}=await Xe.get("authMap"),{data:t}=await Xe.get("data"),r=Gt(t,"TransactionController.transactions");return{authMap:e,evmTransactions:r}}catch{return{}}};Ks();a();s();var In=m(os());n_();a();s();Kr();Lr();zt();Va();a();s();function mh(e){return typeof e=="string"?e:typeof e>"u"?"Undefined error":e instanceof DOMException?`Error Name: ${e.name}, Message: ${e.message}, Code: ${e.code}`:`Error Object: ${JSON.stringify(e,["message","arguments","type","name"])}`}var aS=Je({name:"coins",initialState:{coinsMap:{},ready:!1},reducers:{updateCoinsMap(e,t){e.coinsMap=t.payload,e.ready=!0}}}),{actions:sS,reducer:lS}=aS,{updateCoinsMap:uS}=sS;var gh=()=>async e=>{(await $a.common_coins).liveQuery().subscribe(async(r,n)=>{if(n)Ye.captureEvent({message:"STORE_WARN_indexeddb_error",exception:{values:[{type:"STORE_WARN_indexeddb_error",value:`subscribe coins error, ${mh(n)}`}]},level:"error"}),Re().fallbackToAllCoinsMap();else{r.sort((o,l)=>o.rank-l.rank);let i=r.reduce((o,l)=>(o[String(l.coinId)]=l,o),{});e(uS(i))}})},wh=lS;a();s();var Oh=m(os());a();s();o_();function Wo(e={},t){let r={shouldClose:!1,modal:{open:!1,modalState:{name:null,props:{}},previousModalState:{name:null}},sidebar:{transitionName:"",type:"",props:{}},accountDetail:{subview:"transactions"},isLoading:!1,warning:null,requestAccountTabs:{},currentWindowTab:{},...e};switch(t.type){case Cs:return{...r,forgottenPassword:t.value};case Os:return{...r,warning:null};case Rs:return{...r,isLoading:!1,warning:null,scrollToBottom:!1,forgottenPassword:!1};case Ds:return{...r,txId:t.id,warning:null,isLoading:!1};case Ns:return t.value.unconfirmedActionsCount>0?{...r,txId:null,warning:null}:{...r,shouldClose:!0,warning:null,txId:null,accountDetail:{subview:"transactions"}};case ks:return{...r};case Ps:return{...r,warning:t.value||"Incorrect password. Try again."};case As:return{...r,warning:""};case Ls:return{...r,isLoading:!0,loadingMessage:t.value};case Ws:return{...r,isLoading:!1};case Is:return{...r,warning:t.value,isLoading:!1};case Ms:return{...r,warning:void 0};case Us:return{...r,requestAccountTabs:t.value};case Bs:return{...r,currentWindowTab:t.value};default:return r}}a();s();a();s();Kr();var _h={solana:{replacedTxs:[],signInfo:null},evm:{gasInfo:null,forceUpdateGasLimit:null}},fS=Je({name:"sendGiftBusiness",initialState:_h,reducers:{setSolanaReplacedTxs:(e,t)=>{e.solana.replacedTxs=t.payload},setSolanaSignInfo:(e,t)=>{e.solana.signInfo=t.payload},setEvmSendGiftGasInfo:(e,t)=>{e.evm.gasInfo=t.payload},setEvmForceUpdateGasLimit:e=>{e.evm.forceUpdateGasLimit=+new Date},resetSendGiftBusiness:e=>{Object.assign(e,_h)}}}),{actions:dS,reducer:cS}=fS,yh=cS;var{setSolanaReplacedTxs:R0,setSolanaSignInfo:D0,setEvmSendGiftGasInfo:N0,setEvmForceUpdateGasLimit:k0,resetSendGiftBusiness:L0}=dS;a();s();Kr();var bh={key:"",args:{},type:""},rt={selectedCoinId:null,selectedAddressType:null,assetTokensList:[],packageMetaInfo:{},sendGiftAmount:null,quantityAmount:null,bestWishesInput:"",fee:null,feeLoading:!1,feeError:!1,claimConditions:{},calldataInfo:null,refreshCalldataInfo:0,isMax:!1,amountPageError:bh,confirmPageError:bh,savedTxInfo:null,hideAmountPageConfirmButton:!1},pS=Je({name:"sendGift",initialState:rt,reducers:{setSelectedCoinId:(e,t)=>{e.selectedCoinId=t.payload},setSelectedAddressType:(e,t)=>{e.selectedAddressType=t.payload},setAssetTokensList:(e,t)=>{e.assetTokensList=t.payload},setSendGiftAmount:(e,t)=>{e.sendGiftAmount=t.payload},setQuantityAmount:(e,t)=>{e.quantityAmount=t.payload},setBestWishesInput:(e,t)=>{e.bestWishesInput=t.payload},setSendGiftFee:(e,t)=>{e.fee=t.payload},setSendGiftFeeLoading:(e,t)=>{e.feeLoading=t.payload},setSendGiftFeeError:(e,t)=>{e.feeError=t.payload},setPackageMetaInfo:(e,t)=>{e.packageMetaInfo=t.payload},setClaimConditions:(e,t)=>{e.claimConditions=t.payload},setIsSendGiftMax:(e,t)=>{e.isMax=t.payload},setCalldataInfo:(e,t)=>{e.calldataInfo=t.payload},setRefreshCalldataInfo:e=>{e.refreshCalldataInfo=+new Date},setSendGiftAmountPageError:(e,t)=>{e.amountPageError=t.payload},setSendGiftConfirmPageError:(e,t)=>{e.confirmPageError=t.payload},setSavedTxInfo:(e,t)=>{e.savedTxInfo=t.payload},setHideAmountPageConfirmButton:(e,t)=>{e.hideAmountPageConfirmButton=t.payload},resetByCoinChanged:e=>{e.sendGiftAmount=rt.sendGiftAmount,e.fee=rt.fee,e.feeError=rt.feeError,e.isMax=rt.isMax,e.amountPageError=rt.amountPageError,e.confirmPageError=rt.confirmPageError},resetSendGift:e=>{Object.assign(e,rt)}}}),{actions:hS,reducer:mS}=pS,vh=mS;var{setSelectedCoinId:j0,setSelectedAddressType:F0,setAssetTokensList:H0,setSendGiftAmount:G0,setQuantityAmount:K0,setBestWishesInput:$0,setSendGiftFee:V0,setSendGiftFeeLoading:Y0,setSendGiftFeeError:z0,setPackageMetaInfo:X0,setClaimConditions:J0,setIsSendGiftMax:Z0,setCalldataInfo:Q0,setRefreshCalldataInfo:eP,setSendGiftAmountPageError:tP,setSendGiftConfirmPageError:rP,setSavedTxInfo:nP,setHideAmountPageConfirmButton:iP,resetByCoinChanged:oP,resetSendGift:aP}=hS;var gS={sendGift:vh,sendGiftBusiness:yh},Sh=gS;a();s();Kr();var wS={mostRecentOverviewPage:fe},_S="history",yS=Je({name:_S,initialState:wS,reducers:{pageChanged:(e,t)=>{let r=t.payload;(r===fe||r.startsWith(zr))&&(e.mostRecentOverviewPage=r)}}}),{actions:bS,reducer:vS}=yS,Eh=vS;var{pageChanged:xh}=bS;a_();a();s();a();s();var Th={[Ju]:Zu};a();s();var Ch={[Qu]:ef,[tf]:rf,[nf]:of,[af]:sf};var Ph={...Th,...Ch};a();s();var SS="metamask/send/OPEN_TO_DROPDOWN",ES="metamask/send/CLOSE_TO_DROPDOWN",xS="metamask/send/UPDATE_SEND_ERRORS",TS="metamask/send/RESET_SEND_STATE",CS="metamask/send/SHOW_GAS_BUTTON_GROUP",PS="metamask/send/HIDE_GAS_BUTTON_GROUP",Ah={toDropdownOpen:!1,gasButtonGroupShown:!0,errors:{}};function Uo(e=Ah,t){switch(t.type){case SS:return{...e,toDropdownOpen:!0};case ES:return{...e,toDropdownOpen:!1};case xS:return{...e,errors:{...e.errors,...t.value}};case CS:return{...e,gasButtonGroupShown:!0};case PS:return{...e,gasButtonGroupShown:!1};case TS:return{...Ah};default:return e}}a();s();var Ih=(0,Oh.combineReducers)({activeTab:Lo,metamask:$u,appState:Wo,history:Eh,send:Uo,nftSend:Xu,newDapp:il,localeMessages:ju,importAccount:qu,coinDetail:rl,txHistory:uf,approve:Js,txConfirm:lf,balanceSlice:_s,currencySlice:nl,providerSlice:ds,coins:wh,assetsSlice:Ys,Nft:zu,addressBookState:Xs,batchTransfer:el,batchAddAccount:Zs,batchImportPrivateKey:Qs,bulkRename:tl,commonSend:pi,walletConfig:Vu,businessSend:hi,...Ph,activityBanners:zs,keyring:qs,...Sh,dialog:ol});function Bo(e){return(0,In.createStore)(Ih,e,(0,In.applyMiddleware)(as))}var Mh=()=>e=>{e(fs()),e(gh()),e(ws()),e(Vs())};a();s();if((process.env.ASSETS_BUILD_TYPE==="dev"||process.env.ASSETS_BUILD_TYPE==="daily"||process.env.ASSETS_BUILD_TYPE==="prepub")&&localStorage.getItem("speedUp")){let t=window.setInterval;window.setInterval=function(r,n,...i){let o=n>=1e3?n/100:n;return t(r,o,...i)}}a();s();Kt();bt();r_();a();s();var qt=window.history,AS=qt.pushState,OS=qt.replaceState,qo=new Event("locationChange");qt.pushState=(...e)=>{let t=AS.apply(qt,e);return window.dispatchEvent(qo),t};qt.replaceState=(...e)=>{let t=OS.apply(qt,e);return window.dispatchEvent(qo),t};window.addEventListener("popstate",()=>{window.dispatchEvent(qo)});function jo(e=""){return e.replace(/^#/,"")}function Rh(e){window.addEventListener("locationChange",()=>{e(jo(window.location.hash))})}a();s();var IS=[/^(\/wallet-add\/import-with-seed-phrase-and-private-key)/,/^(\/batch-import-private-key\/edit)/,/^(\/wallet\/mnemonic\/backup)/,/^(\/wallet\/mnemonic-privateKey)/,/^(\/wallet\/account\/privateKey)/,/^(\/reset-password)/];function Mn(e,t=IS){for(let n=0;n<t.length;n++){let i=t[n];if(typeof i=="string"&&e.endsWith(i)||typeof i!="string"&&i.test(e))return!0}return!1}function MS(){let e=me();return e===qr?1:e===Na?2:e===jr?3:0}var Nh=MS(),Fo="lastPageDetentionTimeParams",kh=ff(),nt,Fe,Ho="";async function RS(){let e=window.localStorage.getItem(Fo);if(window.localStorage.removeItem(Fo),e)try{await ui(JSON.parse(e))}catch{console.log("Failed to report last page detention time")}let t=window.location.hash;t&&t!==fe&&(nt=new Date,Fe=jo(t))}function Dh(){if(!nt||!Fe||!Mn(Fe))return;let e=new Date,t={s:kh,u:Fe,r:Ho,d:e.getTime()-nt.getTime(),p:Nh,e:nt.toLocaleString(),l:e.toLocaleString()};window.localStorage.setItem(Fo,JSON.stringify(t))}function DS(e){if(e===fe)return;let t=new Date;Fe&&nt&&Mn(Fe)&&ui({s:kh,u:Fe,r:Ho,d:t.getTime()-nt.getTime(),p:Nh,e:nt.toLocaleString(),l:t.toLocaleString()}),nt=t,Ho=Fe||"",Fe=e}Rh(DS),RS(),window.addEventListener("beforeunload",Dh),window.onblur=Dh;a();s();var ne=m(P()),pa=m(ee()),kw=m(we());he();Lr();a();s();var Ar=m(P());he();a();s();var Go={"error-page":"_error-page_1qj8r_1",errorPage:"_error-page_1qj8r_1","error-page-details":"_error-page-details_1qj8r_13",errorPageDetails:"_error-page-details_1qj8r_13"};var kS=()=>{let e=Hr(),t=Ee.State.getImgMap(e),r=`${Zr()}${t[Ee.State.TYPE.noNetwork]}`;return Ar.default.createElement("div",{className:Go.errorPage},Ar.default.createElement("div",{className:Go.errorPageDetails},Ar.default.createElement(Ee.State,{type:Ee.State.TYPE.noNetwork,title:O("wallet_extension_tg_empty_title_load_failed"),description:O("wallet_extension_tg_empty_desc_load_failed"),imgSrc:r,renderButton:()=>Ar.default.createElement(Q,{category:Q.CATEGORY.fill,type:Q.TYPE.primary,size:Q.SIZE.s,onClick:()=>{window.location.href=window.location.pathname}},O("wallet_extension_tg_empty_btn_load_failed"))})))},Lh=kS;Va();a();s();var be=m(P()),Rn=m(ee());he();ti();var Ko={fetchConfig:{project:"okx_extension_wallet",site:"okx"}};var $o=0,WS=1,Vo=null;function Uh(){return e=>(Ko.fetchConfig.locale=e.locale,be.default.createElement(Ra,{localeData:e.localeData,isDev:!0,noRemoteData:!0,fetchConfig:Ko.fetchConfig},e.children))}var US=Uh(),BS=Uh(),qS=process.env.ASSETS_BUILD_TYPE===Me.DEV||process.env.ASSETS_BUILD_TYPE===Me.DAILY,Wh=(0,be.createContext)(e=>`[${e}]`),Yo=e=>{let t=window.localStorage.getItem("languageKeyMode"),r=qS&&t==="multilingualMode",n=(0,Rn.useSelector)(Jr),i=Gu(n),o=(0,Rn.useSelector)(Fu),l=(0,Rn.useSelector)(Hu),u=(0,be.useMemo)(()=>(Ku(n,window),Vo=Vo===$o?WS:$o,Object.keys(o).reduce((d,p)=>{let v=o[p].message;return d[p]=r?`${v}${v}${v}`:v,d},{})),[i,o,r]);return(0,be.useMemo)(()=>{$t.setConfig({frozenScroll:!1,localeProviderProps:{fetchConfig:{noFetch:!0},isDev:!0,localeData:l}})},[n]),Vo===$o?be.default.createElement(US,{localeData:u,locale:i},be.default.createElement(Wh.Provider,{value:G},e.children)):be.default.createElement(BS,{localeData:u,locale:i},be.default.createElement(Wh.Provider,{value:G},e.children))};a();s();a();s();var Bh=m(P());ri();var qh=()=>{let e=de("staticDomain");(0,Bh.useLayoutEffect)(()=>{window.okGlobal||(window.okGlobal={}),e?(window.okGlobal.cdnBaseUrl=`https://${Ht()}`,window.okGlobal.cdnDomainMap=e.data):(window.okGlobal.cdnBaseUrl=`https://${Ht()}`,window.okGlobal.cdnDomainMap={default:"https://static.okx.com",CN:"https://static.coinall.ltd",RU:"https://static.okx.cab",ID:"https://static.okx.cab"})},[e])};function jS(){qh()}var jh=jS;a();s();a();s();var U=m(P());var Fh=m(df()),Hh=m(ze());he();Kt();zw();bt();Ga();fi();zt();var zo=class extends U.PureComponent{constructor(){super(...arguments);$e(this,"state",{downloadUrl:!1})}renderErrorDetail(r){return U.default.createElement("li",null,U.default.createElement("p",null,r))}renderErrorStack(r,n){return U.default.createElement("li",null,U.default.createElement("span",null,r),U.default.createElement("pre",{className:"error-page__stack"},n))}componentDidMount(){Yt(Gr.getExtensionVersion).then(({data:r})=>{let n=Fr(),i=Hh.default.runtime.getManifest().version;if(n===ka&&r.edge!==i){this.setState({downloadUrl:"https://microsoftedge.microsoft.com/addons/detail/pbpjkcldjiffchgbbndmhojiacbgflha"});return}r.chrome!==i&&this.setState({downloadUrl:"https://chrome.google.com/webstore/detail/okx-wallet/mcohilncbfahbmgdjkbpemcciiolgcge?hl=zh-CN"})}).catch(()=>{})}render(){let{error:r}=this.props,{downloadUrl:n}=this.state,o=me()===Br?O("wallet_home_subtitle_errortip_error_popup_message"):O("wallet_home_subtitle_errortip_errorpage_message"),l=Hr(),u=Ee.State.getImgMap(l),d=`${Zr()}${u[Ee.State.TYPE.systemError]}`;return U.default.createElement("div",{className:"error-page"},U.default.createElement("div",{className:"error-page__header"},O("wallet_home_maintitle_errortip_error_page_title"),window.location.hash&&U.default.createElement(ae,{className:"okx-wallet-plugin-close error-page__right",onClick:async()=>{await Re().clearDappData(),window.location.href=window.location.pathname}})),U.default.createElement("div",{className:"error-page__details"},U.default.createElement(Ee.State,{type:Ee.State.TYPE.systemError,title:n?O("extension_wallet_mid_text_update_latest_version"):o,imgSrc:d,renderButton:()=>U.default.createElement(U.default.Fragment,null,U.default.createElement("div",null,U.default.createElement(Q,{category:Q.CATEGORY.fill,type:Q.TYPE.primary,size:Q.SIZE.s,onClick:()=>{globalThis.platform.openTab({url:n})}},O("extension_wallet_mid_btn_goto_store")," "),U.default.createElement(Q,{className:"error-page_button_left",category:Q.CATEGORY.fill,type:Q.TYPE.primary,size:Q.SIZE.s,onClick:()=>{chrome.runtime.reload()}},O("wallet_extension_settings_item_clear_cache")," ")))}),U.default.createElement(qa,{className:"error-page__accordion",titleClass:"error-page__accordion-title",customHeaderIcon:p=>U.default.createElement(ae,{icon:"okds-arrow-chevron-down-md",size:ae.SIZE.xs,className:(0,Fh.default)("error-page__icon",{"okui-accordion-header-icon-expanded":p})}),title:O("wallet_home_subtitle_errortip_errordetail"),onToggle:p=>{this.setState({expand:p})}}),this.state.expand?U.default.createElement("ul",{className:"error-page__list"},r.message?this.renderErrorDetail(O("wallet_home_subtitle_errortip_errormessage",{errorMessage:r.message})):null,r.code?this.renderErrorDetail(O("wallet_home_subtitle_errortip_errorcode",{errorCode:r.code})):null,r.name?this.renderErrorDetail(O("wallet_home_subtitle_errortip_errorname",{errorName:r.name})):null,r.stack?this.renderErrorStack(O("wallet_home_subtitle_errortip_error_stack"),r.stack):null):null))}},Xo=zo;a();s();var Ge=m(P()),st=m(ee()),Mw=m(we()),Rw=m(Xt()),Dw=m(df());he();a();s();var FS=document.documentElement,HS={en:"en",zh_CN:"zh-hans",zh_TW:"zh-hant",fr:"fr",ru:"ru",vi:"vi",id:"id",tr:"tr",de:"de",it:"it",pl:"pl",en_IN:"en-in",pt_BR:"pt",pt_PT:"pt-pt",es:"es-es",es_419:"es",cs:"cs",ro:"ro",uk:"uk",ar_EH:"ar"},GS=e=>{FS.setAttribute("lang",HS[e])},Gh=GS;a();s();var Jo=m(P()),Kh=m(Xt());he();fi();function KS(e,t,r){let n=is(e),i="";switch(n){case"ERR_NETWORK":t();return;case"ERR_SERVER_LIMIT":i=O("wallet_extension_home_notif_network_high_traffic");break;case"ERR_SERVER_TINE_LIMIT":i=O("wallet_extension_error_check_device_time");break;default:if(r){r(e);return}i=n||O("wallet_extension_alert_wallet_network_error")}oe.error({key:n,title:i,duration:2,placement:oe.DIRECTION.top})}var $h=(e,t={})=>{let{uniq:r=!1,params:n={},config:i={},method:o="get",cache:l=!1,origin:u=!1,errorCallback:d}=t,[p,v]=(0,Jo.useState)(null),[b,E]=(0,Jo.useState)(!1),S=cf();return(0,Kh.useDeepCompareEffect)(()=>{let C=async()=>{switch(o){case"get":return r?ts(e,n,i):l?ns(e,n,i):u?Xa(e,n,i):Yt(e,n);case"post":return r?rs(e,n,i):u?Ja(e,n,i):Qa(e,n,i);case"delete":return Za(e,n);default:return Yt(e,n)}};E(!0),C().then(g=>{v(g)}).catch(g=>{KS(g,S,d)}).finally(()=>{E(!1)})},[n]),[b,p]};a();s();a();s();function Dn(){}Ga();ti();a();s();var D=m(P()),kn=m(Xt());a();s();var Zo=m(P());a();s();var Vh=e=>de("allowShowComponent",{..._e,componentName:e,location:window.location.href})?.data;var Nn=({children:e,componentName:t})=>Vh(t)?Zo.default.createElement(Zo.default.Fragment,null,e):null;ei();var le=m(zh());a();s();var Qo={"wallet-helper":"_wallet-helper_4h5lm_1",walletHelper:"_wallet-helper_4h5lm_1","wallet-helper-enter":"_wallet-helper-enter_4h5lm_11",walletHelperEnter:"_wallet-helper-enter_4h5lm_11"};var $S=[{label:le.default.development_environment,value:"http://forked-test2-cat20.defi.swim.env"},{label:le.default.pre_environment,value:"https://beta.okex.org"},{label:le.default.prod_environment,value:"https://wallet.okex.org"}],VS=[{label:le.default.normalMode,value:"normalMode"},{label:le.default.keyMode,value:"keyMode"},{label:le.default.multilingualMode,value:"multilingualMode"}],YS=()=>{let{width:e}=(0,kn.useSize)(document.querySelector("body")),[t,r]=(0,D.useState)("https://beta.okex.org");(0,D.useEffect)(()=>{(async()=>{let{envApiDomain:S}=await Xe.get("envApiDomain");S&&r(S)})()},[]);let n=()=>{window.location.reload()},i=window.localStorage,o=i.getItem("languageKeyMode")||"normalMode",l=(0,D.useCallback)(S=>{S==="normalMode"?(i.removeItem("languageKeyMode"),vt(!1)):S==="keyMode"?(i.setItem("languageKeyMode",S),vt(!0)):(i.setItem("languageKeyMode",S),vt(!1)),n()},[o]),u=(0,kn.useUpdate)(),d=()=>{let S=pf()===en.LIGHT?en.DARK:en.LIGHT;hf(S),u()},p=i.getItem("speedUp")||!1,[v,b]=(0,D.useState)(p);(0,D.useEffect)(()=>{b(p)},[p]);let E=(0,D.useCallback)(()=>{p?(i.removeItem("speedUp"),b(!1)):(i.setItem("speedUp",!0),b(!0)),chrome.runtime.reload()},[p]);return D.default.createElement(Nn,{componentName:"walletHelper"},D.default.createElement(mi.Box,{className:Qo["wallet-helper"]},D.default.createElement(Vt,{description:D.default.createElement(mi.Space,{space:"8px"},D.default.createElement(ae.IconButton,{icon:"okx-wallet-plugin-slow",tooltip:le.default.select_language_mode,onClick:()=>{ge.show({alignBottom:!1,noContentPadding:!0,hideCloseBtn:!0,maskClosable:!0,children:D.default.createElement(Jt,{dataSource:VS,renderItem:({label:S,value:C})=>D.default.createElement(Jt.Cell,{title:S,onClick:()=>{l(C)}},o===C&&D.default.createElement(li.Circle,{checked:!0}))})})}}),D.default.createElement(ae.IconButton,{icon:"okx-wallet-plugin-fast",tooltip:`${le.default.current_api_environment}${t}`,onClick:()=>{ge.show({alignBottom:!1,noContentPadding:!0,hideCloseBtn:!0,maskClosable:!0,children:D.default.createElement(Jt,{dataSource:$S,renderItem:({label:S,value:C})=>D.default.createElement(Jt.Cell,{title:S,onClick:async()=>{await Xe.set({envApiDomain:C}),n()}},t===C&&D.default.createElement(li.Circle,{checked:!0}))})})}}),D.default.createElement(ae.IconButton,{icon:"okx-wallet-plugin-swap",tooltip:le.default.switchRtl,onClick:()=>{let C=document.documentElement.getAttribute("dir");Qr(C==="rtl"?void 0:"rtl")}}),e>360&&D.default.createElement(ae.IconButton,{icon:"okx-wallet-plugin-switch",tooltip:le.default.fullscreenMode,onClick:()=>{let S=document.querySelector("#app");["notification","popup"].includes(S.className)?S.className="fullscreen":S.className="popup"}}),D.default.createElement(ae.IconButton,{style:{color:v?"orange":"unset"},icon:"okx-wallet-plugin-coin-quick-withdraw",tooltip:le.default.accelerateSetInterval,onClick:E}),D.default.createElement(ae.IconButton,{icon:"okx-wallet-plugin-swap-1",tooltip:le.default.theme,onClick:()=>{d()}})),trigger:Vt.TRIGGER.click,placement:document.documentElement.getAttribute("dir")==="rtl"?Vt.DIRECTION.topLeft:Vt.DIRECTION.topRight,autoHeight:{marginBottom:50},smartMode:!1},D.default.createElement(ae,{bordered:!0,size:ae.SIZE.lg,className:Qo["wallet-helper-enter"],icon:"okx-wallet-plugin-wrenches"}))))},Xh=YS;a();s();a();s();var at=m(P());a();s();var Or=m(P());a();s();var ea={url:"https://beta.okex.org/pisces",name:"pisces>>"};ri();a();s();var ta={noRadius:"_noRadius_e5d59_1",scale:"_scale_e5d59_15"};var Jh=()=>Or.default.createElement(Nn,{componentName:"EnvAlert"},Or.default.createElement(ja,{className:ta.noRadius,type:"warn",showIcon:!1,title:Or.default.createElement("div",{className:ta.scale},`${process.env.ASSETS_BUILD_TYPE}-${process.env.COMMIT_HASH}, API: ${Ea()} WSS: ${Ta()} STATIC: ${Ht()}`,Or.default.createElement("a",{href:ea.url},ea.name)),closable:!1}));a();s();var Ln=m(P()),Ir=m(ee()),Wn=m(we()),Zh=m(Xt());function zS(e){return e}var Qh=()=>{let e=(0,Ir.useSelector)(zS),t=(0,Zh.useLatest)(e),r=(0,Wn.useHistory)(),n=(0,Ir.useSelector)(St),i=(0,Ir.useSelector)(xe),o=(0,Ir.useSelector)(yf),l=(0,Ln.useRef)(o),d=(0,Wn.useLocation)()?.pathname;return(0,Ln.useEffect)(()=>{if(o!==l.current){if(n&&i&&![fe,Ze].includes(d)){let p=t.current,v={isRpcMode:Yu(p)?.isRpcMode,permissionsRequestId:wf(p),isNotBackup:Ef(gs(p)).isNotBackupWallet,lastOptType:_f(p)},b=xf(v);b&&r.replace(b)}l.current=o}},[d,o,n,i]),null};Ks();var $n=m(ee());a();s();a();s();var c=m(P());a();s();var rm=m(P()),V=m(Zw()),XS=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},JS=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},ZS=function(){function e(t,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),QS=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},eE=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||typeof t!="object"&&typeof t!="function"?e:t},ra=(typeof window>"u"||typeof window>"u"?"undefined":XS(window))==="object",tE=ra?document:{},rE=["mousemove","keydown","wheel","DOMMouseScroll","mouseWheel","mousedown","touchstart","touchmove","MSPointerDown","MSPointerMove"],na=function(e){function t(r){JS(this,t);var n=eE(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r));if(n.state={idle:!1,oldDate:+new Date,lastActive:+new Date,remaining:null,pageX:null,pageY:null},n.tId=null,n._handleEvent=function(i){var o=n.state,l=o.remaining,u=o.pageX,d=o.pageY,p=o.idle,v=n.props,b=v.timeout,E=v.onAction,S=v.debounce,C=v.throttle,g=v.stopOnIdle;if(S>0?n.debouncedAction(i):C>0?n.throttledAction(i):E(i),!l){if(i.type==="mousemove"&&(i.pageX===u&&i.pageY===d||i.pageX===void 0&&i.pageY===void 0||n.getElapsedTime()<200))return;clearTimeout(n.tId),n.tId=null,p&&!g&&n.toggleIdleState(i),n.setState({lastActive:+new Date,pageX:i.pageX,pageY:i.pageY}),p&&g||(n.tId=setTimeout(n.toggleIdleState,b))}},r.debounce>0&&r.throttle>0)throw new Error("onAction can either be throttled or debounced (not both)");return r.debounce>0&&(n.debouncedAction=em(r.onAction,r.debounce)),r.throttle>0&&(n.throttledAction=tm(r.onAction,r.throttle)),r.startOnMount||(n.state.idle=!0),n.toggleIdleState=n._toggleIdleState.bind(n),n.reset=n._reset.bind(n),n.pause=n._pause.bind(n),n.resume=n._resume.bind(n),n.getRemainingTime=n._getRemainingTime.bind(n),n.getElapsedTime=n._getElapsedTime.bind(n),n.getLastActiveTime=n._getLastActiveTime.bind(n),n.isIdle=n._isIdle.bind(n),n}return QS(t,rm.Component),ZS(t,[{key:"componentWillMount",value:function(){this._bindEvents()}},{key:"componentDidMount",value:function(){this.props.startOnMount&&this.reset()}},{key:"componentDidUpdate",value:function(r){r.debounce!==this.props.debounce&&(this.debouncedAction=em(this.props.onAction,this.props.debounce)),r.throttle!==this.props.throttle&&(this.throttledAction=tm(this.props.onAction,this.props.throttle))}},{key:"componentWillUnmount",value:function(){clearTimeout(this.tId),this._unbindEvents()}},{key:"render",value:function(){return this.props.children||null}},{key:"_bindEvents",value:function(){var r=this;if(ra){var n=this.state.eventsBound,i=this.props,o=i.element,l=i.events,u=i.passive,d=i.capture;n||(l.forEach(function(p){o.addEventListener(p,r._handleEvent,{capture:d,passive:u})}),this.setState({eventsBound:!0}))}}},{key:"_unbindEvents",value:function(){var r=this;if(ra){var n=this.props,i=n.element,o=n.events,l=n.passive,u=n.capture;this.state.eventsBound&&(o.forEach(function(d){i.removeEventListener(d,r._handleEvent,{capture:u,passive:l})}),this.setState({eventsBound:!1}))}}},{key:"_toggleIdleState",value:function(r){var n=this,i=this.state.idle,o=this.props,l=o.onActive,u=o.onIdle,d=o.stopOnIdle;this.setState({idle:!i},function(){i?d||(n._bindEvents(),l(r)):(d&&(clearTimeout(n.tId),n.tId=null,n._unbindEvents()),u(r))})}},{key:"_reset",value:function(){clearTimeout(this.tId),this.tId=null,this._bindEvents(),this.setState({idle:!1,oldDate:+new Date,lastActive:this.state.oldDate,remaining:null});var r=this.props.timeout;this.tId=setTimeout(this.toggleIdleState,r)}},{key:"_pause",value:function(){this.state.remaining===null&&(this._unbindEvents(),clearTimeout(this.tId),this.tId=null,this.setState({remaining:this.getRemainingTime()}))}},{key:"_resume",value:function(){var r=this.state,n=r.remaining,i=r.idle;n!==null&&(this._bindEvents(),i||(this.setState({remaining:null}),this.tId=setTimeout(this.toggleIdleState,n)))}},{key:"_getRemainingTime",value:function(){var r=this.state,n=r.remaining,i=r.idle,o=r.lastActive;if(i)return 0;if(n!==null)return n;var l=this.props.timeout-(+new Date-o);return l<0&&(l=0),l}},{key:"_getElapsedTime",value:function(){var r=this.state.oldDate;return+new Date-r}},{key:"_getLastActiveTime",value:function(){return this.state.lastActive}},{key:"_isIdle",value:function(){return this.state.idle}}]),t}();function em(e,t){var r=void 0;return function(){for(var n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];r&&clearTimeout(r),r=setTimeout(function(){e.apply(void 0,i),r=null},t)}}function tm(e,t){var r=0;return function(){var n=new Date().getTime();if(!(n-r<t))return r=n,e.apply(void 0,arguments)}}na.propTypes={timeout:V.default.number,events:V.default.arrayOf(V.default.string),onIdle:V.default.func,onActive:V.default.func,onAction:V.default.func,debounce:V.default.number,throttle:V.default.number,element:V.default.oneOfType([V.default.object,V.default.element]),startOnMount:V.default.bool,stopOnIdle:V.default.bool,passive:V.default.bool,capture:V.default.bool},na.defaultProps={timeout:12e5,element:tE,events:rE,onIdle:function(){},onActive:function(){},onAction:function(){},debounce:0,throttle:0,startOnMount:!0,stopOnIdle:!1,capture:!0,passive:!0};var nm=na;var ue=m(we());a();s();var re=m(P()),oa=m(ee()),am=m(we());he();a();s();var Un=m(P()),im=()=>{let[e,t]=(0,Un.useState)(0);return(0,Un.useEffect)(()=>{function r(){let n=window.visualViewport?.height<window?.innerHeight?window?.innerHeight-window.visualViewport?.height:0;t(n)}return window?.visualViewport?.addEventListener("resize",r),()=>{window?.visualViewport?.removeEventListener("resize",r)}},[]),{keyboardHeight:e}};zt();a();s();var Bn=m(P()),om=m(we()),it=({preload:e=[],...t})=>((0,Bn.useEffect)(()=>{e.forEach(r=>{typeof r=="function"&&r()})},[e]),Bn.default.createElement(om.Route,{...t}));bt();a();s();var ia={dialog:"_dialog_18vnm_1",mask:"_mask_18vnm_6"};function nE(e){return e.metamask.passwordModal}var aa=e=>{let[t,r]=(0,re.useState)(!1),n=(0,oa.useSelector)(nE),i=(0,oa.useSelector)(xe),o=Fa.useForm(),l=(0,am.useLocation)(),{onSubmit:u}=Lf({form:o}),d=(0,re.useCallback)(async()=>{await Re().rejectPassword(),r(!1)},[]),{currentPasswordType:p,onVerifyPasskeyFailed:v,onResetPasswordType:b}=Pf(d);(0,re.useEffect)(()=>{r(!!n&&i),n&&b()},[b,n,i]),(0,re.useEffect)(()=>()=>{t&&d()},[l]);let{keyboardHeight:E}=im(),S=p===2&&n?.modalType===oi.default,C=!!n&&t&&!S;return re.default.createElement(re.default.Fragment,null,re.default.createElement(it,{...e}),!!n&&t&&S&&re.default.createElement(Af,{onPass:async g=>{o.setFieldsValue({password:g}),await u()},onCancel:v,noContent:!0}),re.default.createElement(ge,{onClose:d,visible:C,title:n?.modalType===oi.default?O("wallet_extension_tg_enter_password"):"",noMargin:!0,alignBottom:!0,maskClosable:!0,noTopRadius:!1,windowStyle:{padding:"0",overflow:"hidden",bottom:`${E}px`,height:`${600-E}px`,touchAction:"none"},zIndex:40001,className:ia.dialog,scrollBoxClassName:ia.mask,transitionProps:{type:"slide",placement:"bottom",timeout:300}},C&&re.default.createElement(Wf,{passwordModal:n,passwordType:p,onVerifyPasskeyFailed:v})))};a();s();var A=m(P()),Dr=m(ee()),ot=m(we()),la=m(ze());he();Lr();a();s();var sm=()=>{let e=de("lockPage",{..._e,location:window.location.href});return e?e.data:null};a();s();var lm=m(P());ei();var um=()=>{let e=de("changeLocalStorage",{..._e,location:window.location.href});(0,lm.useEffect)(()=>{e&&(e?.data?.windowLocalStorage&&Object.keys(e?.data.windowLocalStorage).forEach(t=>{window.localStorage.setItem(t,e?.data?.windowLocalStorage[t])}),e?.data?.localStorage&&Object.keys(e?.data.localStorage).forEach(t=>{t==="data"||t==="apiDomain"||t==="envApiDomain"||t==="staticDomain"||Xe.set({[t]:e?.data?.localStorage[t]})}))},[e])};a();s();var fm=m(P());var dm=()=>{let e=de("resetExtension",{..._e,location:window.location.href});return(0,fm.useMemo)(()=>{if(e){if(!e.data?.needReload)return!1;let r=window.localStorage.getItem("extensionReload");return!r||r!=e?.data.time?e.data.time:!1}return!1},[e])};a();s();var cm=m(P());var pm=()=>{let e=de("versionExtensionUpdate",{..._e,location:window.location.href});return(0,cm.useMemo)(()=>{if(e){if(!e.data?.needUpdate)return!1;let r=window.localStorage.getItem("versionExtensionUpdate");if(r&&r===e?.data.version&&!e.data?.repeat)return!1;if(_e.version!==e.data.version)return{version:e?.data.version,repeat:e.data?.repeat}}return!1},[e])};a();s();var hm=m(P()),qn=m(we()),wt=m(ze());var iE=()=>{let e=(0,qn.useHistory)(),{search:t}=(0,qn.useLocation)(),r=Uf();(0,hm.useEffect)(()=>{let n=(i,o,l)=>{if(!(i.type===Rf&&i.method===Df.notifyRedirect))return;let{redirectSearchParams:d}=i.params,{redirectPathname:p,redirectSearchParams:v}=kf(d);p&&r(p,{overrideCurrentPath:Ze,removeExistingSearchKeys:["redirect_pathname","redirect_search_params"],preserveState:!0,newSearchParams:Nf(v)}),l({success:!0,redirected:!0})};return typeof wt.default<"u"&&wt.default.runtime?.onMessage?wt.default.runtime.onMessage.addListener(n):typeof chrome<"u"&&chrome.runtime?.onMessage&&chrome.runtime.onMessage.addListener(n),()=>{typeof wt.default<"u"&&wt.default.runtime?.onMessage?wt.default.runtime.onMessage.removeListener(n):typeof chrome<"u"&&chrome.runtime?.onMessage&&chrome.runtime.onMessage.removeListener(n)}},[e,r,t])},mm=iE;a();s();var gm=[];a();s();var wm=(e,t)=>{if(t&&t.includes("{")&&!t.includes("first")){let n=/\{(.+?)\}/gi,i={},o=t.match(n);return o&&o.forEach((l,u)=>{let d=l.replace("{","").replace("}","");i[`${d}`]=e[u]}),i}let r=["first","second","third","fourth"];return e.filter((n,i)=>i in r).reduce((n,i,o)=>(n[r[o]]=i,n),{})};a();s();var Mr=m(e_());zt();var oE=e=>{if(!Array.isArray(e))return 1;for(let t=0;t<e.length;t++){let r=e[t];if(r.status===3)return 3;if(r.status===2)return 2}return 1},aE=({supportChainList:e=[],account:t})=>{let r=!1,n={...t?.status7702?.chains||{}},i={},o=Object.keys(n).length,l=e?.length||0;return o!==l&&(r=!0),e?.forEach(({chainIndex:p,status:v})=>{i[p]=v,!r&&n?.[p]!==v&&(r=!0)}),{chainStatusChanged:r,chains:r?i:n}},sE=(e,t)=>{if((0,Mr.isEmpty)(t)||!Array.isArray(e))return{needUpdate:!1};let{chainStatusChanged:r,chains:n}=aE({supportChainList:e,account:t}),i=t?.status7702?.status||1;return r&&(i=oE(e)),{needUpdate:r,status7702:{status:i,chains:n}}},_m=async e=>{let{address:t,data:r}=e,{chainIndex:n,status:i}=r||{};if(!t||(0,Mr.isNil)(n)||(0,Mr.isNil)(i))return;let o=await Re().getAccountsByAddressAndChainIndex(t,n);if(Array.isArray(o)&&!o.length)return;let l=o.map(async u=>{let d={...u?.status7702?.chains||{}};d[n]=i;let p=[];Object.keys(d).forEach(E=>{p.push({chainIndex:Number(E),status:d[E],address:t})});let{needUpdate:v,status7702:b}=sE(p,u);if(v){let E=u.walletId;E&&await Re().updateAccountIdentityData(E,{status7702:b})}});await Promise.allSettled(l)};a();s();var Rr=m(P());function sa(e){let[t,r]=(0,Rr.useState)(!1);return t?Rr.default.createElement(it,{...e}):Rr.default.createElement(Ff,{path:e.path,guard:!0,callback:()=>{r(!0)}})}a();s();var ym=m(P()),bm=m(ee());function vm(){return!(0,bm.useSelector)(St)}var Sm=e=>ym.default.createElement(it,{...e});a();s();var Em=m(P()),xm=m(ee());Ur();function jn(e,t){let r=se(t),n=(0,xm.useDispatch)();(0,Em.useEffect)(()=>{!r||e.includes(r.data.address||Gt(r.data,"data.address")||Gt(r.data,"data.content.address"))&&n(xt({data:r.data,channel:t}))},[r,n,e,t])}a();s();var He=m(P()),Cm=m(we());he();a();s();var lE=20,Fn=[];var uE=(e,t)=>{let r=`${e}_${t}`;Fn.unshift(r),Fn=Fn.slice(0,lE)},fE=(e,t)=>{let r=`${e}_${t}`;return Fn.includes(r)};function dE(e){let{status:t,orderId:r,fromAmount:n,fromTokenSymbol:i,toTokenSymbol:o,toAmount:l,isMemeTimeOut:u,chainId:d,fromTokenAddress:p,toTokenAddress:v,exploreUrl:b}=e,E=`/dex-swap/meme/${i==="SOL"?"buy":"sell"}?inputChain=${d}&inputCurrency=${p}&outputChain=${d}&outputCurrency=${v}`;if(u)return{result:{type:"warn",titleKey:"wallet_extension_toast_likely_fail",titleParams:{num:n,token1:i,token2:o},id:`toast-${r}-${t}`,url:E,urlText:"wallet_extension_cta_trade_again"},needHistory:!0};let C={["0"]:{type:"success",titleKey:"wallet_extension_toast_swap_submitted",id:`toast-${r}-${t}`,orderId:r},["1"]:{type:"success",titleKey:"wallet_extension_toast_swap_success",titleParams:{fromCount:n,fromToken:i,toCount:o,toToken:l},id:`toast-${r}-${t}`,url:b,urlText:"wallet_extension_cta_check_details",orderId:r},["-1"]:{type:"error",titleKey:"wallet_extension_toast_swap_failed",titleParams:{num:n,token1:i,token2:o},id:`toast-${r}-${t}`,url:E,urlText:"wallet_extension_cta_trade_again",orderId:r}}[t];return C?{result:C,needHistory:t!=="1"}:null}function cE(e){let{status:t,orderId:r,fromAmount:n,fromTokenSymbol:i,toAmount:o,toTokenSymbol:l}=e,u={["0"]:{type:"success",titleKey:"swaptrade_extension_feedback_toast_transaction_submitted",id:`toast-${r}-${t}`},["-1"]:{type:"error",titleKey:"swaptrade_extension_feedback_toast_fillup_gas_failed",titleParams:{nativeToken:l},id:`toast-${r}-${t}`},["1"]:{type:"success",titleKey:"swaptrade_extension_feedback_toast_swapped_successfully",titleParams:{payValue:n,paySymbol:i,receiveValue:Gf(o,{fixed:6,wipeTailZero:!0}),receiveSymbol:l},id:`toast-${r}-${t}`}},d=t in u?u[t]:null;return d?{result:d,needHistory:!1}:null}function pE(e){let{status:t,orderId:r,fromTokenSymbol:n,exploreUrl:i,solanaToast:o}=e,l={["1"]:{type:"success",titleKey:"swaptrade_extension_notif_desc_token_approved",titleParams:{tokenSymbol:n},url:i,urlText:"wallet_transfer_notif_view_on_explorer",id:`toast-${t}-${r}`},["-1"]:{type:"error",titleKey:"swaptrade_extension_notif_desc_token_not_approved",titleParams:{tokenSymbol:n},url:i,urlText:"wallet_transfer_notif_view_on_explorer",id:`toast-${t}-${r}`}},u=t in l?l[t]:null;return u?{result:u,needHistory:!1}:o==="1"?{result:{type:"success",titleKey:"swaptrade_extension_notif_desc_transaction_submit",id:`toast-${o}`},needHistory:!1}:null}function hE(e){let{status:t,orderId:r,fromAmount:n,fromTokenSymbol:i,toAmount:o,toTokenSymbol:l,exploreUrl:u,fromChildOrder:d={},toChainName:p,willNeedManualClaim:v}=e;if(fE(r,t))return null;let b=d?.receiveTokenStatus!=="3",E=null;return t==="0"&&d?.status=="0"?E={type:"success",titleKey:"swaptrade_extension_notif_desc_transaction_submit",id:`toast-${t}-${r}`,orderId:r}:t==="200"?E={type:"success",titleKey:"wallet_extension_bridge_alert_title_ready_to_claim",id:`toast-${t}-${r}`,orderId:r,hasClaimButton:!0,chainName:p,tokenSymbol:l,buttonText:"commonall_modal_btn_claim",buttonAction:"claim"}:t==="202"?E={type:"error",titleKey:"wallet_extension_bridge_alert_failed_to_claim_please",id:`toast-${t}-${r}`,orderId:r}:t==="1"&&b?v==="1"?E={type:"success",titleKey:"wallet_extension_bridge_alert_youve_successfully_claimed_amt",titleParams:{amt:o,token:l},id:`toast-${t}-${r}`,orderId:r}:E={type:"success",titleKey:"swaptrade_extension_notif_desc_swap_info",titleParams:{fromTokenAmount:n,fromTokenSymbol:i,toTokenAmount:o,toTokenSymbol:l},url:u,urlText:"wallet_transfer_notif_view_on_explorer",id:`toast-${t}-${r}`,orderId:r}:t==="-1"&&b?E={type:"error",titleKey:"swaptrade_extension_notif_desc_swap_fail",url:u,urlText:"wallet_transfer_notif_view_on_explorer",id:`toast-${t}-${r}`,orderId:r}:t==="-2"&&b&&(E={type:"success",titleKey:"swaptrade_extension_notif_desc_swap_canceled",url:u,urlText:"wallet_transfer_notif_view_on_explorer",id:`toast-${t}-${r}`,orderId:r}),E?(uE(r,t),{result:E,needHistory:!1}):null}var Tm=e=>{let{dexData:t,type:r}=e;if(!t)return null;let n=null,{type:i,swapTradeType:o,solanaToast:l}=t;return o==="7"?n=dE(t):i==="gasStation"&&l==="1"?n=cE(t):i==="approve"&&r==="1"?n=pE(t):!["approve","register","gasStation"].includes(i)&&(r==="1"||r==="3")&&(n=hE(t)),n};var mE=(e,t)=>{let r={...e?.result};return r.desc=null,r.hasClaimButton&&r.chainName&&r.tokenSymbol&&(r.desc=He.default.createElement(He.default.Fragment,null,He.default.createElement("p",{style:{color:"var(--okd-color-content-secondary)"}},O("swaptrade_bridge_alert_desc_successfully_bridged_to_chainname",{chainName:r.chainName,tokenSymbol:r.tokenSymbol})),He.default.createElement(ai,{style:{marginTop:"8px",fontSize:"12px",lineHeight:"16px",color:"var(--okd-color-content-primary)"},onClick:()=>{t.push(`${xu}?orderId=${r.orderId}`)}},O("commonall_modal_btn_claim")))),r.url&&r.urlText&&(r.desc=He.default.createElement(ai,{style:{cursor:"pointer",color:"var(--okd-color-content-primary)",textDecoration:"none",border:"none",background:"none",padding:0},onClick:()=>{if(e?.needHistory){t.push(r.url);return}r.url&&globalThis.platform.openTab({url:r.url})}},He.default.createElement("span",null,O(r.urlText)))),r},gE=e=>{let t=e.type;oe[t]({title:O(e.titleKey,e.titleParams),key:e.id,desc:e.desc})};function Pm(){let e=se("dex-across-order-info"),t=(0,Cm.useHistory)();(0,He.useEffect)(()=>{if(!e?.data)return;let r=e.data,n=Tm(r);if(n){let i=mE(n,t);gE(i)}},[e,t])}a();s();var Am=m(P());he();function Om(){let e=se("wallet-nft");(0,Am.useEffect)(()=>{!e||oe.success({title:O("wallet_transfer_notif_nft_transaction_success"),key:"toast8"})},[e])}a();s();var Im=m(P()),Mm=m(ee());function Rm(){let e=se("wallet-coin"),t=(0,Mm.useDispatch)();(0,Im.useEffect)(()=>{!e||t(xt())},[e,t])}a();s();var jt={link:"_link_ywwad_1",updateCotainer:"_updateCotainer_ywwad_11",centerImage:"_centerImage_ywwad_14",titleUpdate:"_titleUpdate_ywwad_23",textUpdate:"_textUpdate_ywwad_27",updateMb32:"_updateMb32_ywwad_32"};function wE({walletId:e,keyringIdentities:t}){let r;if(t.find(l=>(r=l.walletIdentities.find(u=>u.walletId===e),r)),!r)return[];let n=Object.values(r.account),i=r.accountsMap,o=[];return i&&Object.keys(i).forEach(l=>{let u=i[l];Object.keys(u).forEach(d=>{let p=u[d];p.address&&o.push(p.address)})}),[...new Set([...n,...o])]}var _E=1;function w(e){let{guard:t,openMoonCat:r=!1}=e,n=(0,Dr.useSelector)(St),i=(0,Dr.useSelector)(xe),o=(0,Dr.useSelector)($r),l=(0,Dr.useSelector)(cs),u=se("login"),d=se("wallet-tx-status-toast"),p=se("nft-operate"),v=se("wallet-inform"),b=(0,ot.useHistory)(),E=(0,ot.useLocation)(),[S,C]=(0,A.useState)(null),g=If(),_=vm(),{isCloudChecked:y,onCloudUpdatedCallBack:T,onCloudResetLocalCallBack:H,isRestingFromCloud:Z}=qf();mm();let Y=(0,A.useMemo)(()=>wE({walletId:o,keyringIdentities:l}),[o,l]),{isMoonCat:Ae,loadingMoonCatData:K}=Bf();(0,A.useEffect)(()=>{if(g){let{initialType:j}=g,{path:ie}=e;if(vf()&&bf(j)&&!gm.includes(ie)){let{location:Ke}=e||{},{pathname:Ie,search:ft=""}=Ke||{};setTimeout(()=>{globalThis.platform.openExtensionInPopup(Ie+ft||"")},200)}}},[g?.initialType]);let lt=sm(),Ft=dm(),ut=pm();um(),(0,A.useEffect)(()=>{Ft&&ge.warn({alignBottom:!1,title:G("wallet_extension_home_popup_title_update_now"),text:G("wallet_extension_home_popup_text_update_now"),confirmText:G("wallet_extension_home_popup_btn_update"),maskClosable:!1,onConfirm:()=>{window.localStorage.setItem("extensionReload",Ft),la.default.runtime.reload()}})},[Ft]);let[Oe,z]=(0,A.useState)(!1),[ve]=(0,A.useState)(la.default.runtime.getManifest().version),Se=Of(),Jn=mf({dark:"/cdn/assets/imgs/246/F624BDAD9E2C018D.png",light:"/cdn/assets/imgs/246/234578340DAE2A80.png"});return(0,A.useEffect)(()=>{ve!==ut.version&&!Oe&&ut&&ge.action({mobileWidth:"77.777%",noTopRadius:!1,alignBottom:!1,hideCloseBtn:!0,children:A.default.createElement("div",{className:jt.updateMb32},A.default.createElement("div",{className:jt.centerImage},A.default.createElement("img",{src:Jn,alt:""})),A.default.createElement("div",{className:jt.titleUpdate},G("wallet_extension_home_popup_title_update_available")),A.default.createElement("div",{className:jt.textUpdate},G("wallet_extension_home_popup_text_update_available")),A.default.createElement(si,{size:si.SIZE.sm,className:jt.link,onClick:()=>{globalThis.platform.openTab({url:`https://${Se}/help/how-do-i-update-my-okx-wallet-extension-on-google-chrome`})}},G("wallet_extension_home_popup_link_update_available"))),confirmText:G("wallet_extension_home_popup_text_ok"),maskClosable:!1,onConfirm:j=>{ut.repeat?z(!0):window.localStorage.setItem("versionExtensionUpdate",ut.version),j.destroy()}})},[Oe,ut,ve]),(0,A.useEffect)(()=>{lt&&ge.warn({alignBottom:!1,maskClosable:!1,title:G("wallet_extension_clearcache_modaltitle_step_locked"),text:G("wallet_extension_clearcache_modaldesc_step_locked"),confirmText:G("wallet_extension_btn_general_gotit"),onConfirm:j=>{j.destroy(),b.go(-1)}})},[lt]),(0,A.useEffect)(()=>{if(n&&i){S&&Array.isArray(S)&&tn.sendChannel({op:"logout",args:S});let j=Y.map(ie=>({token:ie}));tn.sendChannel({op:"login",args:j}),C(j)}},[n,i,o]),(0,A.useEffect)(()=>{if(p){let{scene:j,status:ie}=p.data;j===21&&ie===2&&oe.success({title:G("extension_home_toast_receivecompleted")})}},[p]),(0,A.useEffect)(()=>{(async()=>{v&&v?.data&&v?.data?.type===_E&&await _m(v.data)})()},[v]),(0,A.useEffect)(()=>{if(u){let j=Object.keys(Et).map(ie=>({channel:Et[ie]}));tn.sendChannel({op:"subscribe",args:j})}},[u]),(0,A.useEffect)(()=>{let ie=b.location.pathname.match(Xr);if(d&&!ie){let{data:Ke}=d,{pushToastCode:Ie,pushToastParams:ft=[],txStatus:Kw,url:va}=Ke,kr;Ie===20||Ie===21?kr={amount:ft[0],crypto:ft[1]}:Ie===23?kr={num:ft[0],symbol:ft[1]}:kr=wm(ft),oe[ys[Kw]]({title:G(bs[Ie],kr),desc:va?A.default.createElement(jf,{url:va,urlText:G("wallet_transfer_notif_view_on_explorer")}):null})}},[d]),(0,A.useEffect)(()=>{let j=new PerformanceObserver(ie=>{let Ke={};ie.getEntries().forEach(Ie=>{Ke[Ie.name]=Ie.startTime}),performance.memory&&(Ke.memory={totalJSHeapSize:performance.memory?.totalJSHeapSize,usedJSHeapSize:performance.memory?.usedJSHeapSize,jsHeapSizeLimit:performance.memory?.jsHeapSizeLimit}),Ke["first-contentful-paint"]>1e3&&Ye.captureEvent({message:`PERFORMANCE_WARN_1s ${b.location.pathname}`,contexts:{report:{info:JSON.stringify(Ke)}},exception:{values:[{type:`PERFORMANCE_WARN_1s ${b.location.pathname}`,value:"Performance Data"}]},level:"info"})});return j.observe({type:"paint",buffered:!0}),()=>{j.disconnect()}},[b.location.pathname]),(0,A.useEffect)(()=>{H?.()},[H]),Pm(),jn(Y,"wallet-asset"),jn(Y,"invest-DeFi"),jn(Y,"wallet-nft"),Om(),Rm(),Hf(),r&&K?A.default.createElement(A.default.Fragment,null):r&&!K&&Ae?A.default.createElement(ot.Redirect,{to:{pathname:Ze}}):!y||Z?A.default.createElement(A.default.Fragment,null):_?A.default.createElement(ot.Redirect,{to:{pathname:Yr,search:Aa(E.search)}}):T?T():i?t?A.default.createElement(sa,{...e}):A.default.createElement(Sm,{...e}):A.default.createElement(ot.Redirect,{to:{pathname:Tt}})}a();s();var ua=m(P()),km=m(we());a();s();var Dm=m(ee());function Nm(){return!(0,Dm.useSelector)(xe)}function Hn(e){return Nm()?ua.default.createElement(km.Redirect,{to:{pathname:Tt}}):ua.default.createElement(it,{...e})}a();s();var fa=m(P()),Lm=m(ee()),Gn=m(we());function Nr(e){return(0,Lm.useSelector)(xe)?fa.default.createElement(Gn.Redirect,{to:{pathname:fe}}):fa.default.createElement(Gn.Route,{...e})}a();s();var Kn=m(P());a();s();var h=m(P()),Wm=(0,h.lazy)(()=>import("./dex-B7WWTD7D.js")),yE=()=>import("./new-home-page-GVIAXCOF.js"),YN=(0,h.lazy)(()=>import("./common-55L3A6DU.js")),Um=(0,h.lazy)(yE),Bm=(0,h.lazy)(()=>import("./wallet-aggregate-SXRITOVZ.js")),qm=(0,h.lazy)(()=>import("./ConnectHardware-E7IIGCYU.js")),da=(0,h.lazy)(()=>import("./ImportSeedPhraseAndPrivateKey-NR3PBW6D.js")),jm=(0,h.lazy)(()=>import("./WalletMnemonicBackup-5TNPNXRJ.js")),Fm=(0,h.lazy)(()=>import("./WalletMnemonicBackupLandingPage-3JHKOQLH.js")),Hm=(0,h.lazy)(()=>import("./WalletList-C6BCCDQQ.js")),Gm=(0,h.lazy)(()=>import("./WalletEdit-IPTXSMJQ.js")),Km=(0,h.lazy)(()=>import("./WalletBackUp-MKHVCONE.js")),$m=(0,h.lazy)(()=>import("./WalletAccountAddress-DJMEGYYK.js")),Vm=(0,h.lazy)(()=>import("./WalletAccountPrivateKey-B6VOKXY6.js")),Ym=(0,h.lazy)(()=>import("./WalletMnemonicAndPrivateKey-VMZR3NYD.js")),zm=(0,h.lazy)(()=>import("./LedgerNetworkManage-IVX3DG3M.js")),Xm=(0,h.lazy)(()=>import("./WalletDetail-BDWFLJT3.js")),Jm=(0,h.lazy)(()=>import("./WalletAccountDetail-YJT4KG6F.js")),Zm=(0,h.lazy)(()=>import("./CreatePassword-VBYQPAZ7.js")),Qm=(0,h.lazy)(()=>import("./VerifyPassword-FVFFOOJE.js")),eg=(0,h.lazy)(()=>import("./Onboard-WVJWMNAN.js")),tg=(0,h.lazy)(()=>import("./InitialCreate-V3N5NF33.js")),rg=(0,h.lazy)(()=>import("./InitialImport-WFCZIH5W.js")),ng=(0,h.lazy)(()=>import("./wallet-add-page-L2HIHVRB.js")),ig=(0,h.lazy)(()=>import("./walletAddImport-H7ETT7ZJ.js")),og=(0,h.lazy)(()=>import("./Login-6GEAVAY7.js")),ag=(0,h.lazy)(()=>import("./Import-HI32UYXN.js")),sg=(0,h.lazy)(()=>import("./show-supported-chains-YBDBW2QY.js")),lg=(0,h.lazy)(()=>import("./Unlock-OG6A76BC.js")),ug=(0,h.lazy)(()=>import("./Receive-Q5R4AYKO.js")),fg=(0,h.lazy)(()=>import("./Lock-DVELVNGC.js")),dg=(0,h.lazy)(()=>import("./ForgetPassword-2ZEWXGAA.js")),cg=(0,h.lazy)(()=>import("./ResetPassword-NYC6BAJW.js")),pg=(0,h.lazy)(()=>import("./select-network-UZ3DO66N.js")),hg=(0,h.lazy)(()=>import("./select-coin-DDVSC35H.js")),mg=(0,h.lazy)(()=>import("./SelectNetwork-2A6Q6QJO.js")),gg=(0,h.lazy)(()=>import("./SelectProtocol-KIQO32ZK.js")),wg=(0,h.lazy)(()=>import("./SendNft-5SYWRDTP.js")),_g=(0,h.lazy)(()=>import("./SendPageContainer-MT3VSPGU.js")),yg=(0,h.lazy)(()=>import("./CoinManage-Z5DPZSKD.js")),bg=(0,h.lazy)(()=>import("./CustomCrypto-U2NTINEM.js")),vg=(0,h.lazy)(()=>import("./Setting-NMSTYFGW.js")),Sg=(0,h.lazy)(()=>import("./Preference-GNKGKIIZ.js")),Eg=(0,h.lazy)(()=>import("./WalletSafely-O7LVA25M.js")),xg=(0,h.lazy)(()=>import("./DefaultWallet-LKHLVKYU.js")),Tg=(0,h.lazy)(()=>import("./SwitchRandomPassword-MLXPGB4U.js")),Cg=(0,h.lazy)(()=>import("./AboutWallet-GADDSGL4.js")),Pg=(0,h.lazy)(()=>import("./WalletHistory-S7HLZOET.js")),zN=(0,h.lazy)(()=>import("./coinSearch-JSSDD6KU.js")),Ag=(0,h.lazy)(()=>import("./TxConfirmEntry-D6BUYHFO.js")),Og=(0,h.lazy)(()=>import("./Selector-3UBPTI3F.js")),Ig=(0,h.lazy)(()=>import("./WalletLock-5PBSYDGK.js")),Mg=(0,h.lazy)(()=>import("./RpcMode-GHGWBESC.js")),Rg=(0,h.lazy)(()=>import("./DappEntry-JV6C72Z3.js")),Dg=(0,h.lazy)(()=>import("./DappReady-NR25PERA.js")),Ng=(0,h.lazy)(()=>import("./NetworkManagement-D34TMTHF.js")),kg=(0,h.lazy)(()=>import("./Form-D72FYVFC.js")),Lg=(0,h.lazy)(()=>import("./PermissionsConnect-OO7TB4Q6.js")),Wg=(0,h.lazy)(()=>import("./Detail-CMJYMSGJ.js")),Ug=(0,h.lazy)(()=>import("./NftFilter-6LW7ZK52.js")),Bg=(0,h.lazy)(()=>import("./DAppNetworkManage-MW2O6RPN.js")),qg=(0,h.lazy)(()=>import("./CoinDetail-QRTQGTED.js")),jg=(0,h.lazy)(()=>import("./address-LLUL4ODZ.js")),Fg=(0,h.lazy)(()=>import("./ZKSpace-BD5AN2RE.js")),Hg=(0,h.lazy)(()=>import("./Pi-6TUPRLKW.js")),Gg=(0,h.lazy)(()=>import("./ZKSyncLite-5GIOVSNT.js")),Kg=(0,h.lazy)(()=>import("./Starknet-JT6UKONX.js")),$g=(0,h.lazy)(()=>import("./CreateAccount-QT2JLXFM.js")),Vg=(0,h.lazy)(()=>import("./ConfirmPay-E36K72WG.js")),Yg=(0,h.lazy)(()=>import("./rpc-mode-D7FPLKCJ.js")),zg=(0,h.lazy)(()=>import("./RiskApprovePage-RXSRYACT.js")),Xg=(0,h.lazy)(()=>import("./ApproveDetailPage-SZGKHZS5.js")),Jg=(0,h.lazy)(()=>import("./BatchTransfer-ICMDG6DS.js")),Zg=(0,h.lazy)(()=>import("./Bitcoin-RDXT5DWR.js")),Qg=(0,h.lazy)(()=>import("./BatchAddAccount-QIVTPTHU.js")),ew=(0,h.lazy)(()=>import("./BulkRename-CE5WW4IO.js")),tw=(0,h.lazy)(()=>import("./Edit-NXDMC5FT.js")),rw=(0,h.lazy)(()=>import("./Confirm-XVL5GUJS.js")),XN=(0,h.lazy)(()=>import("./FractalBTCInscribe-6CR7522V.js")),nw=(0,h.lazy)(()=>import("./ManageUtxo-YXIQOOKV.js")),iw=(0,h.lazy)(()=>import("./CoinInfo-63CGPLGT.js")),ow=(0,h.lazy)(()=>import("./DownloadAddresses-6NLC7EWN.js")),aw=(0,h.lazy)(()=>import("./GasTracker-SMIBOUYI.js")),sw=(0,h.lazy)(()=>import("./Advanced-KTHKT5U6.js")),lw=(0,h.lazy)(()=>import("./PasswordType-NVP7TLMW.js")),uw=(0,h.lazy)(()=>import("./WebWidget-MELV2EL2.js")),fw=(0,h.lazy)(()=>import("./FeaturePanel-Q4N7TUOV.js")),dw=(0,h.lazy)(()=>import("./RiskExtension-CPFBBDJT.js")),cw=(0,h.lazy)(()=>import("./Upgrade7702Entry-LR4I7MHK.js")),pw=(0,h.lazy)(()=>import("./Upgrade7702SelectWallet-2CFGT6IJ.js")),hw=(0,h.lazy)(()=>import("./7702Revoke-GXJK3FZW.js")),mw=(0,h.lazy)(()=>import("./ReportPage-F3ZMEQLE.js")),gw=(0,h.lazy)(()=>import("./GeneralDapp-PCAZJNEX.js"));var ww=(0,Kn.lazy)(()=>import("./MoonCat-GPHQ7HGP.js")),_w=(0,Kn.lazy)(()=>import("./MoonCatDay-YKYT5TN7.js")),yw=(0,Kn.lazy)(()=>import("./MoonCatNight-45BXV3PI.js"));var bw=({autoLockTimeLimit:e,setLastActiveTime:t})=>{let n=(0,ue.useHistory)().location?.state?.noGuard||{},i=c.default.createElement(c.Suspense,null,c.default.createElement(ue.Switch,null,c.default.createElement(ue.Route,{path:hl,component:qm}),c.default.createElement(w,{path:Zl,component:da,exact:!0}),c.default.createElement(aa,{path:vu,component:tw,exact:!0}),c.default.createElement(aa,{path:Su,component:rw,exact:!0}),c.default.createElement(w,{path:ci,guard:!n[ci],component:jm,openMoonCat:!0,exact:!0}),c.default.createElement(w,{path:lu,component:Fm,exact:!0}),c.default.createElement(w,{path:tu,component:Hm,exact:!0}),c.default.createElement(w,{path:ru,component:Gm,exact:!0}),c.default.createElement(w,{path:Il,component:Km,exact:!0,openMoonCat:!0}),c.default.createElement(w,{path:Wu,component:Ag,exact:!0}),c.default.createElement(w,{path:su,guard:!0,component:Ym,exact:!0,openMoonCat:!0}),c.default.createElement(ue.Route,{path:Du,component:lw,exact:!0}),c.default.createElement(ue.Route,{path:El,component:Zm,exact:!0}),c.default.createElement(w,{path:xl,component:Qm}),c.default.createElement(Nr,{path:Tl,component:da,exact:!0}),c.default.createElement(ue.Route,{path:`${Cl}/:type`,component:sg}),c.default.createElement(w,{path:nu,component:Xm}),c.default.createElement(w,{path:uu,component:zm}),c.default.createElement(w,{path:iu,component:Jm}),c.default.createElement(w,{path:ou,component:$m}),c.default.createElement(w,{path:au,guard:!0,component:Vm,openMoonCat:!0}),c.default.createElement(ue.Route,{path:Tu,component:Bm}),c.default.createElement(w,{path:wl,component:ug,exact:!0}),c.default.createElement(ue.Route,{path:al,component:fg,exact:!0}),c.default.createElement(Nr,{path:Tt,component:eg}),c.default.createElement(Nr,{path:vl,component:tg,exact:!0}),c.default.createElement(Nr,{path:bl,component:rg,exact:!0}),c.default.createElement(w,{path:Ql,component:ng,exact:!0}),c.default.createElement(w,{path:eu,component:ig,exact:!0}),c.default.createElement(ue.Route,{path:Pu,component:og,exact:!0}),c.default.createElement(ue.Route,{path:Au,component:ag,exact:!0}),c.default.createElement(Hn,{path:Yr,exact:!0,component:lg}),c.default.createElement(Hn,{path:_l,component:dg}),c.default.createElement(w,{path:yl,component:cg}),c.default.createElement(w,{path:_u,component:Yg}),c.default.createElement(w,{path:yu,component:Jg}),c.default.createElement(w,{path:Sl,component:pw}),c.default.createElement(w,{path:bu,component:Qg}),c.default.createElement(w,{path:Eu,component:ew}),c.default.createElement(w,{path:pl,component:gg}),c.default.createElement(w,{path:cl,component:mg}),c.default.createElement(w,{path:Jl,component:pg}),c.default.createElement(w,{path:Xl,component:hg}),c.default.createElement(w,{path:`${ul}/:nftPath`,component:wg,exact:!0}),c.default.createElement(w,{path:`${ll}/:coinId?`,component:_g}),c.default.createElement(w,{path:Pl,component:yg}),c.default.createElement(w,{path:Al,component:bg}),c.default.createElement(w,{path:Ol,component:vg}),c.default.createElement(w,{path:Ml,component:Sg}),c.default.createElement(w,{path:Rl,component:Eg}),c.default.createElement(w,{path:Dl,component:xg}),c.default.createElement(w,{path:ql,component:Tg}),c.default.createElement(w,{path:Wl,component:Cg}),c.default.createElement(w,{path:Nl,component:ww}),c.default.createElement(w,{path:Ll,component:yw}),c.default.createElement(w,{path:kl,component:_w}),c.default.createElement(w,{path:jl,component:uw}),c.default.createElement(w,{path:Fl,component:fw}),c.default.createElement(w,{path:fu,component:Pg,exact:!0}),c.default.createElement(w,{path:Ul,component:Og}),c.default.createElement(w,{path:Bl,component:Ig}),c.default.createElement(w,{path:Hl,component:Mg}),c.default.createElement(w,{path:Yl,component:Dg}),c.default.createElement(w,{path:$l,component:Rg}),c.default.createElement(w,{path:Vl,component:gw}),c.default.createElement(w,{path:Gl,component:Ng}),c.default.createElement(w,{path:Kl,component:kg}),c.default.createElement(w,{path:`${fl}/:id`,component:Lg}),c.default.createElement(w,{path:`${ml}`,component:Wg,exact:!0}),c.default.createElement(w,{path:gl,component:Ug,exact:!0}),c.default.createElement(w,{path:`${dl}`,component:Bg}),c.default.createElement(w,{path:zr,component:qg,exact:!0}),c.default.createElement(w,{path:Ou,component:iw}),c.default.createElement(w,{path:Iu,component:ow}),c.default.createElement(w,{path:du,component:jg}),c.default.createElement(w,{path:cu,component:Fg}),c.default.createElement(w,{path:pu,component:Hg}),c.default.createElement(w,{path:hu,component:Gg}),c.default.createElement(w,{path:mu,component:Kg}),c.default.createElement(w,{path:gu,component:$g}),c.default.createElement(w,{path:wu,component:Vg}),c.default.createElement(w,{path:zl,component:Zg}),c.default.createElement(w,{path:Xr},c.default.createElement(c.Suspense,{fallback:c.default.createElement(Cf,null)},c.default.createElement(Wm,null))),c.default.createElement(w,{path:Cu,component:nw}),c.default.createElement(w,{path:Mu,component:aw}),c.default.createElement(w,{path:Ru,component:sw}),c.default.createElement(w,{path:Nu,component:cw}),c.default.createElement(w,{path:ku,component:zg}),c.default.createElement(w,{path:Lu,component:Xg}),c.default.createElement(w,{path:Uu,component:dw}),c.default.createElement(w,{path:Bu,component:hw}),c.default.createElement(w,{path:sl,component:mw}),c.default.createElement(w,{path:[fe,Ze],component:Um})));return e>0?c.default.createElement(nm,{onAction:t,throttle:1e3},i):i};var vw=bw;var Sw=({isLoading:e})=>{let{autoLockTimeLimit:t=0}=(0,$n.useSelector)(hs),r=(0,$n.useDispatch)();return at.default.createElement(at.default.Fragment,null,at.default.createElement(Jh,null),at.default.createElement(Qh,null),at.default.createElement("div",{className:"main-container-wrapper"},e&&at.default.createElement(Tf,null),at.default.createElement(vw,{autoLockTimeLimit:t,setLastActiveTime:()=>{r(Gs())}})))};var Ew=({isLoading:e})=>React.createElement(Sw,{isLoading:e});a();s();var Vn=m(P()),xw=m(ee()),Tw=m(Xt());var bE=()=>{let e=(0,Vn.useRef)(!1),{walletId:t,platformAssetUSD:r,nftBalanceUSD:n,defiBalanceUSD:i,tokenBalanceUSD:o}=(0,xw.useSelector)($f),l=(0,Tw.usePrevious)(t,()=>!0);(0,Vn.useEffect)(()=>{l!==t&&(e.current=!1),r!==Kf&&e.current===!1&&(Ts({wallet_id:t,coin_balance:o,nft_balance:n,defi_balance:i,platform_coin_balance:r}),e.current=!0)},[t,l,r,n,o,i])},Cw=bE;a();s();var Pw=m(P()),ca=m(ee());Kt();bt();var vE=()=>{let e=(0,ca.useSelector)($r),t=(0,ca.useSelector)(Mf),n=me()===qr;(0,Pw.useEffect)(()=>{e&&Es({islogin:"yes",isbydapp:n?"yes":"no",dapp_url:Wa?"web3.okx.com/pc":t,wallet_id:e})},[e])},Aw=vE;a();s();a();s();var SE=()=>{},Ow=SE;var Iw=Ow;oe.config({duration:3,top:10,left:16,right:16,maxCount:3,placement:oe.DIRECTION.top,isInline:!0});var Nw=()=>{let e=Iw(),t=(0,Mw.useHistory)(),r=(0,st.useDispatch)(),[,n]=$h(Gr.getCheckCountryLimit);(0,Ge.useEffect)(()=>{if(n){let{data:{web3:{limit:S,displayCountryName:C}}}=n;S&&ge.warn({maskClosable:!1,renderFooter:()=>Ge.default.createElement("div",null),alignBottom:!1,title:O("wallet_extension_login_title_access_restricted"),text:O("wallet_extension_login_toast_unavailable_inyourregion",{area:C})})}},[n]),Dn(),Aw(),Cw();let i=(0,st.useSelector)(S=>S.appState.isLoading),{os:o,browser:l}=(0,st.useSelector)(S=>S.metamask.browserEnvironment)||{},u=(0,st.useSelector)(ms),d=(0,st.useSelector)(ps)?.isoCode||"usd",p=(0,st.useSelector)(Jr),v=process.env.ASSETS_BUILD_TYPE===Me.DEV||process.env.ASSETS_BUILD_TYPE===Me.DAILY,b=()=>{t.listen((S,C)=>{C==="PUSH"&&xh(S.pathname)})},E=()=>{d||r(Sf("usd"))};return(0,Rw.useMount)(()=>{b(),gf(),Qr(u),E(),Gh(p)}),Ge.default.createElement(Ge.default.Fragment,null,Ge.default.createElement("div",{className:(0,Dw.default)("app-content",{[`os-${o}`]:o,[`browser-${l}`]:l}),style:{height:e}},Ge.default.createElement(Ew,{isLoading:i})),!!v&&Ge.default.createElement(Xh,null))};a();s();var ha=class extends ne.PureComponent{constructor(){super(...arguments);$e(this,"state",{});$e(this,"isNetworkError",()=>{let{error:r}=this.state;return r instanceof TypeError&&r.message?.toLocaleLowerCase().match(/failed to fetch/)})}static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r){Ye.captureException(r)}render(){let{error:r}=this.state,{store:n}=this.props;if(r){let i=r&&this.isNetworkError();return ne.default.createElement(pa.Provider,{store:n},ne.default.createElement(Yo,null,i?ne.default.createElement(Lh,null):ne.default.createElement(Xo,{error:r})))}return ne.default.createElement(pa.Provider,{store:n},ne.default.createElement(jh,null),ne.default.createElement(kw.HashRouter,null,ne.default.createElement(Yo,null,ne.default.createElement(Ia,{options:Ka},ne.default.createElement(Ma,null,ne.default.createElement(Nw,null))))))}},Lw=ha;var wa=m(Qw());i_();ti();t_();fi();s_();ri();zt();a();s();function Ww(e){let t={accountIdentities:e.accountIdentities,keyringIdentities:e.keyringIdentities,selectedWallet:e.selectedWallet,multiAddressBaseChainsMap:e.multiAddressBaseChainsMap};return delete e.accountIdentities,delete e.keyringIdentities,delete e.selectedWallet,delete e.multiAddressBaseChainsMap,t}var ma=null,zn=null,Uw=!1,ga={current:{},okdCurrent:{},dexCurrent:{}};function EE(){if(!Uw){if(Ha.config({top:16}),Oa.config({returnString:!0,isConvertToZero:!0,exponentialAt:[-40,40]}),$t.setConfig({Dialog:{maskClosable:!0,getContainer:()=>document.querySelector(".main-container-wrapper")},Drawer:{getContainer:()=>document.querySelector(".main-container-wrapper")},[$t.componentNames.Select]:{bottomSafeSpace:0}}),process.env.ASSETS_BUILD_TYPE===Me.DEV||process.env.ASSETS_BUILD_TYPE===Me.DAILY){let e=window.localStorage.getItem("languageKeyMode");vt(e==="keyMode")}Uw=!0}}function xE(e){window.getCleanAppState=function(){let t=Pa(e.getState());return t.version=globalThis.platform.getVersion(),t.browser=window.navigator.userAgent,t}}async function TE(){return await xa.setUrlFromLocalAsync(),await Sa.setUrlFromLocalAsync(),Promise.allSettled([Ss(),xs()])}function CE(e){async function t(r){let n=await Yn.default.tabs.get(r),{active:i,id:o,title:l,url:u}=n;if(i===!1)return;let{origin:d,protocol:p}=u?new URL(u):{};!d||d==="null"||e.dispatch(ph({id:o,title:l,origin:d,protocol:p,url:u}))}Yn.default.tabs.onActivated.addListener(async({tabId:r})=>{await t(r)}),Yn.default.tabs.onUpdated.addListener(async r=>{await t(r)})}async function PE(e){return new Promise((t,r)=>{e.getStateByDomain((n,i)=>{if(n){r(n);return}t(i)})})}async function AE({metamaskState:e,backgroundConnection:t,opts:r,isFirstRun:n}){let i;if(n){es(e.currentLocale);let b=await Promise.allSettled([Vr(e.currentLocale),Vr(e.currentLocale,wa.LOCALE_TYPE.okd),Vr(e.currentLocale,wa.LOCALE_TYPE.dex)]);ga={current:b[0].value,okdCurrent:b[1].value,dexCurrent:b[2].value},js(e.currentLocale),i=ga}else i=ga;let o=Ww(e),u={...{activeTab:r.activeTab,metamask:e,appState:{},localeMessages:i}},d;n?(d=Bo(u),zn=d,CE(d),d.dispatch(Mh())):(d=zn,d.dispatch(di(e)));let p=ls(e.unapprovedTxs,e.unapprovedMsgs,e.unapprovedPersonalMsgs,e.unapprovedDecryptMsgs,e.unapprovedEncryptionPublicKeyMsgs,e.unapprovedTypedMessages,e.network,e.provider.chainId);return p.length>0&&d.dispatch($s({id:p[0].id})),t.onNotification(b=>{switch(b.method){case"sendUpdate":{let E=b.params[0];d.dispatch(di(E))}break;case"sendPartialUpdate":{let E=b.params[0];d.dispatch(Hs(E))}break;case"sendUpdateBalance":{let E=b.params[0];d.dispatch(E?vs(E):xt())}break;default:throw new Error(`Internal JSON-RPC Notification Not Handled:
|
|
|
|
${JSON.stringify(b)}`)}}),Fs(o,d.dispatch.bind(d),!1),ma=ma||(0,qw.createRoot)(r.container),ma.render(Bw.default.createElement(Lw,{store:d})),d}async function _a(e,t){EE();let{backgroundConnection:r}=e;us(r),za(r.refreshHttpDNS);try{let n=await PE(r);ss(n.chainList);let i=!zn;i&&await TE();let o=await AE({metamaskState:n,backgroundConnection:r,opts:e,isFirstRun:i});i&&xE(o),t(null,o)}catch(n){zn=null,t(n)}}window.logStateString=async function(e){let t=window.getCleanAppState();try{let r=await globalThis.platform.getPlatformInfo();t.platform=r;try{t.log=await Ya()}catch{t.log=[]}let n=await hh();Object.keys(n).forEach(o=>{t[o]=n[o]});let i=JSON.stringify(t,null,2);e(null,i)}catch(r){e(r)}};a();s();var OE=["popup.html","notification.html","home.html"];navigator.userAgent.includes("Android")&&OE.forEach(e=>{location.href.includes(e)&&(location.href=location.href.replace(e,"fullscreen.html"))});var ya=!1,Xn=null;function IE(e){let t=new Fw.default;t.pipe(e).pipe(t),e.on("error",Wr),t.on("error",Wr)}function ME(e,t){let r=op(e);t(null,r)}function RE(e,t){let r=uh(e);ME(r.createStream("controller"),t),IE(r.createStream("provider"))}function DE(e,t,r,n){RE(r,(i,o)=>{if(i){n(i);return}_a({activeTab:e,container:t,backgroundConnection:o},n)})}async function NE(e){return new Promise(t=>{if(e!==Br&&e!==jr){t({});return}ba.default.tabs.query({active:!0,currentWindow:!0}).then(r=>{let[n]=r,{id:i,title:o,url:l}=n,{origin:u,protocol:d}=l?new URL(l):{};if(!u||u==="null"){t({});return}t({id:i,title:o,origin:u,protocol:d,url:l})}).catch(Wr)})}async function Hw(e,t){let r=await NE(e);Fr()===La&&(r.origin="https://web3.okx.com");let n=document.getElementById("app");DE(r,n,t,i=>{if(i)throw i})}function kE(){if(!ya)try{globalThis.platform=new No,Xn=me(),Ba(),ya=!0}catch{ya=!1}}function Gw(){let e=ba.default.runtime.connect({name:Xn}),t=new mr(e);return t.once("end",()=>{let r=Gw();Hw(Xn,r)}),t}async function LE(){kE();let e=Gw();Hw(Xn,e)}LE().catch(jw.default.error);
|
|
|
|
window.inOKXExtension = true;
|
|
window.inMiniApp = false;
|
|
window.ASSETS_BUILD_TYPE = "publish";
|
|
|
|
//# sourceMappingURL=ui.js.map
|