{"snapId":"npm:@metamask/solana-wallet-snap","manifest":{"version":"5.0.1","description":"Manage Solana using MetaMask","proposedName":"Solana","repository":{"type":"git","url":"https://github.com/MetaMask/internal-snaps.git"},"source":{"shasum":"oq3fk0VOJl4vJeZ6lWAJU94z5gw8Zrr+rnZG17qKMCE=","location":{"npm":{"filePath":"dist/bundle.js","iconPath":"images/icon.svg","packageName":"@metamask/solana-wallet-snap","registry":"https://registry.npmjs.org/"}},"locales":["locales/en.json"]},"initialConnections":{"https://portfolio.metamask.io":{}},"initialPermissions":{"endowment:rpc":{"dapps":true,"snaps":false},"endowment:keyring":{"allowedOrigins":["https://portfolio.metamask.io"],"capabilities":{"scopes":["solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"],"privateKey":{"exportFormats":[{"encoding":"base58"}]},"bip44":{"deriveIndex":true,"deriveIndexRange":true,"discover":true}}},"snap_getBip32Entropy":[{"path":["m","44'","501'"],"curve":"ed25519"}],"endowment:lifecycle-hooks":{},"endowment:network-access":{},"endowment:cronjob":{"jobs":[]},"endowment:protocol":{"scopes":{"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":{"methods":["getGenesisHash","getLatestBlockhash","getMinimumBalanceForRentExemption"]},"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1":{"methods":["getGenesisHash","getLatestBlockhash","getMinimumBalanceForRentExemption"]}}},"endowment:assets":{"scopes":["solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"]},"endowment:name-lookup":{"chains":["solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"]},"snap_manageAccounts":{},"snap_manageState":{},"snap_dialog":{},"snap_getPreferences":{}},"platformVersion":"11.2.0","manifestVersion":"0.1"},"files":[{"path":"images/icon.svg","value":"<svg width=\"101\" height=\"101\" viewBox=\"0 0 101 101\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M100.48 69.3817L83.8068 86.8015C83.4444 87.1799 83.0058 87.4816 82.5185 87.6878C82.0312 87.894 81.5055 88.0003 80.9743 88H1.93563C1.55849 88 1.18957 87.8926 0.874202 87.6912C0.558829 87.4897 0.31074 87.2029 0.160416 86.8659C0.0100923 86.529 -0.0359181 86.1566 0.0280382 85.7945C0.0919944 85.4324 0.263131 85.0964 0.520422 84.8278L17.2061 67.408C17.5676 67.0306 18.0047 66.7295 18.4904 66.5234C18.9762 66.3172 19.5002 66.2104 20.0301 66.2095H99.0644C99.4415 66.2095 99.8104 66.3169 100.126 66.5183C100.441 66.7198 100.689 67.0067 100.84 67.3436C100.99 67.6806 101.036 68.0529 100.972 68.415C100.908 68.7771 100.737 69.1131 100.48 69.3817ZM83.8068 34.3032C83.4444 33.9248 83.0058 33.6231 82.5185 33.4169C82.0312 33.2108 81.5055 33.1045 80.9743 33.1048H1.93563C1.55849 33.1048 1.18957 33.2121 0.874202 33.4136C0.558829 33.6151 0.31074 33.9019 0.160416 34.2388C0.0100923 34.5758 -0.0359181 34.9482 0.0280382 35.3103C0.0919944 35.6723 0.263131 36.0083 0.520422 36.277L17.2061 53.6968C17.5676 54.0742 18.0047 54.3752 18.4904 54.5814C18.9762 54.7875 19.5002 54.8944 20.0301 54.8952H99.0644C99.4415 54.8952 99.8104 54.7879 100.126 54.5864C100.441 54.3849 100.689 54.0981 100.84 53.7612C100.99 53.4242 101.036 53.0518 100.972 52.6897C100.908 52.3277 100.737 51.9917 100.48 51.723L83.8068 34.3032ZM1.93563 21.7905H80.9743C81.5055 21.7907 82.0312 21.6845 82.5185 21.4783C83.0058 21.2721 83.4444 20.9704 83.8068 20.592L100.48 3.17219C100.737 2.90357 100.908 2.56758 100.972 2.2055C101.036 1.84342 100.99 1.47103 100.84 1.13408C100.689 0.79713 100.441 0.510296 100.126 0.308823C99.8104 0.107349 99.4415 1.24074e-05 99.0644 0L20.0301 0C19.5002 0.000878397 18.9762 0.107699 18.4904 0.313848C18.0047 0.519998 17.5676 0.821087 17.2061 1.19848L0.524723 18.6183C0.267681 18.8866 0.0966198 19.2223 0.0325185 19.5839C-0.0315829 19.9456 0.0140624 20.3177 0.163856 20.6545C0.31365 20.9913 0.561081 21.2781 0.875804 21.4799C1.19053 21.6817 1.55886 21.7896 1.93563 21.7905Z\" fill=\"url(#paint0_linear_174_4403)\"/>\n<defs>\n<linearGradient id=\"paint0_linear_174_4403\" x1=\"8.52558\" y1=\"90.0973\" x2=\"88.9933\" y2=\"-3.01622\" gradientUnits=\"userSpaceOnUse\">\n<stop offset=\"0.08\" stop-color=\"#9945FF\"/>\n<stop offset=\"0.3\" stop-color=\"#8752F3\"/>\n<stop offset=\"0.5\" stop-color=\"#5497D5\"/>\n<stop offset=\"0.6\" stop-color=\"#43B4CA\"/>\n<stop offset=\"0.72\" stop-color=\"#28E0B9\"/>\n<stop offset=\"0.97\" stop-color=\"#19FB9B\"/>\n</linearGradient>\n</defs>\n</svg>\n"},{"path":"dist/bundle.js","value":"(()=>{var e={2091(e,t,n){\"use strict\";t.nl=t.x2=void 0;const r=n(9648),o=n(486),i=n(7004),a=n(2249),s=n(3654),c=n(9450);function u(e){if(\"string\"!=typeof e)throw new TypeError(\"Invalid mnemonic type: \"+typeof e);return e.normalize(\"NFKD\")}function l(e){const t=u(e),n=t.split(\" \");if(![12,15,18,21,24].includes(n.length))throw new Error(\"Invalid mnemonic\");return{nfkd:t,words:n}}function d(e){r.default.bytes(e,16,20,24,28,32)}const f=e=>{const t=8-e.length/4;return new Uint8Array([(0,i.sha256)(e)[0]>>t<<t])};function h(e){if(!Array.isArray(e)||2048!==e.length||\"string\"!=typeof e[0])throw new Error(\"Worlist: expected array of 2048 strings\");return e.forEach(e=>{if(\"string\"!=typeof e)throw new Error(`Wordlist: non-string element: ${e}`)}),c.utils.chain(c.utils.checksum(1,f),c.utils.radix2(11,!0),c.utils.alphabet(e))}function p(e,t){let n;if(\"string\"==typeof e){const{words:r}=l(e);n=h(t).decode(r)}else n=h(t).decode(Array.from(new Uint16Array(e.buffer)).map(e=>t[e]));return d(n),n}function g(e,t){d(e);const n=h(t).encode(e).map(e=>t.indexOf(e));return new Uint8Array(new Uint16Array(n).buffer)}t.x2=p;const m=e=>u(`mnemonic${e}`);function y(e,t){let n;return n=\"string\"==typeof e?(new TextEncoder).encode(l(e).nfkd):(new TextEncoder).encode(Array.from(new Uint16Array(e.buffer)).map(e=>t[e]).join(\" \")),n}t.nl=function(e,t,n=\"\"){const r=y(e,t);return(0,o.pbkdf2Async)(a.sha512,r,m(n),{c:2048,dkLen:64})}},6925(e,t){\"use strict\";t.p=void 0,t.p=\"abandon\\nability\\nable\\nabout\\nabove\\nabsent\\nabsorb\\nabstract\\nabsurd\\nabuse\\naccess\\naccident\\naccount\\naccuse\\nachieve\\nacid\\nacoustic\\nacquire\\nacross\\nact\\naction\\nactor\\nactress\\nactual\\nadapt\\nadd\\naddict\\naddress\\nadjust\\nadmit\\nadult\\nadvance\\nadvice\\naerobic\\naffair\\nafford\\nafraid\\nagain\\nage\\nagent\\nagree\\nahead\\naim\\nair\\nairport\\naisle\\nalarm\\nalbum\\nalcohol\\nalert\\nalien\\nall\\nalley\\nallow\\nalmost\\nalone\\nalpha\\nalready\\nalso\\nalter\\nalways\\namateur\\namazing\\namong\\namount\\namused\\nanalyst\\nanchor\\nancient\\nanger\\nangle\\nangry\\nanimal\\nankle\\nannounce\\nannual\\nanother\\nanswer\\nantenna\\nantique\\nanxiety\\nany\\napart\\napology\\nappear\\napple\\napprove\\napril\\narch\\narctic\\narea\\narena\\nargue\\narm\\narmed\\narmor\\narmy\\naround\\narrange\\narrest\\narrive\\narrow\\nart\\nartefact\\nartist\\nartwork\\nask\\naspect\\nassault\\nasset\\nassist\\nassume\\nasthma\\nathlete\\natom\\nattack\\nattend\\nattitude\\nattract\\nauction\\naudit\\naugust\\naunt\\nauthor\\nauto\\nautumn\\naverage\\navocado\\navoid\\nawake\\naware\\naway\\nawesome\\nawful\\nawkward\\naxis\\nbaby\\nbachelor\\nbacon\\nbadge\\nbag\\nbalance\\nbalcony\\nball\\nbamboo\\nbanana\\nbanner\\nbar\\nbarely\\nbargain\\nbarrel\\nbase\\nbasic\\nbasket\\nbattle\\nbeach\\nbean\\nbeauty\\nbecause\\nbecome\\nbeef\\nbefore\\nbegin\\nbehave\\nbehind\\nbelieve\\nbelow\\nbelt\\nbench\\nbenefit\\nbest\\nbetray\\nbetter\\nbetween\\nbeyond\\nbicycle\\nbid\\nbike\\nbind\\nbiology\\nbird\\nbirth\\nbitter\\nblack\\nblade\\nblame\\nblanket\\nblast\\nbleak\\nbless\\nblind\\nblood\\nblossom\\nblouse\\nblue\\nblur\\nblush\\nboard\\nboat\\nbody\\nboil\\nbomb\\nbone\\nbonus\\nbook\\nboost\\nborder\\nboring\\nborrow\\nboss\\nbottom\\nbounce\\nbox\\nboy\\nbracket\\nbrain\\nbrand\\nbrass\\nbrave\\nbread\\nbreeze\\nbrick\\nbridge\\nbrief\\nbright\\nbring\\nbrisk\\nbroccoli\\nbroken\\nbronze\\nbroom\\nbrother\\nbrown\\nbrush\\nbubble\\nbuddy\\nbudget\\nbuffalo\\nbuild\\nbulb\\nbulk\\nbullet\\nbundle\\nbunker\\nburden\\nburger\\nburst\\nbus\\nbusiness\\nbusy\\nbutter\\nbuyer\\nbuzz\\ncabbage\\ncabin\\ncable\\ncactus\\ncage\\ncake\\ncall\\ncalm\\ncamera\\ncamp\\ncan\\ncanal\\ncancel\\ncandy\\ncannon\\ncanoe\\ncanvas\\ncanyon\\ncapable\\ncapital\\ncaptain\\ncar\\ncarbon\\ncard\\ncargo\\ncarpet\\ncarry\\ncart\\ncase\\ncash\\ncasino\\ncastle\\ncasual\\ncat\\ncatalog\\ncatch\\ncategory\\ncattle\\ncaught\\ncause\\ncaution\\ncave\\nceiling\\ncelery\\ncement\\ncensus\\ncentury\\ncereal\\ncertain\\nchair\\nchalk\\nchampion\\nchange\\nchaos\\nchapter\\ncharge\\nchase\\nchat\\ncheap\\ncheck\\ncheese\\nchef\\ncherry\\nchest\\nchicken\\nchief\\nchild\\nchimney\\nchoice\\nchoose\\nchronic\\nchuckle\\nchunk\\nchurn\\ncigar\\ncinnamon\\ncircle\\ncitizen\\ncity\\ncivil\\nclaim\\nclap\\nclarify\\nclaw\\nclay\\nclean\\nclerk\\nclever\\nclick\\nclient\\ncliff\\nclimb\\nclinic\\nclip\\nclock\\nclog\\nclose\\ncloth\\ncloud\\nclown\\nclub\\nclump\\ncluster\\nclutch\\ncoach\\ncoast\\ncoconut\\ncode\\ncoffee\\ncoil\\ncoin\\ncollect\\ncolor\\ncolumn\\ncombine\\ncome\\ncomfort\\ncomic\\ncommon\\ncompany\\nconcert\\nconduct\\nconfirm\\ncongress\\nconnect\\nconsider\\ncontrol\\nconvince\\ncook\\ncool\\ncopper\\ncopy\\ncoral\\ncore\\ncorn\\ncorrect\\ncost\\ncotton\\ncouch\\ncountry\\ncouple\\ncourse\\ncousin\\ncover\\ncoyote\\ncrack\\ncradle\\ncraft\\ncram\\ncrane\\ncrash\\ncrater\\ncrawl\\ncrazy\\ncream\\ncredit\\ncreek\\ncrew\\ncricket\\ncrime\\ncrisp\\ncritic\\ncrop\\ncross\\ncrouch\\ncrowd\\ncrucial\\ncruel\\ncruise\\ncrumble\\ncrunch\\ncrush\\ncry\\ncrystal\\ncube\\nculture\\ncup\\ncupboard\\ncurious\\ncurrent\\ncurtain\\ncurve\\ncushion\\ncustom\\ncute\\ncycle\\ndad\\ndamage\\ndamp\\ndance\\ndanger\\ndaring\\ndash\\ndaughter\\ndawn\\nday\\ndeal\\ndebate\\ndebris\\ndecade\\ndecember\\ndecide\\ndecline\\ndecorate\\ndecrease\\ndeer\\ndefense\\ndefine\\ndefy\\ndegree\\ndelay\\ndeliver\\ndemand\\ndemise\\ndenial\\ndentist\\ndeny\\ndepart\\ndepend\\ndeposit\\ndepth\\ndeputy\\nderive\\ndescribe\\ndesert\\ndesign\\ndesk\\ndespair\\ndestroy\\ndetail\\ndetect\\ndevelop\\ndevice\\ndevote\\ndiagram\\ndial\\ndiamond\\ndiary\\ndice\\ndiesel\\ndiet\\ndiffer\\ndigital\\ndignity\\ndilemma\\ndinner\\ndinosaur\\ndirect\\ndirt\\ndisagree\\ndiscover\\ndisease\\ndish\\ndismiss\\ndisorder\\ndisplay\\ndistance\\ndivert\\ndivide\\ndivorce\\ndizzy\\ndoctor\\ndocument\\ndog\\ndoll\\ndolphin\\ndomain\\ndonate\\ndonkey\\ndonor\\ndoor\\ndose\\ndouble\\ndove\\ndraft\\ndragon\\ndrama\\ndrastic\\ndraw\\ndream\\ndress\\ndrift\\ndrill\\ndrink\\ndrip\\ndrive\\ndrop\\ndrum\\ndry\\nduck\\ndumb\\ndune\\nduring\\ndust\\ndutch\\nduty\\ndwarf\\ndynamic\\neager\\neagle\\nearly\\nearn\\nearth\\neasily\\neast\\neasy\\necho\\necology\\neconomy\\nedge\\nedit\\neducate\\neffort\\negg\\neight\\neither\\nelbow\\nelder\\nelectric\\nelegant\\nelement\\nelephant\\nelevator\\nelite\\nelse\\nembark\\nembody\\nembrace\\nemerge\\nemotion\\nemploy\\nempower\\nempty\\nenable\\nenact\\nend\\nendless\\nendorse\\nenemy\\nenergy\\nenforce\\nengage\\nengine\\nenhance\\nenjoy\\nenlist\\nenough\\nenrich\\nenroll\\nensure\\nenter\\nentire\\nentry\\nenvelope\\nepisode\\nequal\\nequip\\nera\\nerase\\nerode\\nerosion\\nerror\\nerupt\\nescape\\nessay\\nessence\\nestate\\neternal\\nethics\\nevidence\\nevil\\nevoke\\nevolve\\nexact\\nexample\\nexcess\\nexchange\\nexcite\\nexclude\\nexcuse\\nexecute\\nexercise\\nexhaust\\nexhibit\\nexile\\nexist\\nexit\\nexotic\\nexpand\\nexpect\\nexpire\\nexplain\\nexpose\\nexpress\\nextend\\nextra\\neye\\neyebrow\\nfabric\\nface\\nfaculty\\nfade\\nfaint\\nfaith\\nfall\\nfalse\\nfame\\nfamily\\nfamous\\nfan\\nfancy\\nfantasy\\nfarm\\nfashion\\nfat\\nfatal\\nfather\\nfatigue\\nfault\\nfavorite\\nfeature\\nfebruary\\nfederal\\nfee\\nfeed\\nfeel\\nfemale\\nfence\\nfestival\\nfetch\\nfever\\nfew\\nfiber\\nfiction\\nfield\\nfigure\\nfile\\nfilm\\nfilter\\nfinal\\nfind\\nfine\\nfinger\\nfinish\\nfire\\nfirm\\nfirst\\nfiscal\\nfish\\nfit\\nfitness\\nfix\\nflag\\nflame\\nflash\\nflat\\nflavor\\nflee\\nflight\\nflip\\nfloat\\nflock\\nfloor\\nflower\\nfluid\\nflush\\nfly\\nfoam\\nfocus\\nfog\\nfoil\\nfold\\nfollow\\nfood\\nfoot\\nforce\\nforest\\nforget\\nfork\\nfortune\\nforum\\nforward\\nfossil\\nfoster\\nfound\\nfox\\nfragile\\nframe\\nfrequent\\nfresh\\nfriend\\nfringe\\nfrog\\nfront\\nfrost\\nfrown\\nfrozen\\nfruit\\nfuel\\nfun\\nfunny\\nfurnace\\nfury\\nfuture\\ngadget\\ngain\\ngalaxy\\ngallery\\ngame\\ngap\\ngarage\\ngarbage\\ngarden\\ngarlic\\ngarment\\ngas\\ngasp\\ngate\\ngather\\ngauge\\ngaze\\ngeneral\\ngenius\\ngenre\\ngentle\\ngenuine\\ngesture\\nghost\\ngiant\\ngift\\ngiggle\\nginger\\ngiraffe\\ngirl\\ngive\\nglad\\nglance\\nglare\\nglass\\nglide\\nglimpse\\nglobe\\ngloom\\nglory\\nglove\\nglow\\nglue\\ngoat\\ngoddess\\ngold\\ngood\\ngoose\\ngorilla\\ngospel\\ngossip\\ngovern\\ngown\\ngrab\\ngrace\\ngrain\\ngrant\\ngrape\\ngrass\\ngravity\\ngreat\\ngreen\\ngrid\\ngrief\\ngrit\\ngrocery\\ngroup\\ngrow\\ngrunt\\nguard\\nguess\\nguide\\nguilt\\nguitar\\ngun\\ngym\\nhabit\\nhair\\nhalf\\nhammer\\nhamster\\nhand\\nhappy\\nharbor\\nhard\\nharsh\\nharvest\\nhat\\nhave\\nhawk\\nhazard\\nhead\\nhealth\\nheart\\nheavy\\nhedgehog\\nheight\\nhello\\nhelmet\\nhelp\\nhen\\nhero\\nhidden\\nhigh\\nhill\\nhint\\nhip\\nhire\\nhistory\\nhobby\\nhockey\\nhold\\nhole\\nholiday\\nhollow\\nhome\\nhoney\\nhood\\nhope\\nhorn\\nhorror\\nhorse\\nhospital\\nhost\\nhotel\\nhour\\nhover\\nhub\\nhuge\\nhuman\\nhumble\\nhumor\\nhundred\\nhungry\\nhunt\\nhurdle\\nhurry\\nhurt\\nhusband\\nhybrid\\nice\\nicon\\nidea\\nidentify\\nidle\\nignore\\nill\\nillegal\\nillness\\nimage\\nimitate\\nimmense\\nimmune\\nimpact\\nimpose\\nimprove\\nimpulse\\ninch\\ninclude\\nincome\\nincrease\\nindex\\nindicate\\nindoor\\nindustry\\ninfant\\ninflict\\ninform\\ninhale\\ninherit\\ninitial\\ninject\\ninjury\\ninmate\\ninner\\ninnocent\\ninput\\ninquiry\\ninsane\\ninsect\\ninside\\ninspire\\ninstall\\nintact\\ninterest\\ninto\\ninvest\\ninvite\\ninvolve\\niron\\nisland\\nisolate\\nissue\\nitem\\nivory\\njacket\\njaguar\\njar\\njazz\\njealous\\njeans\\njelly\\njewel\\njob\\njoin\\njoke\\njourney\\njoy\\njudge\\njuice\\njump\\njungle\\njunior\\njunk\\njust\\nkangaroo\\nkeen\\nkeep\\nketchup\\nkey\\nkick\\nkid\\nkidney\\nkind\\nkingdom\\nkiss\\nkit\\nkitchen\\nkite\\nkitten\\nkiwi\\nknee\\nknife\\nknock\\nknow\\nlab\\nlabel\\nlabor\\nladder\\nlady\\nlake\\nlamp\\nlanguage\\nlaptop\\nlarge\\nlater\\nlatin\\nlaugh\\nlaundry\\nlava\\nlaw\\nlawn\\nlawsuit\\nlayer\\nlazy\\nleader\\nleaf\\nlearn\\nleave\\nlecture\\nleft\\nleg\\nlegal\\nlegend\\nleisure\\nlemon\\nlend\\nlength\\nlens\\nleopard\\nlesson\\nletter\\nlevel\\nliar\\nliberty\\nlibrary\\nlicense\\nlife\\nlift\\nlight\\nlike\\nlimb\\nlimit\\nlink\\nlion\\nliquid\\nlist\\nlittle\\nlive\\nlizard\\nload\\nloan\\nlobster\\nlocal\\nlock\\nlogic\\nlonely\\nlong\\nloop\\nlottery\\nloud\\nlounge\\nlove\\nloyal\\nlucky\\nluggage\\nlumber\\nlunar\\nlunch\\nluxury\\nlyrics\\nmachine\\nmad\\nmagic\\nmagnet\\nmaid\\nmail\\nmain\\nmajor\\nmake\\nmammal\\nman\\nmanage\\nmandate\\nmango\\nmansion\\nmanual\\nmaple\\nmarble\\nmarch\\nmargin\\nmarine\\nmarket\\nmarriage\\nmask\\nmass\\nmaster\\nmatch\\nmaterial\\nmath\\nmatrix\\nmatter\\nmaximum\\nmaze\\nmeadow\\nmean\\nmeasure\\nmeat\\nmechanic\\nmedal\\nmedia\\nmelody\\nmelt\\nmember\\nmemory\\nmention\\nmenu\\nmercy\\nmerge\\nmerit\\nmerry\\nmesh\\nmessage\\nmetal\\nmethod\\nmiddle\\nmidnight\\nmilk\\nmillion\\nmimic\\nmind\\nminimum\\nminor\\nminute\\nmiracle\\nmirror\\nmisery\\nmiss\\nmistake\\nmix\\nmixed\\nmixture\\nmobile\\nmodel\\nmodify\\nmom\\nmoment\\nmonitor\\nmonkey\\nmonster\\nmonth\\nmoon\\nmoral\\nmore\\nmorning\\nmosquito\\nmother\\nmotion\\nmotor\\nmountain\\nmouse\\nmove\\nmovie\\nmuch\\nmuffin\\nmule\\nmultiply\\nmuscle\\nmuseum\\nmushroom\\nmusic\\nmust\\nmutual\\nmyself\\nmystery\\nmyth\\nnaive\\nname\\nnapkin\\nnarrow\\nnasty\\nnation\\nnature\\nnear\\nneck\\nneed\\nnegative\\nneglect\\nneither\\nnephew\\nnerve\\nnest\\nnet\\nnetwork\\nneutral\\nnever\\nnews\\nnext\\nnice\\nnight\\nnoble\\nnoise\\nnominee\\nnoodle\\nnormal\\nnorth\\nnose\\nnotable\\nnote\\nnothing\\nnotice\\nnovel\\nnow\\nnuclear\\nnumber\\nnurse\\nnut\\noak\\nobey\\nobject\\noblige\\nobscure\\nobserve\\nobtain\\nobvious\\noccur\\nocean\\noctober\\nodor\\noff\\noffer\\noffice\\noften\\noil\\nokay\\nold\\nolive\\nolympic\\nomit\\nonce\\none\\nonion\\nonline\\nonly\\nopen\\nopera\\nopinion\\noppose\\noption\\norange\\norbit\\norchard\\norder\\nordinary\\norgan\\norient\\noriginal\\norphan\\nostrich\\nother\\noutdoor\\nouter\\noutput\\noutside\\noval\\noven\\nover\\nown\\nowner\\noxygen\\noyster\\nozone\\npact\\npaddle\\npage\\npair\\npalace\\npalm\\npanda\\npanel\\npanic\\npanther\\npaper\\nparade\\nparent\\npark\\nparrot\\nparty\\npass\\npatch\\npath\\npatient\\npatrol\\npattern\\npause\\npave\\npayment\\npeace\\npeanut\\npear\\npeasant\\npelican\\npen\\npenalty\\npencil\\npeople\\npepper\\nperfect\\npermit\\nperson\\npet\\nphone\\nphoto\\nphrase\\nphysical\\npiano\\npicnic\\npicture\\npiece\\npig\\npigeon\\npill\\npilot\\npink\\npioneer\\npipe\\npistol\\npitch\\npizza\\nplace\\nplanet\\nplastic\\nplate\\nplay\\nplease\\npledge\\npluck\\nplug\\nplunge\\npoem\\npoet\\npoint\\npolar\\npole\\npolice\\npond\\npony\\npool\\npopular\\nportion\\nposition\\npossible\\npost\\npotato\\npottery\\npoverty\\npowder\\npower\\npractice\\npraise\\npredict\\nprefer\\nprepare\\npresent\\npretty\\nprevent\\nprice\\npride\\nprimary\\nprint\\npriority\\nprison\\nprivate\\nprize\\nproblem\\nprocess\\nproduce\\nprofit\\nprogram\\nproject\\npromote\\nproof\\nproperty\\nprosper\\nprotect\\nproud\\nprovide\\npublic\\npudding\\npull\\npulp\\npulse\\npumpkin\\npunch\\npupil\\npuppy\\npurchase\\npurity\\npurpose\\npurse\\npush\\nput\\npuzzle\\npyramid\\nquality\\nquantum\\nquarter\\nquestion\\nquick\\nquit\\nquiz\\nquote\\nrabbit\\nraccoon\\nrace\\nrack\\nradar\\nradio\\nrail\\nrain\\nraise\\nrally\\nramp\\nranch\\nrandom\\nrange\\nrapid\\nrare\\nrate\\nrather\\nraven\\nraw\\nrazor\\nready\\nreal\\nreason\\nrebel\\nrebuild\\nrecall\\nreceive\\nrecipe\\nrecord\\nrecycle\\nreduce\\nreflect\\nreform\\nrefuse\\nregion\\nregret\\nregular\\nreject\\nrelax\\nrelease\\nrelief\\nrely\\nremain\\nremember\\nremind\\nremove\\nrender\\nrenew\\nrent\\nreopen\\nrepair\\nrepeat\\nreplace\\nreport\\nrequire\\nrescue\\nresemble\\nresist\\nresource\\nresponse\\nresult\\nretire\\nretreat\\nreturn\\nreunion\\nreveal\\nreview\\nreward\\nrhythm\\nrib\\nribbon\\nrice\\nrich\\nride\\nridge\\nrifle\\nright\\nrigid\\nring\\nriot\\nripple\\nrisk\\nritual\\nrival\\nriver\\nroad\\nroast\\nrobot\\nrobust\\nrocket\\nromance\\nroof\\nrookie\\nroom\\nrose\\nrotate\\nrough\\nround\\nroute\\nroyal\\nrubber\\nrude\\nrug\\nrule\\nrun\\nrunway\\nrural\\nsad\\nsaddle\\nsadness\\nsafe\\nsail\\nsalad\\nsalmon\\nsalon\\nsalt\\nsalute\\nsame\\nsample\\nsand\\nsatisfy\\nsatoshi\\nsauce\\nsausage\\nsave\\nsay\\nscale\\nscan\\nscare\\nscatter\\nscene\\nscheme\\nschool\\nscience\\nscissors\\nscorpion\\nscout\\nscrap\\nscreen\\nscript\\nscrub\\nsea\\nsearch\\nseason\\nseat\\nsecond\\nsecret\\nsection\\nsecurity\\nseed\\nseek\\nsegment\\nselect\\nsell\\nseminar\\nsenior\\nsense\\nsentence\\nseries\\nservice\\nsession\\nsettle\\nsetup\\nseven\\nshadow\\nshaft\\nshallow\\nshare\\nshed\\nshell\\nsheriff\\nshield\\nshift\\nshine\\nship\\nshiver\\nshock\\nshoe\\nshoot\\nshop\\nshort\\nshoulder\\nshove\\nshrimp\\nshrug\\nshuffle\\nshy\\nsibling\\nsick\\nside\\nsiege\\nsight\\nsign\\nsilent\\nsilk\\nsilly\\nsilver\\nsimilar\\nsimple\\nsince\\nsing\\nsiren\\nsister\\nsituate\\nsix\\nsize\\nskate\\nsketch\\nski\\nskill\\nskin\\nskirt\\nskull\\nslab\\nslam\\nsleep\\nslender\\nslice\\nslide\\nslight\\nslim\\nslogan\\nslot\\nslow\\nslush\\nsmall\\nsmart\\nsmile\\nsmoke\\nsmooth\\nsnack\\nsnake\\nsnap\\nsniff\\nsnow\\nsoap\\nsoccer\\nsocial\\nsock\\nsoda\\nsoft\\nsolar\\nsoldier\\nsolid\\nsolution\\nsolve\\nsomeone\\nsong\\nsoon\\nsorry\\nsort\\nsoul\\nsound\\nsoup\\nsource\\nsouth\\nspace\\nspare\\nspatial\\nspawn\\nspeak\\nspecial\\nspeed\\nspell\\nspend\\nsphere\\nspice\\nspider\\nspike\\nspin\\nspirit\\nsplit\\nspoil\\nsponsor\\nspoon\\nsport\\nspot\\nspray\\nspread\\nspring\\nspy\\nsquare\\nsqueeze\\nsquirrel\\nstable\\nstadium\\nstaff\\nstage\\nstairs\\nstamp\\nstand\\nstart\\nstate\\nstay\\nsteak\\nsteel\\nstem\\nstep\\nstereo\\nstick\\nstill\\nsting\\nstock\\nstomach\\nstone\\nstool\\nstory\\nstove\\nstrategy\\nstreet\\nstrike\\nstrong\\nstruggle\\nstudent\\nstuff\\nstumble\\nstyle\\nsubject\\nsubmit\\nsubway\\nsuccess\\nsuch\\nsudden\\nsuffer\\nsugar\\nsuggest\\nsuit\\nsummer\\nsun\\nsunny\\nsunset\\nsuper\\nsupply\\nsupreme\\nsure\\nsurface\\nsurge\\nsurprise\\nsurround\\nsurvey\\nsuspect\\nsustain\\nswallow\\nswamp\\nswap\\nswarm\\nswear\\nsweet\\nswift\\nswim\\nswing\\nswitch\\nsword\\nsymbol\\nsymptom\\nsyrup\\nsystem\\ntable\\ntackle\\ntag\\ntail\\ntalent\\ntalk\\ntank\\ntape\\ntarget\\ntask\\ntaste\\ntattoo\\ntaxi\\nteach\\nteam\\ntell\\nten\\ntenant\\ntennis\\ntent\\nterm\\ntest\\ntext\\nthank\\nthat\\ntheme\\nthen\\ntheory\\nthere\\nthey\\nthing\\nthis\\nthought\\nthree\\nthrive\\nthrow\\nthumb\\nthunder\\nticket\\ntide\\ntiger\\ntilt\\ntimber\\ntime\\ntiny\\ntip\\ntired\\ntissue\\ntitle\\ntoast\\ntobacco\\ntoday\\ntoddler\\ntoe\\ntogether\\ntoilet\\ntoken\\ntomato\\ntomorrow\\ntone\\ntongue\\ntonight\\ntool\\ntooth\\ntop\\ntopic\\ntopple\\ntorch\\ntornado\\ntortoise\\ntoss\\ntotal\\ntourist\\ntoward\\ntower\\ntown\\ntoy\\ntrack\\ntrade\\ntraffic\\ntragic\\ntrain\\ntransfer\\ntrap\\ntrash\\ntravel\\ntray\\ntreat\\ntree\\ntrend\\ntrial\\ntribe\\ntrick\\ntrigger\\ntrim\\ntrip\\ntrophy\\ntrouble\\ntruck\\ntrue\\ntruly\\ntrumpet\\ntrust\\ntruth\\ntry\\ntube\\ntuition\\ntumble\\ntuna\\ntunnel\\nturkey\\nturn\\nturtle\\ntwelve\\ntwenty\\ntwice\\ntwin\\ntwist\\ntwo\\ntype\\ntypical\\nugly\\numbrella\\nunable\\nunaware\\nuncle\\nuncover\\nunder\\nundo\\nunfair\\nunfold\\nunhappy\\nuniform\\nunique\\nunit\\nuniverse\\nunknown\\nunlock\\nuntil\\nunusual\\nunveil\\nupdate\\nupgrade\\nuphold\\nupon\\nupper\\nupset\\nurban\\nurge\\nusage\\nuse\\nused\\nuseful\\nuseless\\nusual\\nutility\\nvacant\\nvacuum\\nvague\\nvalid\\nvalley\\nvalve\\nvan\\nvanish\\nvapor\\nvarious\\nvast\\nvault\\nvehicle\\nvelvet\\nvendor\\nventure\\nvenue\\nverb\\nverify\\nversion\\nvery\\nvessel\\nveteran\\nviable\\nvibrant\\nvicious\\nvictory\\nvideo\\nview\\nvillage\\nvintage\\nviolin\\nvirtual\\nvirus\\nvisa\\nvisit\\nvisual\\nvital\\nvivid\\nvocal\\nvoice\\nvoid\\nvolcano\\nvolume\\nvote\\nvoyage\\nwage\\nwagon\\nwait\\nwalk\\nwall\\nwalnut\\nwant\\nwarfare\\nwarm\\nwarrior\\nwash\\nwasp\\nwaste\\nwater\\nwave\\nway\\nwealth\\nweapon\\nwear\\nweasel\\nweather\\nweb\\nwedding\\nweekend\\nweird\\nwelcome\\nwest\\nwet\\nwhale\\nwhat\\nwheat\\nwheel\\nwhen\\nwhere\\nwhip\\nwhisper\\nwide\\nwidth\\nwife\\nwild\\nwill\\nwin\\nwindow\\nwine\\nwing\\nwink\\nwinner\\nwinter\\nwire\\nwisdom\\nwise\\nwish\\nwitness\\nwolf\\nwoman\\nwonder\\nwood\\nwool\\nword\\nwork\\nworld\\nworry\\nworth\\nwrap\\nwreck\\nwrestle\\nwrist\\nwrite\\nwrong\\nyard\\nyear\\nyellow\\nyou\\nyoung\\nyouth\\nzebra\\nzero\\nzone\\nzoo\".split(\"\\n\")},9648(e,t){\"use strict\";function n(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function r(e){if(\"boolean\"!=typeof e)throw new Error(`Expected boolean, not ${e}`)}function o(e,...t){if(!((n=e)instanceof Uint8Array||null!=n&&\"object\"==typeof n&&\"Uint8Array\"===n.constructor.name))throw new Error(\"Expected Uint8Array\");var n;if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function i(e){if(\"function\"!=typeof e||\"function\"!=typeof e.create)throw new Error(\"Hash should be wrapped by utils.wrapConstructor\");n(e.outputLen),n(e.blockLen)}function a(e,t=!0){if(e.destroyed)throw new Error(\"Hash instance has been destroyed\");if(t&&e.finished)throw new Error(\"Hash#digest() has already been called\")}function s(e,t){o(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}t.output=t.exists=t.hash=t.bytes=t.number=void 0,t.number=n,t.bytes=o,t.hash=i,t.exists=a,t.output=s;const c={number:n,bool:r,bytes:o,hash:i,exists:a,output:s};t.default=c},3134(e,t,n){\"use strict\";t.SHA2=void 0;const r=n(9648),o=n(3654);class i extends o.Hash{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,o.createView)(this.buffer)}update(e){(0,r.exists)(this);const{view:t,buffer:n,blockLen:i}=this,a=(e=(0,o.toBytes)(e)).length;for(let r=0;r<a;){const s=Math.min(i-this.pos,a-r);if(s===i){const t=(0,o.createView)(e);for(;i<=a-r;r+=i)this.process(t,r);continue}n.set(e.subarray(r,r+s),this.pos),this.pos+=s,r+=s,this.pos===i&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,r.exists)(this),(0,r.output)(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:i,isLE:a}=this;let{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>i-s&&(this.process(n,0),s=0);for(let e=s;e<i;e++)t[e]=0;!function(e,t,n,r){if(\"function\"==typeof e.setBigUint64)return e.setBigUint64(t,n,r);const o=BigInt(32),i=BigInt(4294967295),a=Number(n>>o&i),s=Number(n&i),c=r?4:0,u=r?0:4;e.setUint32(t+c,a,r),e.setUint32(t+u,s,r)}(n,i-8,BigInt(8*this.length),a),this.process(n,0);const c=(0,o.createView)(e),u=this.outputLen;if(u%4)throw new Error(\"_sha2: outputLen should be aligned to 32bit\");const l=u/4,d=this.get();if(l>d.length)throw new Error(\"_sha2: outputLen bigger than state\");for(let e=0;e<l;e++)c.setUint32(4*e,d[e],a)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:r,finished:o,destroyed:i,pos:a}=this;return e.length=r,e.pos=a,e.finished=o,e.destroyed=i,r%t&&e.buffer.set(n),e}}t.SHA2=i},3109(e,t){\"use strict\";const n=BigInt(2**32-1),r=BigInt(32);function o(e,t=!1){return t?{h:Number(e&n),l:Number(e>>r&n)}:{h:0|Number(e>>r&n),l:0|Number(e&n)}}function i(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:a,l:s}=o(e[i],t);[n[i],r[i]]=[a,s]}return[n,r]}const a=(e,t)=>BigInt(e>>>0)<<r|BigInt(t>>>0);const s=(e,t,n)=>e>>>n;const c=(e,t,n)=>e<<32-n|t>>>n;const u=(e,t,n)=>e>>>n|t<<32-n;const l=(e,t,n)=>e<<32-n|t>>>n;const d=(e,t,n)=>e<<64-n|t>>>n-32;const f=(e,t,n)=>e>>>n-32|t<<64-n;const h=(e,t)=>t;const p=(e,t)=>e;const g=(e,t,n)=>e<<n|t>>>32-n;const m=(e,t,n)=>t<<n|e>>>32-n;const y=(e,t,n)=>t<<n-32|e>>>64-n;const w=(e,t,n)=>e<<n-32|t>>>64-n;function v(e,t,n,r){const o=(t>>>0)+(r>>>0);return{h:e+n+(o/2**32|0)|0,l:0|o}}const b=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0);const A=(e,t,n,r)=>t+n+r+(e/2**32|0)|0;const S=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0);const E=(e,t,n,r,o)=>t+n+r+o+(e/2**32|0)|0;const x=(e,t,n,r,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(o>>>0);const k=(e,t,n,r,o,i)=>t+n+r+o+i+(e/2**32|0)|0;const I={fromBig:o,split:i,toBig:a,shrSH:s,shrSL:c,rotrSH:u,rotrSL:l,rotrBH:d,rotrBL:f,rotr32H:h,rotr32L:p,rotlSH:g,rotlSL:m,rotlBH:y,rotlBL:w,add:v,add3L:b,add3H:A,add4L:S,add4H:E,add5H:k,add5L:x};t.default=I},4610(e,t){\"use strict\";t.crypto=void 0,t.crypto=\"object\"==typeof globalThis&&\"crypto\"in globalThis?globalThis.crypto:void 0},4832(e,t,n){\"use strict\";t.hmac=void 0;const r=n(9648),o=n(3654);class i extends o.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,r.hash)(e);const n=(0,o.toBytes)(t);if(this.iHash=e.create(),\"function\"!=typeof this.iHash.update)throw new Error(\"Expected instance of class which extends utils.Hash\");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,a=new Uint8Array(i);a.set(n.length>i?e.create().update(n).digest():n);for(let e=0;e<a.length;e++)a[e]^=54;this.iHash.update(a),this.oHash=e.create();for(let e=0;e<a.length;e++)a[e]^=106;this.oHash.update(a),a.fill(0)}update(e){return(0,r.exists)(this),this.iHash.update(e),this}digestInto(e){(0,r.exists)(this),(0,r.bytes)(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:n,finished:r,destroyed:o,blockLen:i,outputLen:a}=this;return e.finished=r,e.destroyed=o,e.blockLen=i,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}t.hmac=(e,t,n)=>new i(e,t).update(n).digest(),t.hmac.create=(e,t)=>new i(e,t)},486(e,t,n){\"use strict\";t.pbkdf2Async=t.pbkdf2=void 0;const r=n(9648),o=n(4832),i=n(3654);function a(e,t,n,a){(0,r.hash)(e);const s=(0,i.checkOpts)({dkLen:32,asyncTick:10},a),{c,dkLen:u,asyncTick:l}=s;if((0,r.number)(c),(0,r.number)(u),(0,r.number)(l),c<1)throw new Error(\"PBKDF2: iterations (c) should be >= 1\");const d=(0,i.toBytes)(t),f=(0,i.toBytes)(n),h=new Uint8Array(u),p=o.hmac.create(e,d),g=p._cloneInto().update(f);return{c,dkLen:u,asyncTick:l,DK:h,PRF:p,PRFSalt:g}}function s(e,t,n,r,o){return e.destroy(),t.destroy(),r&&r.destroy(),o.fill(0),n}t.pbkdf2=function(e,t,n,r){const{c:o,dkLen:c,DK:u,PRF:l,PRFSalt:d}=a(e,t,n,r);let f;const h=new Uint8Array(4),p=(0,i.createView)(h),g=new Uint8Array(l.outputLen);for(let e=1,t=0;t<c;e++,t+=l.outputLen){const n=u.subarray(t,t+l.outputLen);p.setInt32(0,e,!1),(f=d._cloneInto(f)).update(h).digestInto(g),n.set(g.subarray(0,n.length));for(let e=1;e<o;e++){l._cloneInto(f).update(g).digestInto(g);for(let e=0;e<n.length;e++)n[e]^=g[e]}}return s(l,d,u,f,g)},t.pbkdf2Async=async function(e,t,n,r){const{c:o,dkLen:c,asyncTick:u,DK:l,PRF:d,PRFSalt:f}=a(e,t,n,r);let h;const p=new Uint8Array(4),g=(0,i.createView)(p),m=new Uint8Array(d.outputLen);for(let e=1,t=0;t<c;e++,t+=d.outputLen){const n=l.subarray(t,t+d.outputLen);g.setInt32(0,e,!1),(h=f._cloneInto(h)).update(p).digestInto(m),n.set(m.subarray(0,n.length)),await(0,i.asyncLoop)(o-1,u,()=>{d._cloneInto(h).update(m).digestInto(m);for(let e=0;e<n.length;e++)n[e]^=m[e]})}return s(d,f,l,h,m)}},7004(e,t,n){\"use strict\";t.sha256=void 0;const r=n(3134),o=n(3654),i=(e,t,n)=>e&t^~e&n,a=(e,t,n)=>e&t^e&n^t&n,s=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),c=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),u=new Uint32Array(64);class l extends r.SHA2{constructor(){super(64,32,8,!1),this.A=0|c[0],this.B=0|c[1],this.C=0|c[2],this.D=0|c[3],this.E=0|c[4],this.F=0|c[5],this.G=0|c[6],this.H=0|c[7]}get(){const{A:e,B:t,C:n,D:r,E:o,F:i,G:a,H:s}=this;return[e,t,n,r,o,i,a,s]}set(e,t,n,r,o,i,a,s){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|o,this.F=0|i,this.G=0|a,this.H=0|s}process(e,t){for(let n=0;n<16;n++,t+=4)u[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=u[e-15],n=u[e-2],r=(0,o.rotr)(t,7)^(0,o.rotr)(t,18)^t>>>3,i=(0,o.rotr)(n,17)^(0,o.rotr)(n,19)^n>>>10;u[e]=i+u[e-7]+r+u[e-16]|0}let{A:n,B:r,C:c,D:l,E:d,F:f,G:h,H:p}=this;for(let e=0;e<64;e++){const t=p+((0,o.rotr)(d,6)^(0,o.rotr)(d,11)^(0,o.rotr)(d,25))+i(d,f,h)+s[e]+u[e]|0,g=((0,o.rotr)(n,2)^(0,o.rotr)(n,13)^(0,o.rotr)(n,22))+a(n,r,c)|0;p=h,h=f,f=d,d=l+t|0,l=c,c=r,r=n,n=t+g|0}n=n+this.A|0,r=r+this.B|0,c=c+this.C|0,l=l+this.D|0,d=d+this.E|0,f=f+this.F|0,h=h+this.G|0,p=p+this.H|0,this.set(n,r,c,l,d,f,h,p)}roundClean(){u.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class d extends l{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}t.sha256=(0,o.wrapConstructor)(()=>new l),(0,o.wrapConstructor)(()=>new d)},2249(e,t,n){\"use strict\";t.sha512=void 0;const r=n(3134),o=n(3109),i=n(3654),[a,s]=o.default.split([\"0x428a2f98d728ae22\",\"0x7137449123ef65cd\",\"0xb5c0fbcfec4d3b2f\",\"0xe9b5dba58189dbbc\",\"0x3956c25bf348b538\",\"0x59f111f1b605d019\",\"0x923f82a4af194f9b\",\"0xab1c5ed5da6d8118\",\"0xd807aa98a3030242\",\"0x12835b0145706fbe\",\"0x243185be4ee4b28c\",\"0x550c7dc3d5ffb4e2\",\"0x72be5d74f27b896f\",\"0x80deb1fe3b1696b1\",\"0x9bdc06a725c71235\",\"0xc19bf174cf692694\",\"0xe49b69c19ef14ad2\",\"0xefbe4786384f25e3\",\"0x0fc19dc68b8cd5b5\",\"0x240ca1cc77ac9c65\",\"0x2de92c6f592b0275\",\"0x4a7484aa6ea6e483\",\"0x5cb0a9dcbd41fbd4\",\"0x76f988da831153b5\",\"0x983e5152ee66dfab\",\"0xa831c66d2db43210\",\"0xb00327c898fb213f\",\"0xbf597fc7beef0ee4\",\"0xc6e00bf33da88fc2\",\"0xd5a79147930aa725\",\"0x06ca6351e003826f\",\"0x142929670a0e6e70\",\"0x27b70a8546d22ffc\",\"0x2e1b21385c26c926\",\"0x4d2c6dfc5ac42aed\",\"0x53380d139d95b3df\",\"0x650a73548baf63de\",\"0x766a0abb3c77b2a8\",\"0x81c2c92e47edaee6\",\"0x92722c851482353b\",\"0xa2bfe8a14cf10364\",\"0xa81a664bbc423001\",\"0xc24b8b70d0f89791\",\"0xc76c51a30654be30\",\"0xd192e819d6ef5218\",\"0xd69906245565a910\",\"0xf40e35855771202a\",\"0x106aa07032bbd1b8\",\"0x19a4c116b8d2d0c8\",\"0x1e376c085141ab53\",\"0x2748774cdf8eeb99\",\"0x34b0bcb5e19b48a8\",\"0x391c0cb3c5c95a63\",\"0x4ed8aa4ae3418acb\",\"0x5b9cca4f7763e373\",\"0x682e6ff3d6b2b8a3\",\"0x748f82ee5defb2fc\",\"0x78a5636f43172f60\",\"0x84c87814a1f0ab72\",\"0x8cc702081a6439ec\",\"0x90befffa23631e28\",\"0xa4506cebde82bde9\",\"0xbef9a3f7b2c67915\",\"0xc67178f2e372532b\",\"0xca273eceea26619c\",\"0xd186b8c721c0c207\",\"0xeada7dd6cde0eb1e\",\"0xf57d4f7fee6ed178\",\"0x06f067aa72176fba\",\"0x0a637dc5a2c898a6\",\"0x113f9804bef90dae\",\"0x1b710b35131c471b\",\"0x28db77f523047d84\",\"0x32caab7b40c72493\",\"0x3c9ebe0a15c9bebc\",\"0x431d67c49c100d4c\",\"0x4cc5d4becb3e42b6\",\"0x597f299cfc657e2a\",\"0x5fcb6fab3ad6faec\",\"0x6c44198c4a475817\"].map(e=>BigInt(e))),c=new Uint32Array(80),u=new Uint32Array(80);class l extends r.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:n,Bl:r,Ch:o,Cl:i,Dh:a,Dl:s,Eh:c,El:u,Fh:l,Fl:d,Gh:f,Gl:h,Hh:p,Hl:g}=this;return[e,t,n,r,o,i,a,s,c,u,l,d,f,h,p,g]}set(e,t,n,r,o,i,a,s,c,u,l,d,f,h,p,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|r,this.Ch=0|o,this.Cl=0|i,this.Dh=0|a,this.Dl=0|s,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|d,this.Gh=0|f,this.Gl=0|h,this.Hh=0|p,this.Hl=0|g}process(e,t){for(let n=0;n<16;n++,t+=4)c[n]=e.getUint32(t),u[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|c[e-15],n=0|u[e-15],r=o.default.rotrSH(t,n,1)^o.default.rotrSH(t,n,8)^o.default.shrSH(t,n,7),i=o.default.rotrSL(t,n,1)^o.default.rotrSL(t,n,8)^o.default.shrSL(t,n,7),a=0|c[e-2],s=0|u[e-2],l=o.default.rotrSH(a,s,19)^o.default.rotrBH(a,s,61)^o.default.shrSH(a,s,6),d=o.default.rotrSL(a,s,19)^o.default.rotrBL(a,s,61)^o.default.shrSL(a,s,6),f=o.default.add4L(i,d,u[e-7],u[e-16]),h=o.default.add4H(f,r,l,c[e-7],c[e-16]);c[e]=0|h,u[e]=0|f}let{Ah:n,Al:r,Bh:i,Bl:l,Ch:d,Cl:f,Dh:h,Dl:p,Eh:g,El:m,Fh:y,Fl:w,Gh:v,Gl:b,Hh:A,Hl:S}=this;for(let e=0;e<80;e++){const t=o.default.rotrSH(g,m,14)^o.default.rotrSH(g,m,18)^o.default.rotrBH(g,m,41),E=o.default.rotrSL(g,m,14)^o.default.rotrSL(g,m,18)^o.default.rotrBL(g,m,41),x=g&y^~g&v,k=m&w^~m&b,I=o.default.add5L(S,E,k,s[e],u[e]),T=o.default.add5H(I,A,t,x,a[e],c[e]),_=0|I,C=o.default.rotrSH(n,r,28)^o.default.rotrBH(n,r,34)^o.default.rotrBH(n,r,39),B=o.default.rotrSL(n,r,28)^o.default.rotrBL(n,r,34)^o.default.rotrBL(n,r,39),R=n&i^n&d^i&d,P=r&l^r&f^l&f;A=0|v,S=0|b,v=0|y,b=0|w,y=0|g,w=0|m,({h:g,l:m}=o.default.add(0|h,0|p,0|T,0|_)),h=0|d,p=0|f,d=0|i,f=0|l,i=0|n,l=0|r;const N=o.default.add3L(_,B,P);n=o.default.add3H(N,T,C,R),r=0|N}({h:n,l:r}=o.default.add(0|this.Ah,0|this.Al,0|n,0|r)),({h:i,l}=o.default.add(0|this.Bh,0|this.Bl,0|i,0|l)),({h:d,l:f}=o.default.add(0|this.Ch,0|this.Cl,0|d,0|f)),({h,l:p}=o.default.add(0|this.Dh,0|this.Dl,0|h,0|p)),({h:g,l:m}=o.default.add(0|this.Eh,0|this.El,0|g,0|m)),({h:y,l:w}=o.default.add(0|this.Fh,0|this.Fl,0|y,0|w)),({h:v,l:b}=o.default.add(0|this.Gh,0|this.Gl,0|v,0|b)),({h:A,l:S}=o.default.add(0|this.Hh,0|this.Hl,0|A,0|S)),this.set(n,r,i,l,d,f,h,p,g,m,y,w,v,b,A,S)}roundClean(){c.fill(0),u.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class d extends l{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class f extends l{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class h extends l{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}t.sha512=(0,i.wrapConstructor)(()=>new l),(0,i.wrapConstructor)(()=>new d),(0,i.wrapConstructor)(()=>new f),(0,i.wrapConstructor)(()=>new h)},3654(e,t,n){\"use strict\";t.randomBytes=t.wrapConstructor=t.checkOpts=t.Hash=t.toBytes=t.asyncLoop=t.dY=t.qv=t.rotr=t.createView=void 0;const r=n(4610);function o(e){return e instanceof Uint8Array||null!=e&&\"object\"==typeof e&&\"Uint8Array\"===e.constructor.name}t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);if(t.rotr=(e,t)=>e<<32-t|e>>>t,t.qv=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.qv)throw new Error(\"Non little-endian hardware is not supported\");const i=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,\"0\"));const a=48,s=57,c=65,u=70,l=97,d=102;function f(e){return e>=a&&e<=s?e-a:e>=c&&e<=u?e-(c-10):e>=l&&e<=d?e-(l-10):void 0}function h(e){if(\"string\"!=typeof e)throw new Error(\"utf8ToBytes expected string, got \"+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function p(e){if(\"string\"==typeof e&&(e=h(e)),!o(e))throw new Error(\"expected Uint8Array, got \"+typeof e);return e}t.dY=async()=>{},t.asyncLoop=async function(e,n,r){let o=Date.now();for(let i=0;i<e;i++){r(i);const e=Date.now()-o;e>=0&&e<n||(await(0,t.dY)(),o+=e)}},t.toBytes=p;t.Hash=class{clone(){return this._cloneInto()}};const g={}.toString;t.checkOpts=function(e,t){if(void 0!==t&&\"[object Object]\"!==g.call(t))throw new Error(\"Options should be object or undefined\");return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(p(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t},t.randomBytes=function(e=32){if(r.crypto&&\"function\"==typeof r.crypto.getRandomValues)return r.crypto.getRandomValues(new Uint8Array(e));throw new Error(\"crypto.getRandomValues must be defined\")}},9450(e,t){\"use strict\";function n(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function r(e){return e instanceof Uint8Array||null!=e&&\"object\"==typeof e&&\"Uint8Array\"===e.constructor.name}function o(...e){const t=e=>e,n=(e,t)=>n=>e(t(n));return{encode:e.map(e=>e.encode).reduceRight(n,t),decode:e.map(e=>e.decode).reduce(n,t)}}function i(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&\"number\"!=typeof t[0])throw new Error(\"alphabet.encode input should be an array of numbers\");return t.map(t=>{if(n(t),t<0||t>=e.length)throw new Error(`Digit index outside alphabet: ${t} (alphabet: ${e.length})`);return e[t]})},decode:t=>{if(!Array.isArray(t)||t.length&&\"string\"!=typeof t[0])throw new Error(\"alphabet.decode input should be array of strings\");return t.map(t=>{if(\"string\"!=typeof t)throw new Error(`alphabet.decode: not string element=${t}`);const n=e.indexOf(t);if(-1===n)throw new Error(`Unknown letter: \"${t}\". Allowed: ${e}`);return n})}}}function a(e=\"\"){if(\"string\"!=typeof e)throw new Error(\"join separator should be string\");return{encode:t=>{if(!Array.isArray(t)||t.length&&\"string\"!=typeof t[0])throw new Error(\"join.encode input should be array of strings\");for(let e of t)if(\"string\"!=typeof e)throw new Error(`join.encode: non-string input=${e}`);return t.join(e)},decode:t=>{if(\"string\"!=typeof t)throw new Error(\"join.decode input should be string\");return t.split(e)}}}function s(e,t=\"=\"){if(n(e),\"string\"!=typeof t)throw new Error(\"padding chr should be string\");return{encode(n){if(!Array.isArray(n)||n.length&&\"string\"!=typeof n[0])throw new Error(\"padding.encode input should be array of strings\");for(let e of n)if(\"string\"!=typeof e)throw new Error(`padding.encode: non-string input=${e}`);for(;n.length*e%8;)n.push(t);return n},decode(n){if(!Array.isArray(n)||n.length&&\"string\"!=typeof n[0])throw new Error(\"padding.encode input should be array of strings\");for(let e of n)if(\"string\"!=typeof e)throw new Error(`padding.decode: non-string input=${e}`);let r=n.length;if(r*e%8)throw new Error(\"Invalid padding: string should have whole number of bytes\");for(;r>0&&n[r-1]===t;r--)if(!((r-1)*e%8))throw new Error(\"Invalid padding: string has too much padding\");return n.slice(0,r)}}}function c(e){if(\"function\"!=typeof e)throw new Error(\"normalize fn should be function\");return{encode:e=>e,decode:t=>e(t)}}function u(e,t,r){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: wrong to=${r}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error(\"convertRadix: data should be array\");if(!e.length)return[];let o=0;const i=[],a=Array.from(e);for(a.forEach(e=>{if(n(e),e<0||e>=t)throw new Error(`Wrong integer: ${e}`)});;){let e=0,n=!0;for(let i=o;i<a.length;i++){const s=a[i],c=t*e+s;if(!Number.isSafeInteger(c)||t*e/t!==e||c-s!==t*e)throw new Error(\"convertRadix: carry overflow\");e=c%r;const u=Math.floor(c/r);if(a[i]=u,!Number.isSafeInteger(u)||u*r+e!==c)throw new Error(\"convertRadix: carry overflow\");n&&(u?n=!1:o=i)}if(i.push(e),n)break}for(let t=0;t<e.length-1&&0===e[t];t++)i.push(0);return i.reverse()}t.Af=t.Ar=t.uh=t.As=t.rg=t.ic=t.tw=t.r0=t.K3=t.RG=t.xn=t.utils=void 0;const l=(e,t)=>t?l(t,e%t):e,d=(e,t)=>e+(t-l(e,t));function f(e,t,r,o){if(!Array.isArray(e))throw new Error(\"convertRadix2: data should be array\");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if(d(t,r)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${d(t,r)}`);let i=0,a=0;const s=2**r-1,c=[];for(const o of e){if(n(o),o>=2**t)throw new Error(`convertRadix2: invalid data word=${o} from=${t}`);if(i=i<<t|o,a+t>32)throw new Error(`convertRadix2: carry overflow pos=${a} from=${t}`);for(a+=t;a>=r;a-=r)c.push((i>>a-r&s)>>>0);i&=2**a-1}if(i=i<<r-a&s,!o&&a>=t)throw new Error(\"Excess padding\");if(!o&&i)throw new Error(`Non-zero padding: ${i}`);return o&&a>0&&c.push(i>>>0),c}function h(e){return n(e),{encode:t=>{if(!r(t))throw new Error(\"radix.encode input should be Uint8Array\");return u(Array.from(t),256,e)},decode:t=>{if(!Array.isArray(t)||t.length&&\"number\"!=typeof t[0])throw new Error(\"radix.decode input should be array of numbers\");return Uint8Array.from(u(t,e,256))}}}function p(e,t=!1){if(n(e),e<=0||e>32)throw new Error(\"radix2: bits should be in (0..32]\");if(d(8,e)>32||d(e,8)>32)throw new Error(\"radix2: carry overflow\");return{encode:n=>{if(!r(n))throw new Error(\"radix2.encode input should be Uint8Array\");return f(Array.from(n),8,e,!t)},decode:n=>{if(!Array.isArray(n)||n.length&&\"number\"!=typeof n[0])throw new Error(\"radix2.decode input should be array of numbers\");return Uint8Array.from(f(n,e,8,t))}}}function g(e){if(\"function\"!=typeof e)throw new Error(\"unsafeWrapper fn should be function\");return function(...t){try{return e.apply(null,t)}catch(e){}}}function m(e,t){if(n(e),\"function\"!=typeof t)throw new Error(\"checksum fn should be function\");return{encode(n){if(!r(n))throw new Error(\"checksum.encode: input should be Uint8Array\");const o=t(n).slice(0,e),i=new Uint8Array(n.length+e);return i.set(n),i.set(o,n.length),i},decode(n){if(!r(n))throw new Error(\"checksum.decode: input should be Uint8Array\");const o=n.slice(0,-e),i=t(o).slice(0,e),a=n.slice(-e);for(let t=0;t<e;t++)if(i[t]!==a[t])throw new Error(\"Invalid checksum\");return o}}}t.utils={alphabet:i,chain:o,checksum:m,convertRadix:u,convertRadix2:f,radix:h,radix2:p,join:a,padding:s},t.xn=o(p(4),i(\"0123456789ABCDEF\"),a(\"\")),t.RG=o(p(5),i(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\"),s(5),a(\"\")),o(p(5),i(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\"),a(\"\")),o(p(5),i(\"0123456789ABCDEFGHIJKLMNOPQRSTUV\"),s(5),a(\"\")),o(p(5),i(\"0123456789ABCDEFGHIJKLMNOPQRSTUV\"),a(\"\")),o(p(5),i(\"0123456789ABCDEFGHJKMNPQRSTVWXYZ\"),a(\"\"),c(e=>e.toUpperCase().replace(/O/g,\"0\").replace(/[IL]/g,\"1\"))),t.K3=o(p(6),i(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"),s(6),a(\"\")),o(p(6),i(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"),a(\"\")),t.r0=o(p(6),i(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\"),s(6),a(\"\")),o(p(6),i(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\"),a(\"\"));const y=e=>o(h(58),i(e),a(\"\"));t.tw=y(\"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\"),y(\"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ\"),y(\"rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz\");const w=[0,2,3,5,6,7,9,10,11];t.ic={encode(e){let n=\"\";for(let r=0;r<e.length;r+=8){const o=e.subarray(r,r+8);n+=t.tw.encode(o).padStart(w[o.length],\"1\")}return n},decode(e){let n=[];for(let r=0;r<e.length;r+=11){const o=e.slice(r,r+11),i=w.indexOf(o.length),a=t.tw.decode(o);for(let e=0;e<a.length-i;e++)if(0!==a[e])throw new Error(\"base58xmr: wrong padding\");n=n.concat(Array.from(a.slice(a.length-i)))}return Uint8Array.from(n)}};t.rg=e=>o(m(4,t=>e(e(t))),t.tw),t.rg;const v=o(i(\"qpzry9x8gf2tvdw0s3jn54khce6mua7l\"),a(\"\")),b=[996825010,642813549,513874426,1027748829,705979059];function A(e){const t=e>>25;let n=(33554431&e)<<5;for(let e=0;e<b.length;e++)1==(t>>e&1)&&(n^=b[e]);return n}function S(e,t,n=1){const r=e.length;let o=1;for(let t=0;t<r;t++){const n=e.charCodeAt(t);if(n<33||n>126)throw new Error(`Invalid prefix (${e})`);o=A(o)^n>>5}o=A(o);for(let t=0;t<r;t++)o=A(o)^31&e.charCodeAt(t);for(let e of t)o=A(o)^e;for(let e=0;e<6;e++)o=A(o);return o^=n,v.encode(f([o%2**30],30,5,!1))}function E(e){const t=\"bech32\"===e?1:734539939,n=p(5),r=n.decode,o=n.encode,i=g(r);function a(e,n,r=90){if(\"string\"!=typeof e)throw new Error(\"bech32.encode prefix should be string, not \"+typeof e);if(n instanceof Uint8Array&&(n=Array.from(n)),!Array.isArray(n)||n.length&&\"number\"!=typeof n[0])throw new Error(\"bech32.encode words should be array of numbers, not \"+typeof n);if(0===e.length)throw new TypeError(`Invalid prefix length ${e.length}`);const o=e.length+7+n.length;if(!1!==r&&o>r)throw new TypeError(`Length ${o} exceeds limit ${r}`);const i=e.toLowerCase(),a=S(i,n,t);return`${i}1${v.encode(n)}${a}`}function s(e,n=90){if(\"string\"!=typeof e)throw new Error(\"bech32.decode input should be string, not \"+typeof e);if(e.length<8||!1!==n&&e.length>n)throw new TypeError(`Wrong string length: ${e.length} (${e}). Expected (8..${n})`);const r=e.toLowerCase();if(e!==r&&e!==e.toUpperCase())throw new Error(\"String must be lowercase or uppercase\");const o=r.lastIndexOf(\"1\");if(0===o||-1===o)throw new Error('Letter \"1\" must be present between prefix and data only');const i=r.slice(0,o),a=r.slice(o+1);if(a.length<6)throw new Error(\"Data must be at least 6 characters long\");const s=v.decode(a).slice(0,-6),c=S(i,s,t);if(!a.endsWith(c))throw new Error(`Invalid checksum in ${e}: expected \"${c}\"`);return{prefix:i,words:s}}return{encode:a,decode:s,encodeFromBytes:function(e,t){return a(e,o(t))},decodeToBytes:function(e){const{prefix:t,words:n}=s(e,!1);return{prefix:t,words:n,bytes:r(n)}},decodeUnsafe:g(s),fromWords:r,fromWordsUnsafe:i,toWords:o}}E(\"bech32\"),E(\"bech32m\"),t.As={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)},t.uh=o(p(4),i(\"0123456789abcdef\"),a(\"\"),c(e=>{if(\"string\"!=typeof e||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}));const x={utf8:t.As,hex:t.uh,base16:t.xn,base32:t.RG,base64:t.K3,base64url:t.r0,base58:t.tw,base58xmr:t.ic},k=\"Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr\";t.Ar=(e,t)=>{if(\"string\"!=typeof e||!x.hasOwnProperty(e))throw new TypeError(k);if(!r(t))throw new TypeError(\"bytesToString() expects Uint8Array\");return x[e].encode(t)},t.Ar;t.Af=(e,t)=>{if(!x.hasOwnProperty(e))throw new TypeError(k);if(\"string\"!=typeof t)throw new TypeError(\"stringToBytes() expects string\");return x[e].decode(t)},t.Af},7991(e,t){\"use strict\";t.toByteArray=function(e){var t,n,i=s(e),a=i[0],c=i[1],u=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,c)),l=0,d=c>0?a-4:a;for(n=0;n<d;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===c&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===c&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],a=16383,s=0,c=r-o;s<c;s+=a)i.push(u(e,s,s+a>c?c:s+a));1===o?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+\"==\")):2===o&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+\"=\"));return i.join(\"\")};for(var n=[],r=[],o=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,i=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",a=0;a<64;++a)n[a]=i[a],r[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error(\"Invalid string. Length must be a multiple of 4\");var n=e.indexOf(\"=\");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function u(e,t,n){for(var r,o=[],i=t;i<n;i+=3)r=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(c(r));return o.join(\"\")}r[\"-\".charCodeAt(0)]=62,r[\"_\".charCodeAt(0)]=63},1048(e,t,n){\"use strict\";const r=n(7991),o=n(9318),i=\"function\"==typeof Symbol&&\"function\"==typeof Symbol.for?Symbol.for(\"nodejs.util.inspect.custom\"):null;t.hp=c,t.IS=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value \"'+e+'\" is invalid for option \"size\"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,n){if(\"number\"==typeof e){if(\"string\"==typeof t)throw new TypeError('The \"string\" argument must be of type string. Received type number');return d(e)}return u(e,t,n)}function u(e,t,n){if(\"string\"==typeof e)return function(e,t){\"string\"==typeof t&&\"\"!==t||(t=\"utf8\");if(!c.isEncoding(t))throw new TypeError(\"Unknown encoding: \"+t);const n=0|g(e,t);let r=s(n);const o=r.write(e,t);o!==n&&(r=r.slice(0,o));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return h(e,t,n);if(\"undefined\"!=typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return h(e,t,n);if(\"number\"==typeof e)throw new TypeError('The \"value\" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return c.from(r,t,n);const o=function(e){if(c.isBuffer(e)){const t=0|p(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return\"number\"!=typeof e.length||Y(e.length)?s(0):f(e);if(\"Buffer\"===e.type&&Array.isArray(e.data))return f(e.data)}(e);if(o)return o;if(\"undefined\"!=typeof Symbol&&null!=Symbol.toPrimitive&&\"function\"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive](\"string\"),t,n);throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof e)}function l(e){if(\"number\"!=typeof e)throw new TypeError('\"size\" argument must be of type number');if(e<0)throw new RangeError('The value \"'+e+'\" is invalid for option \"size\"')}function d(e){return l(e),s(e<0?0:0|p(e))}function f(e){const t=e.length<0?0:0|p(e.length),n=s(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function h(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('\"offset\" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('\"length\" is outside of buffer bounds');let r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,c.prototype),r}function p(e){if(e>=a)throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+a.toString(16)+\" bytes\");return 0|e}function g(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if(\"string\"!=typeof e)throw new TypeError('The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let o=!1;for(;;)switch(t){case\"ascii\":case\"latin1\":case\"binary\":return n;case\"utf8\":case\"utf-8\":return V(e).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*n;case\"hex\":return n>>>1;case\"base64\":return H(e).length;default:if(o)return r?-1:V(e).length;t=(\"\"+t).toLowerCase(),o=!0}}function m(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return\"\";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return\"\";if((n>>>=0)<=(t>>>=0))return\"\";for(e||(e=\"utf8\");;)switch(e){case\"hex\":return B(this,t,n);case\"utf8\":case\"utf-8\":return I(this,t,n);case\"ascii\":return _(this,t,n);case\"latin1\":case\"binary\":return C(this,t,n);case\"base64\":return k(this,t,n);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return R(this,t,n);default:if(r)throw new TypeError(\"Unknown encoding: \"+e);e=(e+\"\").toLowerCase(),r=!0}}function y(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function w(e,t,n,r,o){if(0===e.length)return-1;if(\"string\"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),Y(n=+n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if(\"string\"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,o);if(\"number\"==typeof t)return t&=255,\"function\"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,o);throw new TypeError(\"val must be string, number or Buffer\")}function v(e,t,n,r,o){let i,a=1,s=e.length,c=t.length;if(void 0!==r&&(\"ucs2\"===(r=String(r).toLowerCase())||\"ucs-2\"===r||\"utf16le\"===r||\"utf-16le\"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let r=-1;for(i=n;i<s;i++)if(u(e,i)===u(t,-1===r?0:i-r)){if(-1===r&&(r=i),i-r+1===c)return r*a}else-1!==r&&(i-=i-r),r=-1}else for(n+c>s&&(n=s-c),i=n;i>=0;i--){let n=!0;for(let r=0;r<c;r++)if(u(e,i+r)!==u(t,r)){n=!1;break}if(n)return i}return-1}function b(e,t,n,r){n=Number(n)||0;const o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;const i=t.length;let a;for(r>i/2&&(r=i/2),a=0;a<r;++a){const r=parseInt(t.substr(2*a,2),16);if(Y(r))return a;e[n+a]=r}return a}function A(e,t,n,r){return G(V(t,e.length-n),e,n,r)}function S(e,t,n,r){return G(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function E(e,t,n,r){return G(H(t),e,n,r)}function x(e,t,n,r){return G(function(e,t){let n,r,o;const i=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function k(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function I(e,t,n){n=Math.min(e.length,n);const r=[];let o=t;for(;o<n;){const t=e[o];let i=null,a=t>239?4:t>223?3:t>191?2:1;if(o+a<=n){let n,r,s,c;switch(a){case 1:t<128&&(i=t);break;case 2:n=e[o+1],128==(192&n)&&(c=(31&t)<<6|63&n,c>127&&(i=c));break;case 3:n=e[o+1],r=e[o+2],128==(192&n)&&128==(192&r)&&(c=(15&t)<<12|(63&n)<<6|63&r,c>2047&&(c<55296||c>57343)&&(i=c));break;case 4:n=e[o+1],r=e[o+2],s=e[o+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(c=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&s,c>65535&&c<1114112&&(i=c))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,r.push(i>>>10&1023|55296),i=56320|1023&i),r.push(i),o+=a}return function(e){const t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);let n=\"\",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=T));return n}(r)}c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||\"undefined\"==typeof console||\"function\"!=typeof console.error||console.error(\"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.\"),Object.defineProperty(c.prototype,\"parent\",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,\"offset\",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,n){return u(e,t,n)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,n){return function(e,t,n){return l(e),e<=0?s(e):void 0!==t?\"string\"==typeof n?s(e).fill(t,n):s(e).fill(t):s(e)}(e,t,n)},c.allocUnsafe=function(e){return d(e)},c.allocUnsafeSlow=function(e){return d(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(Z(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),Z(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,r=t.length;for(let o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"latin1\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('\"list\" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const r=c.allocUnsafe(t);let o=0;for(n=0;n<e.length;++n){let t=e[n];if(Z(t,Uint8Array))o+t.length>r.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(r,o)):Uint8Array.prototype.set.call(r,t,o);else{if(!c.isBuffer(t))throw new TypeError('\"list\" argument must be an Array of Buffers');t.copy(r,o)}o+=t.length}return r},c.byteLength=g,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError(\"Buffer size must be a multiple of 16-bits\");for(let t=0;t<e;t+=2)y(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError(\"Buffer size must be a multiple of 32-bits\");for(let t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError(\"Buffer size must be a multiple of 64-bits\");for(let t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?\"\":0===arguments.length?I(this,0,e):m.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError(\"Argument must be a Buffer\");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e=\"\";const n=t.IS;return e=this.toString(\"hex\",0,n).replace(/(.{2})/g,\"$1 \").trim(),this.length>n&&(e+=\" ... \"),\"<Buffer \"+e+\">\"},i&&(c.prototype[i]=c.prototype.inspect),c.prototype.compare=function(e,t,n,r,o){if(Z(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The \"target\" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError(\"out of range index\");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;let i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0);const s=Math.min(i,a),u=this.slice(r,o),l=e.slice(t,n);for(let e=0;e<s;++e)if(u[e]!==l[e]){i=u[e],a=l[e];break}return i<a?-1:a<i?1:0},c.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},c.prototype.indexOf=function(e,t,n){return w(this,e,t,n,!0)},c.prototype.lastIndexOf=function(e,t,n){return w(this,e,t,n,!1)},c.prototype.write=function(e,t,n,r){if(void 0===t)r=\"utf8\",n=this.length,t=0;else if(void 0===n&&\"string\"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r=\"utf8\")):(r=n,n=void 0)}const o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");r||(r=\"utf8\");let i=!1;for(;;)switch(r){case\"hex\":return b(this,e,t,n);case\"utf8\":case\"utf-8\":return A(this,e,t,n);case\"ascii\":case\"latin1\":case\"binary\":return S(this,e,t,n);case\"base64\":return E(this,e,t,n);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return x(this,e,t,n);default:if(i)throw new TypeError(\"Unknown encoding: \"+r);r=(\"\"+r).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};const T=4096;function _(e,t,n){let r=\"\";n=Math.min(e.length,n);for(let o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function C(e,t,n){let r=\"\";n=Math.min(e.length,n);for(let o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function B(e,t,n){const r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let o=\"\";for(let r=t;r<n;++r)o+=J[e[r]];return o}function R(e,t,n){const r=e.slice(t,n);let o=\"\";for(let e=0;e<r.length-1;e+=2)o+=String.fromCharCode(r[e]+256*r[e+1]);return o}function P(e,t,n){if(e%1!=0||e<0)throw new RangeError(\"offset is not uint\");if(e+t>n)throw new RangeError(\"Trying to access beyond buffer length\")}function N(e,t,n,r,o,i){if(!c.isBuffer(e))throw new TypeError('\"buffer\" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('\"value\" argument is out of bounds');if(n+r>e.length)throw new RangeError(\"Index out of range\")}function O(e,t,n,r,o){$(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function U(e,t,n,r,o){$(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n+7]=i,i>>=8,e[n+6]=i,i>>=8,e[n+5]=i,i>>=8,e[n+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function M(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError(\"Index out of range\");if(n<0)throw new RangeError(\"Index out of range\")}function z(e,t,n,r,i){return t=+t,n>>>=0,i||M(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,i){return t=+t,n>>>=0,i||M(e,0,n,8),o.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const r=this.subarray(e,t);return Object.setPrototypeOf(r,c.prototype),r},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);let r=this[e],o=1,i=0;for(;++i<t&&(o*=256);)r+=this[e+i]*o;return r},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);let r=this[e+--t],o=1;for(;t>0&&(o*=256);)r+=this[e+--t]*o;return r},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=X(function(e){K(e>>>=0,\"offset\");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||q(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(o)<<BigInt(32))}),c.prototype.readBigUInt64BE=X(function(e){K(e>>>=0,\"offset\");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||q(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<<BigInt(32))+BigInt(o)}),c.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);let r=this[e],o=1,i=0;for(;++i<t&&(o*=256);)r+=this[e+i]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);let r=t,o=1,i=this[e+--r];for(;r>0&&(o*=256);)i+=this[e+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||P(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){e>>>=0,t||P(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=X(function(e){K(e>>>=0,\"offset\");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||q(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),c.prototype.readBigInt64BE=X(function(e){K(e>>>=0,\"offset\");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||q(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)}),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||P(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){N(this,e,t,n,Math.pow(2,8*n)-1,0)}let o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){N(this,e,t,n,Math.pow(2,8*n)-1,0)}let o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=X(function(e,t=0){return O(this,e,t,BigInt(0),BigInt(\"0xffffffffffffffff\"))}),c.prototype.writeBigUInt64BE=X(function(e,t=0){return U(this,e,t,BigInt(0),BigInt(\"0xffffffffffffffff\"))}),c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);N(this,e,t,n,r-1,-r)}let o=0,i=1,a=0;for(this[t]=255&e;++o<n&&(i*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);N(this,e,t,n,r-1,-r)}let o=n-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=X(function(e,t=0){return O(this,e,t,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))}),c.prototype.writeBigInt64BE=X(function(e,t=0){return U(this,e,t,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))}),c.prototype.writeFloatLE=function(e,t,n){return z(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return z(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(!c.isBuffer(e))throw new TypeError(\"argument should be a Buffer\");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError(\"targetStart out of bounds\");if(n<0||n>=this.length)throw new RangeError(\"Index out of range\");if(r<0)throw new RangeError(\"sourceEnd out of bounds\");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);const o=r-n;return this===e&&\"function\"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),o},c.prototype.fill=function(e,t,n,r){if(\"string\"==typeof e){if(\"string\"==typeof t?(r=t,t=0,n=this.length):\"string\"==typeof n&&(r=n,n=this.length),void 0!==r&&\"string\"!=typeof r)throw new TypeError(\"encoding must be a string\");if(\"string\"==typeof r&&!c.isEncoding(r))throw new TypeError(\"Unknown encoding: \"+r);if(1===e.length){const t=e.charCodeAt(0);(\"utf8\"===r&&t<128||\"latin1\"===r)&&(e=t)}}else\"number\"==typeof e?e&=255:\"boolean\"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError(\"Out of range index\");if(n<=t)return this;let o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),\"number\"==typeof e)for(o=t;o<n;++o)this[o]=e;else{const i=c.isBuffer(e)?e:c.from(e,r),a=i.length;if(0===a)throw new TypeError('The value \"'+e+'\" is invalid for argument \"value\"');for(o=0;o<n-t;++o)this[o+t]=i[o%a]}return this};const j={};function F(e,t,n){j[e]=class extends n{constructor(){super(),Object.defineProperty(this,\"message\",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,\"code\",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function D(e){let t=\"\",n=e.length;const r=\"-\"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function $(e,t,n,r,o,i){if(e>n||e<t){const r=\"bigint\"==typeof t?\"n\":\"\";let o;throw o=i>3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(i+1)}${r}`:`>= -(2${r} ** ${8*(i+1)-1}${r}) and < 2 ** ${8*(i+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new j.ERR_OUT_OF_RANGE(\"value\",o,e)}!function(e,t,n){K(t,\"offset\"),void 0!==e[t]&&void 0!==e[t+n]||q(t,e.length-(n+1))}(r,o,i)}function K(e,t){if(\"number\"!=typeof e)throw new j.ERR_INVALID_ARG_TYPE(t,\"number\",e)}function q(e,t,n){if(Math.floor(e)!==e)throw K(e,n),new j.ERR_OUT_OF_RANGE(n||\"offset\",\"an integer\",e);if(t<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(n||\"offset\",`>= ${n?1:0} and <= ${t}`,e)}F(\"ERR_BUFFER_OUT_OF_BOUNDS\",function(e){return e?`${e} is outside of buffer bounds`:\"Attempt to access memory outside buffer bounds\"},RangeError),F(\"ERR_INVALID_ARG_TYPE\",function(e,t){return`The \"${e}\" argument must be of type number. Received type ${typeof t}`},TypeError),F(\"ERR_OUT_OF_RANGE\",function(e,t,n){let r=`The value of \"${e}\" is out of range.`,o=n;return Number.isInteger(n)&&Math.abs(n)>2**32?o=D(String(n)):\"bigint\"==typeof n&&(o=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(o=D(o)),o+=\"n\"),r+=` It must be ${t}. Received ${o}`,r},RangeError);const W=/[^+/0-9A-Za-z-_]/g;function V(e,t){let n;t=t||1/0;const r=e.length;let o=null;const i=[];for(let a=0;a<r;++a){if(n=e.charCodeAt(a),n>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error(\"Invalid code point\");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function H(e){return r.toByteArray(function(e){if((e=(e=e.split(\"=\")[0]).trim().replace(W,\"\")).length<2)return\"\";for(;e.length%4!=0;)e+=\"=\";return e}(e))}function G(e,t,n,r){let o;for(o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const J=function(){const e=\"0123456789abcdef\",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let o=0;o<16;++o)t[r+o]=e[n]+e[o]}return t}();function X(e){return\"undefined\"==typeof BigInt?Q:e}function Q(){throw new Error(\"BigInt not supported\")}},282(e){e.exports=a,a.default=a,a.stable=l,a.stableStringify=l;var t=\"[...]\",n=\"[Circular]\",r=[],o=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function a(e,t,n,a){var s;void 0===a&&(a=i()),c(e,\"\",0,[],void 0,0,a);try{s=0===o.length?JSON.stringify(e,t,n):JSON.stringify(e,f(t),n)}catch(e){return JSON.stringify(\"[unable to serialize, circular reference is too complex to analyze]\")}finally{for(;0!==r.length;){var u=r.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return s}function s(e,t,n,i){var a=Object.getOwnPropertyDescriptor(i,n);void 0!==a.get?a.configurable?(Object.defineProperty(i,n,{value:e}),r.push([i,n,t,a])):o.push([t,n,e]):(i[n]=e,r.push([i,n,t]))}function c(e,r,o,i,a,u,l){var d;if(u+=1,\"object\"==typeof e&&null!==e){for(d=0;d<i.length;d++)if(i[d]===e)return void s(n,e,r,a);if(void 0!==l.depthLimit&&u>l.depthLimit)return void s(t,e,r,a);if(void 0!==l.edgesLimit&&o+1>l.edgesLimit)return void s(t,e,r,a);if(i.push(e),Array.isArray(e))for(d=0;d<e.length;d++)c(e[d],d,d,i,e,u,l);else{var f=Object.keys(e);for(d=0;d<f.length;d++){var h=f[d];c(e[h],h,d,i,e,u,l)}}i.pop()}}function u(e,t){return e<t?-1:e>t?1:0}function l(e,t,n,a){void 0===a&&(a=i());var s,c=d(e,\"\",0,[],void 0,0,a)||e;try{s=0===o.length?JSON.stringify(c,t,n):JSON.stringify(c,f(t),n)}catch(e){return JSON.stringify(\"[unable to serialize, circular reference is too complex to analyze]\")}finally{for(;0!==r.length;){var u=r.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return s}function d(e,o,i,a,c,l,f){var h;if(l+=1,\"object\"==typeof e&&null!==e){for(h=0;h<a.length;h++)if(a[h]===e)return void s(n,e,o,c);try{if(\"function\"==typeof e.toJSON)return}catch(e){return}if(void 0!==f.depthLimit&&l>f.depthLimit)return void s(t,e,o,c);if(void 0!==f.edgesLimit&&i+1>f.edgesLimit)return void s(t,e,o,c);if(a.push(e),Array.isArray(e))for(h=0;h<e.length;h++)d(e[h],h,h,a,e,l,f);else{var p={},g=Object.keys(e).sort(u);for(h=0;h<g.length;h++){var m=g[h];d(e[m],m,h,a,e,l,f),p[m]=e[m]}if(void 0===c)return p;r.push([c,o,e]),c[o]=p}a.pop()}}function f(e){return e=void 0!==e?e:function(e,t){return t},function(t,n){if(o.length>0)for(var r=0;r<o.length;r++){var i=o[r];if(i[1]===t&&i[0]===n){n=i[2],o.splice(r,1);break}}return e.call(this,t,n)}}},9318(e,t){t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,c=(1<<s)-1,u=c>>1,l=-7,d=n?o-1:0,f=n?-1:1,h=e[t+d];for(d+=f,i=h&(1<<-l)-1,h>>=-l,l+=s;l>0;i=256*i+e[t+d],d+=f,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=f,l-=8);if(0===i)i=1-u;else{if(i===c)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=u}return(h?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,c,u=8*i-o-1,l=(1<<u)-1,d=l>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+d>=1?f/c:f*Math.pow(2,1-d))*c>=2&&(a++,c/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*c-1)*Math.pow(2,o),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&s,h+=p,s/=256,o-=8);for(a=a<<o|s,u+=o;u>0;e[n+h]=255&a,h+=p,a/=256,u-=8);e[n+h-p]|=128*g}},3103(e,t,n){var r=n(4715)(n(8942),\"DataView\");e.exports=r},5098(e,t,n){var r=n(3305),o=n(9361),i=n(1112),a=n(5276),s=n(5071);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},7553(e,t,n){var r=n(9747),o=n(5962);function i(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}i.prototype=r(o.prototype),i.prototype.constructor=i,e.exports=i},1386(e,t,n){var r=n(2393),o=n(2049),i=n(7144),a=n(7452),s=n(3964);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},528(e,t,n){var r=n(9747),o=n(5962);function i(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}i.prototype=r(o.prototype),i.prototype.constructor=i,e.exports=i},9770(e,t,n){var r=n(4715)(n(8942),\"Map\");e.exports=r},8250(e,t,n){var r=n(9753),o=n(5681),i=n(88),a=n(4732),s=n(9068);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},9413(e,t,n){var r=n(4715)(n(8942),\"Promise\");e.exports=r},4512(e,t,n){var r=n(4715)(n(8942),\"Set\");e.exports=r},3212(e,t,n){var r=n(8250),o=n(1877),i=n(8006);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=o,a.prototype.has=i,e.exports=a},1340(e,t,n){var r=n(1386),o=n(4103),i=n(1779),a=n(4162),s=n(7462),c=n(6638);function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=o,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=s,u.prototype.set=c,e.exports=u},5650(e,t,n){var r=n(8942).Symbol;e.exports=r},1623(e,t,n){var r=n(8942).Uint8Array;e.exports=r},9270(e,t,n){var r=n(4715)(n(8942),\"WeakMap\");e.exports=r},6912(e){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},9968(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},9847(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}},9756(e,t,n){var r=n(2478);e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},358(e,t,n){var r=n(6137),o=n(3283),i=n(3142),a=n(5853),s=n(9632),c=n(8666),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=i(e),l=!n&&o(e),d=!n&&!l&&a(e),f=!n&&!l&&!d&&c(e),h=n||l||d||f,p=h?r(e.length,String):[],g=p.length;for(var m in e)!t&&!u.call(e,m)||h&&(\"length\"==m||d&&(\"offset\"==m||\"parent\"==m)||f&&(\"buffer\"==m||\"byteLength\"==m||\"byteOffset\"==m)||s(m,g))||p.push(m);return p}},5111(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}},1129(e){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},6465(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},3422(e,t,n){var r=n(7073),o=n(6285),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];i.call(e,t)&&o(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},7034(e,t,n){var r=n(6285);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},7930(e,t,n){var r=n(9032),o=n(1211);e.exports=function(e,t){return e&&r(t,o(t),e)}},125(e,t,n){var r=n(9032),o=n(5288);e.exports=function(e,t){return e&&r(t,o(t),e)}},7073(e,t,n){var r=n(2532);e.exports=function(e,t,n){\"__proto__\"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},9334(e,t,n){var r=n(1340),o=n(9968),i=n(3422),a=n(7930),s=n(125),c=n(7099),u=n(4354),l=n(3546),d=n(4733),f=n(393),h=n(3650),p=n(8486),g=n(7350),m=n(424),y=n(5964),w=n(3142),v=n(5853),b=n(7681),A=n(1580),S=n(3943),E=n(1211),x=n(5288),k=\"[object Arguments]\",I=\"[object Function]\",T=\"[object Object]\",_={};_[k]=_[\"[object Array]\"]=_[\"[object ArrayBuffer]\"]=_[\"[object DataView]\"]=_[\"[object Boolean]\"]=_[\"[object Date]\"]=_[\"[object Float32Array]\"]=_[\"[object Float64Array]\"]=_[\"[object Int8Array]\"]=_[\"[object Int16Array]\"]=_[\"[object Int32Array]\"]=_[\"[object Map]\"]=_[\"[object Number]\"]=_[T]=_[\"[object RegExp]\"]=_[\"[object Set]\"]=_[\"[object String]\"]=_[\"[object Symbol]\"]=_[\"[object Uint8Array]\"]=_[\"[object Uint8ClampedArray]\"]=_[\"[object Uint16Array]\"]=_[\"[object Uint32Array]\"]=!0,_[\"[object Error]\"]=_[I]=_[\"[object WeakMap]\"]=!1,e.exports=function e(t,n,C,B,R,P){var N,O=1&n,U=2&n,M=4&n;if(C&&(N=R?C(t,B,R,P):C(t)),void 0!==N)return N;if(!A(t))return t;var z=w(t);if(z){if(N=g(t),!O)return u(t,N)}else{var L=p(t),j=L==I||\"[object GeneratorFunction]\"==L;if(v(t))return c(t,O);if(L==T||L==k||j&&!R){if(N=U||j?{}:y(t),!O)return U?d(t,s(N,t)):l(t,a(N,t))}else{if(!_[L])return R?t:{};N=m(t,L,O)}}P||(P=new r);var F=P.get(t);if(F)return F;P.set(t,N),S(t)?t.forEach(function(r){N.add(e(r,n,C,r,t,P))}):b(t)&&t.forEach(function(r,o){N.set(o,e(r,n,C,o,t,P))});var D=z?void 0:(M?U?h:f:U?x:E)(t);return o(D||t,function(r,o){D&&(r=t[o=r]),i(N,o,e(r,n,C,o,t,P))}),N}},9747(e,t,n){var r=n(1580),o=Object.create,i=function(){function e(){}return function(t){if(!r(t))return{};if(o)return o(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=i},7250(e){e.exports=function(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}},313(e,t,n){var r=n(1129),o=n(714);e.exports=function e(t,n,i,a,s){var c=-1,u=t.length;for(i||(i=o),s||(s=[]);++c<u;){var l=t[c];n>0&&i(l)?n>1?e(l,n-1,i,a,s):r(s,l):a||(s[s.length]=l)}return s}},7923(e,t,n){var r=n(3526),o=n(6040);e.exports=function(e,t){for(var n=0,i=(t=r(t,e)).length;null!=e&&n<i;)e=e[o(t[n++])];return n&&n==i?e:void 0}},8244(e,t,n){var r=n(1129),o=n(3142);e.exports=function(e,t,n){var i=t(e);return o(e)?i:r(i,n(e))}},7379(e,t,n){var r=n(5650),o=n(8870),i=n(9005),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?\"[object Undefined]\":\"[object Null]\":a&&a in Object(e)?o(e):i(e)}},3636(e){e.exports=function(e,t){return null!=e&&t in Object(e)}},2478(e,t,n){var r=n(7250),o=n(9454),i=n(7706);e.exports=function(e,t,n){return t==t?i(e,t,n):r(e,o,n)}},6027(e,t,n){var r=n(7379),o=n(547);e.exports=function(e){return o(e)&&\"[object Arguments]\"==r(e)}},4687(e,t,n){var r=n(353),o=n(547);e.exports=function e(t,n,i,a,s){return t===n||(null==t||null==n||!o(t)&&!o(n)?t!=t&&n!=n:r(t,n,i,a,e,s))}},353(e,t,n){var r=n(1340),o=n(3934),i=n(8861),a=n(1182),s=n(8486),c=n(3142),u=n(5853),l=n(8666),d=\"[object Arguments]\",f=\"[object Array]\",h=\"[object Object]\",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,g,m,y){var w=c(e),v=c(t),b=w?f:s(e),A=v?f:s(t),S=(b=b==d?h:b)==h,E=(A=A==d?h:A)==h,x=b==A;if(x&&u(e)){if(!u(t))return!1;w=!0,S=!1}if(x&&!S)return y||(y=new r),w||l(e)?o(e,t,n,g,m,y):i(e,t,b,n,g,m,y);if(!(1&n)){var k=S&&p.call(e,\"__wrapped__\"),I=E&&p.call(t,\"__wrapped__\");if(k||I){var T=k?e.value():e,_=I?t.value():t;return y||(y=new r),m(T,_,n,g,y)}}return!!x&&(y||(y=new r),a(e,t,n,g,m,y))}},777(e,t,n){var r=n(8486),o=n(547);e.exports=function(e){return o(e)&&\"[object Map]\"==r(e)}},8330(e,t,n){var r=n(1340),o=n(4687);e.exports=function(e,t,n,i){var a=n.length,s=a,c=!i;if(null==e)return!s;for(e=Object(e);a--;){var u=n[a];if(c&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++a<s;){var l=(u=n[a])[0],d=e[l],f=u[1];if(c&&u[2]){if(void 0===d&&!(l in e))return!1}else{var h=new r;if(i)var p=i(d,f,l,e,t,h);if(!(void 0===p?o(f,d,3,i,h):p))return!1}}return!0}},9454(e){e.exports=function(e){return e!=e}},9624(e,t,n){var r=n(3655),o=n(4759),i=n(1580),a=n(4066),s=/^\\[object .+?Constructor\\]$/,c=Function.prototype,u=Object.prototype,l=c.toString,d=u.hasOwnProperty,f=RegExp(\"^\"+l.call(d).replace(/[\\\\^$.*+?()[\\]{}|]/g,\"\\\\$&\").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,\"$1.*?\")+\"$\");e.exports=function(e){return!(!i(e)||o(e))&&(r(e)?f:s).test(a(e))}},1935(e,t,n){var r=n(8486),o=n(547);e.exports=function(e){return o(e)&&\"[object Set]\"==r(e)}},674(e,t,n){var r=n(7379),o=n(5387),i=n(547),a={};a[\"[object Float32Array]\"]=a[\"[object Float64Array]\"]=a[\"[object Int8Array]\"]=a[\"[object Int16Array]\"]=a[\"[object Int32Array]\"]=a[\"[object Uint8Array]\"]=a[\"[object Uint8ClampedArray]\"]=a[\"[object Uint16Array]\"]=a[\"[object Uint32Array]\"]=!0,a[\"[object Arguments]\"]=a[\"[object Array]\"]=a[\"[object ArrayBuffer]\"]=a[\"[object Boolean]\"]=a[\"[object DataView]\"]=a[\"[object Date]\"]=a[\"[object Error]\"]=a[\"[object Function]\"]=a[\"[object Map]\"]=a[\"[object Number]\"]=a[\"[object Object]\"]=a[\"[object RegExp]\"]=a[\"[object Set]\"]=a[\"[object String]\"]=a[\"[object WeakMap]\"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!a[r(e)]}},3334(e,t,n){var r=n(6526),o=n(2343),i=n(2053),a=n(3142),s=n(3282);e.exports=function(e){return\"function\"==typeof e?e:null==e?i:\"object\"==typeof e?a(e)?o(e[0],e[1]):r(e):s(e)}},195(e,t,n){var r=n(4882),o=n(8121),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))i.call(e,n)&&\"constructor\"!=n&&t.push(n);return t}},7200(e,t,n){var r=n(1580),o=n(4882),i=n(8546),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=o(e),n=[];for(var s in e)(\"constructor\"!=s||!t&&a.call(e,s))&&n.push(s);return n}},5962(e){e.exports=function(){}},6526(e,t,n){var r=n(8330),o=n(4367),i=n(3904);e.exports=function(e){var t=o(e);return 1==t.length&&t[0][2]?i(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},2343(e,t,n){var r=n(4687),o=n(6123),i=n(7276),a=n(5187),s=n(7267),c=n(3904),u=n(6040);e.exports=function(e,t){return a(e)&&s(t)?c(u(e),t):function(n){var a=o(n,e);return void 0===a&&a===t?i(n,e):r(t,a,3)}}},2762(e){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},8880(e,t,n){var r=n(7923);e.exports=function(e){return function(t){return r(t,e)}}},4943(e,t,n){var r=n(2053),o=n(6065),i=o?function(e,t){return o.set(e,t),e}:r;e.exports=i},7403(e,t,n){var r=n(2619),o=n(2532),i=n(2053),a=o?function(e,t){return o(e,\"toString\",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:i;e.exports=a},6137(e){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},2291(e,t,n){var r=n(5650),o=n(5111),i=n(3142),a=n(1187),s=r?r.prototype:void 0,c=s?s.toString:void 0;e.exports=function e(t){if(\"string\"==typeof t)return t;if(i(t))return o(t,e)+\"\";if(a(t))return c?c.call(t):\"\";var n=t+\"\";return\"0\"==n&&1/t==-1/0?\"-0\":n}},6403(e,t,n){var r=n(2945),o=/^\\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,\"\"):e}},9460(e){e.exports=function(e){return function(t){return e(t)}}},5568(e){e.exports=function(e,t){return e.has(t)}},3526(e,t,n){var r=n(3142),o=n(5187),i=n(6493),a=n(5243);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:i(a(e))}},8898(e,t,n){var r=n(1623);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},7099(e,t,n){e=n.nmd(e);var r=n(8942),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},2480(e,t,n){var r=n(8898);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},8340(e){var t=/\\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},8069(e,t,n){var r=n(5650),o=r?r.prototype:void 0,i=o?o.valueOf:void 0;e.exports=function(e){return i?Object(i.call(e)):{}}},2264(e,t,n){var r=n(8898);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},4977(e){var t=Math.max;e.exports=function(e,n,r,o){for(var i=-1,a=e.length,s=r.length,c=-1,u=n.length,l=t(a-s,0),d=Array(u+l),f=!o;++c<u;)d[c]=n[c];for(;++i<s;)(f||i<a)&&(d[r[i]]=e[i]);for(;l--;)d[c++]=e[i++];return d}},5755(e){var t=Math.max;e.exports=function(e,n,r,o){for(var i=-1,a=e.length,s=-1,c=r.length,u=-1,l=n.length,d=t(a-c,0),f=Array(d+l),h=!o;++i<d;)f[i]=e[i];for(var p=i;++u<l;)f[p+u]=n[u];for(;++s<c;)(h||i<a)&&(f[p+r[s]]=e[i++]);return f}},4354(e){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},9032(e,t,n){var r=n(3422),o=n(7073);e.exports=function(e,t,n,i){var a=!n;n||(n={});for(var s=-1,c=t.length;++s<c;){var u=t[s],l=i?i(n[u],e[u],u,n,e):void 0;void 0===l&&(l=e[u]),a?o(n,u,l):r(n,u,l)}return n}},3546(e,t,n){var r=n(9032),o=n(7979);e.exports=function(e,t){return r(e,o(e),t)}},4733(e,t,n){var r=n(9032),o=n(5832);e.exports=function(e,t){return r(e,o(e),t)}},1950(e,t,n){var r=n(8942)[\"__core-js_shared__\"];e.exports=r},3816(e){e.exports=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}},6713(e,t,n){var r=n(4364),o=n(8942);e.exports=function(e,t,n){var i=1&t,a=r(e);return function t(){return(this&&this!==o&&this instanceof t?a:e).apply(i?n:this,arguments)}}},4364(e,t,n){var r=n(9747),o=n(1580);e.exports=function(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=r(e.prototype),i=e.apply(n,t);return o(i)?i:n}}},2443(e,t,n){var r=n(6912),o=n(4364),i=n(3504),a=n(4216),s=n(6850),c=n(8813),u=n(8942);e.exports=function(e,t,n){var l=o(e);return function o(){for(var d=arguments.length,f=Array(d),h=d,p=s(o);h--;)f[h]=arguments[h];var g=d<3&&f[0]!==p&&f[d-1]!==p?[]:c(f,p);return(d-=g.length)<n?a(e,t,i,o.placeholder,void 0,f,g,void 0,void 0,n-d):r(this&&this!==u&&this instanceof o?l:e,this,f)}}},1942(e,t,n){var r=n(528),o=n(1439),i=n(5196),a=n(961),s=n(3142),c=n(6648);e.exports=function(e){return o(function(t){var n=t.length,o=n,u=r.prototype.thru;for(e&&t.reverse();o--;){var l=t[o];if(\"function\"!=typeof l)throw new TypeError(\"Expected a function\");if(u&&!d&&\"wrapper\"==a(l))var d=new r([],!0)}for(o=d?o:n;++o<n;){l=t[o];var f=a(l),h=\"wrapper\"==f?i(l):void 0;d=h&&c(h[0])&&424==h[1]&&!h[4].length&&1==h[9]?d[a(h[0])].apply(d,h[3]):1==l.length&&c(l)?d[f]():d.thru(l)}return function(){var e=arguments,r=e[0];if(d&&1==e.length&&s(r))return d.plant(r).value();for(var o=0,i=n?t[o].apply(this,e):r;++o<n;)i=t[o].call(this,i);return i}})}},3504(e,t,n){var r=n(4977),o=n(5755),i=n(3816),a=n(4364),s=n(4216),c=n(6850),u=n(6591),l=n(8813),d=n(8942);e.exports=function e(t,n,f,h,p,g,m,y,w,v){var b=128&n,A=1&n,S=2&n,E=24&n,x=512&n,k=S?void 0:a(t);return function I(){for(var T=arguments.length,_=Array(T),C=T;C--;)_[C]=arguments[C];if(E)var B=c(I),R=i(_,B);if(h&&(_=r(_,h,p,E)),g&&(_=o(_,g,m,E)),T-=R,E&&T<v){var P=l(_,B);return s(t,n,e,I.placeholder,f,_,P,y,w,v-T)}var N=A?f:this,O=S?N[t]:t;return T=_.length,y?_=u(_,y):x&&T>1&&_.reverse(),b&&w<T&&(_.length=w),this&&this!==d&&this instanceof I&&(O=k||a(O)),O.apply(N,_)}}},6341(e,t,n){var r=n(6912),o=n(4364),i=n(8942);e.exports=function(e,t,n,a){var s=1&t,c=o(e);return function t(){for(var o=-1,u=arguments.length,l=-1,d=a.length,f=Array(d+u),h=this&&this!==i&&this instanceof t?c:e;++l<d;)f[l]=a[l];for(;u--;)f[l++]=arguments[++o];return r(h,s?n:this,f)}}},4216(e,t,n){var r=n(6648),o=n(5512),i=n(5620);e.exports=function(e,t,n,a,s,c,u,l,d,f){var h=8&t;t|=h?32:64,4&(t&=~(h?64:32))||(t&=-4);var p=[e,t,s,h?c:void 0,h?u:void 0,h?void 0:c,h?void 0:u,l,d,f],g=n.apply(void 0,p);return r(e)&&o(g,p),g.placeholder=a,i(g,e,t)}},8638(e,t,n){var r=n(4943),o=n(6713),i=n(2443),a=n(3504),s=n(6341),c=n(5196),u=n(7028),l=n(5512),d=n(5620),f=n(7642),h=Math.max;e.exports=function(e,t,n,p,g,m,y,w){var v=2&t;if(!v&&\"function\"!=typeof e)throw new TypeError(\"Expected a function\");var b=p?p.length:0;if(b||(t&=-97,p=g=void 0),y=void 0===y?y:h(f(y),0),w=void 0===w?w:f(w),b-=g?g.length:0,64&t){var A=p,S=g;p=g=void 0}var E=v?void 0:c(e),x=[e,t,n,p,g,A,S,m,y,w];if(E&&u(x,E),e=x[0],t=x[1],n=x[2],p=x[3],g=x[4],!(w=x[9]=void 0===x[9]?v?0:e.length:h(x[9]-b,0))&&24&t&&(t&=-25),t&&1!=t)k=8==t||16==t?i(e,t,w):32!=t&&33!=t||g.length?a.apply(void 0,x):s(e,t,n,p);else var k=o(e,t,n);return d((E?r:l)(k,x),e,t)}},2532(e,t,n){var r=n(4715),o=function(){try{var e=r(Object,\"defineProperty\");return e({},\"\",{}),e}catch(e){}}();e.exports=o},3934(e,t,n){var r=n(3212),o=n(6465),i=n(5568);e.exports=function(e,t,n,a,s,c){var u=1&n,l=e.length,d=t.length;if(l!=d&&!(u&&d>l))return!1;var f=c.get(e),h=c.get(t);if(f&&h)return f==t&&h==e;var p=-1,g=!0,m=2&n?new r:void 0;for(c.set(e,t),c.set(t,e);++p<l;){var y=e[p],w=t[p];if(a)var v=u?a(w,y,p,t,e,c):a(y,w,p,e,t,c);if(void 0!==v){if(v)continue;g=!1;break}if(m){if(!o(t,function(e,t){if(!i(m,t)&&(y===e||s(y,e,n,a,c)))return m.push(t)})){g=!1;break}}else if(y!==w&&!s(y,w,n,a,c)){g=!1;break}}return c.delete(e),c.delete(t),g}},8861(e,t,n){var r=n(5650),o=n(1623),i=n(6285),a=n(3934),s=n(5894),c=n(9828),u=r?r.prototype:void 0,l=u?u.valueOf:void 0;e.exports=function(e,t,n,r,u,d,f){switch(n){case\"[object DataView]\":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case\"[object ArrayBuffer]\":return!(e.byteLength!=t.byteLength||!d(new o(e),new o(t)));case\"[object Boolean]\":case\"[object Date]\":case\"[object Number]\":return i(+e,+t);case\"[object Error]\":return e.name==t.name&&e.message==t.message;case\"[object RegExp]\":case\"[object String]\":return e==t+\"\";case\"[object Map]\":var h=s;case\"[object Set]\":var p=1&r;if(h||(h=c),e.size!=t.size&&!p)return!1;var g=f.get(e);if(g)return g==t;r|=2,f.set(e,t);var m=a(h(e),h(t),r,u,d,f);return f.delete(e),m;case\"[object Symbol]\":if(l)return l.call(e)==l.call(t)}return!1}},1182(e,t,n){var r=n(393),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,i,a,s){var c=1&n,u=r(e),l=u.length;if(l!=r(t).length&&!c)return!1;for(var d=l;d--;){var f=u[d];if(!(c?f in t:o.call(t,f)))return!1}var h=s.get(e),p=s.get(t);if(h&&p)return h==t&&p==e;var g=!0;s.set(e,t),s.set(t,e);for(var m=c;++d<l;){var y=e[f=u[d]],w=t[f];if(i)var v=c?i(w,y,f,t,e,s):i(y,w,f,e,t,s);if(!(void 0===v?y===w||a(y,w,n,i,s):v)){g=!1;break}m||(m=\"constructor\"==f)}if(g&&!m){var b=e.constructor,A=t.constructor;b==A||!(\"constructor\"in e)||!(\"constructor\"in t)||\"function\"==typeof b&&b instanceof b&&\"function\"==typeof A&&A instanceof A||(g=!1)}return s.delete(e),s.delete(t),g}},1439(e,t,n){var r=n(5857),o=n(5234),i=n(796);e.exports=function(e){return i(o(e,void 0,r),e+\"\")}},4967(e){var t=\"object\"==typeof globalThis&&globalThis&&globalThis.Object===Object&&globalThis;e.exports=t},393(e,t,n){var r=n(8244),o=n(7979),i=n(1211);e.exports=function(e){return r(e,i,o)}},3650(e,t,n){var r=n(8244),o=n(5832),i=n(5288);e.exports=function(e){return r(e,i,o)}},5196(e,t,n){var r=n(6065),o=n(9071),i=r?function(e){return r.get(e)}:o;e.exports=i},961(e,t,n){var r=n(3476),o=Object.prototype.hasOwnProperty;e.exports=function(e){for(var t=e.name+\"\",n=r[t],i=o.call(r,t)?n.length:0;i--;){var a=n[i],s=a.func;if(null==s||s==e)return a.name}return t}},6850(e){e.exports=function(e){return e.placeholder}},4700(e,t,n){var r=n(9067);e.exports=function(e,t){var n=e.__data__;return r(t)?n[\"string\"==typeof t?\"string\":\"hash\"]:n.map}},4367(e,t,n){var r=n(7267),o=n(1211);e.exports=function(e){for(var t=o(e),n=t.length;n--;){var i=t[n],a=e[i];t[n]=[i,a,r(a)]}return t}},4715(e,t,n){var r=n(9624),o=n(155);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},4784(e,t,n){var r=n(3766)(Object.getPrototypeOf,Object);e.exports=r},8870(e,t,n){var r=n(5650),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[s]=n:delete e[s]),o}},7979(e,t,n){var r=n(9847),o=n(9306),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),function(t){return i.call(e,t)}))}:o;e.exports=s},5832(e,t,n){var r=n(1129),o=n(4784),i=n(7979),a=n(9306),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,i(e)),e=o(e);return t}:a;e.exports=s},8486(e,t,n){var r=n(3103),o=n(9770),i=n(9413),a=n(4512),s=n(9270),c=n(7379),u=n(4066),l=\"[object Map]\",d=\"[object Promise]\",f=\"[object Set]\",h=\"[object WeakMap]\",p=\"[object DataView]\",g=u(r),m=u(o),y=u(i),w=u(a),v=u(s),b=c;(r&&b(new r(new ArrayBuffer(1)))!=p||o&&b(new o)!=l||i&&b(i.resolve())!=d||a&&b(new a)!=f||s&&b(new s)!=h)&&(b=function(e){var t=c(e),n=\"[object Object]\"==t?e.constructor:void 0,r=n?u(n):\"\";if(r)switch(r){case g:return p;case m:return l;case y:return d;case w:return f;case v:return h}return t}),e.exports=b},155(e){e.exports=function(e,t){return null==e?void 0:e[t]}},8788(e){var t=/\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,n=/,? & /;e.exports=function(e){var r=e.match(t);return r?r[1].split(n):[]}},5899(e,t,n){var r=n(3526),o=n(3283),i=n(3142),a=n(9632),s=n(5387),c=n(6040);e.exports=function(e,t,n){for(var u=-1,l=(t=r(t,e)).length,d=!1;++u<l;){var f=c(t[u]);if(!(d=null!=e&&n(e,f)))break;e=e[f]}return d||++u!=l?d:!!(l=null==e?0:e.length)&&s(l)&&a(f,l)&&(i(e)||o(e))}},3305(e,t,n){var r=n(4497);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},9361(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},1112(e,t,n){var r=n(4497),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return\"__lodash_hash_undefined__\"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},5276(e,t,n){var r=n(4497),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},5071(e,t,n){var r=n(4497);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?\"__lodash_hash_undefined__\":t,this}},7350(e){var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&\"string\"==typeof e[0]&&t.call(e,\"index\")&&(r.index=e.index,r.input=e.input),r}},424(e,t,n){var r=n(8898),o=n(2480),i=n(8340),a=n(8069),s=n(2264);e.exports=function(e,t,n){var c=e.constructor;switch(t){case\"[object ArrayBuffer]\":return r(e);case\"[object Boolean]\":case\"[object Date]\":return new c(+e);case\"[object DataView]\":return o(e,n);case\"[object Float32Array]\":case\"[object Float64Array]\":case\"[object Int8Array]\":case\"[object Int16Array]\":case\"[object Int32Array]\":case\"[object Uint8Array]\":case\"[object Uint8ClampedArray]\":case\"[object Uint16Array]\":case\"[object Uint32Array]\":return s(e,n);case\"[object Map]\":case\"[object Set]\":return new c;case\"[object Number]\":case\"[object String]\":return new c(e);case\"[object RegExp]\":return i(e);case\"[object Symbol]\":return a(e)}}},5964(e,t,n){var r=n(9747),o=n(4784),i=n(4882);e.exports=function(e){return\"function\"!=typeof e.constructor||i(e)?{}:r(o(e))}},9141(e){var t=/\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/;e.exports=function(e,n){var r=n.length;if(!r)return e;var o=r-1;return n[o]=(r>1?\"& \":\"\")+n[o],n=n.join(r>2?\", \":\" \"),e.replace(t,\"{\\n/* [wrapped with \"+n+\"] */\\n\")}},714(e,t,n){var r=n(5650),o=n(3283),i=n(3142),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return i(e)||o(e)||!!(a&&e&&e[a])}},9632(e){var t=/^(?:0|[1-9]\\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=n??9007199254740991)&&(\"number\"==r||\"symbol\"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},5187(e,t,n){var r=n(3142),o=n(1187),i=/\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,a=/^\\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!(\"number\"!=n&&\"symbol\"!=n&&\"boolean\"!=n&&null!=e&&!o(e))||(a.test(e)||!i.test(e)||null!=t&&e in Object(t))}},9067(e){e.exports=function(e){var t=typeof e;return\"string\"==t||\"number\"==t||\"symbol\"==t||\"boolean\"==t?\"__proto__\"!==e:null===e}},6648(e,t,n){var r=n(7553),o=n(5196),i=n(961),a=n(3321);e.exports=function(e){var t=i(e),n=a[t];if(\"function\"!=typeof n||!(t in r.prototype))return!1;if(e===n)return!0;var s=o(n);return!!s&&e===s[0]}},4759(e,t,n){var r,o=n(1950),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||\"\"))?\"Symbol(src)_1.\"+r:\"\";e.exports=function(e){return!!i&&i in e}},4882(e){var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===(\"function\"==typeof n&&n.prototype||t)}},7267(e,t,n){var r=n(1580);e.exports=function(e){return e==e&&!r(e)}},2393(e){e.exports=function(){this.__data__=[],this.size=0}},2049(e,t,n){var r=n(7034),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():o.call(t,n,1),--this.size,!0)}},7144(e,t,n){var r=n(7034);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},7452(e,t,n){var r=n(7034);e.exports=function(e){return r(this.__data__,e)>-1}},3964(e,t,n){var r=n(7034);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},9753(e,t,n){var r=n(5098),o=n(1386),i=n(9770);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},5681(e,t,n){var r=n(4700);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},88(e,t,n){var r=n(4700);e.exports=function(e){return r(this,e).get(e)}},4732(e,t,n){var r=n(4700);e.exports=function(e){return r(this,e).has(e)}},9068(e,t,n){var r=n(4700);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},5894(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},3904(e){e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},6853(e,t,n){var r=n(9011);e.exports=function(e){var t=r(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}},7028(e,t,n){var r=n(4977),o=n(5755),i=n(8813),a=\"__lodash_placeholder__\",s=128,c=Math.min;e.exports=function(e,t){var n=e[1],u=t[1],l=n|u,d=l<131,f=u==s&&8==n||u==s&&256==n&&e[7].length<=t[8]||384==u&&t[7].length<=t[8]&&8==n;if(!d&&!f)return e;1&u&&(e[2]=t[2],l|=1&n?0:4);var h=t[3];if(h){var p=e[3];e[3]=p?r(p,h,t[4]):h,e[4]=p?i(e[3],a):t[4]}return(h=t[5])&&(p=e[5],e[5]=p?o(p,h,t[6]):h,e[6]=p?i(e[5],a):t[6]),(h=t[7])&&(e[7]=h),u&s&&(e[8]=null==e[8]?t[8]:c(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=l,e}},6065(e,t,n){var r=n(9270),o=r&&new r;e.exports=o},4497(e,t,n){var r=n(4715)(Object,\"create\");e.exports=r},8121(e,t,n){var r=n(3766)(Object.keys,Object);e.exports=r},8546(e){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},2306(e,t,n){e=n.nmd(e);var r=n(4967),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,s=function(){try{var e=i&&i.require&&i.require(\"util\").types;return e||a&&a.binding&&a.binding(\"util\")}catch(e){}}();e.exports=s},9005(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},3766(e){e.exports=function(e,t){return function(n){return e(t(n))}}},5234(e,t,n){var r=n(6912),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,a=-1,s=o(i.length-t,0),c=Array(s);++a<s;)c[a]=i[t+a];a=-1;for(var u=Array(t+1);++a<t;)u[a]=i[a];return u[t]=n(c),r(e,this,u)}}},3476(e){e.exports={}},6591(e,t,n){var r=n(4354),o=n(9632),i=Math.min;e.exports=function(e,t){for(var n=e.length,a=i(t.length,n),s=r(e);a--;){var c=t[a];e[a]=o(c,n)?s[c]:void 0}return e}},8813(e){var t=\"__lodash_placeholder__\";e.exports=function(e,n){for(var r=-1,o=e.length,i=0,a=[];++r<o;){var s=e[r];s!==n&&s!==t||(e[r]=t,a[i++]=r)}return a}},8942(e,t,n){var r=n(4967),o=\"object\"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function(\"return this\")();e.exports=i},1877(e){e.exports=function(e){return this.__data__.set(e,\"__lodash_hash_undefined__\"),this}},8006(e){e.exports=function(e){return this.__data__.has(e)}},5512(e,t,n){var r=n(4943),o=n(3316)(r);e.exports=o},9828(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},796(e,t,n){var r=n(7403),o=n(3316)(r);e.exports=o},5620(e,t,n){var r=n(8788),o=n(9141),i=n(796),a=n(33);e.exports=function(e,t,n){var s=t+\"\";return i(e,o(s,a(r(s),n)))}},3316(e){var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var o=t(),i=16-(o-r);if(r=o,i>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},4103(e,t,n){var r=n(1386);e.exports=function(){this.__data__=new r,this.size=0}},1779(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},4162(e){e.exports=function(e){return this.__data__.get(e)}},7462(e){e.exports=function(e){return this.__data__.has(e)}},6638(e,t,n){var r=n(1386),o=n(9770),i=n(8250);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(e,t),this.size=n.size,this}},7706(e){e.exports=function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}},6493(e,t,n){var r=n(6853),o=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,i=/\\\\(\\\\)?/g,a=r(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(\"\"),e.replace(o,function(e,n,r,o){t.push(r?o.replace(i,\"$1\"):n||e)}),t});e.exports=a},6040(e,t,n){var r=n(1187);e.exports=function(e){if(\"string\"==typeof e||r(e))return e;var t=e+\"\";return\"0\"==t&&1/e==-1/0?\"-0\":t}},4066(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+\"\"}catch(e){}}return\"\"}},2945(e){var t=/\\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},33(e,t,n){var r=n(9968),o=n(9756),i=[[\"ary\",128],[\"bind\",1],[\"bindKey\",2],[\"curry\",8],[\"curryRight\",16],[\"flip\",512],[\"partial\",32],[\"partialRight\",64],[\"rearg\",256]];e.exports=function(e,t){return r(i,function(n){var r=\"_.\"+n[0];t&n[1]&&!o(e,r)&&e.push(r)}),e.sort()}},3410(e,t,n){var r=n(7553),o=n(528),i=n(4354);e.exports=function(e){if(e instanceof r)return e.clone();var t=new o(e.__wrapped__,e.__chain__);return t.__actions__=i(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}},5353(e,t,n){var r=n(8638);e.exports=function(e,t,n){return t=n?void 0:t,t=e&&null==t?e.length:t,r(e,128,void 0,void 0,void 0,void 0,t)}},2846(e,t,n){var r=n(9334);e.exports=function(e){return r(e,4)}},2619(e){e.exports=function(e){return function(){return e}}},7336(e,t,n){var r=n(8638);function o(e,t,n){var i=r(e,8,void 0,void 0,void 0,void 0,void 0,t=n?void 0:t);return i.placeholder=o.placeholder,i}o.placeholder={},e.exports=o},2784(e,t,n){var r=n(1580),o=n(4495),i=n(6131),a=Math.max,s=Math.min;e.exports=function(e,t,n){var c,u,l,d,f,h,p=0,g=!1,m=!1,y=!0;if(\"function\"!=typeof e)throw new TypeError(\"Expected a function\");function w(t){var n=c,r=u;return c=u=void 0,p=t,d=e.apply(r,n)}function v(e){var n=e-h;return void 0===h||n>=t||n<0||m&&e-p>=l}function b(){var e=o();if(v(e))return A(e);f=setTimeout(b,function(e){var n=t-(e-h);return m?s(n,l-(e-p)):n}(e))}function A(e){return f=void 0,y&&c?w(e):(c=u=void 0,d)}function S(){var e=o(),n=v(e);if(c=arguments,u=this,h=e,n){if(void 0===f)return function(e){return p=e,f=setTimeout(b,t),g?w(e):d}(h);if(m)return clearTimeout(f),f=setTimeout(b,t),w(h)}return void 0===f&&(f=setTimeout(b,t)),d}return t=i(t)||0,r(n)&&(g=!!n.leading,l=(m=\"maxWait\"in n)?a(i(n.maxWait)||0,t):l,y=\"trailing\"in n?!!n.trailing:y),S.cancel=function(){void 0!==f&&clearTimeout(f),p=0,c=h=u=f=void 0},S.flush=function(){return void 0===f?d:A(o())},S}},6285(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},5857(e,t,n){var r=n(313);e.exports=function(e){return(null==e?0:e.length)?r(e,1):[]}},2879(e,t,n){var r=n(1942)();e.exports=r},3579(e,t,n){var r=n(3565),o=n(2991),i=Array.prototype.push;function a(e,t){return 2==t?function(t,n){return e(t,n)}:function(t){return e(t)}}function s(e){for(var t=e?e.length:0,n=Array(t);t--;)n[t]=e[t];return n}function c(e,t){return function(){var n=arguments.length;if(n){for(var r=Array(n);n--;)r[n]=arguments[n];var o=r[0]=t.apply(void 0,r);return e.apply(void 0,r),o}}}e.exports=function e(t,n,u,l){var d=\"function\"==typeof n,f=n===Object(n);if(f&&(l=u,u=n,n=void 0),null==u)throw new TypeError;l||(l={});var h=!(\"cap\"in l)||l.cap,p=!(\"curry\"in l)||l.curry,g=!(\"fixed\"in l)||l.fixed,m=!(\"immutable\"in l)||l.immutable,y=!(\"rearg\"in l)||l.rearg,w=d?u:o,v=\"curry\"in l&&l.curry,b=\"fixed\"in l&&l.fixed,A=\"rearg\"in l&&l.rearg,S=d?u.runInContext():void 0,E=d?u:{ary:t.ary,assign:t.assign,clone:t.clone,curry:t.curry,forEach:t.forEach,isArray:t.isArray,isError:t.isError,isFunction:t.isFunction,isWeakMap:t.isWeakMap,iteratee:t.iteratee,keys:t.keys,rearg:t.rearg,toInteger:t.toInteger,toPath:t.toPath},x=E.ary,k=E.assign,I=E.clone,T=E.curry,_=E.forEach,C=E.isArray,B=E.isError,R=E.isFunction,P=E.isWeakMap,N=E.keys,O=E.rearg,U=E.toInteger,M=E.toPath,z=N(r.aryMethod),L={castArray:function(e){return function(){var t=arguments[0];return C(t)?e(s(t)):e.apply(void 0,arguments)}},iteratee:function(e){return function(){var t=arguments[1],n=e(arguments[0],t),r=n.length;return h&&\"number\"==typeof t?(t=t>2?t-2:1,r&&r<=t?n:a(n,t)):n}},mixin:function(e){return function(t){var n=this;if(!R(n))return e(n,Object(t));var r=[];return _(N(t),function(e){R(t[e])&&r.push([e,n.prototype[e]])}),e(n,Object(t)),_(r,function(e){var t=e[1];R(t)?n.prototype[e[0]]=t:delete n.prototype[e[0]]}),n}},nthArg:function(e){return function(t){var n=t<0?1:U(t)+1;return T(e(t),n)}},rearg:function(e){return function(t,n){var r=n?n.length:0;return T(e(t,n),r)}},runInContext:function(n){return function(r){return e(t,n(r),l)}}};function j(e,t){if(h){var n=r.iterateeRearg[e];if(n)return function(e,t){return q(e,function(e){var n=t.length;return function(e,t){return 2==t?function(t,n){return e.apply(void 0,arguments)}:function(t){return e.apply(void 0,arguments)}}(O(a(e,n),t),n)})}(t,n);var o=!d&&r.iterateeAry[e];if(o)return function(e,t){return q(e,function(e){return\"function\"==typeof e?a(e,t):e})}(t,o)}return t}function F(e,t,n){if(g&&(b||!r.skipFixed[e])){var o=r.methodSpread[e],a=o&&o.start;return void 0===a?x(t,n):function(e,t){return function(){for(var n=arguments.length,r=n-1,o=Array(n);n--;)o[n]=arguments[n];var a=o[t],s=o.slice(0,t);return a&&i.apply(s,a),t!=r&&i.apply(s,o.slice(t+1)),e.apply(this,s)}}(t,a)}return t}function D(e,t,n){return y&&n>1&&(A||!r.skipRearg[e])?O(t,r.methodRearg[e]||r.aryRearg[n]):t}function $(e,t){for(var n=-1,r=(t=M(t)).length,o=r-1,i=I(Object(e)),a=i;null!=a&&++n<r;){var s=t[n],c=a[s];null==c||R(c)||B(c)||P(c)||(a[s]=I(n==o?c:Object(c))),a=a[s]}return i}function K(t,n){var o=r.aliasToReal[t]||t,i=r.remap[o]||o,a=l;return function(t){var r=d?S:E,s=d?S[i]:n,c=k(k({},a),t);return e(r,o,s,c)}}function q(e,t){return function(){var n=arguments.length;if(!n)return e();for(var r=Array(n);n--;)r[n]=arguments[n];var o=y?0:n-1;return r[o]=t(r[o]),e.apply(void 0,r)}}function W(e,t,n){var o,i=r.aliasToReal[e]||e,a=t,u=L[i];return u?a=u(t):m&&(r.mutate.array[i]?a=c(t,s):r.mutate.object[i]?a=c(t,function(e){return function(t){return e({},t)}}(t)):r.mutate.set[i]&&(a=c(t,$))),_(z,function(e){return _(r.aryMethod[e],function(t){if(i==t){var n=r.methodSpread[i],s=n&&n.afterRearg;return o=s?F(i,D(i,a,e),e):D(i,F(i,a,e),e),o=function(e,t,n){return v||p&&n>1?T(t,n):t}(0,o=j(i,o),e),!1}}),!o}),o||(o=a),o==t&&(o=v?T(o,1):function(){return t.apply(this,arguments)}),o.convert=K(i,t),o.placeholder=t.placeholder=n,o}if(!f)return W(n,u,w);var V=u,H=[];return _(z,function(e){_(r.aryMethod[e],function(e){var t=V[r.remap[e]||e];t&&H.push([e,W(e,t,V)])})}),_(N(V),function(e){var t=V[e];if(\"function\"==typeof t){for(var n=H.length;n--;)if(H[n][0]==e)return;t.convert=K(e,t),H.push([e,t])}}),_(H,function(e){V[e[0]]=e[1]}),V.convert=function(e){return V.runInContext.convert(e)(void 0)},V.placeholder=V,_(N(V),function(e){_(r.realToAlias[e]||[],function(t){V[t]=V[e]})}),V}},3565(e,t){t.aliasToReal={each:\"forEach\",eachRight:\"forEachRight\",entries:\"toPairs\",entriesIn:\"toPairsIn\",extend:\"assignIn\",extendAll:\"assignInAll\",extendAllWith:\"assignInAllWith\",extendWith:\"assignInWith\",first:\"head\",conforms:\"conformsTo\",matches:\"isMatch\",property:\"get\",__:\"placeholder\",F:\"stubFalse\",T:\"stubTrue\",all:\"every\",allPass:\"overEvery\",always:\"constant\",any:\"some\",anyPass:\"overSome\",apply:\"spread\",assoc:\"set\",assocPath:\"set\",complement:\"negate\",compose:\"flowRight\",contains:\"includes\",dissoc:\"unset\",dissocPath:\"unset\",dropLast:\"dropRight\",dropLastWhile:\"dropRightWhile\",equals:\"isEqual\",identical:\"eq\",indexBy:\"keyBy\",init:\"initial\",invertObj:\"invert\",juxt:\"over\",omitAll:\"omit\",nAry:\"ary\",path:\"get\",pathEq:\"matchesProperty\",pathOr:\"getOr\",paths:\"at\",pickAll:\"pick\",pipe:\"flow\",pluck:\"map\",prop:\"get\",propEq:\"matchesProperty\",propOr:\"getOr\",props:\"at\",symmetricDifference:\"xor\",symmetricDifferenceBy:\"xorBy\",symmetricDifferenceWith:\"xorWith\",takeLast:\"takeRight\",takeLastWhile:\"takeRightWhile\",unapply:\"rest\",unnest:\"flatten\",useWith:\"overArgs\",where:\"conformsTo\",whereEq:\"isMatch\",zipObj:\"zipObject\"},t.aryMethod={1:[\"assignAll\",\"assignInAll\",\"attempt\",\"castArray\",\"ceil\",\"create\",\"curry\",\"curryRight\",\"defaultsAll\",\"defaultsDeepAll\",\"floor\",\"flow\",\"flowRight\",\"fromPairs\",\"invert\",\"iteratee\",\"memoize\",\"method\",\"mergeAll\",\"methodOf\",\"mixin\",\"nthArg\",\"over\",\"overEvery\",\"overSome\",\"rest\",\"reverse\",\"round\",\"runInContext\",\"spread\",\"template\",\"trim\",\"trimEnd\",\"trimStart\",\"uniqueId\",\"words\",\"zipAll\"],2:[\"add\",\"after\",\"ary\",\"assign\",\"assignAllWith\",\"assignIn\",\"assignInAllWith\",\"at\",\"before\",\"bind\",\"bindAll\",\"bindKey\",\"chunk\",\"cloneDeepWith\",\"cloneWith\",\"concat\",\"conformsTo\",\"countBy\",\"curryN\",\"curryRightN\",\"debounce\",\"defaults\",\"defaultsDeep\",\"defaultTo\",\"delay\",\"difference\",\"divide\",\"drop\",\"dropRight\",\"dropRightWhile\",\"dropWhile\",\"endsWith\",\"eq\",\"every\",\"filter\",\"find\",\"findIndex\",\"findKey\",\"findLast\",\"findLastIndex\",\"findLastKey\",\"flatMap\",\"flatMapDeep\",\"flattenDepth\",\"forEach\",\"forEachRight\",\"forIn\",\"forInRight\",\"forOwn\",\"forOwnRight\",\"get\",\"groupBy\",\"gt\",\"gte\",\"has\",\"hasIn\",\"includes\",\"indexOf\",\"intersection\",\"invertBy\",\"invoke\",\"invokeMap\",\"isEqual\",\"isMatch\",\"join\",\"keyBy\",\"lastIndexOf\",\"lt\",\"lte\",\"map\",\"mapKeys\",\"mapValues\",\"matchesProperty\",\"maxBy\",\"meanBy\",\"merge\",\"mergeAllWith\",\"minBy\",\"multiply\",\"nth\",\"omit\",\"omitBy\",\"overArgs\",\"pad\",\"padEnd\",\"padStart\",\"parseInt\",\"partial\",\"partialRight\",\"partition\",\"pick\",\"pickBy\",\"propertyOf\",\"pull\",\"pullAll\",\"pullAt\",\"random\",\"range\",\"rangeRight\",\"rearg\",\"reject\",\"remove\",\"repeat\",\"restFrom\",\"result\",\"sampleSize\",\"some\",\"sortBy\",\"sortedIndex\",\"sortedIndexOf\",\"sortedLastIndex\",\"sortedLastIndexOf\",\"sortedUniqBy\",\"split\",\"spreadFrom\",\"startsWith\",\"subtract\",\"sumBy\",\"take\",\"takeRight\",\"takeRightWhile\",\"takeWhile\",\"tap\",\"throttle\",\"thru\",\"times\",\"trimChars\",\"trimCharsEnd\",\"trimCharsStart\",\"truncate\",\"union\",\"uniqBy\",\"uniqWith\",\"unset\",\"unzipWith\",\"without\",\"wrap\",\"xor\",\"zip\",\"zipObject\",\"zipObjectDeep\"],3:[\"assignInWith\",\"assignWith\",\"clamp\",\"differenceBy\",\"differenceWith\",\"findFrom\",\"findIndexFrom\",\"findLastFrom\",\"findLastIndexFrom\",\"getOr\",\"includesFrom\",\"indexOfFrom\",\"inRange\",\"intersectionBy\",\"intersectionWith\",\"invokeArgs\",\"invokeArgsMap\",\"isEqualWith\",\"isMatchWith\",\"flatMapDepth\",\"lastIndexOfFrom\",\"mergeWith\",\"orderBy\",\"padChars\",\"padCharsEnd\",\"padCharsStart\",\"pullAllBy\",\"pullAllWith\",\"rangeStep\",\"rangeStepRight\",\"reduce\",\"reduceRight\",\"replace\",\"set\",\"slice\",\"sortedIndexBy\",\"sortedLastIndexBy\",\"transform\",\"unionBy\",\"unionWith\",\"update\",\"xorBy\",\"xorWith\",\"zipWith\"],4:[\"fill\",\"setWith\",\"updateWith\"]},t.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},t.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},t.iterateeRearg={mapKeys:[1],reduceRight:[1,0]},t.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},t.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},t.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},t.realToAlias=function(){var e=Object.prototype.hasOwnProperty,n=t.aliasToReal,r={};for(var o in n){var i=n[o];e.call(r,i)?r[i].push(o):r[i]=[o]}return r}(),t.remap={assignAll:\"assign\",assignAllWith:\"assignWith\",assignInAll:\"assignIn\",assignInAllWith:\"assignInWith\",curryN:\"curry\",curryRightN:\"curryRight\",defaultsAll:\"defaults\",defaultsDeepAll:\"defaultsDeep\",findFrom:\"find\",findIndexFrom:\"findIndex\",findLastFrom:\"findLast\",findLastIndexFrom:\"findLastIndex\",getOr:\"get\",includesFrom:\"includes\",indexOfFrom:\"indexOf\",invokeArgs:\"invoke\",invokeArgsMap:\"invokeMap\",lastIndexOfFrom:\"lastIndexOf\",mergeAll:\"merge\",mergeAllWith:\"mergeWith\",padChars:\"pad\",padCharsEnd:\"padEnd\",padCharsStart:\"padStart\",propertyOf:\"get\",rangeStep:\"range\",rangeStepRight:\"rangeRight\",restFrom:\"rest\",spreadFrom:\"spread\",trimChars:\"trim\",trimCharsEnd:\"trimEnd\",trimCharsStart:\"trimStart\",zipAll:\"zip\"},t.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0},t.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}},8055(e,t,n){e.exports={ary:n(5353),assign:n(7930),clone:n(2846),curry:n(7336),forEach:n(9968),isArray:n(3142),isError:n(441),isFunction:n(3655),isWeakMap:n(7769),iteratee:n(2590),keys:n(195),rearg:n(864),toInteger:n(7642),toPath:n(2613)}},2673(e,t,n){var r=n(3579),o=n(8055);e.exports=function(e,t,n){return r(o,e,t,n)}},4255(e,t,n){var r=n(2673)(\"debounce\",n(2784));r.placeholder=n(2991),e.exports=r},3092(e,t,n){var r=n(2673)(\"flow\",n(2879));r.placeholder=n(2991),e.exports=r},3804(e,t,n){e.exports=n(3092)},2991(e){e.exports={}},6123(e,t,n){var r=n(7923);e.exports=function(e,t,n){var o=null==e?void 0:r(e,t);return void 0===o?n:o}},7276(e,t,n){var r=n(3636),o=n(5899);e.exports=function(e,t){return null!=e&&o(e,t,r)}},2053(e){e.exports=function(e){return e}},3283(e,t,n){var r=n(6027),o=n(547),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,\"callee\")&&!s.call(e,\"callee\")};e.exports=c},3142(e){var t=Array.isArray;e.exports=t},6529(e,t,n){var r=n(3655),o=n(5387);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},5853(e,t,n){e=n.nmd(e);var r=n(8942),o=n(4772),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,s=a&&a.exports===i?r.Buffer:void 0,c=(s?s.isBuffer:void 0)||o;e.exports=c},441(e,t,n){var r=n(7379),o=n(547),i=n(8360);e.exports=function(e){if(!o(e))return!1;var t=r(e);return\"[object Error]\"==t||\"[object DOMException]\"==t||\"string\"==typeof e.message&&\"string\"==typeof e.name&&!i(e)}},3655(e,t,n){var r=n(7379),o=n(1580);e.exports=function(e){if(!o(e))return!1;var t=r(e);return\"[object Function]\"==t||\"[object GeneratorFunction]\"==t||\"[object AsyncFunction]\"==t||\"[object Proxy]\"==t}},5387(e){e.exports=function(e){return\"number\"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7681(e,t,n){var r=n(777),o=n(9460),i=n(2306),a=i&&i.isMap,s=a?o(a):r;e.exports=s},1580(e){e.exports=function(e){var t=typeof e;return null!=e&&(\"object\"==t||\"function\"==t)}},547(e){e.exports=function(e){return null!=e&&\"object\"==typeof e}},8360(e,t,n){var r=n(7379),o=n(4784),i=n(547),a=Function.prototype,s=Object.prototype,c=a.toString,u=s.hasOwnProperty,l=c.call(Object);e.exports=function(e){if(!i(e)||\"[object Object]\"!=r(e))return!1;var t=o(e);if(null===t)return!0;var n=u.call(t,\"constructor\")&&t.constructor;return\"function\"==typeof n&&n instanceof n&&c.call(n)==l}},3943(e,t,n){var r=n(1935),o=n(9460),i=n(2306),a=i&&i.isSet,s=a?o(a):r;e.exports=s},1187(e,t,n){var r=n(7379),o=n(547);e.exports=function(e){return\"symbol\"==typeof e||o(e)&&\"[object Symbol]\"==r(e)}},8666(e,t,n){var r=n(674),o=n(9460),i=n(2306),a=i&&i.isTypedArray,s=a?o(a):r;e.exports=s},7769(e,t,n){var r=n(8486),o=n(547);e.exports=function(e){return o(e)&&\"[object WeakMap]\"==r(e)}},2590(e,t,n){var r=n(9334),o=n(3334);e.exports=function(e){return o(\"function\"==typeof e?e:r(e,1))}},1211(e,t,n){var r=n(358),o=n(195),i=n(6529);e.exports=function(e){return i(e)?r(e):o(e)}},5288(e,t,n){var r=n(358),o=n(7200),i=n(6529);e.exports=function(e){return i(e)?r(e,!0):o(e)}},5250(e,t,n){var r;e=n.nmd(e),function(){var o,i=\"Expected a function\",a=\"__lodash_hash_undefined__\",s=\"__lodash_placeholder__\",c=16,u=32,l=64,d=128,f=256,h=1/0,p=9007199254740991,g=NaN,m=4294967295,y=[[\"ary\",d],[\"bind\",1],[\"bindKey\",2],[\"curry\",8],[\"curryRight\",c],[\"flip\",512],[\"partial\",u],[\"partialRight\",l],[\"rearg\",f]],w=\"[object Arguments]\",v=\"[object Array]\",b=\"[object Boolean]\",A=\"[object Date]\",S=\"[object Error]\",E=\"[object Function]\",x=\"[object GeneratorFunction]\",k=\"[object Map]\",I=\"[object Number]\",T=\"[object Object]\",_=\"[object Promise]\",C=\"[object RegExp]\",B=\"[object Set]\",R=\"[object String]\",P=\"[object Symbol]\",N=\"[object WeakMap]\",O=\"[object ArrayBuffer]\",U=\"[object DataView]\",M=\"[object Float32Array]\",z=\"[object Float64Array]\",L=\"[object Int8Array]\",j=\"[object Int16Array]\",F=\"[object Int32Array]\",D=\"[object Uint8Array]\",$=\"[object Uint8ClampedArray]\",K=\"[object Uint16Array]\",q=\"[object Uint32Array]\",W=/\\b__p \\+= '';/g,V=/\\b(__p \\+=) '' \\+/g,H=/(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g,G=/&(?:amp|lt|gt|quot|#39);/g,Z=/[&<>\"']/g,Y=RegExp(G.source),J=RegExp(Z.source),X=/<%-([\\s\\S]+?)%>/g,Q=/<%([\\s\\S]+?)%>/g,ee=/<%=([\\s\\S]+?)%>/g,te=/\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,ne=/^\\w*$/,re=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,oe=/[\\\\^$.*+?()[\\]{}|]/g,ie=RegExp(oe.source),ae=/^\\s+/,se=/\\s/,ce=/\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,ue=/\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,le=/,? & /,de=/[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g,fe=/[()=,{}\\[\\]\\/\\s]/,he=/\\\\(\\\\)?/g,pe=/\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g,ge=/\\w*$/,me=/^[-+]0x[0-9a-f]+$/i,ye=/^0b[01]+$/i,we=/^\\[object .+?Constructor\\]$/,ve=/^0o[0-7]+$/i,be=/^(?:0|[1-9]\\d*)$/,Ae=/[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g,Se=/($^)/,Ee=/['\\n\\r\\u2028\\u2029\\\\]/g,xe=\"\\\\ud800-\\\\udfff\",ke=\"\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff\",Ie=\"\\\\u2700-\\\\u27bf\",Te=\"a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff\",_e=\"A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde\",Ce=\"\\\\ufe0e\\\\ufe0f\",Be=\"\\\\xac\\\\xb1\\\\xd7\\\\xf7\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf\\\\u2000-\\\\u206f \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000\",Re=\"['’]\",Pe=\"[\"+xe+\"]\",Ne=\"[\"+Be+\"]\",Oe=\"[\"+ke+\"]\",Ue=\"\\\\d+\",Me=\"[\"+Ie+\"]\",ze=\"[\"+Te+\"]\",Le=\"[^\"+xe+Be+Ue+Ie+Te+_e+\"]\",je=\"\\\\ud83c[\\\\udffb-\\\\udfff]\",Fe=\"[^\"+xe+\"]\",De=\"(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}\",$e=\"[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]\",Ke=\"[\"+_e+\"]\",qe=\"\\\\u200d\",We=\"(?:\"+ze+\"|\"+Le+\")\",Ve=\"(?:\"+Ke+\"|\"+Le+\")\",He=\"(?:['’](?:d|ll|m|re|s|t|ve))?\",Ge=\"(?:['’](?:D|LL|M|RE|S|T|VE))?\",Ze=\"(?:\"+Oe+\"|\"+je+\")\"+\"?\",Ye=\"[\"+Ce+\"]?\",Je=Ye+Ze+(\"(?:\"+qe+\"(?:\"+[Fe,De,$e].join(\"|\")+\")\"+Ye+Ze+\")*\"),Xe=\"(?:\"+[Me,De,$e].join(\"|\")+\")\"+Je,Qe=\"(?:\"+[Fe+Oe+\"?\",Oe,De,$e,Pe].join(\"|\")+\")\",et=RegExp(Re,\"g\"),tt=RegExp(Oe,\"g\"),nt=RegExp(je+\"(?=\"+je+\")|\"+Qe+Je,\"g\"),rt=RegExp([Ke+\"?\"+ze+\"+\"+He+\"(?=\"+[Ne,Ke,\"$\"].join(\"|\")+\")\",Ve+\"+\"+Ge+\"(?=\"+[Ne,Ke+We,\"$\"].join(\"|\")+\")\",Ke+\"?\"+We+\"+\"+He,Ke+\"+\"+Ge,\"\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])\",\"\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])\",Ue,Xe].join(\"|\"),\"g\"),ot=RegExp(\"[\"+qe+xe+ke+Ce+\"]\"),it=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,at=[\"Array\",\"Buffer\",\"DataView\",\"Date\",\"Error\",\"Float32Array\",\"Float64Array\",\"Function\",\"Int8Array\",\"Int16Array\",\"Int32Array\",\"Map\",\"Math\",\"Object\",\"Promise\",\"RegExp\",\"Set\",\"String\",\"Symbol\",\"TypeError\",\"Uint8Array\",\"Uint8ClampedArray\",\"Uint16Array\",\"Uint32Array\",\"WeakMap\",\"_\",\"clearTimeout\",\"isFinite\",\"parseInt\",\"setTimeout\"],st=-1,ct={};ct[M]=ct[z]=ct[L]=ct[j]=ct[F]=ct[D]=ct[$]=ct[K]=ct[q]=!0,ct[w]=ct[v]=ct[O]=ct[b]=ct[U]=ct[A]=ct[S]=ct[E]=ct[k]=ct[I]=ct[T]=ct[C]=ct[B]=ct[R]=ct[N]=!1;var ut={};ut[w]=ut[v]=ut[O]=ut[U]=ut[b]=ut[A]=ut[M]=ut[z]=ut[L]=ut[j]=ut[F]=ut[k]=ut[I]=ut[T]=ut[C]=ut[B]=ut[R]=ut[P]=ut[D]=ut[$]=ut[K]=ut[q]=!0,ut[S]=ut[E]=ut[N]=!1;var lt={\"\\\\\":\"\\\\\",\"'\":\"'\",\"\\n\":\"n\",\"\\r\":\"r\",\"\\u2028\":\"u2028\",\"\\u2029\":\"u2029\"},dt=parseFloat,ft=parseInt,ht=\"object\"==typeof globalThis&&globalThis&&globalThis.Object===Object&&globalThis,pt=\"object\"==typeof self&&self&&self.Object===Object&&self,gt=ht||pt||Function(\"return this\")(),mt=t&&!t.nodeType&&t,yt=mt&&e&&!e.nodeType&&e,wt=yt&&yt.exports===mt,vt=wt&&ht.process,bt=function(){try{var e=yt&&yt.require&&yt.require(\"util\").types;return e||vt&&vt.binding&&vt.binding(\"util\")}catch(e){}}(),At=bt&&bt.isArrayBuffer,St=bt&&bt.isDate,Et=bt&&bt.isMap,xt=bt&&bt.isRegExp,kt=bt&&bt.isSet,It=bt&&bt.isTypedArray;function Tt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function _t(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o<i;){var a=e[o];t(r,a,n(a),e)}return r}function Ct(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function Bt(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function Rt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Pt(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}function Nt(e,t){return!!(null==e?0:e.length)&&Kt(e,t,0)>-1}function Ot(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}function Ut(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}function Mt(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function zt(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function Lt(e,t,n,r){var o=null==e?0:e.length;for(r&&o&&(n=e[--o]);o--;)n=t(n,e[o],o,e);return n}function jt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Ft=Ht(\"length\");function Dt(e,t,n){var r;return n(e,function(e,n,o){if(t(e,n,o))return r=n,!1}),r}function $t(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function Kt(e,t,n){return t==t?function(e,t,n){var r=n-1,o=e.length;for(;++r<o;)if(e[r]===t)return r;return-1}(e,t,n):$t(e,Wt,n)}function qt(e,t,n,r){for(var o=n-1,i=e.length;++o<i;)if(r(e[o],t))return o;return-1}function Wt(e){return e!=e}function Vt(e,t){var n=null==e?0:e.length;return n?Yt(e,t)/n:g}function Ht(e){return function(t){return null==t?o:t[e]}}function Gt(e){return function(t){return null==e?o:e[t]}}function Zt(e,t,n,r,o){return o(e,function(e,o,i){n=r?(r=!1,e):t(n,e,o,i)}),n}function Yt(e,t){for(var n,r=-1,i=e.length;++r<i;){var a=t(e[r]);a!==o&&(n=n===o?a:n+a)}return n}function Jt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Xt(e){return e?e.slice(0,mn(e)+1).replace(ae,\"\"):e}function Qt(e){return function(t){return e(t)}}function en(e,t){return Ut(t,function(t){return e[t]})}function tn(e,t){return e.has(t)}function nn(e,t){for(var n=-1,r=e.length;++n<r&&Kt(t,e[n],0)>-1;);return n}function rn(e,t){for(var n=e.length;n--&&Kt(t,e[n],0)>-1;);return n}var on=Gt({À:\"A\",Á:\"A\",Â:\"A\",Ã:\"A\",Ä:\"A\",Å:\"A\",à:\"a\",á:\"a\",â:\"a\",ã:\"a\",ä:\"a\",å:\"a\",Ç:\"C\",ç:\"c\",Ð:\"D\",ð:\"d\",È:\"E\",É:\"E\",Ê:\"E\",Ë:\"E\",è:\"e\",é:\"e\",ê:\"e\",ë:\"e\",Ì:\"I\",Í:\"I\",Î:\"I\",Ï:\"I\",ì:\"i\",í:\"i\",î:\"i\",ï:\"i\",Ñ:\"N\",ñ:\"n\",Ò:\"O\",Ó:\"O\",Ô:\"O\",Õ:\"O\",Ö:\"O\",Ø:\"O\",ò:\"o\",ó:\"o\",ô:\"o\",õ:\"o\",ö:\"o\",ø:\"o\",Ù:\"U\",Ú:\"U\",Û:\"U\",Ü:\"U\",ù:\"u\",ú:\"u\",û:\"u\",ü:\"u\",Ý:\"Y\",ý:\"y\",ÿ:\"y\",Æ:\"Ae\",æ:\"ae\",Þ:\"Th\",þ:\"th\",ß:\"ss\",Ā:\"A\",Ă:\"A\",Ą:\"A\",ā:\"a\",ă:\"a\",ą:\"a\",Ć:\"C\",Ĉ:\"C\",Ċ:\"C\",Č:\"C\",ć:\"c\",ĉ:\"c\",ċ:\"c\",č:\"c\",Ď:\"D\",Đ:\"D\",ď:\"d\",đ:\"d\",Ē:\"E\",Ĕ:\"E\",Ė:\"E\",Ę:\"E\",Ě:\"E\",ē:\"e\",ĕ:\"e\",ė:\"e\",ę:\"e\",ě:\"e\",Ĝ:\"G\",Ğ:\"G\",Ġ:\"G\",Ģ:\"G\",ĝ:\"g\",ğ:\"g\",ġ:\"g\",ģ:\"g\",Ĥ:\"H\",Ħ:\"H\",ĥ:\"h\",ħ:\"h\",Ĩ:\"I\",Ī:\"I\",Ĭ:\"I\",Į:\"I\",İ:\"I\",ĩ:\"i\",ī:\"i\",ĭ:\"i\",į:\"i\",ı:\"i\",Ĵ:\"J\",ĵ:\"j\",Ķ:\"K\",ķ:\"k\",ĸ:\"k\",Ĺ:\"L\",Ļ:\"L\",Ľ:\"L\",Ŀ:\"L\",Ł:\"L\",ĺ:\"l\",ļ:\"l\",ľ:\"l\",ŀ:\"l\",ł:\"l\",Ń:\"N\",Ņ:\"N\",Ň:\"N\",Ŋ:\"N\",ń:\"n\",ņ:\"n\",ň:\"n\",ŋ:\"n\",Ō:\"O\",Ŏ:\"O\",Ő:\"O\",ō:\"o\",ŏ:\"o\",ő:\"o\",Ŕ:\"R\",Ŗ:\"R\",Ř:\"R\",ŕ:\"r\",ŗ:\"r\",ř:\"r\",Ś:\"S\",Ŝ:\"S\",Ş:\"S\",Š:\"S\",ś:\"s\",ŝ:\"s\",ş:\"s\",š:\"s\",Ţ:\"T\",Ť:\"T\",Ŧ:\"T\",ţ:\"t\",ť:\"t\",ŧ:\"t\",Ũ:\"U\",Ū:\"U\",Ŭ:\"U\",Ů:\"U\",Ű:\"U\",Ų:\"U\",ũ:\"u\",ū:\"u\",ŭ:\"u\",ů:\"u\",ű:\"u\",ų:\"u\",Ŵ:\"W\",ŵ:\"w\",Ŷ:\"Y\",ŷ:\"y\",Ÿ:\"Y\",Ź:\"Z\",Ż:\"Z\",Ž:\"Z\",ź:\"z\",ż:\"z\",ž:\"z\",Ĳ:\"IJ\",ĳ:\"ij\",Œ:\"Oe\",œ:\"oe\",ŉ:\"'n\",ſ:\"s\"}),an=Gt({\"&\":\"&amp;\",\"<\":\"&lt;\",\">\":\"&gt;\",'\"':\"&quot;\",\"'\":\"&#39;\"});function sn(e){return\"\\\\\"+lt[e]}function cn(e){return ot.test(e)}function un(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function ln(e,t){return function(n){return e(t(n))}}function dn(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var a=e[n];a!==t&&a!==s||(e[n]=s,i[o++]=n)}return i}function fn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function hn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function pn(e){return cn(e)?function(e){var t=nt.lastIndex=0;for(;nt.test(e);)++t;return t}(e):Ft(e)}function gn(e){return cn(e)?function(e){return e.match(nt)||[]}(e):function(e){return e.split(\"\")}(e)}function mn(e){for(var t=e.length;t--&&se.test(e.charAt(t)););return t}var yn=Gt({\"&amp;\":\"&\",\"&lt;\":\"<\",\"&gt;\":\">\",\"&quot;\":'\"',\"&#39;\":\"'\"});var wn=function e(t){var n,r=(t=null==t?gt:wn.defaults(gt.Object(),t,wn.pick(gt,at))).Array,se=t.Date,xe=t.Error,ke=t.Function,Ie=t.Math,Te=t.Object,_e=t.RegExp,Ce=t.String,Be=t.TypeError,Re=r.prototype,Pe=ke.prototype,Ne=Te.prototype,Oe=t[\"__core-js_shared__\"],Ue=Pe.toString,Me=Ne.hasOwnProperty,ze=0,Le=(n=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||\"\"))?\"Symbol(src)_1.\"+n:\"\",je=Ne.toString,Fe=Ue.call(Te),De=gt._,$e=_e(\"^\"+Ue.call(Me).replace(oe,\"\\\\$&\").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,\"$1.*?\")+\"$\"),Ke=wt?t.Buffer:o,qe=t.Symbol,We=t.Uint8Array,Ve=Ke?Ke.allocUnsafe:o,He=ln(Te.getPrototypeOf,Te),Ge=Te.create,Ze=Ne.propertyIsEnumerable,Ye=Re.splice,Je=qe?qe.isConcatSpreadable:o,Xe=qe?qe.iterator:o,Qe=qe?qe.toStringTag:o,nt=function(){try{var e=hi(Te,\"defineProperty\");return e({},\"\",{}),e}catch(e){}}(),ot=t.clearTimeout!==gt.clearTimeout&&t.clearTimeout,lt=se&&se.now!==gt.Date.now&&se.now,ht=t.setTimeout!==gt.setTimeout&&t.setTimeout,pt=Ie.ceil,mt=Ie.floor,yt=Te.getOwnPropertySymbols,vt=Ke?Ke.isBuffer:o,bt=t.isFinite,Ft=Re.join,Gt=ln(Te.keys,Te),vn=Ie.max,bn=Ie.min,An=se.now,Sn=t.parseInt,En=Ie.random,xn=Re.reverse,kn=hi(t,\"DataView\"),In=hi(t,\"Map\"),Tn=hi(t,\"Promise\"),_n=hi(t,\"Set\"),Cn=hi(t,\"WeakMap\"),Bn=hi(Te,\"create\"),Rn=Cn&&new Cn,Pn={},Nn=ji(kn),On=ji(In),Un=ji(Tn),Mn=ji(_n),zn=ji(Cn),Ln=qe?qe.prototype:o,jn=Ln?Ln.valueOf:o,Fn=Ln?Ln.toString:o;function Dn(e){if(ns(e)&&!Wa(e)&&!(e instanceof Wn)){if(e instanceof qn)return e;if(Me.call(e,\"__wrapped__\"))return Fi(e)}return new qn(e)}var $n=function(){function e(){}return function(t){if(!ts(t))return{};if(Ge)return Ge(t);e.prototype=t;var n=new e;return e.prototype=o,n}}();function Kn(){}function qn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=o}function Wn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=m,this.__views__=[]}function Vn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Hn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Gn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Zn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Gn;++t<n;)this.add(e[t])}function Yn(e){var t=this.__data__=new Hn(e);this.size=t.size}function Jn(e,t){var n=Wa(e),r=!n&&qa(e),o=!n&&!r&&Za(e),i=!n&&!r&&!o&&ls(e),a=n||r||o||i,s=a?Jt(e.length,Ce):[],c=s.length;for(var u in e)!t&&!Me.call(e,u)||a&&(\"length\"==u||o&&(\"offset\"==u||\"parent\"==u)||i&&(\"buffer\"==u||\"byteLength\"==u||\"byteOffset\"==u)||bi(u,c))||s.push(u);return s}function Xn(e){var t=e.length;return t?e[Zr(0,t-1)]:o}function Qn(e,t){return Mi(Ro(e),cr(t,0,e.length))}function er(e){return Mi(Ro(e))}function tr(e,t,n){(n!==o&&!Da(e[t],n)||n===o&&!(t in e))&&ar(e,t,n)}function nr(e,t,n){var r=e[t];Me.call(e,t)&&Da(r,n)&&(n!==o||t in e)||ar(e,t,n)}function rr(e,t){for(var n=e.length;n--;)if(Da(e[n][0],t))return n;return-1}function or(e,t,n,r){return hr(e,function(e,o,i){t(r,e,n(e),i)}),r}function ir(e,t){return e&&Po(t,Ps(t),e)}function ar(e,t,n){\"__proto__\"==t&&nt?nt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function sr(e,t){for(var n=-1,i=t.length,a=r(i),s=null==e;++n<i;)a[n]=s?o:Ts(e,t[n]);return a}function cr(e,t,n){return e==e&&(n!==o&&(e=e<=n?e:n),t!==o&&(e=e>=t?e:t)),e}function ur(e,t,n,r,i,a){var s,c=1&t,u=2&t,l=4&t;if(n&&(s=i?n(e,r,i,a):n(e)),s!==o)return s;if(!ts(e))return e;var d=Wa(e);if(d){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&\"string\"==typeof e[0]&&Me.call(e,\"index\")&&(n.index=e.index,n.input=e.input);return n}(e),!c)return Ro(e,s)}else{var f=mi(e),h=f==E||f==x;if(Za(e))return ko(e,c);if(f==T||f==w||h&&!i){if(s=u||h?{}:wi(e),!c)return u?function(e,t){return Po(e,gi(e),t)}(e,function(e,t){return e&&Po(t,Ns(t),e)}(s,e)):function(e,t){return Po(e,pi(e),t)}(e,ir(s,e))}else{if(!ut[f])return i?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case O:return Io(e);case b:case A:return new r(+e);case U:return function(e,t){var n=t?Io(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case M:case z:case L:case j:case F:case D:case $:case K:case q:return To(e,n);case k:return new r;case I:case R:return new r(e);case C:return function(e){var t=new e.constructor(e.source,ge.exec(e));return t.lastIndex=e.lastIndex,t}(e);case B:return new r;case P:return o=e,jn?Te(jn.call(o)):{}}var o}(e,f,c)}}a||(a=new Yn);var p=a.get(e);if(p)return p;a.set(e,s),ss(e)?e.forEach(function(r){s.add(ur(r,t,n,r,e,a))}):rs(e)&&e.forEach(function(r,o){s.set(o,ur(r,t,n,o,e,a))});var g=d?o:(l?u?ai:ii:u?Ns:Ps)(e);return Ct(g||e,function(r,o){g&&(r=e[o=r]),nr(s,o,ur(r,t,n,o,e,a))}),s}function lr(e,t,n){var r=n.length;if(null==e)return!r;for(e=Te(e);r--;){var i=n[r],a=t[i],s=e[i];if(s===o&&!(i in e)||!a(s))return!1}return!0}function dr(e,t,n){if(\"function\"!=typeof e)throw new Be(i);return Pi(function(){e.apply(o,n)},t)}function fr(e,t,n,r){var o=-1,i=Nt,a=!0,s=e.length,c=[],u=t.length;if(!s)return c;n&&(t=Ut(t,Qt(n))),r?(i=Ot,a=!1):t.length>=200&&(i=tn,a=!1,t=new Zn(t));e:for(;++o<s;){var l=e[o],d=null==n?l:n(l);if(l=r||0!==l?l:0,a&&d==d){for(var f=u;f--;)if(t[f]===d)continue e;c.push(l)}else i(t,d,r)||c.push(l)}return c}Dn.templateSettings={escape:X,evaluate:Q,interpolate:ee,variable:\"\",imports:{_:Dn}},Dn.prototype=Kn.prototype,Dn.prototype.constructor=Dn,qn.prototype=$n(Kn.prototype),qn.prototype.constructor=qn,Wn.prototype=$n(Kn.prototype),Wn.prototype.constructor=Wn,Vn.prototype.clear=function(){this.__data__=Bn?Bn(null):{},this.size=0},Vn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Vn.prototype.get=function(e){var t=this.__data__;if(Bn){var n=t[e];return n===a?o:n}return Me.call(t,e)?t[e]:o},Vn.prototype.has=function(e){var t=this.__data__;return Bn?t[e]!==o:Me.call(t,e)},Vn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Bn&&t===o?a:t,this},Hn.prototype.clear=function(){this.__data__=[],this.size=0},Hn.prototype.delete=function(e){var t=this.__data__,n=rr(t,e);return!(n<0)&&(n==t.length-1?t.pop():Ye.call(t,n,1),--this.size,!0)},Hn.prototype.get=function(e){var t=this.__data__,n=rr(t,e);return n<0?o:t[n][1]},Hn.prototype.has=function(e){return rr(this.__data__,e)>-1},Hn.prototype.set=function(e,t){var n=this.__data__,r=rr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Gn.prototype.clear=function(){this.size=0,this.__data__={hash:new Vn,map:new(In||Hn),string:new Vn}},Gn.prototype.delete=function(e){var t=di(this,e).delete(e);return this.size-=t?1:0,t},Gn.prototype.get=function(e){return di(this,e).get(e)},Gn.prototype.has=function(e){return di(this,e).has(e)},Gn.prototype.set=function(e,t){var n=di(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Zn.prototype.add=Zn.prototype.push=function(e){return this.__data__.set(e,a),this},Zn.prototype.has=function(e){return this.__data__.has(e)},Yn.prototype.clear=function(){this.__data__=new Hn,this.size=0},Yn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Yn.prototype.get=function(e){return this.__data__.get(e)},Yn.prototype.has=function(e){return this.__data__.has(e)},Yn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Hn){var r=n.__data__;if(!In||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Gn(r)}return n.set(e,t),this.size=n.size,this};var hr=Uo(Ar),pr=Uo(Sr,!0);function gr(e,t){var n=!0;return hr(e,function(e,r,o){return n=!!t(e,r,o)}),n}function mr(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],s=t(a);if(null!=s&&(c===o?s==s&&!us(s):n(s,c)))var c=s,u=a}return u}function yr(e,t){var n=[];return hr(e,function(e,r,o){t(e,r,o)&&n.push(e)}),n}function wr(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=vi),o||(o=[]);++i<a;){var s=e[i];t>0&&n(s)?t>1?wr(s,t-1,n,r,o):Mt(o,s):r||(o[o.length]=s)}return o}var vr=Mo(),br=Mo(!0);function Ar(e,t){return e&&vr(e,t,Ps)}function Sr(e,t){return e&&br(e,t,Ps)}function Er(e,t){return Pt(t,function(t){return Xa(e[t])})}function xr(e,t){for(var n=0,r=(t=Ao(t,e)).length;null!=e&&n<r;)e=e[Li(t[n++])];return n&&n==r?e:o}function kr(e,t,n){var r=t(e);return Wa(e)?r:Mt(r,n(e))}function Ir(e){return null==e?e===o?\"[object Undefined]\":\"[object Null]\":Qe&&Qe in Te(e)?function(e){var t=Me.call(e,Qe),n=e[Qe];try{e[Qe]=o;var r=!0}catch(e){}var i=je.call(e);r&&(t?e[Qe]=n:delete e[Qe]);return i}(e):function(e){return je.call(e)}(e)}function Tr(e,t){return e>t}function _r(e,t){return null!=e&&Me.call(e,t)}function Cr(e,t){return null!=e&&t in Te(e)}function Br(e,t,n){for(var i=n?Ot:Nt,a=e[0].length,s=e.length,c=s,u=r(s),l=1/0,d=[];c--;){var f=e[c];c&&t&&(f=Ut(f,Qt(t))),l=bn(f.length,l),u[c]=!n&&(t||a>=120&&f.length>=120)?new Zn(c&&f):o}f=e[0];var h=-1,p=u[0];e:for(;++h<a&&d.length<l;){var g=f[h],m=t?t(g):g;if(g=n||0!==g?g:0,!(p?tn(p,m):i(d,m,n))){for(c=s;--c;){var y=u[c];if(!(y?tn(y,m):i(e[c],m,n)))continue e}p&&p.push(m),d.push(g)}}return d}function Rr(e,t,n){var r=null==(e=Ci(e,t=Ao(t,e)))?e:e[Li(Ji(t))];return null==r?o:Tt(r,e,n)}function Pr(e){return ns(e)&&Ir(e)==w}function Nr(e,t,n,r,i){return e===t||(null==e||null==t||!ns(e)&&!ns(t)?e!=e&&t!=t:function(e,t,n,r,i,a){var s=Wa(e),c=Wa(t),u=s?v:mi(e),l=c?v:mi(t),d=(u=u==w?T:u)==T,f=(l=l==w?T:l)==T,h=u==l;if(h&&Za(e)){if(!Za(t))return!1;s=!0,d=!1}if(h&&!d)return a||(a=new Yn),s||ls(e)?ri(e,t,n,r,i,a):function(e,t,n,r,o,i,a){switch(n){case U:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case O:return!(e.byteLength!=t.byteLength||!i(new We(e),new We(t)));case b:case A:case I:return Da(+e,+t);case S:return e.name==t.name&&e.message==t.message;case C:case R:return e==t+\"\";case k:var s=un;case B:var c=1&r;if(s||(s=fn),e.size!=t.size&&!c)return!1;var u=a.get(e);if(u)return u==t;r|=2,a.set(e,t);var l=ri(s(e),s(t),r,o,i,a);return a.delete(e),l;case P:if(jn)return jn.call(e)==jn.call(t)}return!1}(e,t,u,n,r,i,a);if(!(1&n)){var p=d&&Me.call(e,\"__wrapped__\"),g=f&&Me.call(t,\"__wrapped__\");if(p||g){var m=p?e.value():e,y=g?t.value():t;return a||(a=new Yn),i(m,y,n,r,a)}}if(!h)return!1;return a||(a=new Yn),function(e,t,n,r,i,a){var s=1&n,c=ii(e),u=c.length,l=ii(t),d=l.length;if(u!=d&&!s)return!1;var f=u;for(;f--;){var h=c[f];if(!(s?h in t:Me.call(t,h)))return!1}var p=a.get(e),g=a.get(t);if(p&&g)return p==t&&g==e;var m=!0;a.set(e,t),a.set(t,e);var y=s;for(;++f<u;){var w=e[h=c[f]],v=t[h];if(r)var b=s?r(v,w,h,t,e,a):r(w,v,h,e,t,a);if(!(b===o?w===v||i(w,v,n,r,a):b)){m=!1;break}y||(y=\"constructor\"==h)}if(m&&!y){var A=e.constructor,S=t.constructor;A==S||!(\"constructor\"in e)||!(\"constructor\"in t)||\"function\"==typeof A&&A instanceof A&&\"function\"==typeof S&&S instanceof S||(m=!1)}return a.delete(e),a.delete(t),m}(e,t,n,r,i,a)}(e,t,n,r,Nr,i))}function Or(e,t,n,r){var i=n.length,a=i,s=!r;if(null==e)return!a;for(e=Te(e);i--;){var c=n[i];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++i<a;){var u=(c=n[i])[0],l=e[u],d=c[1];if(s&&c[2]){if(l===o&&!(u in e))return!1}else{var f=new Yn;if(r)var h=r(l,d,u,e,t,f);if(!(h===o?Nr(d,l,3,r,f):h))return!1}}return!0}function Ur(e){return!(!ts(e)||(t=e,Le&&Le in t))&&(Xa(e)?$e:we).test(ji(e));var t}function Mr(e){return\"function\"==typeof e?e:null==e?oc:\"object\"==typeof e?Wa(e)?$r(e[0],e[1]):Dr(e):hc(e)}function zr(e){if(!ki(e))return Gt(e);var t=[];for(var n in Te(e))Me.call(e,n)&&\"constructor\"!=n&&t.push(n);return t}function Lr(e){if(!ts(e))return function(e){var t=[];if(null!=e)for(var n in Te(e))t.push(n);return t}(e);var t=ki(e),n=[];for(var r in e)(\"constructor\"!=r||!t&&Me.call(e,r))&&n.push(r);return n}function jr(e,t){return e<t}function Fr(e,t){var n=-1,o=Ha(e)?r(e.length):[];return hr(e,function(e,r,i){o[++n]=t(e,r,i)}),o}function Dr(e){var t=fi(e);return 1==t.length&&t[0][2]?Ti(t[0][0],t[0][1]):function(n){return n===e||Or(n,e,t)}}function $r(e,t){return Si(e)&&Ii(t)?Ti(Li(e),t):function(n){var r=Ts(n,e);return r===o&&r===t?_s(n,e):Nr(t,r,3)}}function Kr(e,t,n,r,i){e!==t&&vr(t,function(a,s){if(i||(i=new Yn),ts(a))!function(e,t,n,r,i,a,s){var c=Bi(e,n),u=Bi(t,n),l=s.get(u);if(l)return void tr(e,n,l);var d=a?a(c,u,n+\"\",e,t,s):o,f=d===o;if(f){var h=Wa(u),p=!h&&Za(u),g=!h&&!p&&ls(u);d=u,h||p||g?Wa(c)?d=c:Ga(c)?d=Ro(c):p?(f=!1,d=ko(u,!0)):g?(f=!1,d=To(u,!0)):d=[]:is(u)||qa(u)?(d=c,qa(c)?d=ws(c):ts(c)&&!Xa(c)||(d=wi(u))):f=!1}f&&(s.set(u,d),i(d,u,r,a,s),s.delete(u));tr(e,n,d)}(e,t,s,n,Kr,r,i);else{var c=r?r(Bi(e,s),a,s+\"\",e,t,i):o;c===o&&(c=a),tr(e,s,c)}},Ns)}function qr(e,t){var n=e.length;if(n)return bi(t+=t<0?n:0,n)?e[t]:o}function Wr(e,t,n){t=t.length?Ut(t,function(e){return Wa(e)?function(t){return xr(t,1===e.length?e[0]:e)}:e}):[oc];var r=-1;t=Ut(t,Qt(li()));var o=Fr(e,function(e,n,o){var i=Ut(t,function(t){return t(e)});return{criteria:i,index:++r,value:e}});return function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(o,function(e,t){return function(e,t,n){var r=-1,o=e.criteria,i=t.criteria,a=o.length,s=n.length;for(;++r<a;){var c=_o(o[r],i[r]);if(c)return r>=s?c:c*(\"desc\"==n[r]?-1:1)}return e.index-t.index}(e,t,n)})}function Vr(e,t,n){for(var r=-1,o=t.length,i={};++r<o;){var a=t[r],s=xr(e,a);n(s,a)&&eo(i,Ao(a,e),s)}return i}function Hr(e,t,n,r){var o=r?qt:Kt,i=-1,a=t.length,s=e;for(e===t&&(t=Ro(t)),n&&(s=Ut(e,Qt(n)));++i<a;)for(var c=0,u=t[i],l=n?n(u):u;(c=o(s,l,c,r))>-1;)s!==e&&Ye.call(s,c,1),Ye.call(e,c,1);return e}function Gr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;bi(o)?Ye.call(e,o,1):ho(e,o)}}return e}function Zr(e,t){return e+mt(En()*(t-e+1))}function Yr(e,t){var n=\"\";if(!e||t<1||t>p)return n;do{t%2&&(n+=e),(t=mt(t/2))&&(e+=e)}while(t);return n}function Jr(e,t){return Ni(_i(e,t,oc),e+\"\")}function Xr(e){return Xn(Ds(e))}function Qr(e,t){var n=Ds(e);return Mi(n,cr(t,0,n.length))}function eo(e,t,n,r){if(!ts(e))return e;for(var i=-1,a=(t=Ao(t,e)).length,s=a-1,c=e;null!=c&&++i<a;){var u=Li(t[i]),l=n;if(\"__proto__\"===u||\"constructor\"===u||\"prototype\"===u)return e;if(i!=s){var d=c[u];(l=r?r(d,u,c):o)===o&&(l=ts(d)?d:bi(t[i+1])?[]:{})}nr(c,u,l),c=c[u]}return e}var to=Rn?function(e,t){return Rn.set(e,t),e}:oc,no=nt?function(e,t){return nt(e,\"toString\",{configurable:!0,enumerable:!1,value:tc(t),writable:!0})}:oc;function ro(e){return Mi(Ds(e))}function oo(e,t,n){var o=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=r(i);++o<i;)a[o]=e[o+t];return a}function io(e,t){var n;return hr(e,function(e,r,o){return!(n=t(e,r,o))}),!!n}function ao(e,t,n){var r=0,o=null==e?r:e.length;if(\"number\"==typeof t&&t==t&&o<=2147483647){for(;r<o;){var i=r+o>>>1,a=e[i];null!==a&&!us(a)&&(n?a<=t:a<t)?r=i+1:o=i}return o}return so(e,t,oc,n)}function so(e,t,n,r){var i=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=n(t))!=t,c=null===t,u=us(t),l=t===o;i<a;){var d=mt((i+a)/2),f=n(e[d]),h=f!==o,p=null===f,g=f==f,m=us(f);if(s)var y=r||g;else y=l?g&&(r||h):c?g&&h&&(r||!p):u?g&&h&&!p&&(r||!m):!p&&!m&&(r?f<=t:f<t);y?i=d+1:a=d}return bn(a,4294967294)}function co(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var a=e[n],s=t?t(a):a;if(!n||!Da(s,c)){var c=s;i[o++]=0===a?0:a}}return i}function uo(e){return\"number\"==typeof e?e:us(e)?g:+e}function lo(e){if(\"string\"==typeof e)return e;if(Wa(e))return Ut(e,lo)+\"\";if(us(e))return Fn?Fn.call(e):\"\";var t=e+\"\";return\"0\"==t&&1/e==-1/0?\"-0\":t}function fo(e,t,n){var r=-1,o=Nt,i=e.length,a=!0,s=[],c=s;if(n)a=!1,o=Ot;else if(i>=200){var u=t?null:Jo(e);if(u)return fn(u);a=!1,o=tn,c=new Zn}else c=t?[]:s;e:for(;++r<i;){var l=e[r],d=t?t(l):l;if(l=n||0!==l?l:0,a&&d==d){for(var f=c.length;f--;)if(c[f]===d)continue e;t&&c.push(d),s.push(l)}else o(c,d,n)||(c!==s&&c.push(d),s.push(l))}return s}function ho(e,t){var n=-1,r=(t=Ao(t,e)).length;if(!r)return!0;for(;++n<r;){var o=Li(t[n]);if(\"__proto__\"===o&&!Me.call(e,\"__proto__\"))return!1;if((\"constructor\"===o||\"prototype\"===o)&&n<r-1)return!1}var i=Ci(e,t);return null==i||delete i[Li(Ji(t))]}function po(e,t,n,r){return eo(e,t,n(xr(e,t)),r)}function go(e,t,n,r){for(var o=e.length,i=r?o:-1;(r?i--:++i<o)&&t(e[i],i,e););return n?oo(e,r?0:i,r?i+1:o):oo(e,r?i+1:0,r?o:i)}function mo(e,t){var n=e;return n instanceof Wn&&(n=n.value()),zt(t,function(e,t){return t.func.apply(t.thisArg,Mt([e],t.args))},n)}function yo(e,t,n){var o=e.length;if(o<2)return o?fo(e[0]):[];for(var i=-1,a=r(o);++i<o;)for(var s=e[i],c=-1;++c<o;)c!=i&&(a[i]=fr(a[i]||s,e[c],t,n));return fo(wr(a,1),t,n)}function wo(e,t,n){for(var r=-1,i=e.length,a=t.length,s={};++r<i;){var c=r<a?t[r]:o;n(s,e[r],c)}return s}function vo(e){return Ga(e)?e:[]}function bo(e){return\"function\"==typeof e?e:oc}function Ao(e,t){return Wa(e)?e:Si(e,t)?[e]:zi(vs(e))}var So=Jr;function Eo(e,t,n){var r=e.length;return n=n===o?r:n,!t&&n>=r?e:oo(e,t,n)}var xo=ot||function(e){return gt.clearTimeout(e)};function ko(e,t){if(t)return e.slice();var n=e.length,r=Ve?Ve(n):new e.constructor(n);return e.copy(r),r}function Io(e){var t=new e.constructor(e.byteLength);return new We(t).set(new We(e)),t}function To(e,t){var n=t?Io(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function _o(e,t){if(e!==t){var n=e!==o,r=null===e,i=e==e,a=us(e),s=t!==o,c=null===t,u=t==t,l=us(t);if(!c&&!l&&!a&&e>t||a&&s&&u&&!c&&!l||r&&s&&u||!n&&u||!i)return 1;if(!r&&!a&&!l&&e<t||l&&n&&i&&!r&&!a||c&&n&&i||!s&&i||!u)return-1}return 0}function Co(e,t,n,o){for(var i=-1,a=e.length,s=n.length,c=-1,u=t.length,l=vn(a-s,0),d=r(u+l),f=!o;++c<u;)d[c]=t[c];for(;++i<s;)(f||i<a)&&(d[n[i]]=e[i]);for(;l--;)d[c++]=e[i++];return d}function Bo(e,t,n,o){for(var i=-1,a=e.length,s=-1,c=n.length,u=-1,l=t.length,d=vn(a-c,0),f=r(d+l),h=!o;++i<d;)f[i]=e[i];for(var p=i;++u<l;)f[p+u]=t[u];for(;++s<c;)(h||i<a)&&(f[p+n[s]]=e[i++]);return f}function Ro(e,t){var n=-1,o=e.length;for(t||(t=r(o));++n<o;)t[n]=e[n];return t}function Po(e,t,n,r){var i=!n;n||(n={});for(var a=-1,s=t.length;++a<s;){var c=t[a],u=r?r(n[c],e[c],c,n,e):o;u===o&&(u=e[c]),i?ar(n,c,u):nr(n,c,u)}return n}function No(e,t){return function(n,r){var o=Wa(n)?_t:or,i=t?t():{};return o(n,e,li(r,2),i)}}function Oo(e){return Jr(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:o,s=i>2?n[2]:o;for(a=e.length>3&&\"function\"==typeof a?(i--,a):o,s&&Ai(n[0],n[1],s)&&(a=i<3?o:a,i=1),t=Te(t);++r<i;){var c=n[r];c&&e(t,c,r,a)}return t})}function Uo(e,t){return function(n,r){if(null==n)return n;if(!Ha(n))return e(n,r);for(var o=n.length,i=t?o:-1,a=Te(n);(t?i--:++i<o)&&!1!==r(a[i],i,a););return n}}function Mo(e){return function(t,n,r){for(var o=-1,i=Te(t),a=r(t),s=a.length;s--;){var c=a[e?s:++o];if(!1===n(i[c],c,i))break}return t}}function zo(e){return function(t){var n=cn(t=vs(t))?gn(t):o,r=n?n[0]:t.charAt(0),i=n?Eo(n,1).join(\"\"):t.slice(1);return r[e]()+i}}function Lo(e){return function(t){return zt(Xs(qs(t).replace(et,\"\")),e,\"\")}}function jo(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=$n(e.prototype),r=e.apply(n,t);return ts(r)?r:n}}function Fo(e){return function(t,n,r){var i=Te(t);if(!Ha(t)){var a=li(n,3);t=Ps(t),n=function(e){return a(i[e],e,i)}}var s=e(t,n,r);return s>-1?i[a?t[s]:s]:o}}function Do(e){return oi(function(t){var n=t.length,r=n,a=qn.prototype.thru;for(e&&t.reverse();r--;){var s=t[r];if(\"function\"!=typeof s)throw new Be(i);if(a&&!c&&\"wrapper\"==ci(s))var c=new qn([],!0)}for(r=c?r:n;++r<n;){var u=ci(s=t[r]),l=\"wrapper\"==u?si(s):o;c=l&&Ei(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?c[ci(l[0])].apply(c,l[3]):1==s.length&&Ei(s)?c[u]():c.thru(s)}return function(){var e=arguments,r=e[0];if(c&&1==e.length&&Wa(r))return c.plant(r).value();for(var o=0,i=n?t[o].apply(this,e):r;++o<n;)i=t[o].call(this,i);return i}})}function $o(e,t,n,i,a,s,c,u,l,f){var h=t&d,p=1&t,g=2&t,m=24&t,y=512&t,w=g?o:jo(e);return function d(){for(var v=arguments.length,b=r(v),A=v;A--;)b[A]=arguments[A];if(m)var S=ui(d),E=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(b,S);if(i&&(b=Co(b,i,a,m)),s&&(b=Bo(b,s,c,m)),v-=E,m&&v<f){var x=dn(b,S);return Zo(e,t,$o,d.placeholder,n,b,x,u,l,f-v)}var k=p?n:this,I=g?k[e]:e;return v=b.length,u?b=function(e,t){var n=e.length,r=bn(t.length,n),i=Ro(e);for(;r--;){var a=t[r];e[r]=bi(a,n)?i[a]:o}return e}(b,u):y&&v>1&&b.reverse(),h&&l<v&&(b.length=l),this&&this!==gt&&this instanceof d&&(I=w||jo(I)),I.apply(k,b)}}function Ko(e,t){return function(n,r){return function(e,t,n,r){return Ar(e,function(e,o,i){t(r,n(e),o,i)}),r}(n,e,t(r),{})}}function qo(e,t){return function(n,r){var i;if(n===o&&r===o)return t;if(n!==o&&(i=n),r!==o){if(i===o)return r;\"string\"==typeof n||\"string\"==typeof r?(n=lo(n),r=lo(r)):(n=uo(n),r=uo(r)),i=e(n,r)}return i}}function Wo(e){return oi(function(t){return t=Ut(t,Qt(li())),Jr(function(n){var r=this;return e(t,function(e){return Tt(e,r,n)})})})}function Vo(e,t){var n=(t=t===o?\" \":lo(t)).length;if(n<2)return n?Yr(t,e):t;var r=Yr(t,pt(e/pn(t)));return cn(t)?Eo(gn(r),0,e).join(\"\"):r.slice(0,e)}function Ho(e){return function(t,n,i){return i&&\"number\"!=typeof i&&Ai(t,n,i)&&(n=i=o),t=ps(t),n===o?(n=t,t=0):n=ps(n),function(e,t,n,o){for(var i=-1,a=vn(pt((t-e)/(n||1)),0),s=r(a);a--;)s[o?a:++i]=e,e+=n;return s}(t,n,i=i===o?t<n?1:-1:ps(i),e)}}function Go(e){return function(t,n){return\"string\"==typeof t&&\"string\"==typeof n||(t=ys(t),n=ys(n)),e(t,n)}}function Zo(e,t,n,r,i,a,s,c,d,f){var h=8&t;t|=h?u:l,4&(t&=~(h?l:u))||(t&=-4);var p=[e,t,i,h?a:o,h?s:o,h?o:a,h?o:s,c,d,f],g=n.apply(o,p);return Ei(e)&&Ri(g,p),g.placeholder=r,Oi(g,e,t)}function Yo(e){var t=Ie[e];return function(e,n){if(e=ys(e),(n=null==n?0:bn(gs(n),292))&&bt(e)){var r=(vs(e)+\"e\").split(\"e\");return+((r=(vs(t(r[0]+\"e\"+(+r[1]+n)))+\"e\").split(\"e\"))[0]+\"e\"+(+r[1]-n))}return t(e)}}var Jo=_n&&1/fn(new _n([,-0]))[1]==h?function(e){return new _n(e)}:uc;function Xo(e){return function(t){var n=mi(t);return n==k?un(t):n==B?hn(t):function(e,t){return Ut(t,function(t){return[t,e[t]]})}(t,e(t))}}function Qo(e,t,n,a,h,p,g,m){var y=2&t;if(!y&&\"function\"!=typeof e)throw new Be(i);var w=a?a.length:0;if(w||(t&=-97,a=h=o),g=g===o?g:vn(gs(g),0),m=m===o?m:gs(m),w-=h?h.length:0,t&l){var v=a,b=h;a=h=o}var A=y?o:si(e),S=[e,t,n,a,h,v,b,p,g,m];if(A&&function(e,t){var n=e[1],r=t[1],o=n|r,i=o<131,a=r==d&&8==n||r==d&&n==f&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!i&&!a)return e;1&r&&(e[2]=t[2],o|=1&n?0:4);var c=t[3];if(c){var u=e[3];e[3]=u?Co(u,c,t[4]):c,e[4]=u?dn(e[3],s):t[4]}(c=t[5])&&(u=e[5],e[5]=u?Bo(u,c,t[6]):c,e[6]=u?dn(e[5],s):t[6]);(c=t[7])&&(e[7]=c);r&d&&(e[8]=null==e[8]?t[8]:bn(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=o}(S,A),e=S[0],t=S[1],n=S[2],a=S[3],h=S[4],!(m=S[9]=S[9]===o?y?0:e.length:vn(S[9]-w,0))&&24&t&&(t&=-25),t&&1!=t)E=8==t||t==c?function(e,t,n){var i=jo(e);return function a(){for(var s=arguments.length,c=r(s),u=s,l=ui(a);u--;)c[u]=arguments[u];var d=s<3&&c[0]!==l&&c[s-1]!==l?[]:dn(c,l);return(s-=d.length)<n?Zo(e,t,$o,a.placeholder,o,c,d,o,o,n-s):Tt(this&&this!==gt&&this instanceof a?i:e,this,c)}}(e,t,m):t!=u&&33!=t||h.length?$o.apply(o,S):function(e,t,n,o){var i=1&t,a=jo(e);return function t(){for(var s=-1,c=arguments.length,u=-1,l=o.length,d=r(l+c),f=this&&this!==gt&&this instanceof t?a:e;++u<l;)d[u]=o[u];for(;c--;)d[u++]=arguments[++s];return Tt(f,i?n:this,d)}}(e,t,n,a);else var E=function(e,t,n){var r=1&t,o=jo(e);return function t(){return(this&&this!==gt&&this instanceof t?o:e).apply(r?n:this,arguments)}}(e,t,n);return Oi((A?to:Ri)(E,S),e,t)}function ei(e,t,n,r){return e===o||Da(e,Ne[n])&&!Me.call(r,n)?t:e}function ti(e,t,n,r,i,a){return ts(e)&&ts(t)&&(a.set(t,e),Kr(e,t,o,ti,a),a.delete(t)),e}function ni(e){return is(e)?o:e}function ri(e,t,n,r,i,a){var s=1&n,c=e.length,u=t.length;if(c!=u&&!(s&&u>c))return!1;var l=a.get(e),d=a.get(t);if(l&&d)return l==t&&d==e;var f=-1,h=!0,p=2&n?new Zn:o;for(a.set(e,t),a.set(t,e);++f<c;){var g=e[f],m=t[f];if(r)var y=s?r(m,g,f,t,e,a):r(g,m,f,e,t,a);if(y!==o){if(y)continue;h=!1;break}if(p){if(!jt(t,function(e,t){if(!tn(p,t)&&(g===e||i(g,e,n,r,a)))return p.push(t)})){h=!1;break}}else if(g!==m&&!i(g,m,n,r,a)){h=!1;break}}return a.delete(e),a.delete(t),h}function oi(e){return Ni(_i(e,o,Vi),e+\"\")}function ii(e){return kr(e,Ps,pi)}function ai(e){return kr(e,Ns,gi)}var si=Rn?function(e){return Rn.get(e)}:uc;function ci(e){for(var t=e.name+\"\",n=Pn[t],r=Me.call(Pn,t)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==e)return o.name}return t}function ui(e){return(Me.call(Dn,\"placeholder\")?Dn:e).placeholder}function li(){var e=Dn.iteratee||ic;return e=e===ic?Mr:e,arguments.length?e(arguments[0],arguments[1]):e}function di(e,t){var n,r,o=e.__data__;return(\"string\"==(r=typeof(n=t))||\"number\"==r||\"symbol\"==r||\"boolean\"==r?\"__proto__\"!==n:null===n)?o[\"string\"==typeof t?\"string\":\"hash\"]:o.map}function fi(e){for(var t=Ps(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,Ii(o)]}return t}function hi(e,t){var n=function(e,t){return null==e?o:e[t]}(e,t);return Ur(n)?n:o}var pi=yt?function(e){return null==e?[]:(e=Te(e),Pt(yt(e),function(t){return Ze.call(e,t)}))}:mc,gi=yt?function(e){for(var t=[];e;)Mt(t,pi(e)),e=He(e);return t}:mc,mi=Ir;function yi(e,t,n){for(var r=-1,o=(t=Ao(t,e)).length,i=!1;++r<o;){var a=Li(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&es(o)&&bi(a,o)&&(Wa(e)||qa(e))}function wi(e){return\"function\"!=typeof e.constructor||ki(e)?{}:$n(He(e))}function vi(e){return Wa(e)||qa(e)||!!(Je&&e&&e[Je])}function bi(e,t){var n=typeof e;return!!(t=t??p)&&(\"number\"==n||\"symbol\"!=n&&be.test(e))&&e>-1&&e%1==0&&e<t}function Ai(e,t,n){if(!ts(n))return!1;var r=typeof t;return!!(\"number\"==r?Ha(n)&&bi(t,n.length):\"string\"==r&&t in n)&&Da(n[t],e)}function Si(e,t){if(Wa(e))return!1;var n=typeof e;return!(\"number\"!=n&&\"symbol\"!=n&&\"boolean\"!=n&&null!=e&&!us(e))||(ne.test(e)||!te.test(e)||null!=t&&e in Te(t))}function Ei(e){var t=ci(e),n=Dn[t];if(\"function\"!=typeof n||!(t in Wn.prototype))return!1;if(e===n)return!0;var r=si(n);return!!r&&e===r[0]}(kn&&mi(new kn(new ArrayBuffer(1)))!=U||In&&mi(new In)!=k||Tn&&mi(Tn.resolve())!=_||_n&&mi(new _n)!=B||Cn&&mi(new Cn)!=N)&&(mi=function(e){var t=Ir(e),n=t==T?e.constructor:o,r=n?ji(n):\"\";if(r)switch(r){case Nn:return U;case On:return k;case Un:return _;case Mn:return B;case zn:return N}return t});var xi=Oe?Xa:yc;function ki(e){var t=e&&e.constructor;return e===(\"function\"==typeof t&&t.prototype||Ne)}function Ii(e){return e==e&&!ts(e)}function Ti(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==o||e in Te(n)))}}function _i(e,t,n){return t=vn(t===o?e.length-1:t,0),function(){for(var o=arguments,i=-1,a=vn(o.length-t,0),s=r(a);++i<a;)s[i]=o[t+i];i=-1;for(var c=r(t+1);++i<t;)c[i]=o[i];return c[t]=n(s),Tt(e,this,c)}}function Ci(e,t){return t.length<2?e:xr(e,oo(t,0,-1))}function Bi(e,t){if((\"constructor\"!==t||\"function\"!=typeof e[t])&&\"__proto__\"!=t)return e[t]}var Ri=Ui(to),Pi=ht||function(e,t){return gt.setTimeout(e,t)},Ni=Ui(no);function Oi(e,t,n){var r=t+\"\";return Ni(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?\"& \":\"\")+t[r],t=t.join(n>2?\", \":\" \"),e.replace(ce,\"{\\n/* [wrapped with \"+t+\"] */\\n\")}(r,function(e,t){return Ct(y,function(n){var r=\"_.\"+n[0];t&n[1]&&!Nt(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(ue);return t?t[1].split(le):[]}(r),n)))}function Ui(e){var t=0,n=0;return function(){var r=An(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(o,arguments)}}function Mi(e,t){var n=-1,r=e.length,i=r-1;for(t=t===o?r:t;++n<t;){var a=Zr(n,i),s=e[a];e[a]=e[n],e[n]=s}return e.length=t,e}var zi=function(e){var t=Ua(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(\"\"),e.replace(re,function(e,n,r,o){t.push(r?o.replace(he,\"$1\"):n||e)}),t});function Li(e){if(\"string\"==typeof e||us(e))return e;var t=e+\"\";return\"0\"==t&&1/e==-1/0?\"-0\":t}function ji(e){if(null!=e){try{return Ue.call(e)}catch(e){}try{return e+\"\"}catch(e){}}return\"\"}function Fi(e){if(e instanceof Wn)return e.clone();var t=new qn(e.__wrapped__,e.__chain__);return t.__actions__=Ro(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Di=Jr(function(e,t){return Ga(e)?fr(e,wr(t,1,Ga,!0)):[]}),$i=Jr(function(e,t){var n=Ji(t);return Ga(n)&&(n=o),Ga(e)?fr(e,wr(t,1,Ga,!0),li(n,2)):[]}),Ki=Jr(function(e,t){var n=Ji(t);return Ga(n)&&(n=o),Ga(e)?fr(e,wr(t,1,Ga,!0),o,n):[]});function qi(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:gs(n);return o<0&&(o=vn(r+o,0)),$t(e,li(t,3),o)}function Wi(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r-1;return n!==o&&(i=gs(n),i=n<0?vn(r+i,0):bn(i,r-1)),$t(e,li(t,3),i,!0)}function Vi(e){return(null==e?0:e.length)?wr(e,1):[]}function Hi(e){return e&&e.length?e[0]:o}var Gi=Jr(function(e){var t=Ut(e,vo);return t.length&&t[0]===e[0]?Br(t):[]}),Zi=Jr(function(e){var t=Ji(e),n=Ut(e,vo);return t===Ji(n)?t=o:n.pop(),n.length&&n[0]===e[0]?Br(n,li(t,2)):[]}),Yi=Jr(function(e){var t=Ji(e),n=Ut(e,vo);return(t=\"function\"==typeof t?t:o)&&n.pop(),n.length&&n[0]===e[0]?Br(n,o,t):[]});function Ji(e){var t=null==e?0:e.length;return t?e[t-1]:o}var Xi=Jr(Qi);function Qi(e,t){return e&&e.length&&t&&t.length?Hr(e,t):e}var ea=oi(function(e,t){var n=null==e?0:e.length,r=sr(e,t);return Gr(e,Ut(t,function(e){return bi(e,n)?+e:e}).sort(_o)),r});function ta(e){return null==e?e:xn.call(e)}var na=Jr(function(e){return fo(wr(e,1,Ga,!0))}),ra=Jr(function(e){var t=Ji(e);return Ga(t)&&(t=o),fo(wr(e,1,Ga,!0),li(t,2))}),oa=Jr(function(e){var t=Ji(e);return t=\"function\"==typeof t?t:o,fo(wr(e,1,Ga,!0),o,t)});function ia(e){if(!e||!e.length)return[];var t=0;return e=Pt(e,function(e){if(Ga(e))return t=vn(e.length,t),!0}),Jt(t,function(t){return Ut(e,Ht(t))})}function aa(e,t){if(!e||!e.length)return[];var n=ia(e);return null==t?n:Ut(n,function(e){return Tt(t,o,e)})}var sa=Jr(function(e,t){return Ga(e)?fr(e,t):[]}),ca=Jr(function(e){return yo(Pt(e,Ga))}),ua=Jr(function(e){var t=Ji(e);return Ga(t)&&(t=o),yo(Pt(e,Ga),li(t,2))}),la=Jr(function(e){var t=Ji(e);return t=\"function\"==typeof t?t:o,yo(Pt(e,Ga),o,t)}),da=Jr(ia);var fa=Jr(function(e){var t=e.length,n=t>1?e[t-1]:o;return n=\"function\"==typeof n?(e.pop(),n):o,aa(e,n)});function ha(e){var t=Dn(e);return t.__chain__=!0,t}function pa(e,t){return t(e)}var ga=oi(function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return sr(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Wn&&bi(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:pa,args:[i],thisArg:o}),new qn(r,this.__chain__).thru(function(e){return t&&!e.length&&e.push(o),e})):this.thru(i)});var ma=No(function(e,t,n){Me.call(e,n)?++e[n]:ar(e,n,1)});var ya=Fo(qi),wa=Fo(Wi);function va(e,t){return(Wa(e)?Ct:hr)(e,li(t,3))}function ba(e,t){return(Wa(e)?Bt:pr)(e,li(t,3))}var Aa=No(function(e,t,n){Me.call(e,n)?e[n].push(t):ar(e,n,[t])});var Sa=Jr(function(e,t,n){var o=-1,i=\"function\"==typeof t,a=Ha(e)?r(e.length):[];return hr(e,function(e){a[++o]=i?Tt(t,e,n):Rr(e,t,n)}),a}),Ea=No(function(e,t,n){ar(e,n,t)});function xa(e,t){return(Wa(e)?Ut:Fr)(e,li(t,3))}var ka=No(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]});var Ia=Jr(function(e,t){if(null==e)return[];var n=t.length;return n>1&&Ai(e,t[0],t[1])?t=[]:n>2&&Ai(t[0],t[1],t[2])&&(t=[t[0]]),Wr(e,wr(t,1),[])}),Ta=lt||function(){return gt.Date.now()};function _a(e,t,n){return t=n?o:t,t=e&&null==t?e.length:t,Qo(e,d,o,o,o,o,t)}function Ca(e,t){var n;if(\"function\"!=typeof t)throw new Be(i);return e=gs(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=o),n}}var Ba=Jr(function(e,t,n){var r=1;if(n.length){var o=dn(n,ui(Ba));r|=u}return Qo(e,r,t,n,o)}),Ra=Jr(function(e,t,n){var r=3;if(n.length){var o=dn(n,ui(Ra));r|=u}return Qo(t,r,e,n,o)});function Pa(e,t,n){var r,a,s,c,u,l,d=0,f=!1,h=!1,p=!0;if(\"function\"!=typeof e)throw new Be(i);function g(t){var n=r,i=a;return r=a=o,d=t,c=e.apply(i,n)}function m(e){var n=e-l;return l===o||n>=t||n<0||h&&e-d>=s}function y(){var e=Ta();if(m(e))return w(e);u=Pi(y,function(e){var n=t-(e-l);return h?bn(n,s-(e-d)):n}(e))}function w(e){return u=o,p&&r?g(e):(r=a=o,c)}function v(){var e=Ta(),n=m(e);if(r=arguments,a=this,l=e,n){if(u===o)return function(e){return d=e,u=Pi(y,t),f?g(e):c}(l);if(h)return xo(u),u=Pi(y,t),g(l)}return u===o&&(u=Pi(y,t)),c}return t=ys(t)||0,ts(n)&&(f=!!n.leading,s=(h=\"maxWait\"in n)?vn(ys(n.maxWait)||0,t):s,p=\"trailing\"in n?!!n.trailing:p),v.cancel=function(){u!==o&&xo(u),d=0,r=l=a=u=o},v.flush=function(){return u===o?c:w(Ta())},v}var Na=Jr(function(e,t){return dr(e,1,t)}),Oa=Jr(function(e,t,n){return dr(e,ys(t)||0,n)});function Ua(e,t){if(\"function\"!=typeof e||null!=t&&\"function\"!=typeof t)throw new Be(i);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(Ua.Cache||Gn),n}function Ma(e){if(\"function\"!=typeof e)throw new Be(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ua.Cache=Gn;var za=So(function(e,t){var n=(t=1==t.length&&Wa(t[0])?Ut(t[0],Qt(li())):Ut(wr(t,1),Qt(li()))).length;return Jr(function(r){for(var o=-1,i=bn(r.length,n);++o<i;)r[o]=t[o].call(this,r[o]);return Tt(e,this,r)})}),La=Jr(function(e,t){var n=dn(t,ui(La));return Qo(e,u,o,t,n)}),ja=Jr(function(e,t){var n=dn(t,ui(ja));return Qo(e,l,o,t,n)}),Fa=oi(function(e,t){return Qo(e,f,o,o,o,t)});function Da(e,t){return e===t||e!=e&&t!=t}var $a=Go(Tr),Ka=Go(function(e,t){return e>=t}),qa=Pr(function(){return arguments}())?Pr:function(e){return ns(e)&&Me.call(e,\"callee\")&&!Ze.call(e,\"callee\")},Wa=r.isArray,Va=At?Qt(At):function(e){return ns(e)&&Ir(e)==O};function Ha(e){return null!=e&&es(e.length)&&!Xa(e)}function Ga(e){return ns(e)&&Ha(e)}var Za=vt||yc,Ya=St?Qt(St):function(e){return ns(e)&&Ir(e)==A};function Ja(e){if(!ns(e))return!1;var t=Ir(e);return t==S||\"[object DOMException]\"==t||\"string\"==typeof e.message&&\"string\"==typeof e.name&&!is(e)}function Xa(e){if(!ts(e))return!1;var t=Ir(e);return t==E||t==x||\"[object AsyncFunction]\"==t||\"[object Proxy]\"==t}function Qa(e){return\"number\"==typeof e&&e==gs(e)}function es(e){return\"number\"==typeof e&&e>-1&&e%1==0&&e<=p}function ts(e){var t=typeof e;return null!=e&&(\"object\"==t||\"function\"==t)}function ns(e){return null!=e&&\"object\"==typeof e}var rs=Et?Qt(Et):function(e){return ns(e)&&mi(e)==k};function os(e){return\"number\"==typeof e||ns(e)&&Ir(e)==I}function is(e){if(!ns(e)||Ir(e)!=T)return!1;var t=He(e);if(null===t)return!0;var n=Me.call(t,\"constructor\")&&t.constructor;return\"function\"==typeof n&&n instanceof n&&Ue.call(n)==Fe}var as=xt?Qt(xt):function(e){return ns(e)&&Ir(e)==C};var ss=kt?Qt(kt):function(e){return ns(e)&&mi(e)==B};function cs(e){return\"string\"==typeof e||!Wa(e)&&ns(e)&&Ir(e)==R}function us(e){return\"symbol\"==typeof e||ns(e)&&Ir(e)==P}var ls=It?Qt(It):function(e){return ns(e)&&es(e.length)&&!!ct[Ir(e)]};var ds=Go(jr),fs=Go(function(e,t){return e<=t});function hs(e){if(!e)return[];if(Ha(e))return cs(e)?gn(e):Ro(e);if(Xe&&e[Xe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Xe]());var t=mi(e);return(t==k?un:t==B?fn:Ds)(e)}function ps(e){return e?(e=ys(e))===h||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function gs(e){var t=ps(e),n=t%1;return t==t?n?t-n:t:0}function ms(e){return e?cr(gs(e),0,m):0}function ys(e){if(\"number\"==typeof e)return e;if(us(e))return g;if(ts(e)){var t=\"function\"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+\"\":t}if(\"string\"!=typeof e)return 0===e?e:+e;e=Xt(e);var n=ye.test(e);return n||ve.test(e)?ft(e.slice(2),n?2:8):me.test(e)?g:+e}function ws(e){return Po(e,Ns(e))}function vs(e){return null==e?\"\":lo(e)}var bs=Oo(function(e,t){if(ki(t)||Ha(t))Po(t,Ps(t),e);else for(var n in t)Me.call(t,n)&&nr(e,n,t[n])}),As=Oo(function(e,t){Po(t,Ns(t),e)}),Ss=Oo(function(e,t,n,r){Po(t,Ns(t),e,r)}),Es=Oo(function(e,t,n,r){Po(t,Ps(t),e,r)}),xs=oi(sr);var ks=Jr(function(e,t){e=Te(e);var n=-1,r=t.length,i=r>2?t[2]:o;for(i&&Ai(t[0],t[1],i)&&(r=1);++n<r;)for(var a=t[n],s=Ns(a),c=-1,u=s.length;++c<u;){var l=s[c],d=e[l];(d===o||Da(d,Ne[l])&&!Me.call(e,l))&&(e[l]=a[l])}return e}),Is=Jr(function(e){return e.push(o,ti),Tt(Us,o,e)});function Ts(e,t,n){var r=null==e?o:xr(e,t);return r===o?n:r}function _s(e,t){return null!=e&&yi(e,t,Cr)}var Cs=Ko(function(e,t,n){null!=t&&\"function\"!=typeof t.toString&&(t=je.call(t)),e[t]=n},tc(oc)),Bs=Ko(function(e,t,n){null!=t&&\"function\"!=typeof t.toString&&(t=je.call(t)),Me.call(e,t)?e[t].push(n):e[t]=[n]},li),Rs=Jr(Rr);function Ps(e){return Ha(e)?Jn(e):zr(e)}function Ns(e){return Ha(e)?Jn(e,!0):Lr(e)}var Os=Oo(function(e,t,n){Kr(e,t,n)}),Us=Oo(function(e,t,n,r){Kr(e,t,n,r)}),Ms=oi(function(e,t){var n={};if(null==e)return n;var r=!1;t=Ut(t,function(t){return t=Ao(t,e),r||(r=t.length>1),t}),Po(e,ai(e),n),r&&(n=ur(n,7,ni));for(var o=t.length;o--;)ho(n,t[o]);return n});var zs=oi(function(e,t){return null==e?{}:function(e,t){return Vr(e,t,function(t,n){return _s(e,n)})}(e,t)});function Ls(e,t){if(null==e)return{};var n=Ut(ai(e),function(e){return[e]});return t=li(t),Vr(e,n,function(e,n){return t(e,n[0])})}var js=Xo(Ps),Fs=Xo(Ns);function Ds(e){return null==e?[]:en(e,Ps(e))}var $s=Lo(function(e,t,n){return t=t.toLowerCase(),e+(n?Ks(t):t)});function Ks(e){return Js(vs(e).toLowerCase())}function qs(e){return(e=vs(e))&&e.replace(Ae,on).replace(tt,\"\")}var Ws=Lo(function(e,t,n){return e+(n?\"-\":\"\")+t.toLowerCase()}),Vs=Lo(function(e,t,n){return e+(n?\" \":\"\")+t.toLowerCase()}),Hs=zo(\"toLowerCase\");var Gs=Lo(function(e,t,n){return e+(n?\"_\":\"\")+t.toLowerCase()});var Zs=Lo(function(e,t,n){return e+(n?\" \":\"\")+Js(t)});var Ys=Lo(function(e,t,n){return e+(n?\" \":\"\")+t.toUpperCase()}),Js=zo(\"toUpperCase\");function Xs(e,t,n){return e=vs(e),(t=n?o:t)===o?function(e){return it.test(e)}(e)?function(e){return e.match(rt)||[]}(e):function(e){return e.match(de)||[]}(e):e.match(t)||[]}var Qs=Jr(function(e,t){try{return Tt(e,o,t)}catch(e){return Ja(e)?e:new xe(e)}}),ec=oi(function(e,t){return Ct(t,function(t){t=Li(t),ar(e,t,Ba(e[t],e))}),e});function tc(e){return function(){return e}}var nc=Do(),rc=Do(!0);function oc(e){return e}function ic(e){return Mr(\"function\"==typeof e?e:ur(e,1))}var ac=Jr(function(e,t){return function(n){return Rr(n,e,t)}}),sc=Jr(function(e,t){return function(n){return Rr(e,n,t)}});function cc(e,t,n){var r=Ps(t),o=Er(t,r);null!=n||ts(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=Er(t,Ps(t)));var i=!(ts(n)&&\"chain\"in n&&!n.chain),a=Xa(e);return Ct(o,function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__);return(n.__actions__=Ro(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Mt([this.value()],arguments))})}),e}function uc(){}var lc=Wo(Ut),dc=Wo(Rt),fc=Wo(jt);function hc(e){return Si(e)?Ht(Li(e)):function(e){return function(t){return xr(t,e)}}(e)}var pc=Ho(),gc=Ho(!0);function mc(){return[]}function yc(){return!1}var wc=qo(function(e,t){return e+t},0),vc=Yo(\"ceil\"),bc=qo(function(e,t){return e/t},1),Ac=Yo(\"floor\");var Sc,Ec=qo(function(e,t){return e*t},1),xc=Yo(\"round\"),kc=qo(function(e,t){return e-t},0);return Dn.after=function(e,t){if(\"function\"!=typeof t)throw new Be(i);return e=gs(e),function(){if(--e<1)return t.apply(this,arguments)}},Dn.ary=_a,Dn.assign=bs,Dn.assignIn=As,Dn.assignInWith=Ss,Dn.assignWith=Es,Dn.at=xs,Dn.before=Ca,Dn.bind=Ba,Dn.bindAll=ec,Dn.bindKey=Ra,Dn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Wa(e)?e:[e]},Dn.chain=ha,Dn.chunk=function(e,t,n){t=(n?Ai(e,t,n):t===o)?1:vn(gs(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var a=0,s=0,c=r(pt(i/t));a<i;)c[s++]=oo(e,a,a+=t);return c},Dn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,o=[];++t<n;){var i=e[t];i&&(o[r++]=i)}return o},Dn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],o=e;o--;)t[o-1]=arguments[o];return Mt(Wa(n)?Ro(n):[n],wr(t,1))},Dn.cond=function(e){var t=null==e?0:e.length,n=li();return e=t?Ut(e,function(e){if(\"function\"!=typeof e[1])throw new Be(i);return[n(e[0]),e[1]]}):[],Jr(function(n){for(var r=-1;++r<t;){var o=e[r];if(Tt(o[0],this,n))return Tt(o[1],this,n)}})},Dn.conforms=function(e){return function(e){var t=Ps(e);return function(n){return lr(n,e,t)}}(ur(e,1))},Dn.constant=tc,Dn.countBy=ma,Dn.create=function(e,t){var n=$n(e);return null==t?n:ir(n,t)},Dn.curry=function e(t,n,r){var i=Qo(t,8,o,o,o,o,o,n=r?o:n);return i.placeholder=e.placeholder,i},Dn.curryRight=function e(t,n,r){var i=Qo(t,c,o,o,o,o,o,n=r?o:n);return i.placeholder=e.placeholder,i},Dn.debounce=Pa,Dn.defaults=ks,Dn.defaultsDeep=Is,Dn.defer=Na,Dn.delay=Oa,Dn.difference=Di,Dn.differenceBy=$i,Dn.differenceWith=Ki,Dn.drop=function(e,t,n){var r=null==e?0:e.length;return r?oo(e,(t=n||t===o?1:gs(t))<0?0:t,r):[]},Dn.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?oo(e,0,(t=r-(t=n||t===o?1:gs(t)))<0?0:t):[]},Dn.dropRightWhile=function(e,t){return e&&e.length?go(e,li(t,3),!0,!0):[]},Dn.dropWhile=function(e,t){return e&&e.length?go(e,li(t,3),!0):[]},Dn.fill=function(e,t,n,r){var i=null==e?0:e.length;return i?(n&&\"number\"!=typeof n&&Ai(e,t,n)&&(n=0,r=i),function(e,t,n,r){var i=e.length;for((n=gs(n))<0&&(n=-n>i?0:i+n),(r=r===o||r>i?i:gs(r))<0&&(r+=i),r=n>r?0:ms(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Dn.filter=function(e,t){return(Wa(e)?Pt:yr)(e,li(t,3))},Dn.flatMap=function(e,t){return wr(xa(e,t),1)},Dn.flatMapDeep=function(e,t){return wr(xa(e,t),h)},Dn.flatMapDepth=function(e,t,n){return n=n===o?1:gs(n),wr(xa(e,t),n)},Dn.flatten=Vi,Dn.flattenDeep=function(e){return(null==e?0:e.length)?wr(e,h):[]},Dn.flattenDepth=function(e,t){return(null==e?0:e.length)?wr(e,t=t===o?1:gs(t)):[]},Dn.flip=function(e){return Qo(e,512)},Dn.flow=nc,Dn.flowRight=rc,Dn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var o=e[t];ar(r,o[0],o[1])}return r},Dn.functions=function(e){return null==e?[]:Er(e,Ps(e))},Dn.functionsIn=function(e){return null==e?[]:Er(e,Ns(e))},Dn.groupBy=Aa,Dn.initial=function(e){return(null==e?0:e.length)?oo(e,0,-1):[]},Dn.intersection=Gi,Dn.intersectionBy=Zi,Dn.intersectionWith=Yi,Dn.invert=Cs,Dn.invertBy=Bs,Dn.invokeMap=Sa,Dn.iteratee=ic,Dn.keyBy=Ea,Dn.keys=Ps,Dn.keysIn=Ns,Dn.map=xa,Dn.mapKeys=function(e,t){var n={};return t=li(t,3),Ar(e,function(e,r,o){ar(n,t(e,r,o),e)}),n},Dn.mapValues=function(e,t){var n={};return t=li(t,3),Ar(e,function(e,r,o){ar(n,r,t(e,r,o))}),n},Dn.matches=function(e){return Dr(ur(e,1))},Dn.matchesProperty=function(e,t){return $r(e,ur(t,1))},Dn.memoize=Ua,Dn.merge=Os,Dn.mergeWith=Us,Dn.method=ac,Dn.methodOf=sc,Dn.mixin=cc,Dn.negate=Ma,Dn.nthArg=function(e){return e=gs(e),Jr(function(t){return qr(t,e)})},Dn.omit=Ms,Dn.omitBy=function(e,t){return Ls(e,Ma(li(t)))},Dn.once=function(e){return Ca(2,e)},Dn.orderBy=function(e,t,n,r){return null==e?[]:(Wa(t)||(t=null==t?[]:[t]),Wa(n=r?o:n)||(n=null==n?[]:[n]),Wr(e,t,n))},Dn.over=lc,Dn.overArgs=za,Dn.overEvery=dc,Dn.overSome=fc,Dn.partial=La,Dn.partialRight=ja,Dn.partition=ka,Dn.pick=zs,Dn.pickBy=Ls,Dn.property=hc,Dn.propertyOf=function(e){return function(t){return null==e?o:xr(e,t)}},Dn.pull=Xi,Dn.pullAll=Qi,Dn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Hr(e,t,li(n,2)):e},Dn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Hr(e,t,o,n):e},Dn.pullAt=ea,Dn.range=pc,Dn.rangeRight=gc,Dn.rearg=Fa,Dn.reject=function(e,t){return(Wa(e)?Pt:yr)(e,Ma(li(t,3)))},Dn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,o=[],i=e.length;for(t=li(t,3);++r<i;){var a=e[r];t(a,r,e)&&(n.push(a),o.push(r))}return Gr(e,o),n},Dn.rest=function(e,t){if(\"function\"!=typeof e)throw new Be(i);return Jr(e,t=t===o?t:gs(t))},Dn.reverse=ta,Dn.sampleSize=function(e,t,n){return t=(n?Ai(e,t,n):t===o)?1:gs(t),(Wa(e)?Qn:Qr)(e,t)},Dn.set=function(e,t,n){return null==e?e:eo(e,t,n)},Dn.setWith=function(e,t,n,r){return r=\"function\"==typeof r?r:o,null==e?e:eo(e,t,n,r)},Dn.shuffle=function(e){return(Wa(e)?er:ro)(e)},Dn.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&\"number\"!=typeof n&&Ai(e,t,n)?(t=0,n=r):(t=null==t?0:gs(t),n=n===o?r:gs(n)),oo(e,t,n)):[]},Dn.sortBy=Ia,Dn.sortedUniq=function(e){return e&&e.length?co(e):[]},Dn.sortedUniqBy=function(e,t){return e&&e.length?co(e,li(t,2)):[]},Dn.split=function(e,t,n){return n&&\"number\"!=typeof n&&Ai(e,t,n)&&(t=n=o),(n=n===o?m:n>>>0)?(e=vs(e))&&(\"string\"==typeof t||null!=t&&!as(t))&&!(t=lo(t))&&cn(e)?Eo(gn(e),0,n):e.split(t,n):[]},Dn.spread=function(e,t){if(\"function\"!=typeof e)throw new Be(i);return t=null==t?0:vn(gs(t),0),Jr(function(n){var r=n[t],o=Eo(n,0,t);return r&&Mt(o,r),Tt(e,this,o)})},Dn.tail=function(e){var t=null==e?0:e.length;return t?oo(e,1,t):[]},Dn.take=function(e,t,n){return e&&e.length?oo(e,0,(t=n||t===o?1:gs(t))<0?0:t):[]},Dn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?oo(e,(t=r-(t=n||t===o?1:gs(t)))<0?0:t,r):[]},Dn.takeRightWhile=function(e,t){return e&&e.length?go(e,li(t,3),!1,!0):[]},Dn.takeWhile=function(e,t){return e&&e.length?go(e,li(t,3)):[]},Dn.tap=function(e,t){return t(e),e},Dn.throttle=function(e,t,n){var r=!0,o=!0;if(\"function\"!=typeof e)throw new Be(i);return ts(n)&&(r=\"leading\"in n?!!n.leading:r,o=\"trailing\"in n?!!n.trailing:o),Pa(e,t,{leading:r,maxWait:t,trailing:o})},Dn.thru=pa,Dn.toArray=hs,Dn.toPairs=js,Dn.toPairsIn=Fs,Dn.toPath=function(e){return Wa(e)?Ut(e,Li):us(e)?[e]:Ro(zi(vs(e)))},Dn.toPlainObject=ws,Dn.transform=function(e,t,n){var r=Wa(e),o=r||Za(e)||ls(e);if(t=li(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:ts(e)&&Xa(i)?$n(He(e)):{}}return(o?Ct:Ar)(e,function(e,r,o){return t(n,e,r,o)}),n},Dn.unary=function(e){return _a(e,1)},Dn.union=na,Dn.unionBy=ra,Dn.unionWith=oa,Dn.uniq=function(e){return e&&e.length?fo(e):[]},Dn.uniqBy=function(e,t){return e&&e.length?fo(e,li(t,2)):[]},Dn.uniqWith=function(e,t){return t=\"function\"==typeof t?t:o,e&&e.length?fo(e,o,t):[]},Dn.unset=function(e,t){return null==e||ho(e,t)},Dn.unzip=ia,Dn.unzipWith=aa,Dn.update=function(e,t,n){return null==e?e:po(e,t,bo(n))},Dn.updateWith=function(e,t,n,r){return r=\"function\"==typeof r?r:o,null==e?e:po(e,t,bo(n),r)},Dn.values=Ds,Dn.valuesIn=function(e){return null==e?[]:en(e,Ns(e))},Dn.without=sa,Dn.words=Xs,Dn.wrap=function(e,t){return La(bo(t),e)},Dn.xor=ca,Dn.xorBy=ua,Dn.xorWith=la,Dn.zip=da,Dn.zipObject=function(e,t){return wo(e||[],t||[],nr)},Dn.zipObjectDeep=function(e,t){return wo(e||[],t||[],eo)},Dn.zipWith=fa,Dn.entries=js,Dn.entriesIn=Fs,Dn.extend=As,Dn.extendWith=Ss,cc(Dn,Dn),Dn.add=wc,Dn.attempt=Qs,Dn.camelCase=$s,Dn.capitalize=Ks,Dn.ceil=vc,Dn.clamp=function(e,t,n){return n===o&&(n=t,t=o),n!==o&&(n=(n=ys(n))==n?n:0),t!==o&&(t=(t=ys(t))==t?t:0),cr(ys(e),t,n)},Dn.clone=function(e){return ur(e,4)},Dn.cloneDeep=function(e){return ur(e,5)},Dn.cloneDeepWith=function(e,t){return ur(e,5,t=\"function\"==typeof t?t:o)},Dn.cloneWith=function(e,t){return ur(e,4,t=\"function\"==typeof t?t:o)},Dn.conformsTo=function(e,t){return null==t||lr(e,t,Ps(t))},Dn.deburr=qs,Dn.defaultTo=function(e,t){return null==e||e!=e?t:e},Dn.divide=bc,Dn.endsWith=function(e,t,n){e=vs(e),t=lo(t);var r=e.length,i=n=n===o?r:cr(gs(n),0,r);return(n-=t.length)>=0&&e.slice(n,i)==t},Dn.eq=Da,Dn.escape=function(e){return(e=vs(e))&&J.test(e)?e.replace(Z,an):e},Dn.escapeRegExp=function(e){return(e=vs(e))&&ie.test(e)?e.replace(oe,\"\\\\$&\"):e},Dn.every=function(e,t,n){var r=Wa(e)?Rt:gr;return n&&Ai(e,t,n)&&(t=o),r(e,li(t,3))},Dn.find=ya,Dn.findIndex=qi,Dn.findKey=function(e,t){return Dt(e,li(t,3),Ar)},Dn.findLast=wa,Dn.findLastIndex=Wi,Dn.findLastKey=function(e,t){return Dt(e,li(t,3),Sr)},Dn.floor=Ac,Dn.forEach=va,Dn.forEachRight=ba,Dn.forIn=function(e,t){return null==e?e:vr(e,li(t,3),Ns)},Dn.forInRight=function(e,t){return null==e?e:br(e,li(t,3),Ns)},Dn.forOwn=function(e,t){return e&&Ar(e,li(t,3))},Dn.forOwnRight=function(e,t){return e&&Sr(e,li(t,3))},Dn.get=Ts,Dn.gt=$a,Dn.gte=Ka,Dn.has=function(e,t){return null!=e&&yi(e,t,_r)},Dn.hasIn=_s,Dn.head=Hi,Dn.identity=oc,Dn.includes=function(e,t,n,r){e=Ha(e)?e:Ds(e),n=n&&!r?gs(n):0;var o=e.length;return n<0&&(n=vn(o+n,0)),cs(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&Kt(e,t,n)>-1},Dn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:gs(n);return o<0&&(o=vn(r+o,0)),Kt(e,t,o)},Dn.inRange=function(e,t,n){return t=ps(t),n===o?(n=t,t=0):n=ps(n),function(e,t,n){return e>=bn(t,n)&&e<vn(t,n)}(e=ys(e),t,n)},Dn.invoke=Rs,Dn.isArguments=qa,Dn.isArray=Wa,Dn.isArrayBuffer=Va,Dn.isArrayLike=Ha,Dn.isArrayLikeObject=Ga,Dn.isBoolean=function(e){return!0===e||!1===e||ns(e)&&Ir(e)==b},Dn.isBuffer=Za,Dn.isDate=Ya,Dn.isElement=function(e){return ns(e)&&1===e.nodeType&&!is(e)},Dn.isEmpty=function(e){if(null==e)return!0;if(Ha(e)&&(Wa(e)||\"string\"==typeof e||\"function\"==typeof e.splice||Za(e)||ls(e)||qa(e)))return!e.length;var t=mi(e);if(t==k||t==B)return!e.size;if(ki(e))return!zr(e).length;for(var n in e)if(Me.call(e,n))return!1;return!0},Dn.isEqual=function(e,t){return Nr(e,t)},Dn.isEqualWith=function(e,t,n){var r=(n=\"function\"==typeof n?n:o)?n(e,t):o;return r===o?Nr(e,t,o,n):!!r},Dn.isError=Ja,Dn.isFinite=function(e){return\"number\"==typeof e&&bt(e)},Dn.isFunction=Xa,Dn.isInteger=Qa,Dn.isLength=es,Dn.isMap=rs,Dn.isMatch=function(e,t){return e===t||Or(e,t,fi(t))},Dn.isMatchWith=function(e,t,n){return n=\"function\"==typeof n?n:o,Or(e,t,fi(t),n)},Dn.isNaN=function(e){return os(e)&&e!=+e},Dn.isNative=function(e){if(xi(e))throw new xe(\"Unsupported core-js use. Try https://npms.io/search?q=ponyfill.\");return Ur(e)},Dn.isNil=function(e){return null==e},Dn.isNull=function(e){return null===e},Dn.isNumber=os,Dn.isObject=ts,Dn.isObjectLike=ns,Dn.isPlainObject=is,Dn.isRegExp=as,Dn.isSafeInteger=function(e){return Qa(e)&&e>=-9007199254740991&&e<=p},Dn.isSet=ss,Dn.isString=cs,Dn.isSymbol=us,Dn.isTypedArray=ls,Dn.isUndefined=function(e){return e===o},Dn.isWeakMap=function(e){return ns(e)&&mi(e)==N},Dn.isWeakSet=function(e){return ns(e)&&\"[object WeakSet]\"==Ir(e)},Dn.join=function(e,t){return null==e?\"\":Ft.call(e,t)},Dn.kebabCase=Ws,Dn.last=Ji,Dn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return n!==o&&(i=(i=gs(n))<0?vn(r+i,0):bn(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):$t(e,Wt,i,!0)},Dn.lowerCase=Vs,Dn.lowerFirst=Hs,Dn.lt=ds,Dn.lte=fs,Dn.max=function(e){return e&&e.length?mr(e,oc,Tr):o},Dn.maxBy=function(e,t){return e&&e.length?mr(e,li(t,2),Tr):o},Dn.mean=function(e){return Vt(e,oc)},Dn.meanBy=function(e,t){return Vt(e,li(t,2))},Dn.min=function(e){return e&&e.length?mr(e,oc,jr):o},Dn.minBy=function(e,t){return e&&e.length?mr(e,li(t,2),jr):o},Dn.stubArray=mc,Dn.stubFalse=yc,Dn.stubObject=function(){return{}},Dn.stubString=function(){return\"\"},Dn.stubTrue=function(){return!0},Dn.multiply=Ec,Dn.nth=function(e,t){return e&&e.length?qr(e,gs(t)):o},Dn.noConflict=function(){return gt._===this&&(gt._=De),this},Dn.noop=uc,Dn.now=Ta,Dn.pad=function(e,t,n){e=vs(e);var r=(t=gs(t))?pn(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return Vo(mt(o),n)+e+Vo(pt(o),n)},Dn.padEnd=function(e,t,n){e=vs(e);var r=(t=gs(t))?pn(e):0;return t&&r<t?e+Vo(t-r,n):e},Dn.padStart=function(e,t,n){e=vs(e);var r=(t=gs(t))?pn(e):0;return t&&r<t?Vo(t-r,n)+e:e},Dn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),Sn(vs(e).replace(ae,\"\"),t||0)},Dn.random=function(e,t,n){if(n&&\"boolean\"!=typeof n&&Ai(e,t,n)&&(t=n=o),n===o&&(\"boolean\"==typeof t?(n=t,t=o):\"boolean\"==typeof e&&(n=e,e=o)),e===o&&t===o?(e=0,t=1):(e=ps(e),t===o?(t=e,e=0):t=ps(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var i=En();return bn(e+i*(t-e+dt(\"1e-\"+((i+\"\").length-1))),t)}return Zr(e,t)},Dn.reduce=function(e,t,n){var r=Wa(e)?zt:Zt,o=arguments.length<3;return r(e,li(t,4),n,o,hr)},Dn.reduceRight=function(e,t,n){var r=Wa(e)?Lt:Zt,o=arguments.length<3;return r(e,li(t,4),n,o,pr)},Dn.repeat=function(e,t,n){return t=(n?Ai(e,t,n):t===o)?1:gs(t),Yr(vs(e),t)},Dn.replace=function(){var e=arguments,t=vs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Dn.result=function(e,t,n){var r=-1,i=(t=Ao(t,e)).length;for(i||(i=1,e=o);++r<i;){var a=null==e?o:e[Li(t[r])];a===o&&(r=i,a=n),e=Xa(a)?a.call(e):a}return e},Dn.round=xc,Dn.runInContext=e,Dn.sample=function(e){return(Wa(e)?Xn:Xr)(e)},Dn.size=function(e){if(null==e)return 0;if(Ha(e))return cs(e)?pn(e):e.length;var t=mi(e);return t==k||t==B?e.size:zr(e).length},Dn.snakeCase=Gs,Dn.some=function(e,t,n){var r=Wa(e)?jt:io;return n&&Ai(e,t,n)&&(t=o),r(e,li(t,3))},Dn.sortedIndex=function(e,t){return ao(e,t)},Dn.sortedIndexBy=function(e,t,n){return so(e,t,li(n,2))},Dn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=ao(e,t);if(r<n&&Da(e[r],t))return r}return-1},Dn.sortedLastIndex=function(e,t){return ao(e,t,!0)},Dn.sortedLastIndexBy=function(e,t,n){return so(e,t,li(n,2),!0)},Dn.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=ao(e,t,!0)-1;if(Da(e[n],t))return n}return-1},Dn.startCase=Zs,Dn.startsWith=function(e,t,n){return e=vs(e),n=null==n?0:cr(gs(n),0,e.length),t=lo(t),e.slice(n,n+t.length)==t},Dn.subtract=kc,Dn.sum=function(e){return e&&e.length?Yt(e,oc):0},Dn.sumBy=function(e,t){return e&&e.length?Yt(e,li(t,2)):0},Dn.template=function(e,t,n){var r=Dn.templateSettings;n&&Ai(e,t,n)&&(t=o),e=vs(e),t=Es({},t,r,ei);var i=Es({},t.imports,r.imports,ei),a=Ps(i),s=en(i,a);Ct(a,function(e){if(fe.test(e))throw new xe(\"Invalid `imports` option passed into `_.template`\")});var c,u,l=0,d=t.interpolate||Se,f=\"__p += '\",h=_e((t.escape||Se).source+\"|\"+d.source+\"|\"+(d===ee?pe:Se).source+\"|\"+(t.evaluate||Se).source+\"|$\",\"g\"),p=\"//# sourceURL=\"+(Me.call(t,\"sourceURL\")?(t.sourceURL+\"\").replace(/\\s/g,\" \"):\"lodash.templateSources[\"+ ++st+\"]\")+\"\\n\";e.replace(h,function(t,n,r,o,i,a){return r||(r=o),f+=e.slice(l,a).replace(Ee,sn),n&&(c=!0,f+=\"' +\\n__e(\"+n+\") +\\n'\"),i&&(u=!0,f+=\"';\\n\"+i+\";\\n__p += '\"),r&&(f+=\"' +\\n((__t = (\"+r+\")) == null ? '' : __t) +\\n'\"),l=a+t.length,t}),f+=\"';\\n\";var g=Me.call(t,\"variable\")&&t.variable;if(g){if(fe.test(g))throw new xe(\"Invalid `variable` option passed into `_.template`\")}else f=\"with (obj) {\\n\"+f+\"\\n}\\n\";f=(u?f.replace(W,\"\"):f).replace(V,\"$1\").replace(H,\"$1;\"),f=\"function(\"+(g||\"obj\")+\") {\\n\"+(g?\"\":\"obj || (obj = {});\\n\")+\"var __t, __p = ''\"+(c?\", __e = _.escape\":\"\")+(u?\", __j = Array.prototype.join;\\nfunction print() { __p += __j.call(arguments, '') }\\n\":\";\\n\")+f+\"return __p\\n}\";var m=Qs(function(){return ke(a,p+\"return \"+f).apply(o,s)});if(m.source=f,Ja(m))throw m;return m},Dn.times=function(e,t){if((e=gs(e))<1||e>p)return[];var n=m,r=bn(e,m);t=li(t),e-=m;for(var o=Jt(r,t);++n<e;)t(n);return o},Dn.toFinite=ps,Dn.toInteger=gs,Dn.toLength=ms,Dn.toLower=function(e){return vs(e).toLowerCase()},Dn.toNumber=ys,Dn.toSafeInteger=function(e){return e?cr(gs(e),-9007199254740991,p):0===e?e:0},Dn.toString=vs,Dn.toUpper=function(e){return vs(e).toUpperCase()},Dn.trim=function(e,t,n){if((e=vs(e))&&(n||t===o))return Xt(e);if(!e||!(t=lo(t)))return e;var r=gn(e),i=gn(t);return Eo(r,nn(r,i),rn(r,i)+1).join(\"\")},Dn.trimEnd=function(e,t,n){if((e=vs(e))&&(n||t===o))return e.slice(0,mn(e)+1);if(!e||!(t=lo(t)))return e;var r=gn(e);return Eo(r,0,rn(r,gn(t))+1).join(\"\")},Dn.trimStart=function(e,t,n){if((e=vs(e))&&(n||t===o))return e.replace(ae,\"\");if(!e||!(t=lo(t)))return e;var r=gn(e);return Eo(r,nn(r,gn(t))).join(\"\")},Dn.truncate=function(e,t){var n=30,r=\"...\";if(ts(t)){var i=\"separator\"in t?t.separator:i;n=\"length\"in t?gs(t.length):n,r=\"omission\"in t?lo(t.omission):r}var a=(e=vs(e)).length;if(cn(e)){var s=gn(e);a=s.length}if(n>=a)return e;var c=n-pn(r);if(c<1)return r;var u=s?Eo(s,0,c).join(\"\"):e.slice(0,c);if(i===o)return u+r;if(s&&(c+=u.length-c),as(i)){if(e.slice(c).search(i)){var l,d=u;for(i.global||(i=_e(i.source,vs(ge.exec(i))+\"g\")),i.lastIndex=0;l=i.exec(d);)var f=l.index;u=u.slice(0,f===o?c:f)}}else if(e.indexOf(lo(i),c)!=c){var h=u.lastIndexOf(i);h>-1&&(u=u.slice(0,h))}return u+r},Dn.unescape=function(e){return(e=vs(e))&&Y.test(e)?e.replace(G,yn):e},Dn.uniqueId=function(e){var t=++ze;return vs(e)+t},Dn.upperCase=Ys,Dn.upperFirst=Js,Dn.each=va,Dn.eachRight=ba,Dn.first=Hi,cc(Dn,(Sc={},Ar(Dn,function(e,t){Me.call(Dn.prototype,t)||(Sc[t]=e)}),Sc),{chain:!1}),Dn.VERSION=\"4.18.1\",Ct([\"bind\",\"bindKey\",\"curry\",\"curryRight\",\"partial\",\"partialRight\"],function(e){Dn[e].placeholder=Dn}),Ct([\"drop\",\"take\"],function(e,t){Wn.prototype[e]=function(n){n=n===o?1:vn(gs(n),0);var r=this.__filtered__&&!t?new Wn(this):this.clone();return r.__filtered__?r.__takeCount__=bn(n,r.__takeCount__):r.__views__.push({size:bn(n,m),type:e+(r.__dir__<0?\"Right\":\"\")}),r},Wn.prototype[e+\"Right\"]=function(t){return this.reverse()[e](t).reverse()}}),Ct([\"filter\",\"map\",\"takeWhile\"],function(e,t){var n=t+1,r=1==n||3==n;Wn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:li(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),Ct([\"head\",\"last\"],function(e,t){var n=\"take\"+(t?\"Right\":\"\");Wn.prototype[e]=function(){return this[n](1).value()[0]}}),Ct([\"initial\",\"tail\"],function(e,t){var n=\"drop\"+(t?\"\":\"Right\");Wn.prototype[e]=function(){return this.__filtered__?new Wn(this):this[n](1)}}),Wn.prototype.compact=function(){return this.filter(oc)},Wn.prototype.find=function(e){return this.filter(e).head()},Wn.prototype.findLast=function(e){return this.reverse().find(e)},Wn.prototype.invokeMap=Jr(function(e,t){return\"function\"==typeof e?new Wn(this):this.map(function(n){return Rr(n,e,t)})}),Wn.prototype.reject=function(e){return this.filter(Ma(li(e)))},Wn.prototype.slice=function(e,t){e=gs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Wn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==o&&(n=(t=gs(t))<0?n.dropRight(-t):n.take(t-e)),n)},Wn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Wn.prototype.toArray=function(){return this.take(m)},Ar(Wn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=Dn[r?\"take\"+(\"last\"==t?\"Right\":\"\"):t],a=r||/^find/.test(t);i&&(Dn.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,c=t instanceof Wn,u=s[0],l=c||Wa(t),d=function(e){var t=i.apply(Dn,Mt([e],s));return r&&f?t[0]:t};l&&n&&\"function\"==typeof u&&1!=u.length&&(c=l=!1);var f=this.__chain__,h=!!this.__actions__.length,p=a&&!f,g=c&&!h;if(!a&&l){t=g?t:new Wn(this);var m=e.apply(t,s);return m.__actions__.push({func:pa,args:[d],thisArg:o}),new qn(m,f)}return p&&g?e.apply(this,s):(m=this.thru(d),p?r?m.value()[0]:m.value():m)})}),Ct([\"pop\",\"push\",\"shift\",\"sort\",\"splice\",\"unshift\"],function(e){var t=Re[e],n=/^(?:push|sort|unshift)$/.test(e)?\"tap\":\"thru\",r=/^(?:pop|shift)$/.test(e);Dn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(Wa(o)?o:[],e)}return this[n](function(n){return t.apply(Wa(n)?n:[],e)})}}),Ar(Wn.prototype,function(e,t){var n=Dn[t];if(n){var r=n.name+\"\";Me.call(Pn,r)||(Pn[r]=[]),Pn[r].push({name:t,func:n})}}),Pn[$o(o,2).name]=[{name:\"wrapper\",func:o}],Wn.prototype.clone=function(){var e=new Wn(this.__wrapped__);return e.__actions__=Ro(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ro(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ro(this.__views__),e},Wn.prototype.reverse=function(){if(this.__filtered__){var e=new Wn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Wn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Wa(e),r=t<0,o=n?e.length:0,i=function(e,t,n){var r=-1,o=n.length;for(;++r<o;){var i=n[r],a=i.size;switch(i.type){case\"drop\":e+=a;break;case\"dropRight\":t-=a;break;case\"take\":t=bn(t,e+a);break;case\"takeRight\":e=vn(e,t-a)}}return{start:e,end:t}}(0,o,this.__views__),a=i.start,s=i.end,c=s-a,u=r?s:a-1,l=this.__iteratees__,d=l.length,f=0,h=bn(c,this.__takeCount__);if(!n||!r&&o==c&&h==c)return mo(e,this.__actions__);var p=[];e:for(;c--&&f<h;){for(var g=-1,m=e[u+=t];++g<d;){var y=l[g],w=y.iteratee,v=y.type,b=w(m);if(2==v)m=b;else if(!b){if(1==v)continue e;break e}}p[f++]=m}return p},Dn.prototype.at=ga,Dn.prototype.chain=function(){return ha(this)},Dn.prototype.commit=function(){return new qn(this.value(),this.__chain__)},Dn.prototype.next=function(){this.__values__===o&&(this.__values__=hs(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?o:this.__values__[this.__index__++]}},Dn.prototype.plant=function(e){for(var t,n=this;n instanceof Kn;){var r=Fi(n);r.__index__=0,r.__values__=o,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},Dn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Wn){var t=e;return this.__actions__.length&&(t=new Wn(this)),(t=t.reverse()).__actions__.push({func:pa,args:[ta],thisArg:o}),new qn(t,this.__chain__)}return this.thru(ta)},Dn.prototype.toJSON=Dn.prototype.valueOf=Dn.prototype.value=function(){return mo(this.__wrapped__,this.__actions__)},Dn.prototype.first=Dn.prototype.head,Xe&&(Dn.prototype[Xe]=function(){return this}),Dn}();gt._=wn,(r=function(){return wn}.call(t,n,t,e))===o||(e.exports=r)}.call(this)},9011(e,t,n){var r=n(8250);function o(e,t){if(\"function\"!=typeof e||null!=t&&\"function\"!=typeof t)throw new TypeError(\"Expected a function\");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},9071(e){e.exports=function(){}},4495(e,t,n){var r=n(8942);e.exports=function(){return r.Date.now()}},3282(e,t,n){var r=n(2762),o=n(8880),i=n(5187),a=n(6040);e.exports=function(e){return i(e)?r(a(e)):o(e)}},864(e,t,n){var r=n(8638),o=n(1439),i=o(function(e,t){return r(e,256,void 0,void 0,void 0,t)});e.exports=i},9306(e){e.exports=function(){return[]}},4772(e){e.exports=function(){return!1}},3301(e,t,n){var r=n(6131),o=1/0;e.exports=function(e){return e?(e=r(e))===o||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},7642(e,t,n){var r=n(3301);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},6131(e,t,n){var r=n(6403),o=n(1580),i=n(1187),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if(\"number\"==typeof e)return e;if(i(e))return NaN;if(o(e)){var t=\"function\"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+\"\":t}if(\"string\"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||c.test(e)?u(e.slice(2),n?2:8):a.test(e)?NaN:+e}},2613(e,t,n){var r=n(5111),o=n(4354),i=n(3142),a=n(1187),s=n(6493),c=n(6040),u=n(5243);e.exports=function(e){return i(e)?r(e,c):a(e)?[e]:o(s(u(e)))}},5243(e,t,n){var r=n(2291);e.exports=function(e){return null==e?\"\":r(e)}},3321(e,t,n){var r=n(7553),o=n(528),i=n(5962),a=n(3142),s=n(547),c=n(3410),u=Object.prototype.hasOwnProperty;function l(e){if(s(e)&&!a(e)&&!(e instanceof r)){if(e instanceof o)return e;if(u.call(e,\"__wrapped__\"))return c(e)}return new o(e)}l.prototype=i.prototype,l.prototype.constructor=l,e.exports=l}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r={};(()=>{\"use strict\";n.r(r),n.d(r,{onActive:()=>LN,onAssetHistoricalPrice:()=>PN,onAssetsConversion:()=>BN,onAssetsLookup:()=>CN,onAssetsMarketData:()=>DN,onClientRequest:()=>NN,onCronjob:()=>_N,onInactive:()=>jN,onInstall:()=>zN,onKeyringRequest:()=>IN,onNameLookup:()=>FN,onProtocolRequest:()=>RN,onRpcRequest:()=>kN,onStart:()=>UN,onUpdate:()=>MN,onUserInput:()=>TN,onWebSocketEvent:()=>ON});var e={};n.r(e),n.d(e,{compressPublicKey:()=>UA,compressedPublicKeyLength:()=>jA,curve:()=>TA,decompressPublicKey:()=>MA,deriveUnhardenedKeys:()=>RA,getPublicKey:()=>NA,isValidPrivateKey:()=>BA,masterNodeGenerationSpec:()=>LA,name:()=>_A,privateKeyLength:()=>zA,publicAdd:()=>OA,publicKeyLength:()=>PA,secret:()=>CA});var t={};n.r(t),n.d(t,{bytesToNumberLE:()=>HA,compressPublicKey:()=>JA,compressedPublicKeyLength:()=>tS,curve:()=>FA,decompressPublicKey:()=>XA,deriveUnhardenedKeys:()=>WA,getPublicKey:()=>ZA,isValidPrivateKey:()=>qA,masterNodeGenerationSpec:()=>eS,multiplyWithBase:()=>GA,name:()=>DA,privateKeyLength:()=>QA,publicAdd:()=>YA,publicKeyLength:()=>VA,secret:()=>$A});var o={};n.r(o),n.d(o,{compressPublicKey:()=>TS,compressedPublicKeyLength:()=>RS,curve:()=>vS,decompressPublicKey:()=>_S,deriveUnhardenedKeys:()=>SS,getPublicKey:()=>kS,isValidPrivateKey:()=>xS,masterNodeGenerationSpec:()=>BS,name:()=>bS,privateKeyLength:()=>CS,publicAdd:()=>IS,publicKeyLength:()=>ES,secret:()=>AS});var i={};n.r(i),n.d(i,{deriveChildKey:()=>XS,privateKeyToEthAddress:()=>YS,publicKeyToEthAddress:()=>JS});var a={};n.r(a),n.d(a,{bip39MnemonicToMultipath:()=>rE,createBip39KeyFromSeed:()=>iE,deriveChildKey:()=>oE,entropyToCip3MasterNode:()=>aE});var s={};n.r(s),n.d(s,{add:()=>hE,bigIntToBytes:()=>uE,bytesToBigInt:()=>cE,deriveChainCode:()=>bE,deriveChildKey:()=>EE,derivePrivateKey:()=>yE,derivePublicKey:()=>SE,getKeyExtension:()=>pE,mod2Pow256:()=>fE,padEnd32Bytes:()=>lE,toReversed:()=>sE,trunc28Mul8:()=>dE});var c={};n.r(c),n.d(c,{deriveChildKey:()=>xE});class u extends TypeError{constructor(e,t){let n;const{message:r,explanation:o,...i}=e,{path:a}=e,s=0===a.length?r:`At path: ${a.join(\".\")} -- ${r}`;super(o??s),null!=o&&(this.cause=s),Object.assign(this,i),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...t()])}}function l(e){return\"object\"==typeof e&&null!==e}function d(e){if(\"[object Object]\"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function f(e){return\"symbol\"==typeof e?e.toString():\"string\"==typeof e?JSON.stringify(e):`${e}`}function h(e,t,n,r){if(!0===e)return;!1===e?e={}:\"string\"==typeof e&&(e={message:e});const{path:o,branch:i}=t,{type:a}=n,{refinement:s,message:c=`Expected a value of type \\`${a}\\`${s?` with refinement \\`${s}\\``:\"\"}, but received: \\`${f(r)}\\``}=e;return{value:r,type:a,refinement:s,key:o[o.length-1],path:o,branch:i,...e,message:c}}function*p(e,t,n,r){(function(e){return l(e)&&\"function\"==typeof e[Symbol.iterator]})(e)||(e=[e]);for(const o of e){const e=h(o,t,n,r);e&&(yield e)}}function*g(e,t,n={}){const{path:r=[],branch:o=[e],coerce:i=!1,mask:a=!1}=n,s={path:r,branch:o};if(i&&(e=t.coercer(e,s),a&&\"type\"!==t.type&&l(t.schema)&&l(e)&&!Array.isArray(e)))for(const n in e)void 0===t.schema[n]&&delete e[n];let c=\"valid\";for(const r of t.validator(e,s))r.explanation=n.message,c=\"not_valid\",yield[r,void 0];for(let[u,d,f]of t.entries(e,s)){const t=g(d,f,{path:void 0===u?r:[...r,u],branch:void 0===u?o:[...o,d],coerce:i,mask:a,message:n.message});for(const n of t)n[0]?(c=null===n[0].refinement||void 0===n[0].refinement?\"not_valid\":\"not_refined\",yield[n[0],void 0]):i&&(d=n[1],void 0===u?e=d:e instanceof Map?e.set(u,d):e instanceof Set?e.add(d):l(e)&&(void 0!==d||u in e)&&(e[u]=d))}if(\"not_valid\"!==c)for(const r of t.refiner(e,s))r.explanation=n.message,c=\"not_refined\",yield[r,void 0];\"valid\"===c&&(yield[void 0,e])}class m{constructor(e){const{type:t,schema:n,validator:r,refiner:o,coercer:i=e=>e,entries:a=function*(){}}=e;this.type=t,this.schema=n,this.entries=a,this.coercer=i,this.validator=r?(e,t)=>p(r(e,t),t,this,e):()=>[],this.refiner=o?(e,t)=>p(o(e,t),t,this,e):()=>[];for(const t of Object.getOwnPropertySymbols(e))Object.defineProperty(this,t,Object.getOwnPropertyDescriptor(e,t))}assert(e,t){return v(e,this,t)}create(e,t){return b(e,this,t)}is(e){return A(e,this)}mask(e,t){return function(e,t,n){const r=S(e,t,{coerce:!0,mask:!0,message:n});if(r[0])throw r[0];return r[1]}(e,this,t)}validate(e,t={}){return S(e,this,t)}}const y=\"EXACT_OPTIONAL\";class w extends m{constructor(e){super({...e,type:`exact optional ${e.type}`}),this.brand=y}static isExactOptional(e){return l(e)&&\"brand\"in e&&e.brand===y}}function v(e,t,n){const r=S(e,t,{message:n});if(r[0])throw r[0]}function b(e,t,n){const r=S(e,t,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}function A(e,t){return!S(e,t)[0]}function S(e,t,n={}){const r=g(e,t,n),o=function(e){const{done:t,value:n}=e.next();return t?void 0:n}(r);if(o[0]){return[new u(o[0],function*(){for(const e of r)e[0]&&(yield e[0])}),void 0]}return[void 0,o[1]]}function E(e,t){return new m({type:e,schema:null,validator:t})}function x(e,t){return E(e,e=>\"string\"==typeof e&&t.test(e))}const k=x(\"UuidV4\",/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu),I=k,T=(E(\"Url\",e=>{try{const t=new URL(e);return\"http:\"===t.protocol||\"https:\"===t.protocol}catch{return!1}}),x(\"StringNumber\",/^\\d+(\\.\\d+)?$/u)),_=\"***\",C=Symbol.for(\"superstruct.sensitive\");function B(e,t){const n={...e};for(const e of t)e in n&&(n[e]=_);return n}function R(e){function*t(t){for(const n of t)yield{...n,value:_,message:`Expected a value of type \\`${e.type}\\`${n.refinement?` with refinement \\`${n.refinement}\\``:\"\"}, but received: \\`${_}\\``,branch:new Array(n.branch.length).fill(_)}}return new m({...e,validator:(n,r)=>t(e.validator(n,r)),refiner:(n,r)=>t(e.refiner(n,r)),*entries(t,n){for(const[r,o,i]of e.entries(t,n))yield[r,o,R(i)]}})}function P(e,t,n){function*r(e){for(const r of e){if(!l(t)){yield r;continue}const e=r.branch.indexOf(t);if(-1===e){yield r;continue}const o=[...r.branch];o[e]=B(t,n);for(let t=e-1;t>=0;t--){const e=o[t];if(!l(e))break;const n=r.branch[t+1],i=o[t+1];if(Array.isArray(e)){const r=e.indexOf(n);if(-1===r)break;const a=[...e];a[r]=i,o[t]=a}else if(e instanceof Map){let r,a=!1;for(const[t,o]of e)if(o===n){r=t,a=!0;break}if(!a)break;const s=new Map(e);s.set(r,i),o[t]=s}else{const r=Object.keys(e).find(t=>e[t]===n);if(void 0===r)break;o[t]={...e,[r]:i}}}yield{...r,branch:o}}}return new m({...e,validator:(t,n)=>r(e.validator(t,n)),refiner:(t,n)=>r(e.refiner(t,n)),*entries(r,o){for(const i of e.entries(r,o)){const[e,r,o]=i;yield[e,r,P(o,t,n)]}}})}function N(e){const t=R(e);return Object.defineProperty(t,C,{value:!0,enumerable:!0,configurable:!0,writable:!1}),t}function O(e,t){const n=Object.keys(t).filter(e=>{return void 0!==t[e]&&(n=t[e],Object.prototype.hasOwnProperty.call(n,C));var n});return 0===n.length?e:new m({...e,*entries(t,r){const o=r.branch[r.branch.length-1]??t;for(const i of e.entries(t,r)){const[e,t,r]=i;yield[e,t,P(r,o,n)]}}})}function U(e){return new m({type:\"array\",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[n,r]of t.entries())yield[n,r,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${f(e)}`})}function M(){return E(\"boolean\",e=>\"boolean\"==typeof e)}function z(e){const t={},n=e.map(e=>f(e)).join();for(const n of e)t[n]=n;return new m({type:\"enums\",schema:t,validator:t=>e.includes(t)||`Expected one of \\`${n}\\`, but received: ${f(t)}`})}function L(){return E(\"integer\",e=>\"number\"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${f(e)}`)}function j(e){const t=f(e),n=typeof e;return new m({type:\"literal\",schema:\"string\"===n||\"number\"===n||\"boolean\"===n?e:null,validator:n=>n===e||`Expected the literal \\`${t}\\`, but received: ${f(n)}`})}function F(){return E(\"never\",()=>!1)}function D(e){return new m({...e,validator:(t,n)=>null===t||e.validator(t,n),refiner:(t,n)=>null===t||e.refiner(t,n)})}function $(){return E(\"number\",e=>\"number\"==typeof e&&!isNaN(e)||`Expected a number, but received: ${f(e)}`)}function K(e){const t=e?Object.keys(e):[],n=F(),r=new m({type:\"object\",schema:e??null,*entries(r){if(e&&l(r)){const o=new Set(Object.keys(r));for(const n of t){o.delete(n);const t=e[n];w.isExactOptional(t)&&!Object.prototype.hasOwnProperty.call(r,n)||(yield[n,r[n],e[n]])}for(const e of o)yield[e,r[e],n]}},validator:e=>l(e)||`Expected an object, but received: ${f(e)}`,coercer:e=>l(e)?{...e}:e});return e?O(r,e):r}function q(e){return new m({...e,validator:(t,n)=>void 0===t||e.validator(t,n),refiner:(t,n)=>void 0===t||e.refiner(t,n)})}function W(e){return new w(e)}function V(e,t){return new m({type:\"record\",schema:null,*entries(n){if(l(n))for(const r in n){const o=n[r];yield[r,r,e],yield[r,o,t]}},validator:e=>l(e)||`Expected an object, but received: ${f(e)}`})}function H(){return E(\"string\",e=>\"string\"==typeof e||`Expected a string, but received: ${f(e)}`)}function G(e){const t=F();return new m({type:\"tuple\",schema:null,*entries(n){if(Array.isArray(n)){const r=Math.max(e.length,n.length);for(let o=0;o<r;o++)yield[o,n[o],e[o]||t]}},validator:e=>Array.isArray(e)||`Expected an array, but received: ${f(e)}`})}function Z(e){const t=Object.keys(e),n=new m({type:\"type\",schema:e,*entries(n){if(l(n))for(const r of t)w.isExactOptional(e[r])&&!Object.prototype.hasOwnProperty.call(n,r)||(yield[r,n[r],e[r]])},validator:e=>l(e)||`Expected an object, but received: ${f(e)}`,coercer:e=>l(e)?{...e}:e});return O(n,e)}function Y(e){const t=e.map(e=>e.type).join(\" | \");return new m({type:\"union\",schema:null,coercer(t){for(const n of e){const[e,r]=n.validate(t,{coerce:!0});if(!e)return r}return t},validator(n,r){const o=[];for(const t of e){const[...e]=g(n,t,r),[i]=e;if(!i?.[0])return[];for(const[t]of e)t&&o.push(t)}return[`Expected the value to satisfy a union of \\`${t}\\`, but received: ${f(n)}`,...o]}})}function J(){return E(\"unknown\",()=>!0)}function X(e,t,n){return new m({...e,coercer:(r,o)=>A(r,t)?e.coercer(n(r,o),o):e.coercer(r,o)})}function Q(e){return e instanceof Map||e instanceof Set?e.size:e.length}function ee(e,t,n={}){const{exclusive:r}=n;return re(e,\"min\",n=>r?n>t:n>=t||`Expected a ${e.type} greater than ${r?\"\":\"or equal to \"}${t} but received \\`${n}\\``)}function te(e){return re(e,\"nonempty\",t=>Q(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function ne(e,t){return re(e,\"pattern\",n=>t.test(n)||`Expected a ${e.type} matching \\`/${t.source}/\\` but received \"${n}\"`)}function re(e,t,n){return new m({...e,*refiner(r,o){yield*e.refiner(r,o);const i=p(n(r,o),o,e,r);for(const e of i)yield{...e,refinement:t}}})}function oe(e){return null==e}function ie(e){return Boolean(e)&&\"object\"==typeof e&&!Array.isArray(e)}const ae=(e,t)=>Object.hasOwnProperty.call(e,t);var se;!function(e){e[e.Null=4]=\"Null\",e[e.Comma=1]=\"Comma\",e[e.Wrapper=1]=\"Wrapper\",e[e.True=4]=\"True\",e[e.False=5]=\"False\",e[e.Quote=1]=\"Quote\",e[e.Colon=1]=\"Colon\",e[e.Date=24]=\"Date\"}(se=se||(se={}));function ce(e){if(\"object\"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}}const ue=e=>K(e);function le({path:e,branch:t}){const n=e[e.length-1];return ae(t[t.length-2],n)}function de(e){return new m({...e,type:`optional ${e.type}`,validator:(t,n)=>!le(n)||e.validator(t,n),refiner:(t,n)=>!le(n)||e.refiner(t,n)})}function fe(e){if(null===e||\"boolean\"==typeof e||\"string\"==typeof e)return!0;if(\"number\"==typeof e&&Number.isFinite(e))return!0;if(\"object\"==typeof e){let t=!0;if(Array.isArray(e)){for(let n=0;n<e.length;n++)if(!fe(e[n])){t=!1;break}return t}const n=Object.entries(e);for(let e=0;e<n.length;e++)if(\"string\"!=typeof n[e][0]||!fe(n[e][1])){t=!1;break}return t}return!1}const he=E(\"JSON\",e=>fe(e)),pe=X(he,re(E(\"any\",()=>!0),\"JSON\",e=>A(e,he)),e=>JSON.parse(JSON.stringify(e,(e,t)=>{if(\"__proto__\"!==e&&\"constructor\"!==e)return t})));function ge(e){try{return function(e){b(e,pe)}(e),!0}catch{return!1}}const me=j(\"2.0\"),ye=D(Y([$(),H()])),we=ue({code:L(),message:H(),data:de(pe),stack:de(H())}),ve=Y([V(H(),pe),U(pe)]);ue({id:ye,jsonrpc:me,method:H(),params:de(ve)}),ue({jsonrpc:me,method:H(),params:de(ve)});K({id:ye,jsonrpc:me,result:q(J()),error:q(we)});const be=ue({id:ye,jsonrpc:me,result:pe}),Ae=ue({id:ye,jsonrpc:me,error:we});Y([be,Ae]);function Se(e){return A(e,Ae)}function Ee(e){return A(e,we)}const xe=K({jsonrpc:j(\"2.0\"),id:Y([H(),$(),j(null)]),method:H(),params:W(Y([U(pe),V(H(),pe)]))});var ke;function Ie(e){return new m({type:\"union\",schema:null,*entries(t,n){yield*e(t).entries(t,n)},*refiner(t,n){yield*e(t).refiner(t,n)},coercer:(t,n)=>e(t).coercer(t,n),validator:(t,n)=>e(t).validator(t,n)})}!function(e){e.Mnemonic=\"mnemonic\",e.PrivateKey=\"private-key\",e.Custom=\"custom\"}(ke||(ke={}));const Te=K({type:j(`${ke.Mnemonic}`),id:H(),derivationPath:H(),groupIndex:$()}),_e=K({type:j(`${ke.PrivateKey}`)}),Ce=K({type:j(`${ke.Custom}`)}),Be=Ie(e=>{if(!ce(e))return Te;switch(e.type){case ke.PrivateKey:return _e;case ke.Custom:return Ce;case ke.Mnemonic:default:return Te}}),Re=(Pe=[V(H(),pe),Z({entropy:W(Be),exportable:W(M())})],new m({type:\"intersection\",schema:null,*entries(e,t){for(const{entries:n}of Pe)yield*n(e,t)},*validator(e,t){for(const{validator:n}of Pe)yield*n(e,t)},*refiner(e,t){for(const{refiner:n}of Pe)yield*n(e,t)}}));var Pe;const Ne=/^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})$/u,Oe=/^[-a-z0-9]{3,8}$/u,Ue=/^[-_a-zA-Z0-9]{1,32}$/u,Me=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})):(?<accountAddress>[-.%a-zA-Z0-9]{1,128})$/u,ze=/^[-.%a-zA-Z0-9]{1,128}$/u,Le=/^[-a-z0-9]{3,8}$/u,je=/^[-.%a-zA-Z0-9]{1,128}$/u,Fe=/^[-.%a-zA-Z0-9]{1,78}$/u,De=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})$/u,$e=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})\\/(?<tokenId>[-.%a-zA-Z0-9]{1,78})$/u,Ke=x(\"CaipChainId\",Ne),qe=(x(\"CaipNamespace\",Oe),x(\"CaipReference\",Ue),x(\"CaipAccountId\",Me)),We=(x(\"CaipAccountAddress\",ze),x(\"CaipAssetNamespace\",Le),x(\"CaipAssetReference\",je),x(\"CaipTokenId\",Fe),x(\"CaipAssetType\",De)),Ve=x(\"CaipAssetId\",$e),He=x(\"CaipAssetTypeOrId\",/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})(\\/(?<tokenId>[-.%a-zA-Z0-9]{1,78}))?$/u);var Ge,Ze,Ye,Je,Xe,Qe,et;function tt(e){const t=De.exec(e);if(!t?.groups)throw new Error(\"Invalid CAIP asset type.\");return{assetNamespace:t.groups.assetNamespace,assetReference:t.groups.assetReference,chainId:t.groups.chainId,chain:{namespace:t.groups.namespace,reference:t.groups.reference}}}!function(e){e.Bip122=\"bip122\",e.Solana=\"solana\",e.Stellar=\"stellar\",e.Tron=\"tron\",e.Eip155=\"eip155\",e.Wallet=\"wallet\"}(Ge=Ge||(Ge={})),function(e){e.Eoa=\"eip155:eoa\",e.Erc4337=\"eip155:erc4337\"}(Ze||(Ze={})),function(e){e.P2pkh=\"bip122:p2pkh\",e.P2sh=\"bip122:p2sh\",e.P2wpkh=\"bip122:p2wpkh\",e.P2tr=\"bip122:p2tr\"}(Ye||(Ye={})),function(e){e.DataAccount=\"solana:data-account\"}(Je||(Je={})),function(e){e.Eoa=\"tron:eoa\"}(Xe||(Xe={})),function(e){e.Account=\"stellar:account\"}(Qe||(Qe={})),function(e){e.Account=\"any:account\"}(et||(et={}));const nt=z([`${Ze.Eoa}`,`${Ze.Erc4337}`,`${Ye.P2pkh}`,`${Ye.P2sh}`,`${Ye.P2wpkh}`,`${Ye.P2tr}`,`${Je.DataAccount}`,`${Xe.Eoa}`,`${Qe.Account}`,`${et.Account}`]),rt=K({id:I,type:z([`${Ze.Eoa}`,`${Ze.Erc4337}`,`${Ye.P2pkh}`,`${Ye.P2sh}`,`${Ye.P2wpkh}`,`${Ye.P2tr}`,`${Je.DataAccount}`,`${Xe.Eoa}`,`${Qe.Account}`,`${et.Account}`]),address:H(),scopes:te(U(Ke)),options:Re,methods:U(H())}),ot=x(\"DerivationPath\",/^m(?:\\/\\d+'?)+$/u);var it;!function(e){e.Bip44=\"bip44\"}(it||(it={}));const at=K({type:j(`${it.Bip44}`),scopes:U(Ke),derivationPath:ot}),st=K({limit:$(),next:W(D(H()))}),ct=K({amount:T,unit:H(),metadata:W(V(H(),pe))}),ut=K({id:k,scope:H(),account:k,origin:H(),request:K({method:H(),params:W(Y([U(pe),V(H(),pe)]))})}),lt=K({type:j(\"bip44:derive-path\"),entropySource:H(),derivationPath:ot}),dt=K({type:j(\"bip44:derive-index\"),entropySource:H(),groupIndex:$()}),ft=K({type:j(\"bip44:discover\"),entropySource:H(),groupIndex:$()}),ht=K({type:j(\"bip44:derive-index-range\"),entropySource:H(),range:K({from:$(),to:$()})}),pt=Z({type:j(\"custom\")});var gt;!function(e){e.Hexadecimal=\"hexadecimal\",e.Base58=\"base58\",e.Base32=\"base32\"}(gt||(gt={}));const mt=z([`${gt.Hexadecimal}`,`${gt.Base58}`,`${gt.Base32}`]),yt=(K({encoding:mt,type:W(nt)}),K({encoding:mt}),K({type:j(\"private-key:import\"),privateKey:N(H()),encoding:mt,accountType:W(nt)}));var wt;!function(e){e.Bip44DerivePath=\"bip44:derive-path\",e.Bip44DeriveIndex=\"bip44:derive-index\",e.Bip44DeriveIndexRange=\"bip44:derive-index-range\",e.Bip44Discover=\"bip44:discover\",e.PrivateKeyImport=\"private-key:import\",e.Custom=\"custom\"}(wt||(wt={}));const vt=Ie(e=>{const t=e?.type;switch(t){case wt.Bip44DerivePath:return lt;case wt.Bip44DeriveIndex:return dt;case wt.Bip44DeriveIndexRange:return ht;case wt.Bip44Discover:return ft;case wt.PrivateKeyImport:return yt;case wt.Custom:return pt;default:return lt}});var bt;!function(e){e.CreateAccount=\"keyring_createAccount\",e.CreateAccounts=\"keyring_createAccounts\",e.DeleteAccount=\"keyring_deleteAccount\",e.DiscoverAccounts=\"keyring_discoverAccounts\",e.ExportAccount=\"keyring_exportAccount\",e.FilterAccountChains=\"keyring_filterAccountChains\",e.GetAccount=\"keyring_getAccount\",e.ListAccounts=\"keyring_listAccounts\",e.UpdateAccount=\"keyring_updateAccount\",e.ApproveRequest=\"keyring_approveRequest\",e.GetRequest=\"keyring_getRequest\",e.ListRequests=\"keyring_listRequests\",e.RejectRequest=\"keyring_rejectRequest\",e.SubmitRequest=\"keyring_submitRequest\",e.GetAccountBalances=\"keyring_getAccountBalances\",e.ListAccountAssets=\"keyring_listAccountAssets\",e.ListAccountTransactions=\"keyring_listAccountTransactions\",e.SetSelectedAccounts=\"keyring_setSelectedAccounts\",e.ResolveAccountAddress=\"keyring_resolveAccountAddress\"}(bt||(bt={}));const At={jsonrpc:j(\"2.0\"),id:Y([H(),$(),j(null)])},St=(K({...At,method:j(\"keyring_listAccounts\")}),U(rt),K({...At,method:j(\"keyring_getAccount\"),params:K({id:k})}),K({...At,method:j(\"keyring_createAccount\"),params:K({options:V(H(),pe)})}),K({...At,method:j(\"keyring_createAccounts\"),params:K({options:vt})}),U(rt),K({...At,method:j(\"keyring_setSelectedAccounts\"),params:K({accounts:U(H())})}),j(null),K({...At,method:j(\"keyring_discoverAccounts\"),params:K({scopes:U(Ke),entropySource:H(),groupIndex:$()})}),U(at),K({...At,method:j(\"keyring_listAccountTransactions\"),params:K({id:k,pagination:st})})),Et=K({...At,method:j(\"keyring_listAccountAssets\"),params:K({id:k})}),xt=U(He),kt=(K({...At,method:j(`${bt.GetAccountBalances}`),params:K({id:k,assets:U(We)})}),V(We,ct),K({...At,method:j(\"keyring_resolveAccountAddress\"),params:K({scope:Ke,request:xe})}),D(K({address:qe})),K({...At,method:j(\"keyring_filterAccountChains\"),params:K({id:k,chains:U(H())})}),U(H()),K({...At,method:j(\"keyring_updateAccount\"),params:K({account:rt})}),j(null),K({...At,method:j(\"keyring_deleteAccount\"),params:K({id:k})}),j(null),K({...At,method:j(\"keyring_exportAccount\"),params:K({id:k})}),K({...At,method:j(\"keyring_listRequests\")}),U(ut),K({...At,method:j(\"keyring_getRequest\"),params:K({id:k})}),K({...At,method:j(\"keyring_submitRequest\"),params:ut}),K({...At,method:j(\"keyring_approveRequest\"),params:K({id:k,data:V(H(),pe)})}),j(null),K({...At,method:j(\"keyring_rejectRequest\"),params:K({id:k})}),j(null),K({type:j(\"private-key\"),privateKey:N(H()),encoding:mt}),K({type:j(\"private-key\"),encoding:mt}));var It;!function(e){e.PrivateKey=\"private-key\"}(It||(It={}));const Tt=kt;const _t={GetAccounts:\"keyring_getAccounts\",CreateAccounts:\"keyring_createAccounts\",GetAccount:\"keyring_getAccount\",DeleteAccount:\"keyring_deleteAccount\",ExportAccount:\"keyring_exportAccount\",SubmitRequest:\"keyring_submitRequest\"};const Ct={jsonrpc:j(\"2.0\"),id:Y([H(),$(),j(null)])},Bt=K({...Ct,method:j(`${_t.GetAccounts}`)}),Rt=(U(rt),K({...Ct,method:j(`${_t.GetAccount}`),params:K({id:k})})),Pt=K({...Ct,method:j(`${_t.CreateAccounts}`),params:vt}),Nt=(U(rt),K({...Ct,method:j(`${_t.DeleteAccount}`),params:K({id:k})})),Ot=(j(null),K({...Ct,method:j(`${_t.ExportAccount}`),params:K({id:k,options:W(Tt)})})),Ut=K({...Ct,method:j(`${_t.SubmitRequest}`),params:ut}),Mt=K({address:qe});const zt={..._t,SetSelectedAccounts:\"keyring_setSelectedAccounts\",GetAccountTransactions:\"keyring_getAccountTransactions\",GetAccountAssets:\"keyring_getAccountAssets\",GetAccountBalances:\"keyring_getAccountBalances\",ResolveAccountAddress:\"keyring_resolveAccountAddress\"};const Lt={jsonrpc:j(\"2.0\"),id:Y([H(),$(),j(null)])},jt=K({...Lt,method:j(`${zt.SetSelectedAccounts}`),params:K({accounts:U(H())})}),Ft=(j(null),K({...Lt,method:j(`${zt.GetAccountTransactions}`),params:K({id:k,pagination:st})})),Dt=K({...Lt,method:j(`${zt.GetAccountAssets}`),params:K({id:k})}),$t=(U(He),K({...Lt,method:j(`${zt.GetAccountBalances}`),params:K({id:k,assets:U(We)})})),Kt=(V(We,ct),K({...Lt,method:j(`${zt.ResolveAccountAddress}`),params:K({scope:Ke,request:xe})})),qt=(D(Mt),-31002),Wt=\"Snap Error\";function Vt(e,t,n=null){return ie(e)&&ae(e,t)?e[t]:n}function Ht(e,t,n=String(e)){const r=Vt(e,t);return\"string\"==typeof r?r:n}function Gt(e){return Ht(e,\"message\")}function Zt(e){return Ht(e,\"stack\",null)}function Yt(e){return Ht(e,\"name\",e instanceof Error?e.name:\"Error\")}function Jt(e){const t=Vt(e,\"data\");return null!==t&&ge(t)&&!Array.isArray(t)?t:{}}function Xt(e){if(ie(e)&&\"serialize\"in e&&\"function\"==typeof e.serialize){const t=e.serialize();return Ee(t)&&function(e){return e.code===qt&&e.message===Wt}(t)}return!1}var Qt=n(282);const en={invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},tn={userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901},nn={\"-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.\"}};const rn=en.internal,on=(an(rn),\"Unspecified server error.\");function an(e,t=\"Unspecified error message. This is a bug, please report it.\"){if(function(e){return Number.isInteger(e)}(e)){const t=e.toString();if(ae(nn,t))return nn[t].message;if(function(e){return e>=-32099&&e<=-32e3}(e))return on}return t}function sn(e){return Array.isArray(e)?e.map(e=>ge(e)?e:ie(e)?cn(e):null):ie(e)?cn(e):ge(e)?e:null}function cn(e){return Object.getOwnPropertyNames(e).reduce((t,n)=>{const r=e[n];return ge(r)&&(t[n]=r),t},{})}const un=function(e){return e?.__esModule?e.default:e}(Qt);class ln extends Error{constructor(e,t,n){if(!Number.isInteger(e))throw new Error('\"code\" must be an integer.');if(!t||\"string\"!=typeof t)throw new Error('\"message\" must be a non-empty string.');!function(e){return ie(e)&&ae(e,\"cause\")&&ie(e.cause)}(n)?super(t):(super(t,{cause:n.cause}),ae(this,\"cause\")||Object.assign(this,{cause:n.cause})),void 0!==n&&(this.data=n),this.code=e}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data,ce(this.data)&&(e.data.cause=sn(this.data.cause))),this.stack&&(e.stack=this.stack),e}toString(){return un(this.serialize(),fn,2)}}class dn extends ln{constructor(e,t,n){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('\"code\" must be an integer such that: 1000 <= code <= 4999');super(e,t,n)}}function fn(e,t){if(\"[Circular]\"!==t)return t}const hn=e=>Cn(en.parse,e),pn=e=>Cn(en.invalidRequest,e),gn=e=>Cn(en.invalidParams,e),mn=e=>Cn(en.methodNotFound,e),yn=e=>Cn(en.internal,e),wn=e=>Cn(en.invalidInput,e),vn=e=>Cn(en.resourceNotFound,e),bn=e=>Cn(en.resourceUnavailable,e),An=e=>Cn(en.transactionRejected,e),Sn=e=>Cn(en.methodNotSupported,e),En=e=>Cn(en.limitExceeded,e),xn=e=>Bn(tn.userRejectedRequest,e),kn=e=>Bn(tn.unauthorized,e),In=e=>Bn(tn.unsupportedMethod,e),Tn=e=>Bn(tn.disconnected,e),_n=e=>Bn(tn.chainDisconnected,e);function Cn(e,t){const[n,r]=Rn(t);return new ln(e,n??an(e),r)}function Bn(e,t){const[n,r]=Rn(t);return new dn(e,n??an(e),r)}function Rn(e){if(e){if(\"string\"==typeof e)return[e];if(\"object\"==typeof e&&!Array.isArray(e)){const{message:t,data:n}=e;if(t&&\"string\"!=typeof t)throw new Error(\"Must specify string message.\");return[t??void 0,n]}}return[]}class Pn extends Error{#e;#t;#n;#r;constructor(e,t={}){const n=Gt(e);super(n),this.#t=n,this.#e=function(e){const t=Vt(e,\"code\");return\"number\"==typeof t&&Number.isInteger(t)?t:-32603}(e);const r={...Jt(e),...t};Object.keys(r).length>0&&(this.#n=r),this.#r=super.stack}get name(){return\"SnapError\"}get code(){return this.#e}get message(){return this.#t}get data(){return this.#n}get stack(){return this.#r}toJSON(){return{code:qt,message:Wt,data:{cause:{code:this.code,message:this.message,stack:this.stack,...this.data?{data:this.data}:{}}}}}serialize(){return this.toJSON()}}function Nn(e){if(\"string\"==typeof e)return{name:\"Error\",message:e,stack:null,cause:null};if(Ee(e))return{name:\"JsonRpcError\",message:Gt(e),stack:Zt(e)??Zt(e.data)??null,cause:null};const t=function(e){return Vt(e,\"cause\")}(e);return{name:Yt(e),message:Gt(e),stack:Zt(e)??null,cause:null===t?null:Nn(t)}}function On(e){return class extends Pn{constructor(t,n){if(\"object\"==typeof t){const n=e();return void super({code:n.code,message:n.message,data:t})}const r=e(t);super({code:r.code,message:r.message,data:n})}}}const Un=On(yn),Mn=On(wn),zn=On(gn),Ln=On(pn),jn=On(En),Fn=On(mn),Dn=On(Sn),$n=On(hn),Kn=On(vn),qn=On(bn),Wn=On(An),Vn=On(_n),Hn=On(Tn),Gn=On(kn),Zn=On(In),Yn=On(xn);class Jn extends Dn{constructor(e){super(`Method not supported: ${e}`)}}async function Xn(e,t){try{return await async function(e,t){switch(v(t,xe),t.method){case`${_t.GetAccounts}`:return v(t,Bt),e.getAccounts();case`${_t.GetAccount}`:return v(t,Rt),e.getAccount(t.params.id);case`${_t.CreateAccounts}`:return v(t,Pt),e.createAccounts(t.params);case`${_t.DeleteAccount}`:return v(t,Nt),e.deleteAccount(t.params.id);case`${_t.ExportAccount}`:if(void 0===e.exportAccount)throw new Jn(t.method);return v(t,Ot),e.exportAccount(t.params.id,t.params.options);case`${_t.SubmitRequest}`:return v(t,Ut),e.submitRequest(t.params);case`${zt.SetSelectedAccounts}`:if(void 0===e.setSelectedAccounts)throw new Jn(t.method);return v(t,jt),e.setSelectedAccounts(t.params.accounts);case`${bt.ListAccountTransactions}`:if(void 0===e.getAccountTransactions)throw new Jn(t.method);return v(t,St),e.getAccountTransactions(t.params.id,t.params.pagination);case`${zt.GetAccountTransactions}`:if(void 0===e.getAccountTransactions)throw new Jn(t.method);return v(t,Ft),e.getAccountTransactions(t.params.id,t.params.pagination);case`${bt.ListAccountAssets}`:if(void 0===e.getAccountAssets)throw new Jn(t.method);return v(t,Et),e.getAccountAssets(t.params.id);case`${zt.GetAccountAssets}`:if(void 0===e.getAccountAssets)throw new Jn(t.method);return v(t,Dt),e.getAccountAssets(t.params.id);case`${zt.GetAccountBalances}`:if(void 0===e.getAccountBalances)throw new Jn(t.method);return v(t,$t),e.getAccountBalances(t.params.id,t.params.assets);case`${zt.ResolveAccountAddress}`:if(void 0===e.resolveAccountAddress)throw new Jn(t.method);return v(t,Kt),e.resolveAccountAddress(t.params.scope,t.params.request);default:throw new Jn(t.method)}}(e,t)}catch(e){if(Xt(e))throw e;const t=e instanceof Error&&\"string\"==typeof e.message?e.message:\"An unknown error occurred while handling the keyring (v2) request\";throw new Error(t)}}var Qn=/^-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?$/i,er=Math.ceil,tr=Math.floor,nr=\"[BigNumber Error] \",rr=nr+\"Number primitive has more than 15 significant digits: \",or=1e14,ir=14,ar=9007199254740991,sr=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],cr=1e7,ur=1e9;function lr(e){var t=0|e;return e>0||e===t?t:t-1}function dr(e){for(var t,n,r=1,o=e.length,i=e[0]+\"\";r<o;){for(t=e[r++]+\"\",n=ir-t.length;n--;t=\"0\"+t);i+=t}for(o=i.length;48===i.charCodeAt(--o););return i.slice(0,o+1||1)}function fr(e,t){var n,r,o=e.c,i=t.c,a=e.s,s=t.s,c=e.e,u=t.e;if(!a||!s)return null;if(n=o&&!o[0],r=i&&!i[0],n||r)return n?r?0:-s:a;if(a!=s)return a;if(n=a<0,r=c==u,!o||!i)return r?0:!o^n?1:-1;if(!r)return c>u^n?1:-1;for(s=(c=o.length)<(u=i.length)?c:u,a=0;a<s;a++)if(o[a]!=i[a])return o[a]>i[a]^n?1:-1;return c==u?0:c>u^n?1:-1}function hr(e,t,n,r){if(e<t||e>n||e!==tr(e))throw Error(nr+(r||\"Argument\")+(\"number\"==typeof e?e<t||e>n?\" out of range: \":\" not an integer: \":\" not a primitive number: \")+String(e))}function pr(e){var t=e.c.length-1;return lr(e.e/ir)==t&&e.c[t]%2!=0}function gr(e,t){return(e.length>1?e.charAt(0)+\".\"+e.slice(1):e)+(t<0?\"e\":\"e+\")+t}function mr(e,t,n){var r,o;if(t<0){for(o=n+\".\";++t;o+=n);e=o+e}else if(++t>(r=e.length)){for(o=n,t-=r;--t;o+=n);e+=o}else t<r&&(e=e.slice(0,t)+\".\"+e.slice(t));return e}var yr=function e(t){var n,r,o,i,a,s,c,u,l,d,f=I.prototype={constructor:I,toString:null,valueOf:null},h=new I(1),p=20,g=4,m=-7,y=21,w=-1e7,v=1e7,b=!1,A=1,S=0,E={prefix:\"\",groupSize:3,secondaryGroupSize:0,groupSeparator:\",\",decimalSeparator:\".\",fractionGroupSize:0,fractionGroupSeparator:\" \",suffix:\"\"},x=\"0123456789abcdefghijklmnopqrstuvwxyz\",k=!0;function I(e,t){var n,i,a,s,c,u,l,d,f=this;if(!(f instanceof I))return new I(e,t);if(null==t){if(e&&!0===e._isBigNumber)return f.s=e.s,void(!e.c||e.e>v?f.c=f.e=null:e.e<w?f.c=[f.e=0]:(f.e=e.e,f.c=e.c.slice()));if((u=\"number\"==typeof e)&&0*e==0){if(f.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,c=e;c>=10;c/=10,s++);return void(s>v?f.c=f.e=null:(f.e=s,f.c=[e]))}d=String(e)}else{if(!Qn.test(d=String(e)))return o(f,d,u);f.s=45==d.charCodeAt(0)?(d=d.slice(1),-1):1}(s=d.indexOf(\".\"))>-1&&(d=d.replace(\".\",\"\")),(c=d.search(/e/i))>0?(s<0&&(s=c),s+=+d.slice(c+1),d=d.substring(0,c)):s<0&&(s=d.length)}else{if(hr(t,2,x.length,\"Base\"),10==t&&k)return B(f=new I(e),p+f.e+1,g);if(d=String(e),u=\"number\"==typeof e){if(0*e!=0)return o(f,d,u,t);if(f.s=1/e<0?(d=d.slice(1),-1):1,I.DEBUG&&d.replace(/^0\\.0*|\\./,\"\").length>15)throw Error(rr+e)}else f.s=45===d.charCodeAt(0)?(d=d.slice(1),-1):1;for(n=x.slice(0,t),s=c=0,l=d.length;c<l;c++)if(n.indexOf(i=d.charAt(c))<0){if(\".\"==i){if(c>s){s=l;continue}}else if(!a&&(d==d.toUpperCase()&&(d=d.toLowerCase())||d==d.toLowerCase()&&(d=d.toUpperCase()))){a=!0,c=-1,s=0;continue}return o(f,String(e),u,t)}u=!1,(s=(d=r(d,t,10,f.s)).indexOf(\".\"))>-1?d=d.replace(\".\",\"\"):s=d.length}for(c=0;48===d.charCodeAt(c);c++);for(l=d.length;48===d.charCodeAt(--l););if(d=d.slice(c,++l)){if(l-=c,u&&I.DEBUG&&l>15&&(e>ar||e!==tr(e)))throw Error(rr+f.s*e);if((s=s-c-1)>v)f.c=f.e=null;else if(s<w)f.c=[f.e=0];else{if(f.e=s,f.c=[],c=(s+1)%ir,s<0&&(c+=ir),c<l){for(c&&f.c.push(+d.slice(0,c)),l-=ir;c<l;)f.c.push(+d.slice(c,c+=ir));c=ir-(d=d.slice(c)).length}else c-=l;for(;c--;d+=\"0\");f.c.push(+d)}}else f.c=[f.e=0]}function T(e,t,n,r){var o,i,a,s,c;if(null==n?n=g:hr(n,0,8),!e.c)return e.toString();if(o=e.c[0],a=e.e,null==t)c=dr(e.c),c=1==r||2==r&&(a<=m||a>=y)?gr(c,a):mr(c,a,\"0\");else if(i=(e=B(new I(e),t,n)).e,s=(c=dr(e.c)).length,1==r||2==r&&(t<=i||i<=m)){for(;s<t;c+=\"0\",s++);c=gr(c,i)}else if(t-=a+(2===r&&i>a),c=mr(c,i,\"0\"),i+1>s){if(--t>0)for(c+=\".\";t--;c+=\"0\");}else if((t+=i-s)>0)for(i+1==s&&(c+=\".\");t--;c+=\"0\");return e.s<0&&o?\"-\"+c:c}function _(e,t){for(var n,r,o=1,i=new I(e[0]);o<e.length;o++)(!(r=new I(e[o])).s||(n=fr(i,r))===t||0===n&&i.s===t)&&(i=r);return i}function C(e,t,n){for(var r=1,o=t.length;!t[--o];t.pop());for(o=t[0];o>=10;o/=10,r++);return(n=r+n*ir-1)>v?e.c=e.e=null:n<w?e.c=[e.e=0]:(e.e=n,e.c=t),e}function B(e,t,n,r){var o,i,a,s,c,u,l,d=e.c,f=sr;if(d){e:{for(o=1,s=d[0];s>=10;s/=10,o++);if((i=t-o)<0)i+=ir,a=t,c=d[u=0],l=tr(c/f[o-a-1]%10);else if((u=er((i+1)/ir))>=d.length){if(!r)break e;for(;d.length<=u;d.push(0));c=l=0,o=1,a=(i%=ir)-ir+1}else{for(c=s=d[u],o=1;s>=10;s/=10,o++);l=(a=(i%=ir)-ir+o)<0?0:tr(c/f[o-a-1]%10)}if(r=r||t<0||null!=d[u+1]||(a<0?c:c%f[o-a-1]),r=n<4?(l||r)&&(0==n||n==(e.s<0?3:2)):l>5||5==l&&(4==n||r||6==n&&(i>0?a>0?c/f[o-a]:0:d[u-1])%10&1||n==(e.s<0?8:7)),t<1||!d[0])return d.length=0,r?(t-=e.e+1,d[0]=f[(ir-t%ir)%ir],e.e=-t||0):d[0]=e.e=0,e;if(0==i?(d.length=u,s=1,u--):(d.length=u+1,s=f[ir-i],d[u]=a>0?tr(c/f[o-a]%f[a])*s:0),r)for(;;){if(0==u){for(i=1,a=d[0];a>=10;a/=10,i++);for(a=d[0]+=s,s=1;a>=10;a/=10,s++);i!=s&&(e.e++,d[0]==or&&(d[0]=1));break}if(d[u]+=s,d[u]!=or)break;d[u--]=0,s=1}for(i=d.length;0===d[--i];d.pop());}e.e>v?e.c=e.e=null:e.e<w&&(e.c=[e.e=0])}return e}function R(e){var t,n=e.e;return null===n?e.toString():(t=dr(e.c),t=n<=m||n>=y?gr(t,n):mr(t,n,\"0\"),e.s<0?\"-\"+t:t)}return I.clone=e,I.ROUND_UP=0,I.ROUND_DOWN=1,I.ROUND_CEIL=2,I.ROUND_FLOOR=3,I.ROUND_HALF_UP=4,I.ROUND_HALF_DOWN=5,I.ROUND_HALF_EVEN=6,I.ROUND_HALF_CEIL=7,I.ROUND_HALF_FLOOR=8,I.EUCLID=9,I.config=I.set=function(e){var t,n;if(null!=e){if(\"object\"!=typeof e)throw Error(nr+\"Object expected: \"+e);if(e.hasOwnProperty(t=\"DECIMAL_PLACES\")&&(hr(n=e[t],0,ur,t),p=n),e.hasOwnProperty(t=\"ROUNDING_MODE\")&&(hr(n=e[t],0,8,t),g=n),e.hasOwnProperty(t=\"EXPONENTIAL_AT\")&&((n=e[t])&&n.pop?(hr(n[0],-ur,0,t),hr(n[1],0,ur,t),m=n[0],y=n[1]):(hr(n,-ur,ur,t),m=-(y=n<0?-n:n))),e.hasOwnProperty(t=\"RANGE\"))if((n=e[t])&&n.pop)hr(n[0],-ur,-1,t),hr(n[1],1,ur,t),w=n[0],v=n[1];else{if(hr(n,-ur,ur,t),!n)throw Error(nr+t+\" cannot be zero: \"+n);w=-(v=n<0?-n:n)}if(e.hasOwnProperty(t=\"CRYPTO\")){if((n=e[t])!==!!n)throw Error(nr+t+\" not true or false: \"+n);if(n){if(\"undefined\"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw b=!n,Error(nr+\"crypto unavailable\");b=n}else b=n}if(e.hasOwnProperty(t=\"MODULO_MODE\")&&(hr(n=e[t],0,9,t),A=n),e.hasOwnProperty(t=\"POW_PRECISION\")&&(hr(n=e[t],0,ur,t),S=n),e.hasOwnProperty(t=\"FORMAT\")){if(\"object\"!=typeof(n=e[t]))throw Error(nr+t+\" not an object: \"+n);E=n}if(e.hasOwnProperty(t=\"ALPHABET\")){if(\"string\"!=typeof(n=e[t])||/^.?$|[+\\-.\\s]|(.).*\\1/.test(n))throw Error(nr+t+\" invalid: \"+n);k=\"0123456789\"==n.slice(0,10),x=n}}return{DECIMAL_PLACES:p,ROUNDING_MODE:g,EXPONENTIAL_AT:[m,y],RANGE:[w,v],CRYPTO:b,MODULO_MODE:A,POW_PRECISION:S,FORMAT:E,ALPHABET:x}},I.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!I.DEBUG)return!0;var t,n,r=e.c,o=e.e,i=e.s;e:if(\"[object Array]\"=={}.toString.call(r)){if((1===i||-1===i)&&o>=-ur&&o<=ur&&o===tr(o)){if(0===r[0]){if(0===o&&1===r.length)return!0;break e}if((t=(o+1)%ir)<1&&(t+=ir),String(r[0]).length==t){for(t=0;t<r.length;t++)if((n=r[t])<0||n>=or||n!==tr(n))break e;if(0!==n)return!0}}}else if(null===r&&null===o&&(null===i||1===i||-1===i))return!0;throw Error(nr+\"Invalid BigNumber: \"+e)},I.maximum=I.max=function(){return _(arguments,-1)},I.minimum=I.min=function(){return _(arguments,1)},I.random=(i=9007199254740992,a=Math.random()*i&2097151?function(){return tr(Math.random()*i)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,n,r,o,i,s=0,c=[],u=new I(h);if(null==e?e=p:hr(e,0,ur),o=er(e/ir),b)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(o*=2));s<o;)(i=131072*t[s]+(t[s+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),t[s]=n[0],t[s+1]=n[1]):(c.push(i%1e14),s+=2);s=o/2}else{if(!crypto.randomBytes)throw b=!1,Error(nr+\"crypto unavailable\");for(t=crypto.randomBytes(o*=7);s<o;)(i=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(c.push(i%1e14),s+=7);s=o/7}if(!b)for(;s<o;)(i=a())<9e15&&(c[s++]=i%1e14);for(o=c[--s],e%=ir,o&&e&&(i=sr[ir-e],c[s]=tr(o/i)*i);0===c[s];c.pop(),s--);if(s<0)c=[r=0];else{for(r=-1;0===c[0];c.splice(0,1),r-=ir);for(s=1,i=c[0];i>=10;i/=10,s++);s<ir&&(r-=ir-s)}return u.e=r,u.c=c,u}),I.sum=function(){for(var e=1,t=arguments,n=new I(t[0]);e<t.length;)n=n.plus(t[e++]);return n},r=function(){var e=\"0123456789\";function t(e,t,n,r){for(var o,i,a=[0],s=0,c=e.length;s<c;){for(i=a.length;i--;a[i]*=t);for(a[0]+=r.indexOf(e.charAt(s++)),o=0;o<a.length;o++)a[o]>n-1&&(null==a[o+1]&&(a[o+1]=0),a[o+1]+=a[o]/n|0,a[o]%=n)}return a.reverse()}return function(r,o,i,a,s){var c,u,l,d,f,h,m,y,w=r.indexOf(\".\"),v=p,b=g;for(w>=0&&(d=S,S=0,r=r.replace(\".\",\"\"),h=(y=new I(o)).pow(r.length-w),S=d,y.c=t(mr(dr(h.c),h.e,\"0\"),10,i,e),y.e=y.c.length),l=d=(m=t(r,o,i,s?(c=x,e):(c=e,x))).length;0==m[--d];m.pop());if(!m[0])return c.charAt(0);if(w<0?--l:(h.c=m,h.e=l,h.s=a,m=(h=n(h,y,v,b,i)).c,f=h.r,l=h.e),w=m[u=l+v+1],d=i/2,f=f||u<0||null!=m[u+1],f=b<4?(null!=w||f)&&(0==b||b==(h.s<0?3:2)):w>d||w==d&&(4==b||f||6==b&&1&m[u-1]||b==(h.s<0?8:7)),u<1||!m[0])r=f?mr(c.charAt(1),-v,c.charAt(0)):c.charAt(0);else{if(m.length=u,f)for(--i;++m[--u]>i;)m[u]=0,u||(++l,m=[1].concat(m));for(d=m.length;!m[--d];);for(w=0,r=\"\";w<=d;r+=c.charAt(m[w++]));r=mr(r,l,c.charAt(0))}return r}}(),n=function(){function e(e,t,n){var r,o,i,a,s=0,c=e.length,u=t%cr,l=t/cr|0;for(e=e.slice();c--;)s=((o=u*(i=e[c]%cr)+(r=l*i+(a=e[c]/cr|0)*u)%cr*cr+s)/n|0)+(r/cr|0)+l*a,e[c]=o%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var o,i;if(n!=r)i=n>r?1:-1;else for(o=i=0;o<n;o++)if(e[o]!=t[o]){i=e[o]>t[o]?1:-1;break}return i}function n(e,t,n,r){for(var o=0;n--;)e[n]-=o,o=e[n]<t[n]?1:0,e[n]=o*r+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(r,o,i,a,s){var c,u,l,d,f,h,p,g,m,y,w,v,b,A,S,E,x,k=r.s==o.s?1:-1,T=r.c,_=o.c;if(!(T&&T[0]&&_&&_[0]))return new I(r.s&&o.s&&(T?!_||T[0]!=_[0]:_)?T&&0==T[0]||!_?0*k:k/0:NaN);for(m=(g=new I(k)).c=[],k=i+(u=r.e-o.e)+1,s||(s=or,u=lr(r.e/ir)-lr(o.e/ir),k=k/ir|0),l=0;_[l]==(T[l]||0);l++);if(_[l]>(T[l]||0)&&u--,k<0)m.push(1),d=!0;else{for(A=T.length,E=_.length,l=0,k+=2,(f=tr(s/(_[0]+1)))>1&&(_=e(_,f,s),T=e(T,f,s),E=_.length,A=T.length),b=E,w=(y=T.slice(0,E)).length;w<E;y[w++]=0);x=_.slice(),x=[0].concat(x),S=_[0],_[1]>=s/2&&S++;do{if(f=0,(c=t(_,y,E,w))<0){if(v=y[0],E!=w&&(v=v*s+(y[1]||0)),(f=tr(v/S))>1)for(f>=s&&(f=s-1),p=(h=e(_,f,s)).length,w=y.length;1==t(h,y,p,w);)f--,n(h,E<p?x:_,p,s),p=h.length,c=1;else 0==f&&(c=f=1),p=(h=_.slice()).length;if(p<w&&(h=[0].concat(h)),n(y,h,w,s),w=y.length,-1==c)for(;t(_,y,E,w)<1;)f++,n(y,E<w?x:_,w,s),w=y.length}else 0===c&&(f++,y=[0]);m[l++]=f,y[0]?y[w++]=T[b]||0:(y=[T[b]],w=1)}while((b++<A||null!=y[0])&&k--);d=null!=y[0],m[0]||m.splice(0,1)}if(s==or){for(l=1,k=m[0];k>=10;k/=10,l++);B(g,i+(g.e=l+u*ir-1)+1,a,d)}else g.e=u,g.r=+d;return g}}(),s=/^(-?)0([xbo])(?=\\w[\\w.]*$)/i,c=/^([^.]+)\\.$/,u=/^\\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,d=/^\\s*\\+(?=[\\w.])|^\\s+|\\s+$/g,o=function(e,t,n,r){var o,i=n?t:t.replace(d,\"\");if(l.test(i))e.s=isNaN(i)?null:i<0?-1:1;else{if(!n&&(i=i.replace(s,function(e,t,n){return o=\"x\"==(n=n.toLowerCase())?16:\"b\"==n?2:8,r&&r!=o?e:t}),r&&(o=r,i=i.replace(c,\"$1\").replace(u,\"0.$1\")),t!=i))return new I(i,o);if(I.DEBUG)throw Error(nr+\"Not a\"+(r?\" base \"+r:\"\")+\" number: \"+t);e.s=null}e.c=e.e=null},f.absoluteValue=f.abs=function(){var e=new I(this);return e.s<0&&(e.s=1),e},f.comparedTo=function(e,t){return fr(this,new I(e,t))},f.decimalPlaces=f.dp=function(e,t){var n,r,o,i=this;if(null!=e)return hr(e,0,ur),null==t?t=g:hr(t,0,8),B(new I(i),e+i.e+1,t);if(!(n=i.c))return null;if(r=((o=n.length-1)-lr(this.e/ir))*ir,o=n[o])for(;o%10==0;o/=10,r--);return r<0&&(r=0),r},f.dividedBy=f.div=function(e,t){return n(this,new I(e,t),p,g)},f.dividedToIntegerBy=f.idiv=function(e,t){return n(this,new I(e,t),0,1)},f.exponentiatedBy=f.pow=function(e,t){var n,r,o,i,a,s,c,u,l=this;if((e=new I(e)).c&&!e.isInteger())throw Error(nr+\"Exponent not an integer: \"+R(e));if(null!=t&&(t=new I(t)),a=e.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!e.c||!e.c[0])return u=new I(Math.pow(+R(l),a?e.s*(2-pr(e)):+R(e))),t?u.mod(t):u;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new I(NaN);(r=!s&&l.isInteger()&&t.isInteger())&&(l=l.mod(t))}else{if(e.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||a&&l.c[1]>=24e7:l.c[0]<8e13||a&&l.c[0]<=9999975e7)))return i=l.s<0&&pr(e)?-0:0,l.e>-1&&(i=1/i),new I(s?1/i:i);S&&(i=er(S/ir+2))}for(a?(n=new I(.5),s&&(e.s=1),c=pr(e)):c=(o=Math.abs(+R(e)))%2,u=new I(h);;){if(c){if(!(u=u.times(l)).c)break;i?u.c.length>i&&(u.c.length=i):r&&(u=u.mod(t))}if(o){if(0===(o=tr(o/2)))break;c=o%2}else if(B(e=e.times(n),e.e+1,1),e.e>14)c=pr(e);else{if(0===(o=+R(e)))break;c=o%2}l=l.times(l),i?l.c&&l.c.length>i&&(l.c.length=i):r&&(l=l.mod(t))}return r?u:(s&&(u=h.div(u)),t?u.mod(t):i?B(u,S,g,void 0):u)},f.integerValue=function(e){var t=new I(this);return null==e?e=g:hr(e,0,8),B(t,t.e+1,e)},f.isEqualTo=f.eq=function(e,t){return 0===fr(this,new I(e,t))},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(e,t){return fr(this,new I(e,t))>0},f.isGreaterThanOrEqualTo=f.gte=function(e,t){return 1===(t=fr(this,new I(e,t)))||0===t},f.isInteger=function(){return!!this.c&&lr(this.e/ir)>this.c.length-2},f.isLessThan=f.lt=function(e,t){return fr(this,new I(e,t))<0},f.isLessThanOrEqualTo=f.lte=function(e,t){return-1===(t=fr(this,new I(e,t)))||0===t},f.isNaN=function(){return!this.s},f.isNegative=function(){return this.s<0},f.isPositive=function(){return this.s>0},f.isZero=function(){return!!this.c&&0==this.c[0]},f.minus=function(e,t){var n,r,o,i,a=this,s=a.s;if(t=(e=new I(e,t)).s,!s||!t)return new I(NaN);if(s!=t)return e.s=-t,a.plus(e);var c=a.e/ir,u=e.e/ir,l=a.c,d=e.c;if(!c||!u){if(!l||!d)return l?(e.s=-t,e):new I(d?a:NaN);if(!l[0]||!d[0])return d[0]?(e.s=-t,e):new I(l[0]?a:3==g?-0:0)}if(c=lr(c),u=lr(u),l=l.slice(),s=c-u){for((i=s<0)?(s=-s,o=l):(u=c,o=d),o.reverse(),t=s;t--;o.push(0));o.reverse()}else for(r=(i=(s=l.length)<(t=d.length))?s:t,s=t=0;t<r;t++)if(l[t]!=d[t]){i=l[t]<d[t];break}if(i&&(o=l,l=d,d=o,e.s=-e.s),(t=(r=d.length)-(n=l.length))>0)for(;t--;l[n++]=0);for(t=or-1;r>s;){if(l[--r]<d[r]){for(n=r;n&&!l[--n];l[n]=t);--l[n],l[r]+=or}l[r]-=d[r]}for(;0==l[0];l.splice(0,1),--u);return l[0]?C(e,l,u):(e.s=3==g?-1:1,e.c=[e.e=0],e)},f.modulo=f.mod=function(e,t){var r,o,i=this;return e=new I(e,t),!i.c||!e.s||e.c&&!e.c[0]?new I(NaN):!e.c||i.c&&!i.c[0]?new I(i):(9==A?(o=e.s,e.s=1,r=n(i,e,0,3),e.s=o,r.s*=o):r=n(i,e,0,A),(e=i.minus(r.times(e))).c[0]||1!=A||(e.s=i.s),e)},f.multipliedBy=f.times=function(e,t){var n,r,o,i,a,s,c,u,l,d,f,h,p,g,m,y=this,w=y.c,v=(e=new I(e,t)).c;if(!(w&&v&&w[0]&&v[0]))return!y.s||!e.s||w&&!w[0]&&!v||v&&!v[0]&&!w?e.c=e.e=e.s=null:(e.s*=y.s,w&&v?(e.c=[0],e.e=0):e.c=e.e=null),e;for(r=lr(y.e/ir)+lr(e.e/ir),e.s*=y.s,(c=w.length)<(d=v.length)&&(p=w,w=v,v=p,o=c,c=d,d=o),o=c+d,p=[];o--;p.push(0));for(g=or,m=cr,o=d;--o>=0;){for(n=0,f=v[o]%m,h=v[o]/m|0,i=o+(a=c);i>o;)n=((u=f*(u=w[--a]%m)+(s=h*u+(l=w[a]/m|0)*f)%m*m+p[i]+n)/g|0)+(s/m|0)+h*l,p[i--]=u%g;p[i]=n}return n?++r:p.splice(0,1),C(e,p,r)},f.negated=function(){var e=new I(this);return e.s=-e.s||null,e},f.plus=function(e,t){var n,r=this,o=r.s;if(t=(e=new I(e,t)).s,!o||!t)return new I(NaN);if(o!=t)return e.s=-t,r.minus(e);var i=r.e/ir,a=e.e/ir,s=r.c,c=e.c;if(!i||!a){if(!s||!c)return new I(o/0);if(!s[0]||!c[0])return c[0]?e:new I(s[0]?r:0*o)}if(i=lr(i),a=lr(a),s=s.slice(),o=i-a){for(o>0?(a=i,n=c):(o=-o,n=s),n.reverse();o--;n.push(0));n.reverse()}for((o=s.length)-(t=c.length)<0&&(n=c,c=s,s=n,t=o),o=0;t;)o=(s[--t]=s[t]+c[t]+o)/or|0,s[t]=or===s[t]?0:s[t]%or;return o&&(s=[o].concat(s),++a),C(e,s,a)},f.precision=f.sd=function(e,t){var n,r,o,i=this;if(null!=e&&e!==!!e)return hr(e,1,ur),null==t?t=g:hr(t,0,8),B(new I(i),e,t);if(!(n=i.c))return null;if(r=(o=n.length-1)*ir+1,o=n[o]){for(;o%10==0;o/=10,r--);for(o=n[0];o>=10;o/=10,r++);}return e&&i.e+1>r&&(r=i.e+1),r},f.shiftedBy=function(e){return hr(e,-9007199254740991,ar),this.times(\"1e\"+e)},f.squareRoot=f.sqrt=function(){var e,t,r,o,i,a=this,s=a.c,c=a.s,u=a.e,l=p+4,d=new I(\"0.5\");if(1!==c||!s||!s[0])return new I(!c||c<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(c=Math.sqrt(+R(a)))||c==1/0?(((t=dr(s)).length+u)%2==0&&(t+=\"0\"),c=Math.sqrt(+t),u=lr((u+1)/2)-(u<0||u%2),r=new I(t=c==1/0?\"5e\"+u:(t=c.toExponential()).slice(0,t.indexOf(\"e\")+1)+u)):r=new I(c+\"\"),r.c[0])for((c=(u=r.e)+l)<3&&(c=0);;)if(i=r,r=d.times(i.plus(n(a,i,l,1))),dr(i.c).slice(0,c)===(t=dr(r.c)).slice(0,c)){if(r.e<u&&--c,\"9999\"!=(t=t.slice(c-3,c+1))&&(o||\"4999\"!=t)){+t&&(+t.slice(1)||\"5\"!=t.charAt(0))||(B(r,r.e+p+2,1),e=!r.times(r).eq(a));break}if(!o&&(B(i,i.e+p+2,0),i.times(i).eq(a))){r=i;break}l+=4,c+=4,o=1}return B(r,r.e+p+1,g,e)},f.toExponential=function(e,t){return null!=e&&(hr(e,0,ur),e++),T(this,e,t,1)},f.toFixed=function(e,t){return null!=e&&(hr(e,0,ur),e=e+this.e+1),T(this,e,t)},f.toFormat=function(e,t,n){var r,o=this;if(null==n)null!=e&&t&&\"object\"==typeof t?(n=t,t=null):e&&\"object\"==typeof e?(n=e,e=t=null):n=E;else if(\"object\"!=typeof n)throw Error(nr+\"Argument not an object: \"+n);if(r=o.toFixed(e,t),o.c){var i,a=r.split(\".\"),s=+n.groupSize,c=+n.secondaryGroupSize,u=n.groupSeparator||\"\",l=a[0],d=a[1],f=o.s<0,h=f?l.slice(1):l,p=h.length;if(c&&(i=s,s=c,c=i,p-=i),s>0&&p>0){for(i=p%s||s,l=h.substr(0,i);i<p;i+=s)l+=u+h.substr(i,s);c>0&&(l+=u+h.slice(i)),f&&(l=\"-\"+l)}r=d?l+(n.decimalSeparator||\"\")+((c=+n.fractionGroupSize)?d.replace(new RegExp(\"\\\\d{\"+c+\"}\\\\B\",\"g\"),\"$&\"+(n.fractionGroupSeparator||\"\")):d):l}return(n.prefix||\"\")+r+(n.suffix||\"\")},f.toFraction=function(e){var t,r,o,i,a,s,c,u,l,d,f,p,m=this,y=m.c;if(null!=e&&(!(c=new I(e)).isInteger()&&(c.c||1!==c.s)||c.lt(h)))throw Error(nr+\"Argument \"+(c.isInteger()?\"out of range: \":\"not an integer: \")+R(c));if(!y)return new I(m);for(t=new I(h),l=r=new I(h),o=u=new I(h),p=dr(y),a=t.e=p.length-m.e-1,t.c[0]=sr[(s=a%ir)<0?ir+s:s],e=!e||c.comparedTo(t)>0?a>0?t:l:c,s=v,v=1/0,c=new I(p),u.c[0]=0;d=n(c,t,0,1),1!=(i=r.plus(d.times(o))).comparedTo(e);)r=o,o=i,l=u.plus(d.times(i=l)),u=i,t=c.minus(d.times(i=t)),c=i;return i=n(e.minus(r),o,0,1),u=u.plus(i.times(l)),r=r.plus(i.times(o)),u.s=l.s=m.s,f=n(l,o,a*=2,g).minus(m).abs().comparedTo(n(u,r,a,g).minus(m).abs())<1?[l,o]:[u,r],v=s,f},f.toNumber=function(){return+R(this)},f.toPrecision=function(e,t){return null!=e&&hr(e,1,ur),T(this,e,t,2)},f.toString=function(e){var t,n=this,o=n.s,i=n.e;return null===i?o?(t=\"Infinity\",o<0&&(t=\"-\"+t)):t=\"NaN\":(null==e?t=i<=m||i>=y?gr(dr(n.c),i):mr(dr(n.c),i,\"0\"):10===e&&k?t=mr(dr((n=B(new I(n),p+i+1,g)).c),n.e,\"0\"):(hr(e,2,x.length,\"Base\"),t=r(mr(dr(n.c),i,\"0\"),10,e,o,!0)),o<0&&n.c[0]&&(t=\"-\"+t)),t},f.valueOf=f.toJSON=function(){return R(this)},f._isBigNumber=!0,f[Symbol.toStringTag]=\"BigNumber\",f[Symbol.for(\"nodejs.util.inspect.custom\")]=f.valueOf,null!=t&&I.set(t),I}();const wr=yr;function vr(e,t){return n=e,Boolean(\"string\"==typeof n?.prototype?.constructor?.name)?new e({message:t}):e({message:t});var n}class br extends Error{constructor(e){super(e.message),this.code=\"ERR_ASSERTION\"}}function Ar(e,t=\"Assertion failed.\",n=br){if(!e){if(t instanceof Error)throw t;throw vr(n,t)}}var Sr=-32700,Er=-32603,xr=-32602,kr=-32601,Ir=-32600,Tr=-32015,_r=-32014,Cr=-32012,Br=-32010,Rr=-32009,Pr=-32007,Nr=-32006,Or=-32004,Ur=-32002,Mr=-32001,zr=28e5,Lr=2800001,jr=2800003,Fr=2800006,Dr=2800007,$r=2800008,Kr=2800009,qr=323e4,Wr=32300001,Vr=3230002,Hr=3230004,Gr=361e4,Zr=3610001,Yr=3610003,Jr=3610005,Xr=3610006,Qr=3610007,eo=3704001,to=3704002,no=3704003,ro=4615e3,oo=4615026,io=4615045,ao=5508e3,so=5663e3,co=5663001,uo=5663004,lo=5663005,fo=5663006,ho=5663007,po=5663008,go=5663009,mo=5663012,yo=5663015,wo=5663016,vo=5663017,bo=5663018,Ao=5663019,So=705e4,Eo=7050030,xo=7050031,ko=7050035,Io=8078e3,To=8078001,_o=8078002,Co=8078004,Bo=8078005,Ro=8078006,Po=8078007,No=8078008,Oo=8078011,Uo=8078012,Mo=8078013,zo=8078014,Lo=8078017,jo=8078018,Fo=8078022,Do=81e5,$o=8100002,Ko=8100003,qo=9900003;function Wo(e){if(Array.isArray(e)){return\"%5B\"+e.map(Wo).join(\"%2C%20\")+\"%5D\"}return\"bigint\"==typeof e?`${e}n`:encodeURIComponent(String(null!=e&&null===Object.getPrototypeOf(e)?{...e}:e))}function Vo([e,t]){return`${e}=${Wo(t)}`}function Ho(e,t={}){{let n=`Solana error #${e}; Decode this error by running \\`npx @solana/errors decode -- ${e}`;return Object.keys(t).length&&(n+=` '${function(e){const t=Object.entries(e).map(Vo).join(\"&\");return btoa(t)}(t)}'`),`${n}\\``}}function Go(e,t){return!!(e instanceof Error&&\"SolanaError\"===e.name)&&(void 0===t||e.context.__code===t)}var Zo=class extends Error{cause=this.cause;context;constructor(...[e,t]){let n,r;if(t){const{cause:e,...o}=t;e&&(r={cause:e}),Object.keys(o).length>0&&(n=o)}super(Ho(e,n),r),this.context={__code:e,...n},this.name=\"SolanaError\"}};function Yo(...e){\"captureStackTrace\"in Error&&\"function\"==typeof Error.captureStackTrace&&Error.captureStackTrace(...e)}function Jo({errorCodeBaseOffset:e,getErrorContext:t,orderedErrorNames:n,rpcEnumError:r},o){let i,a;\"string\"==typeof r?i=r:(i=Object.keys(r)[0],a=r[i]);const s=e+n.indexOf(i),c=t(s,i,a),u=new Zo(s,c);return Yo(u,o),u}var Xo=[\"GenericError\",\"InvalidArgument\",\"InvalidInstructionData\",\"InvalidAccountData\",\"AccountDataTooSmall\",\"InsufficientFunds\",\"IncorrectProgramId\",\"MissingRequiredSignature\",\"AccountAlreadyInitialized\",\"UninitializedAccount\",\"UnbalancedInstruction\",\"ModifiedProgramId\",\"ExternalAccountLamportSpend\",\"ExternalAccountDataModified\",\"ReadonlyLamportChange\",\"ReadonlyDataModified\",\"DuplicateAccountIndex\",\"ExecutableModified\",\"RentEpochModified\",\"NotEnoughAccountKeys\",\"AccountDataSizeChanged\",\"AccountNotExecutable\",\"AccountBorrowFailed\",\"AccountBorrowOutstanding\",\"DuplicateAccountOutOfSync\",\"Custom\",\"InvalidError\",\"ExecutableDataModified\",\"ExecutableLamportChange\",\"ExecutableAccountNotRentExempt\",\"UnsupportedProgramId\",\"CallDepth\",\"MissingAccount\",\"ReentrancyNotAllowed\",\"MaxSeedLengthExceeded\",\"InvalidSeeds\",\"InvalidRealloc\",\"ComputationalBudgetExceeded\",\"PrivilegeEscalation\",\"ProgramEnvironmentSetupFailure\",\"ProgramFailedToComplete\",\"ProgramFailedToCompile\",\"Immutable\",\"IncorrectAuthority\",\"BorshIoError\",\"AccountNotRentExempt\",\"InvalidAccountOwner\",\"ArithmeticOverflow\",\"UnsupportedSysvar\",\"IllegalOwner\",\"MaxAccountsDataAllocationsExceeded\",\"MaxAccountsExceeded\",\"MaxInstructionTraceLengthExceeded\",\"BuiltinProgramsMustConsumeComputeUnits\"];function Qo(e,t){const n=Number(e);return Jo({errorCodeBaseOffset:4615001,getErrorContext:(e,t,r)=>e===ro?{errorName:t,index:n,...void 0!==r?{instructionErrorContext:r}:null}:e===oo?{code:Number(r),index:n}:e===io?{encodedData:r,index:n}:{index:n},orderedErrorNames:Xo,rpcEnumError:t},Qo)}var ei=[\"AccountInUse\",\"AccountLoadedTwice\",\"AccountNotFound\",\"ProgramAccountNotFound\",\"InsufficientFundsForFee\",\"InvalidAccountForFee\",\"AlreadyProcessed\",\"BlockhashNotFound\",\"CallChainTooDeep\",\"MissingSignatureForFee\",\"InvalidAccountIndex\",\"SignatureFailure\",\"InvalidProgramForExecution\",\"SanitizeFailure\",\"ClusterMaintenance\",\"AccountBorrowOutstanding\",\"WouldExceedMaxBlockCostLimit\",\"UnsupportedVersion\",\"InvalidWritableAccount\",\"WouldExceedMaxAccountCostLimit\",\"WouldExceedAccountDataBlockLimit\",\"TooManyAccountLocks\",\"AddressLookupTableNotFound\",\"InvalidAddressLookupTableOwner\",\"InvalidAddressLookupTableData\",\"InvalidAddressLookupTableIndex\",\"InvalidRentPayingAccount\",\"WouldExceedMaxVoteCostLimit\",\"WouldExceedAccountDataTotalLimit\",\"DuplicateInstruction\",\"InsufficientFundsForRent\",\"MaxLoadedAccountsDataSizeExceeded\",\"InvalidLoadedAccountsDataSizeLimit\",\"ResanitizationNeeded\",\"ProgramExecutionTemporarilyRestricted\",\"UnbalancedTransaction\"];function ti(e){return\"object\"==typeof e&&\"InstructionError\"in e?Qo(...e.InstructionError):Jo({errorCodeBaseOffset:7050001,getErrorContext:(e,t,n)=>e===So?{errorName:t,...void 0!==n?{transactionErrorContext:n}:null}:e===Eo?{index:Number(n)}:e===xo||e===ko?{accountIndex:Number(n.account_index)}:void 0,orderedErrorNames:ei,rpcEnumError:e},ti)}function ni(e){let t;if(\"object\"==typeof(n=e)&&null!==n&&\"code\"in n&&\"message\"in n&&(\"number\"==typeof n.code||\"bigint\"==typeof n.code)&&\"string\"==typeof n.message){const{code:n,data:r,message:o}=e,i=Number(n);if(i===Ur){const{err:e,...n}=r,o=e?{cause:ti(e)}:null;t=new Zo(Ur,{...n,...o})}else{let e;switch(i){case Er:case xr:case Ir:case kr:case Sr:case Cr:case Mr:case Or:case _r:case Br:case Rr:case Pr:case Nr:case Tr:e={__serverMessage:o};break;default:\"object\"!=typeof r||Array.isArray(r)||(e=r)}t=new Zo(i,e)}}else{const n=\"object\"==typeof e&&null!==e&&\"message\"in e&&\"string\"==typeof e.message?e.message:\"Malformed JSON-RPC error with no message attribute\";t=new Zo(10,{error:e,message:n})}var n;return Yo(t,ni),t}var ri=(e,t)=>((e,t)=>{if(e.length>=t)return e;const n=new Uint8Array(t).fill(0);return n.set(e),n})(e.length<=t?e:e.slice(0,t),t);function oi(e,t,n){const r=0===n&&e.length===t.length?e:e.slice(n,n+t.length);return r.length===t.length&&t.every((e,t)=>e===r[t])}function ii(e,t){return\"fixedSize\"in t?t.fixedSize:t.getSizeFromValue(e)}function ai(e){return Object.freeze({...e,encode:t=>{const n=new Uint8Array(ii(t,e));return e.write(t,n,0),n}})}function si(e){return Object.freeze({...e,decode:(t,n=0)=>e.read(t,n)[0]})}function ci(e){return\"fixedSize\"in e&&\"number\"==typeof e.fixedSize}function ui(e){if(!ci(e))throw new Zo(_o)}function li(e){return!ci(e)}function di(e,t){if(ci(e)!==ci(t))throw new Zo(Co);if(ci(e)&&ci(t)&&e.fixedSize!==t.fixedSize)throw new Zo(Bo,{decoderFixedSize:t.fixedSize,encoderFixedSize:e.fixedSize});if(!ci(e)&&!ci(t)&&e.maxSize!==t.maxSize)throw new Zo(Ro,{decoderMaxSize:t.maxSize,encoderMaxSize:e.maxSize});return{...t,...e,decode:t.decode,encode:e.encode,read:t.read,write:e.write}}function fi(e,t,n,r=0){const o=n.length-r;if(o<t)throw new Zo(To,{bytesLength:o,codecDescription:e,expected:t})}function hi(e,t,n){if(t<0||t>n)throw new Zo(zo,{bytesLength:n,codecDescription:e,offset:t})}function pi(e,t){const n=(n,r,o)=>{const i=e.encode(n);return o=t.write(i.length,r,o),r.set(i,o),o+i.length};if(ci(t)&&ci(e))return ai({...e,fixedSize:t.fixedSize+e.fixedSize,write:n});const r=ci(t)?t.fixedSize:t.maxSize??null,o=ci(e)?e.fixedSize:e.maxSize??null,i=null!==r&&null!==o?r+o:null;return ai({...e,...null!==i?{maxSize:i}:{},getSizeFromValue:n=>{const r=ii(n,e);return ii(r,t)+r},write:n})}function gi(e,t){const n=(n,r)=>{const[o,i]=t.read(n,r),a=Number(o);return((r=i)>0||n.length>a)&&(n=n.slice(r,r+a)),fi(\"addDecoderSizePrefix\",a,n),[e.decode(n),r+a]};if(ci(t)&&ci(e))return si({...e,fixedSize:t.fixedSize+e.fixedSize,read:n});const r=ci(t)?t.fixedSize:t.maxSize??null,o=ci(e)?e.fixedSize:e.maxSize??null,i=null!==r&&null!==o?r+o:null;return si({...e,...null!==i?{maxSize:i}:{},read:n})}function mi(e,t){return ai({fixedSize:t,write:(n,r,o)=>{const i=e.encode(n),a=i.length>t?i.slice(0,t):i;return r.set(a,o),o+t}})}function yi(e,t){return si({fixedSize:t,read:(n,r)=>{fi(\"fixCodecSize\",t,n,r),(r>0||n.length>t)&&(n=n.slice(r,r+t)),ci(e)&&(n=ri(n,e.fixedSize));const[o]=e.read(n,0);return[o,r+t]}})}function wi(e,t){return ai({...e,write:(n,r,o)=>{const i=e=>bi(e,r.length),a=t.preOffset?t.preOffset({bytes:r,preOffset:o,wrapBytes:i}):o;hi(\"offsetEncoder\",a,r.length);const s=e.write(n,r,a),c=t.postOffset?t.postOffset({bytes:r,newPreOffset:a,postOffset:s,preOffset:o,wrapBytes:i}):s;return hi(\"offsetEncoder\",c,r.length),c}})}function vi(e,t){return si({...e,read:(n,r)=>{const o=e=>bi(e,n.length),i=t.preOffset?t.preOffset({bytes:n,preOffset:r,wrapBytes:o}):r;hi(\"offsetDecoder\",i,n.length);const[a,s]=e.read(n,i),c=t.postOffset?t.postOffset({bytes:n,newPreOffset:i,postOffset:s,preOffset:r,wrapBytes:o}):s;return hi(\"offsetDecoder\",c,n.length),[a,c]}})}function bi(e,t){return 0===t?0:(e%t+t)%t}function Ai(e,t){if(ci(e)){const n=t(e.fixedSize);if(n<0)throw new Zo(Mo,{bytesLength:n,codecDescription:\"resizeEncoder\"});return ai({...e,fixedSize:n})}return ai({...e,getSizeFromValue:n=>{const r=t(e.getSizeFromValue(n));if(r<0)throw new Zo(Mo,{bytesLength:r,codecDescription:\"resizeEncoder\"});return r}})}function Si(e,t){if(ci(e)){const n=t(e.fixedSize);if(n<0)throw new Zo(Mo,{bytesLength:n,codecDescription:\"resizeDecoder\"});return si({...e,fixedSize:n})}return e}function Ei(e,t){return wi(Ai(e,e=>e+t),{preOffset:({preOffset:e})=>e+t})}function xi(e,t){return vi(Si(e,e=>e+t),{postOffset:({postOffset:e})=>e+t})}function ki(e,t){return ai({...li(e)?{...e,getSizeFromValue:n=>e.getSizeFromValue(t(n))}:e,write:(n,r,o)=>e.write(t(n),r,o)})}function Ii(e,t){return si({...e,read:(n,r)=>{const[o,i]=e.read(n,r);return[t(o,n,r),i]}})}function Ti(e,t,n,r){if(r<t||r>n)throw new Zo(Oo,{codecDescription:e,max:n,min:t,value:r})}function _i(e){return 1!==e?.endian}function Ci(e){return ai({fixedSize:e.size,write(t,n,r){e.range&&Ti(e.name,e.range[0],e.range[1],t);const o=new ArrayBuffer(e.size);return e.set(new DataView(o),t,_i(e.config)),n.set(new Uint8Array(o),r),r+e.size}})}function Bi(e){return si({fixedSize:e.size,read(t,n=0){!function(e,t,n=0){if(t.length-n<=0)throw new Zo(Io,{codecDescription:e})}(e.name,t,n),fi(e.name,e.size,t,n);const r=new DataView(function(e,t,n){const r=e.byteOffset+(t??0),o=n??e.byteLength;return e.buffer.slice(r,r+o)}(t,n,e.size));return[e.get(r,_i(e.config)),n+e.size]}})}var Ri=(e={})=>Bi({config:e,get:(e,t)=>e.getFloat64(0,t),name:\"f64\",size:8}),Pi=(e={})=>Bi({config:e,get:(e,t)=>e.getInt16(0,t),name:\"i16\",size:2}),Ni=(e={})=>Bi({config:e,get:(e,t)=>e.getBigInt64(0,t),name:\"i64\",size:8}),Oi=()=>Bi({get:e=>e.getInt8(0),name:\"i8\",size:1}),Ui=()=>ai({getSizeFromValue:e=>e<=127?1:e<=16383?2:3,maxSize:3,write:(e,t,n)=>{Ti(\"shortU16\",0,65535,e);const r=[0];for(let t=0;;t+=1){const n=Number(e)>>7*t;if(0===n)break;const o=127&n;r[t]=o,t>0&&(r[t-1]|=128)}return t.set(r,n),n+r.length}}),Mi=()=>si({maxSize:3,read:(e,t)=>{let n=0,r=0;for(;++r;){const o=r-1,i=e[t+o];if(n|=(127&i)<<7*o,!(128&i))break}return[n,t+r]}}),zi=(e={})=>Bi({config:e,get:(e,t)=>e.getUint16(0,t),name:\"u16\",size:2}),Li=(e={})=>Ci({config:e,name:\"u32\",range:[0,Number(\"0xffffffff\")],set:(e,t,n)=>e.setUint32(0,Number(t),n),size:4}),ji=(e={})=>Bi({config:e,get:(e,t)=>e.getUint32(0,t),name:\"u32\",size:4}),Fi=(e={})=>Ci({config:e,name:\"u64\",range:[0n,BigInt(\"0xffffffffffffffff\")],set:(e,t,n)=>e.setBigUint64(0,BigInt(t),n),size:8}),Di=(e={})=>Bi({config:e,get:(e,t)=>e.getBigUint64(0,t),name:\"u64\",size:8}),$i=()=>Ci({name:\"u8\",range:[0,Number(\"0xff\")],set:(e,t)=>e.setUint8(0,Number(t)),size:1}),Ki=()=>Bi({get:e=>e.getUint8(0),name:\"u8\",size:1});var qi,Wi=((qi=Wi||{})[qi.WRITABLE_SIGNER=3]=\"WRITABLE_SIGNER\",qi[qi.READONLY_SIGNER=2]=\"READONLY_SIGNER\",qi[qi.WRITABLE=1]=\"WRITABLE\",qi[qi.READONLY=0]=\"READONLY\",qi);function Vi(e){return e>=2}function Hi(e){return!!(1&e)}function Gi(e,t){return e|t}function Zi(e){return 2|e}function Yi(e,t,n=t){if(!t.match(new RegExp(`^[${e}]*$`)))throw new Zo(Uo,{alphabet:e,base:e.length,value:n})}var Ji=e=>ai({getSizeFromValue:t=>{const[n,r]=ea(t,e[0]);if(!r)return t.length;const o=ta(r,e);return n.length+Math.ceil(o.toString(16).length/2)},write(t,n,r){if(Yi(e,t),\"\"===t)return r;const[o,i]=ea(t,e[0]);if(!i)return n.set(new Uint8Array(o.length).fill(0),r),r+o.length;let a=ta(i,e);const s=[];for(;a>0n;)s.unshift(Number(a%256n)),a/=256n;const c=[...Array(o.length).fill(0),...s];return n.set(c,r),r+c.length}}),Xi=e=>si({read(t,n){const r=0===n?t:t.slice(n);if(0===r.length)return[\"\",0];let o=r.findIndex(e=>0!==e);o=-1===o?r.length:o;const i=e[0].repeat(o);if(o===r.length)return[i,t.length];const a=function(e,t){const n=BigInt(t.length),r=[];for(;e>0n;)r.unshift(t[Number(e%n)]),e/=n;return r.join(\"\")}(r.slice(o).reduce((e,t)=>256n*e+BigInt(t),0n),e);return[i+a,t.length]}}),Qi=e=>di(Ji(e),Xi(e));function ea(e,t){const[n,r]=e.split(new RegExp(`((?!${t}).*)`));return[n,r]}function ta(e,t){const n=BigInt(t.length);let r=0n;for(const o of e)r*=n,r+=BigInt(t.indexOf(o));return r}var na=\"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\",ra=()=>Ji(na),oa=()=>Xi(na),ia=()=>Qi(na);var aa,sa,ca=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",ua=()=>ai({getSizeFromValue:e=>{try{return atob(e).length}catch{throw new Zo(Uo,{alphabet:ca,base:64,value:e})}},write(e,t,n){try{const r=atob(e).split(\"\").map(e=>e.charCodeAt(0));return t.set(r,n),r.length+n}catch{throw new Zo(Uo,{alphabet:ca,base:64,value:e})}}}),la=()=>si({read(e,t=0){const n=e.slice(t);return[btoa(String.fromCharCode(...n)),e.length]}}),da=()=>di(ua(),la()),fa=e=>e.replace(/\\u0000/g,\"\"),ha=globalThis.TextDecoder,pa=globalThis.TextEncoder,ga=()=>{let e;return si({read(t,n){const r=(e||=new ha).decode(t.slice(n));return[fa(r),t.length]}})},ma=()=>di((()=>{let e;return ai({getSizeFromValue:t=>(e||=new pa).encode(t).length,write:(t,n,r)=>{const o=(e||=new pa).encode(t);return n.set(o,r),r+o.length}})})(),ga());function ya(){if(!globalThis.isSecureContext)throw new Zo(Gr)}function wa(){if(ya(),void 0===globalThis.crypto||\"function\"!=typeof globalThis.crypto.subtle?.exportKey)throw new Zo(Yr)}function va(){return aa||(aa=ra()),aa}function ba(e){if(e.length<32||e.length>44)return!1;const t=va();try{return 32===t.encode(e).byteLength}catch{return!1}}function Aa(e){if(e.length<32||e.length>44)throw new Zo(Lr,{actualLength:e.length});const t=va().encode(e).byteLength;if(32!==t)throw new Zo(zr,{actualLength:t})}function Sa(e){return Aa(e),e}function Ea(){return ki(mi(va(),32),e=>Sa(e))}function xa(){return yi((sa||(sa=oa()),sa),32)}function ka(){return di(Ea(),xa())}function Ia(){return new Intl.Collator(\"en\",{caseFirst:\"lower\",ignorePunctuation:!1,localeMatcher:\"best fit\",numeric:!1,sensitivity:\"variant\",usage:\"sort\"}).compare}var Ta=57896044618658097711785492504343953926634992332820282019728792003956564819949n,_a=19681161376707505956807079304988542015446066515923890162744021073123829784752n;function Ca(e){const t=e%Ta;return t>=0n?t:Ta+t}function Ba(e,t){let n=e;for(;t-- >0n;)n*=n,n%=Ta;return n}function Ra(e,t){const n=Ca(t*t*t),r=function(e){const t=e*e%Ta*e%Ta,n=Ba(t,2n)*t%Ta,r=Ba(n,1n)*e%Ta,o=Ba(r,5n)*r%Ta,i=Ba(o,10n)*o%Ta,a=Ba(i,20n)*i%Ta,s=Ba(a,40n)*a%Ta,c=Ba(s,80n)*s%Ta,u=Ba(c,80n)*s%Ta,l=Ba(u,10n)*o%Ta;return Ba(l,2n)*e%Ta}(e*Ca(n*n*t));let o=Ca(e*n*r);const i=Ca(t*o*o),a=o,s=Ca(o*_a),c=i===e,u=i===Ca(-e),l=i===Ca(-e*_a);return c&&(o=a),(u||l)&&(o=s),1n==(1n&Ca(o))&&(o=Ca(-o)),c||u?o:null}function Pa(e){if(32!==e.byteLength)return!1;const t=function(e){const t=e.reduce((e,t,n)=>`${function(e){const t=e.toString(16);return 1===t.length?`0${t}`:t}(31===n?-129&t:t)}${e}`,\"\");return BigInt(`0x${t}`)}(e);return function(e,t){const n=Ca(e*e),r=Ra(Ca(n-1n),Ca(37095705934669439343138083508754565189542113879843219016388785533085940283555n*n+1n));return null!==r&&(0n!==r||!(128&t))}(t,e[31])}var Na=[80,114,111,103,114,97,109,68,101,114,105,118,101,100,65,100,100,114,101,115,115];async function Oa({programAddress:e,seeds:t}){if(function(){if(ya(),void 0===globalThis.crypto||\"function\"!=typeof globalThis.crypto.subtle?.digest)throw new Zo(Zr)}(),t.length>16)throw new Zo(Fr,{actual:t.length,maxSeeds:16});let n;const r=t.reduce((e,t,r)=>{const o=\"string\"==typeof t?(n||=new TextEncoder).encode(t):t;if(o.byteLength>32)throw new Zo(Dr,{actual:o.byteLength,index:r,maxSeedLength:32});return e.push(...o),e},[]),o=ka(),i=o.encode(e),a=await crypto.subtle.digest(\"SHA-256\",new Uint8Array([...r,...i,...Na])),s=new Uint8Array(a);if(Pa(s))throw new Zo($r);return o.decode(s)}async function Ua(e){if(wa(),\"public\"!==e.type||\"Ed25519\"!==e.algorithm.name)throw new Zo(jr);const t=await crypto.subtle.exportKey(\"raw\",e);return xa().decode(new Uint8Array(t))}var Ma,za=Object.freeze({name:\"Ed25519\"});async function La(e,t){const n=e.byteLength;if(32!==n)throw new Zo(eo,{actualLength:n});const r=function(e){return new Uint8Array([48,46,2,1,0,48,5,6,3,43,101,112,4,34,4,32,...e])}(e);return await crypto.subtle.importKey(\"pkcs8\",r,za,t??!1,[\"sign\"])}async function ja(e,t){!function(){if(ya(),void 0===globalThis.crypto||\"function\"!=typeof globalThis.crypto.subtle?.sign)throw new Zo(Jr)}();const n=await crypto.subtle.sign(za,e,t);return new Uint8Array(n)}function Fa(e){return function(e){if(Ma||(Ma=ra()),e.length<64||e.length>88)throw new Zo(no,{actualLength:e.length});const t=Ma.encode(e).byteLength;if(64!==t)throw new Zo(to,{actualLength:t})}(e),e}async function Da(e,t,n){return function(){if(ya(),void 0===globalThis.crypto||\"function\"!=typeof globalThis.crypto.subtle?.verify)throw new Zo(Xr)}(),await crypto.subtle.verify(za,e,t,n)}async function $a(e,t=!1){const n=La(e,t),[r,o]=await Promise.all([(t?n:La(e,!0)).then(async e=>await async function(e,t=!1){if(wa(),!1===e.extractable)throw new Zo(Qr,{key:e});const n=await crypto.subtle.exportKey(\"jwk\",e);return await crypto.subtle.importKey(\"jwk\",{crv:\"Ed25519\",ext:t,key_ops:[\"verify\"],kty:\"OKP\",x:n.x},\"Ed25519\",t,[\"verify\"])}(e,!0)),n]);return{privateKey:o,publicKey:r}}function Ka(e,t,n){if(t!==n)throw new Zo(Po,{actual:n,codecDescription:e,expected:t})}function qa(e){return e.reduce((e,t)=>null===e||null===t?null:e+t,0)}function Wa(e){return ci(e)?e.fixedSize:null}function Va(e){return ci(e)?e.fixedSize:e.maxSize??null}function Ha(e,t={}){const n=t.size??Li(),r=Za(n,Wa(e)),o=Za(n,Va(e))??void 0;return ai({...null!==r?{fixedSize:r}:{getSizeFromValue:t=>(\"object\"==typeof n?ii(t.length,n):0)+[...t].reduce((t,n)=>t+ii(n,e),0),maxSize:o},write:(t,r,o)=>(\"number\"==typeof n&&Ka(\"array\",n,t.length),\"object\"==typeof n&&(o=n.write(t.length,r,o)),t.forEach(t=>{o=e.write(t,r,o)}),o)})}function Ga(e,t={}){const n=t.size??ji(),r=Wa(e),o=Za(n,r),i=Za(n,Va(e))??void 0;return si({...null!==o?{fixedSize:o}:{maxSize:i},read:(t,r)=>{const o=[];if(\"object\"==typeof n&&0===t.slice(r).length)return[o,r];if(\"remainder\"===n){for(;r<t.length;){const[n,i]=e.read(t,r);r=i,o.push(n)}return[o,r]}const[i,a]=\"number\"==typeof n?[n,r]:n.read(t,r);r=a;for(let n=0;n<i;n+=1){const[n,i]=e.read(t,r);r=i,o.push(n)}return[o,r]}})}function Za(e,t){return\"number\"!=typeof e?null:0===e?0:null===t?null:t*e}function Ya(e={}){return Ii(e.size??Ki(),e=>1===Number(e))}function Ja(){return ai({getSizeFromValue:e=>e.length,write:(e,t,n)=>(t.set(e,n),n+e.length)})}function Xa(){return si({read:(e,t)=>{const n=e.slice(t);return[n,t+n.length]}})}function Qa(e){return si({fixedSize:e.length,read:(t,n)=>{const r=si({read(e,t){const n=e.slice(t).reduce((e,t)=>e+t.toString(16).padStart(2,\"0\"),\"\");return[n,e.length]}});if(!oi(t,e,n))throw new Zo(jo,{constant:e,data:t,hexConstant:r.decode(e),hexData:r.decode(t),offset:n});return[void 0,n+e.length]}})}function es(e){const t=qa(e.map(Wa)),n=qa(e.map(Va))??void 0;return si({...null===t?{maxSize:n}:{fixedSize:t},read:(t,n)=>{const r=[];return e.forEach(e=>{const[o,i]=e.read(t,n);r.push(o),n=i}),[r,n]}})}function ts(e,t){const n=rs(e),r=(n,r)=>{const o=t(n,r);return ns(e,o),e[o].read(n,r)};if(null!==n)return si({fixedSize:n,read:r});const o=os(e);return si({...null!==o?{maxSize:o}:{},read:r})}function ns(e,t){if(void 0===e[t])throw new Zo(Lo,{maxRange:e.length-1,minRange:0,variant:t})}function rs(e){if(0===e.length)return 0;if(!ci(e[0]))return null;const t=e[0].fixedSize;return e.every(e=>ci(e)&&e.fixedSize===t)?t:null}function os(e){return e.map(e=>Va(e)).reduce((e,t)=>null===e||null===t?null:Math.max(e,t),0)}function is(e,t={}){const n=t.discriminator??\"__kind\",r=t.size??Ki();return ts(e.map(([e,t])=>Ii(es([r,t]),([,t])=>({[n]:e,...t}))),(e,t)=>Number(r.read(e,t)[0]))}function as(e){const t=[...new Set(Object.values(e).filter(e=>\"number\"==typeof e))].sort(),n=Object.fromEntries(Object.entries(e).slice(t.length)),r=Object.keys(n),o=Object.values(n),i=[...new Set([...r,...o.filter(e=>\"string\"==typeof e)])];return{enumKeys:r,enumRecord:n,enumValues:o,numericalValues:t,stringValues:i}}function ss(e,t){let n=e.length;for(;n--;)if(t(e[n],n,e))return n;return-1}function cs(e){if(0===e.length)return\"\";let t=[e[0],e[0]];const n=[];for(let r=1;r<e.length;r++){const o=e[r];t[1]+1===o?t[1]=o:(n.push(t[0]===t[1]?`${t[0]}`:`${t[0]}-${t[1]}`),t=[o,o])}return n.push(t[0]===t[1]?`${t[0]}`:`${t[0]}-${t[1]}`),n.join(\", \")}function us(e,t={}){const n=t.size??Ki(),r=t.useValuesAsDiscriminators??!1,{enumKeys:o,enumValues:i,numericalValues:a}=as(e);if(r&&i.some(e=>\"string\"==typeof e))throw new Zo(Fo,{stringValues:i.filter(e=>\"string\"==typeof e)});return Ii(n,e=>{const t=Number(e),n=function({discriminator:e,enumKeys:t,enumValues:n,useValuesAsDiscriminators:r}){return r?ss(n,t=>t===e):e>=0&&e<t.length?e:-1}({discriminator:t,enumKeys:o,enumValues:i,useValuesAsDiscriminators:r});if(n<0){const e=r?a:[...Array(o.length).keys()];throw new Zo(No,{discriminator:t,formattedValidDiscriminators:cs(e),validDiscriminators:e})}return i[n]})}var ls;function ds(e,t){return Ii(es([...t,e]),e=>e[e.length-1])}function fs(e,t,n={}){return Ii(Ga(es([e,t]),n),e=>new Map(e))}function hs(){return si({fixedSize:0,read:(e,t)=>[void 0,t]})}function ps(e){const t=e.map(([,e])=>e),n=qa(t.map(Wa)),r=qa(t.map(Va))??void 0;return ai({...null===n?{getSizeFromValue:t=>e.map(([e,n])=>ii(t[e],n)).reduce((e,t)=>e+t,0),maxSize:r}:{fixedSize:n},write:(t,n,r)=>(e.forEach(([e,o])=>{r=o.write(t[e],n,r)}),r)})}function gs(e){const t=e.map(([,e])=>e),n=qa(t.map(Wa)),r=qa(t.map(Va))??void 0;return si({...null===n?{maxSize:r}:{fixedSize:n},read:(t,n)=>{const r={};return e.forEach(([e,o])=>{const[i,a]=o.read(t,n);n=a,r[e]=i}),[r,n]}})}function ms(){return ls||(ls=ra()),ls}function ys(e){if(e.length<32||e.length>44)throw new Zo(4,{actualLength:e.length});const t=ms().encode(e).byteLength;if(32!==t)throw new Zo(5,{actualLength:t})}function ws(e){switch(e){case\"finalized\":return 2;case\"confirmed\":return 1;case\"processed\":return 0;default:throw new Zo(qo,{unexpectedValue:e})}}var vs=18446744073709551615n;function bs(e){return function(e){if(e<0||e>vs)throw new Zo(6)}(e),e}function As(e,...t){return t.reduce((e,t)=>t(e),e)}function Ss(e){if(!(\"lifetimeConstraint\"in e&&\"string\"==typeof e.lifetimeConstraint.blockhash&&\"bigint\"==typeof e.lifetimeConstraint.lastValidBlockHeight))return!1;try{return ys(e.lifetimeConstraint.blockhash),!0}catch{return!1}}function Es(e,t){if(\"lifetimeConstraint\"in t&&t.lifetimeConstraint.blockhash===e.blockhash&&t.lifetimeConstraint.lastValidBlockHeight===e.lastValidBlockHeight)return t;const n={...t,lifetimeConstraint:Object.freeze(e)};return Object.freeze(n),n}var xs=e=>ai({getSizeFromValue:t=>{const[n,r]=Is(t,e[0]);if(!r)return t.length;const o=Ts(r,e);return n.length+Math.ceil(o.toString(16).length/2)},write(t,n,r){if(function(e,t,n=t){if(!t.match(new RegExp(`^[${e}]*$`)))throw new Zo(Uo,{alphabet:e,base:e.length,value:n})}(e,t),\"\"===t)return r;const[o,i]=Is(t,e[0]);if(!i)return n.set(new Uint8Array(o.length).fill(0),r),r+o.length;let a=Ts(i,e);const s=[];for(;a>0n;)s.unshift(Number(a%256n)),a/=256n;const c=[...Array(o.length).fill(0),...s];return n.set(c,r),r+c.length}}),ks=e=>si({read(t,n){const r=0===n?t:t.slice(n);if(0===r.length)return[\"\",0];let o=r.findIndex(e=>0!==e);o=-1===o?r.length:o;const i=e[0].repeat(o);if(o===r.length)return[i,t.length];const a=function(e,t){const n=BigInt(t.length),r=[];for(;e>0n;)r.unshift(t[Number(e%n)]),e/=n;return r.join(\"\")}(r.slice(o).reduce((e,t)=>256n*e+BigInt(t),0n),e);return[i+a,t.length]}});function Is(e,t){const[n,r]=e.split(new RegExp(`((?!${t}).*)`));return[n,r]}function Ts(e,t){const n=BigInt(t.length);let r=0n;for(const o of e)r*=n,r+=BigInt(t.indexOf(o));return r}var _s,Cs,Bs,Rs,Ps,Ns,Os=\"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\";function Us(){return Bs||(Bs=$i()),Bs}function Ms(){return Rs||(Rs=Ki()),Rs}function zs(){return ai({getSizeFromValue:e=>\"legacy\"===e?0:1,maxSize:1,write:(e,t,n)=>{if(\"legacy\"===e)return n;if(e<0||e>127)throw new Zo(uo,{actualVersion:e});return t.set([128|e],n),n+1}})}function Ls(){return si({maxSize:1,read:(e,t)=>{const n=e[t];if(128&n){return[128^n,t+1]}return[\"legacy\",t]}})}function js(){return ps(Ds())}function Fs(){return ki(ps([...Ds(),[\"addressTableLookups\",Ha((_s||(_s=ps([[\"lookupTableAddress\",Ea()],[\"writableIndices\",Ha($i(),{size:Ui()})],[\"readableIndices\",Ha($i(),{size:Ui()})]])),_s),{size:Ui()})]]),e=>\"legacy\"===e.version?e:{...e,addressTableLookups:e.addressTableLookups??[]})}function Ds(){return[[\"version\",zs()],[\"header\",ps([[\"numSignerAccounts\",Us()],[\"numReadonlySignerAccounts\",Us()],[\"numReadonlyNonSignerAccounts\",Us()]])],[\"staticAccounts\",Ha(Ea(),{size:Ui()})],[\"lifetimeToken\",mi(xs(Os),32)],[\"instructions\",Ha((Ps||(Ps=ki(ps([[\"programAddressIndex\",$i()],[\"accountIndices\",Ha($i(),{size:Ui()})],[\"data\",pi(Ja(),Ui())]]),e=>void 0!==e.accountIndices&&void 0!==e.data?e:{...e,accountIndices:e.accountIndices??[],data:e.data??new Uint8Array(0)})),Ps),{size:Ui()})]]}function $s(){return ai({getSizeFromValue:e=>\"legacy\"===e.version?js().getSizeFromValue(e):Fs().getSizeFromValue(e),write:(e,t,n)=>\"legacy\"===e.version?js().write(e,t,n):Fs().write(e,t,n)})}function Ks(){return Ii(gs([[\"version\",Ls()],[\"header\",gs([[\"numSignerAccounts\",Ms()],[\"numReadonlySignerAccounts\",Ms()],[\"numReadonlyNonSignerAccounts\",Ms()]])],[\"staticAccounts\",Ga(xa(),{size:Mi()})],[\"lifetimeToken\",yi(ks(Os),32)],[\"instructions\",Ga((Ns||(Ns=Ii(gs([[\"programAddressIndex\",Ki()],[\"accountIndices\",Ga(Ki(),{size:Mi()})],[\"data\",gi(Xa(),Mi())]]),e=>{if(e.accountIndices.length&&e.data.byteLength)return e;const{accountIndices:t,data:n,...r}=e;return{...r,...t.length?{accountIndices:t}:null,...n.byteLength?{data:n}:null}})),Ns),{size:Mi()})],[\"addressTableLookups\",Ga((Cs||(Cs=gs([[\"lookupTableAddress\",xa()],[\"writableIndices\",Ga(Ki(),{size:Mi()})],[\"readableIndices\",Ga(Ki(),{size:Mi()})]])),Cs),{size:Mi()})]]),({addressTableLookups:e,...t})=>\"legacy\"!==t.version&&e?.length?{...t,addressTableLookups:e}:t)}function qs(e,t,n){e[t]=n(e[t]??{role:Wi.READONLY})}var Ws=Symbol(\"AddressMapTypeProperty\");function Vs(e){const t={};for(const n of e){if(!(\"lookupTableAddress\"in n))continue;const e=t[n.lookupTableAddress]||={readableIndices:[],writableIndices:[]};n.role===Wi.WRITABLE?e.writableIndices.push(n.addressIndex):e.readableIndices.push(n.addressIndex)}return Object.keys(t).sort(Ia()).map(e=>({lookupTableAddress:e,...t[e]}))}function Hs(e){let t=0,n=0,r=0;for(const o of e){if(\"lookupTableAddress\"in o)break;const e=Hi(o.role);Vi(o.role)?(r++,e||n++):e||t++}return{numReadonlyNonSignerAccounts:t,numReadonlySignerAccounts:n,numSignerAccounts:r}}function Gs(e,t){const n=function(e){const t={};for(const[n,r]of e.entries())t[r.address]=n;return t}(t);return e.map(({accounts:e,data:t,programAddress:r})=>({programAddressIndex:n[r],...e?{accountIndices:e.map(({address:e})=>n[e])}:null,...t?{data:t}:null}))}function Zs(e){const t=e.findIndex(e=>\"lookupTableAddress\"in e);return(-1===t?e:e.slice(0,t)).map(({address:e})=>e)}function Ys(e){const t=function(e){let t;const n=Object.entries(e).sort(([e,n],[r,o])=>{if(n[Ws]!==o[Ws]){if(0===n[Ws])return-1;if(0===o[Ws])return 1;if(2===n[Ws])return-1;if(2===o[Ws])return 1}const i=Vi(n.role);if(i!==Vi(o.role))return i?-1:1;const a=Hi(n.role);return a!==Hi(o.role)?a?-1:1:(t||=Ia(),1===n[Ws]&&1===o[Ws]&&n.lookupTableAddress!==o.lookupTableAddress?t(n.lookupTableAddress,o.lookupTableAddress):t(e,r))}).map(([e,t])=>({address:e,...t}));return n}(function(e,t){const n={[e]:{[Ws]:0,role:Wi.WRITABLE_SIGNER}},r=new Set;for(const e of t){let t;if(qs(n,e.programAddress,t=>{if(r.add(e.programAddress),Ws in t){if(Hi(t.role)){if(0===t[Ws])throw new Zo(so,{programAddress:e.programAddress});throw new Zo(co,{programAddress:e.programAddress})}if(2===t[Ws])return t}return{[Ws]:2,role:Wi.READONLY}}),e.accounts)for(const o of e.accounts)qs(n,o.address,e=>{const{address:n,...i}=o;if(Ws in e)switch(e[Ws]){case 0:return e;case 1:{const n=Gi(e.role,i.role);if(\"lookupTableAddress\"in i){if(e.lookupTableAddress!==i.lookupTableAddress&&(t||=Ia())(i.lookupTableAddress,e.lookupTableAddress)<0)return{[Ws]:1,...i,role:n}}else if(Vi(i.role))return{[Ws]:2,role:n};return e.role!==n?{...e,role:n}:e}case 2:{const t=Gi(e.role,i.role);if(r.has(o.address)){if(Hi(i.role))throw new Zo(co,{programAddress:o.address});return e.role!==t?{...e,role:t}:e}return\"lookupTableAddress\"in i&&!Vi(e.role)?{...i,[Ws]:1,role:t}:e.role!==t?{...e,role:t}:e}}return\"lookupTableAddress\"in i?{...i,[Ws]:1}:{...i,[Ws]:2}})}return n}(e.feePayer.address,e.instructions));return{...\"legacy\"!==e.version?{addressTableLookups:Vs(t)}:null,header:Hs(t),instructions:Gs(e.instructions,t),lifetimeToken:(n=e.lifetimeConstraint,\"nonce\"in n?n.nonce:n.blockhash),staticAccounts:Zs(t),version:e.version};var n}function Js({version:e}){return Object.freeze({instructions:Object.freeze([]),version:e})}var Xs,Qs=\"SysvarRecentB1ockHashes11111111111111111111\",ec=\"11111111111111111111111111111111\";function tc(e,t){return{accounts:[{address:e,role:Wi.WRITABLE},{address:Qs,role:Wi.READONLY},{address:t,role:Wi.READONLY_SIGNER}],data:new Uint8Array([4,0,0,0]),programAddress:ec}}function nc(e){return e.programAddress===ec&&null!=e.data&&(4===(t=e.data).byteLength&&4===t[0]&&0===t[1]&&0===t[2]&&0===t[3])&&3===e.accounts?.length&&null!=e.accounts[0].address&&e.accounts[0].role===Wi.WRITABLE&&e.accounts[1].address===Qs&&e.accounts[1].role===Wi.READONLY&&null!=e.accounts[2].address&&Vi(e.accounts[2].role);var t}function rc(e){return\"lifetimeConstraint\"in e&&\"string\"==typeof e.lifetimeConstraint.nonce&&null!=e.instructions[0]&&nc(e.instructions[0])}function oc(e,t){if(\"feePayer\"in t&&e===t.feePayer?.address&&function(e){return!!e&&\"address\"in e&&\"string\"==typeof e.address&&1===Object.keys(e).length}(t.feePayer))return t;const n={...t,feePayer:Object.freeze({address:e})};return Object.freeze(n),n}function ic(e,t){return ac([e],t)}function ac(e,t){return Object.freeze({...t,instructions:Object.freeze([...t.instructions,...e])})}function sc(e,t){return Object.freeze({...t,instructions:Object.freeze([...e,...t.instructions])})}function cc(e,t){const n=e.staticAccounts[0];if(!n)throw new Zo(po);const r=function(e){const{header:t}=e,n=t.numSignerAccounts-t.numReadonlySignerAccounts,r=e.staticAccounts.length-t.numSignerAccounts-t.numReadonlyNonSignerAccounts,o=[];let i=0;for(let t=0;t<n;t++)o.push({address:e.staticAccounts[i],role:Wi.WRITABLE_SIGNER}),i++;for(let n=0;n<t.numReadonlySignerAccounts;n++)o.push({address:e.staticAccounts[i],role:Wi.READONLY_SIGNER}),i++;for(let t=0;t<r;t++)o.push({address:e.staticAccounts[i],role:Wi.WRITABLE}),i++;for(let n=0;n<t.numReadonlyNonSignerAccounts;n++)o.push({address:e.staticAccounts[i],role:Wi.READONLY}),i++;return o}(e),o=\"addressTableLookups\"in e&&void 0!==e.addressTableLookups&&e.addressTableLookups.length>0?function(e,t){const n=e.map(e=>e.lookupTableAddress),r=n.filter(e=>void 0===t[e]);if(r.length>0)throw new Zo(lo,{lookupTableAddresses:r});const o=[],i=[];for(const n of e){const e=t[n.lookupTableAddress],r=Math.max(...n.readableIndices,...n.writableIndices);if(r>=e.length)throw new Zo(fo,{highestKnownIndex:e.length-1,highestRequestedIndex:r,lookupTableAddress:n.lookupTableAddress});const a=n.readableIndices.map(t=>({address:e[t],addressIndex:t,lookupTableAddress:n.lookupTableAddress,role:Wi.READONLY}));o.push(...a);const s=n.writableIndices.map(t=>({address:e[t],addressIndex:t,lookupTableAddress:n.lookupTableAddress,role:Wi.WRITABLE}));i.push(...s)}return[...i,...o]}(e.addressTableLookups,t?.addressesByLookupTableAddress??{}):[],i=[...r,...o],a=e.instructions.map(e=>function(e,t){const n=t[e.programAddressIndex]?.address;if(!n)throw new Zo(ho,{index:e.programAddressIndex});const r=e.accountIndices?.map(e=>t[e]),{data:o}=e;return Object.freeze({programAddress:n,...r&&r.length?{accounts:Object.freeze(r)}:{},...o&&o.length?{data:o}:{}})}(e,i)),s=a[0],c=function(e,t,n){if(t&&nc(t)){const n=t.accounts[0].address;Aa(n);const r=t.accounts[2].address;return Aa(r),{nonce:e,nonceAccountAddress:n,nonceAuthorityAddress:r}}return{blockhash:e,lastValidBlockHeight:n??2n**64n-1n}}(e.lifetimeToken,s,t?.lastValidBlockHeight);return As(Js({version:e.version}),e=>oc(n,e),e=>a.reduce((e,t)=>ic(t,e),e),e=>\"blockhash\"in c?Es(c,e):function({nonce:e,nonceAccountAddress:t,nonceAuthorityAddress:n},r){let o;const i=r.instructions[0];if(i&&nc(i))if(function(e,t,n){return e.accounts[0].address===t&&e.accounts[2].address===n}(i,t,n)){if(rc(r)&&r.lifetimeConstraint.nonce===e)return r;o=[i,...r.instructions.slice(1)]}else o=[Object.freeze(tc(t,n)),...r.instructions.slice(1)];else o=[Object.freeze(tc(t,n)),...r.instructions];return Object.freeze({...r,instructions:Object.freeze(o),lifetimeConstraint:Object.freeze({nonce:e})})}(c,e))}function uc(e){const t=Object.values(e);if(0===t.length)throw new Zo(wo);return t.map(e=>e||new Uint8Array(64).fill(0))}function lc(){return ps([[\"signatures\",ki(Ha(mi(Ja(),64),{size:Ui()}),uc)],[\"messageBytes\",Ja()]])}function dc(){return Ii(gs([[\"signatures\",Ga(yi(Xa(),64),{size:Mi()})],[\"messageBytes\",Xa()]]),fc)}function fc(e){const{messageBytes:t,signatures:n}=e,r=es([Ls(),xi(Ki(),2),Ga(xa(),{size:Mi()})]),[o,i,a]=r.decode(t),s=a.slice(0,i);if(s.length!==n.length)throw new Zo(vo,{numRequiredSignatures:i,signaturesLength:n.length,signerAddresses:s});const c={};return s.forEach((e,t)=>{const r=n[t];r.every(e=>0===e)?c[e]=null:c[e]=r}),{messageBytes:t,signatures:Object.freeze(c)}}function hc(e){const t=Ys(e),n=$s().encode(t),r=t.staticAccounts.slice(0,t.header.numSignerAccounts),o={};for(const e of r)o[e]=null;let i;i=Ss(e)?{blockhash:e.lifetimeConstraint.blockhash,lastValidBlockHeight:e.lifetimeConstraint.lastValidBlockHeight}:{nonce:e.lifetimeConstraint.nonce,nonceAccountAddress:e.instructions[0].accounts[0].address};const a={lifetimeConstraint:i,messageBytes:n,signatures:Object.freeze(o)};return Object.freeze(a)}function pc(e){Xs||(Xs=oa());const t=Object.values(e.signatures)[0];if(!t)throw new Zo(mo);return Xs.decode(t)}async function gc(e,t){let n,r;if(await Promise.all(e.map(async e=>{const o=await Ua(e.publicKey),i=t.signatures[o];if(void 0===i)return r||=new Set,void r.add(o);if(r)return;const a=await ja(e.privateKey,t.messageBytes);var s,c;null!==i&&(c=i,(s=a).length===c.length&&s.every((e,t)=>e===c[t]))||(n||={},n[o]=a)})),r&&r.size>0){const e=Object.keys(t.signatures);throw new Zo(yo,{expectedAddresses:e,unexpectedAddresses:[...r]})}return n?Object.freeze({...t,signatures:Object.freeze({...t.signatures,...n})}):t}function mc(e){const t=[];if(Object.entries(e.signatures).forEach(([e,n])=>{n||t.push(e)}),t.length>0)throw new Zo(go,{addresses:t})}function yc(e){const t=lc().encode(e);return la().decode(t)}function wc(e){const t={};return e.forEach(e=>{if(t[e.address]){if(t[e.address]!==e)throw new Zo(ao,{address:e.address})}else t[e.address]=e}),Object.values(t)}function vc(e){return\"modifyAndSignTransactions\"in e&&\"function\"==typeof e.modifyAndSignTransactions}function bc(e){return\"signTransactions\"in e&&\"function\"==typeof e.signTransactions}function Ac(e){return\"signAndSendTransactions\"in e&&\"function\"==typeof e.signAndSendTransactions}function Sc(e){return bc(e)||vc(e)||Ac(e)}function Ec(e){return wc((e.accounts??[]).flatMap(e=>\"signer\"in e?e.signer:[]))}function xc(e){return wc([...e.feePayer&&Sc(e.feePayer)?[e.feePayer]:[],...e.instructions.flatMap(Ec)])}function kc(e,t){const n=(r=t)&&\"feePayer\"in r&&r.feePayer&&\"string\"==typeof r.feePayer.address&&!Sc(r.feePayer)?e.find(e=>e.address===t.feePayer.address):void 0;var r;return n||0!==t.instructions.length?Object.freeze({...t,...n?{feePayer:n}:null,instructions:t.instructions.map(t=>function(e,t){if(!t.accounts||0===t.accounts.length)return t;const n=new Map(wc(e).map(e=>[e.address,e]));return Object.freeze({...t,accounts:t.accounts.map(e=>{const t=n.get(e.address);return Vi(e.role)&&!(\"signer\"in e)&&t?Object.freeze({...e,signer:t}):e})})}(e,t))}):t}async function Ic(e){const t=await Ua(e.publicKey),n={address:t,keyPair:e,signMessages:n=>Promise.all(n.map(async n=>Object.freeze({[t]:await ja(e.privateKey,n.content)}))),signTransactions:n=>Promise.all(n.map(async n=>{const r=await gc([e],n);return Object.freeze({[t]:r.signatures[t]})}))};return Object.freeze(n)}async function Tc(e,t){return await Ic(await $a(e,t))}function _c(e){const t={address:e,signMessages:e=>Promise.resolve(e.map(()=>Object.freeze({}))),signTransactions:e=>Promise.resolve(e.map(()=>Object.freeze({})))};return Object.freeze(t)}async function Cc(e,t){const{partialSigners:n,modifyingSigners:r}=Bc(wc(xc(e).filter(Sc)),{identifySendingSigner:!1});return await Rc(e,r,n,t)}function Bc(e,t={}){const n=t.identifySendingSigner??!0?function(e){const t=e.filter(Ac);if(0===t.length)return null;const n=t.filter(e=>!vc(e)&&!bc(e));if(n.length>0)return n[0];return t[0]}(e):null,r=e.filter(e=>e!==n&&(vc(e)||bc(e))),o=function(e){const t=e.filter(vc);if(0===t.length)return[];const n=t.filter(e=>!bc(e));return n.length>0?n:[t[0]]}(r),i=r.filter(bc).filter(e=>!o.includes(e));return Object.freeze({modifyingSigners:o,partialSigners:i,sendingSigner:n})}async function Rc(e,t=[],n=[],r){const o=hc(e),i=await t.reduce(async(e,t)=>{r?.abortSignal?.throwIfAborted();const[n]=await t.modifyAndSignTransactions([await e],r);return Object.freeze(n)},Promise.resolve(o));r?.abortSignal?.throwIfAborted();const a=await Promise.all(n.map(async e=>{const[t]=await e.signTransactions([i],r);return t})),s={...i,signatures:Object.freeze(a.reduce((e,t)=>({...e,...t}),i.signatures??{}))};return Object.freeze(s)}var Pc=globalThis.TextEncoder;var Nc,Oc=\"11111111111111111111111111111111\",Uc=((Nc=Uc||{})[Nc.CreateAccount=0]=\"CreateAccount\",Nc[Nc.Assign=1]=\"Assign\",Nc[Nc.TransferSol=2]=\"TransferSol\",Nc[Nc.CreateAccountWithSeed=3]=\"CreateAccountWithSeed\",Nc[Nc.AdvanceNonceAccount=4]=\"AdvanceNonceAccount\",Nc[Nc.WithdrawNonceAccount=5]=\"WithdrawNonceAccount\",Nc[Nc.InitializeNonceAccount=6]=\"InitializeNonceAccount\",Nc[Nc.AuthorizeNonceAccount=7]=\"AuthorizeNonceAccount\",Nc[Nc.Allocate=8]=\"Allocate\",Nc[Nc.AllocateWithSeed=9]=\"AllocateWithSeed\",Nc[Nc.AssignWithSeed=10]=\"AssignWithSeed\",Nc[Nc.TransferSolWithSeed=11]=\"TransferSolWithSeed\",Nc[Nc.UpgradeNonceAccount=12]=\"UpgradeNonceAccount\",Nc);function Mc(e){if(!e)throw new Error(\"Expected a Address.\");return\"object\"==typeof e&&\"address\"in e?e.address:Array.isArray(e)?e[0]:e}function zc(e,t){return t=>{if(!t.value)return Object.freeze({address:e,role:Wi.READONLY});const n=t.isWritable?Wi.WRITABLE:Wi.READONLY;return Object.freeze({address:Mc(t.value),role:Lc(t.value)?Zi(n):n,...Lc(t.value)?{signer:t.value}:{}})}}function Lc(e){return!!e&&\"object\"==typeof e&&\"address\"in e&&Sc(e)}function jc(){return gs([[\"discriminator\",ji()]])}function Fc(){return gs([[\"discriminator\",ji()],[\"space\",Di()]])}function Dc(){return gs([[\"discriminator\",ji()],[\"base\",xa()],[\"seed\",gi(ga(),Di())],[\"space\",Di()],[\"programAddress\",xa()]])}function $c(){return gs([[\"discriminator\",ji()],[\"programAddress\",xa()]])}function Kc(){return gs([[\"discriminator\",ji()],[\"base\",xa()],[\"seed\",gi(ga(),Di())],[\"programAddress\",xa()]])}function qc(){return gs([[\"discriminator\",ji()],[\"newNonceAuthority\",xa()]])}function Wc(){return gs([[\"discriminator\",ji()],[\"lamports\",Di()],[\"space\",Di()],[\"programAddress\",xa()]])}function Vc(){return gs([[\"discriminator\",ji()],[\"base\",xa()],[\"seed\",gi(ga(),Di())],[\"amount\",Di()],[\"space\",Di()],[\"programAddress\",xa()]])}function Hc(){return gs([[\"discriminator\",ji()],[\"nonceAuthority\",xa()]])}function Gc(){return ki(ps([[\"discriminator\",Li()],[\"amount\",Fi()]]),e=>({...e,discriminator:2}))}function Zc(){return gs([[\"discriminator\",ji()],[\"amount\",Di()]])}function Yc(){return gs([[\"discriminator\",ji()],[\"amount\",Di()],[\"fromSeed\",gi(ga(),Di())],[\"fromOwner\",xa()]])}function Jc(){return gs([[\"discriminator\",ji()]])}function Xc(){return gs([[\"discriminator\",ji()],[\"withdrawAmount\",Di()]])}const Qc={log:(console.log,(...e)=>{}),info:(console.info,(...e)=>{}),warn:(console.warn,(...e)=>{}),debug:(console.debug,(...e)=>{}),error:(console.error,(...e)=>{})};const eu={log:()=>{},info:()=>{},warn:()=>{},debug:()=>{},error:()=>{}},tu=(e,t)=>new Proxy(e,{get(e,n){const r=e[n];return\"function\"==typeof r?(n,...o)=>r.call(e,t,n,...o):r}}),nu=Qc;const ru=(e,t)=>`${e}:${t.map(e=>JSON.stringify(e)).join(\":\")}`,ou=(e,t,{ttlMilliseconds:n,functionName:r,generateCacheKey:o})=>{const i=o??ru,a=r??e.name??\"anonymousFunction\";return async(...r)=>{const o=i(a,r);try{const e=await t.get(o);if(void 0!==e)return e}catch(e){nu.error(`Cache get error for key \"${o}\":`,e)}const s=await e(...r);return t.set(o,s,n).catch(e=>{nu.error(`Cache set error for key \"${o}\":`,e)}),s}},iu=x(\"SolAddress\",/^[1-9A-HJ-NP-Za-km-z]{32,44}$/iu);var au;!function(e){e.SendAndConfirmTransaction=\"sendAndConfirmTransaction\",e.SignAndSendTransaction=\"signAndSendTransaction\",e.SignTransaction=\"signTransaction\",e.SignMessage=\"signMessage\",e.SignIn=\"signIn\"}(au||(au={}));K({...rt.schema,address:iu,type:j(`${Je.DataAccount}`),scopes:te(U(Ke)),methods:U(z(Object.values(au)))});const su=1000000n,cu=1e9,uu=\"metamask\";var lu=function(e){return e.Mainnet=\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp\",e.Devnet=\"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1\",e.Testnet=\"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z\",e.Localnet=\"solana:123456789abcdef\",e}({}),du=function(e){return e.SolMainnet=\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/slip44:501\",e.SolDevnet=\"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1/slip44:501\",e.SolTestnet=\"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z/slip44:501\",e.SolLocalnet=\"solana:123456789abcdef/slip44:501\",e.UsdcMainnet=\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",e.UsdcDevnet=\"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1/token:4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU\",e.UsdcLocalnet=\"solana:123456789abcdef/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",e.EurcMainnet=\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:HzwqbKZw8HxMN6bF2yFZNrht3c2iXXzpKcFu7uBEDKtr\",e.EurcDevnet=\"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1/token:HzwqbKZw8HxMN6bF2yFZNrht3c2iXXzpKcFu7uBEDKtr\",e.EurcLocalnet=\"solana:123456789abcdef/token:HzwqbKZw8HxMN6bF2yFZNrht3c2iXXzpKcFu7uBEDKtr\",e.Ai16zMainnet=\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:HeLp6NuQkmYB4pYWo2zYs22mESHXPQYzXbB8n4V98jwC\",e}({});ne(H(),/^solana:[a-zA-Z0-9]+\\/slip44:501$/u);const fu=ne(H(),/^solana:[a-zA-Z0-9]+\\/token:[a-zA-Z0-9]+$/u),hu=(ne(H(),/^solana:[a-zA-Z0-9]+\\/nft:[a-zA-Z0-9]+$/u),E(\"TokenCaipAssetTypeFromString\",e=>{if(\"string\"!=typeof e)return\"Expected a string, but received: \"+typeof e;const[t]=fu.validate(e);return t||!0}));var pu=function(e){return e.SOL=\"slip44:501\",e}({});const gu={\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/slip44:501\":{symbol:\"SOL\",caip19Id:\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/slip44:501\",address:\"So11111111111111111111111111111111111111112\",decimals:9},\"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1/slip44:501\":{symbol:\"SOL\",caip19Id:\"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1/slip44:501\",address:\"So11111111111111111111111111111111111111112\",decimals:9},\"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z/slip44:501\":{symbol:\"SOL\",caip19Id:\"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z/slip44:501\",address:\"So11111111111111111111111111111111111111112\",decimals:9},\"solana:123456789abcdef/slip44:501\":{symbol:\"SOL\",caip19Id:\"solana:123456789abcdef/slip44:501\",address:\"So11111111111111111111111111111111111111112\",decimals:9},\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\":{symbol:\"USDC\",caip19Id:\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",address:\"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",decimals:6},\"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1/token:4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU\":{symbol:\"USDC\",caip19Id:\"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1/token:4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU\",address:\"4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU\",decimals:6},\"solana:123456789abcdef/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\":{symbol:\"USDC\",caip19Id:\"solana:123456789abcdef/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",address:\"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",decimals:6}},mu={\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp\":{caip2Id:\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp\",cluster:\"mainnet\",name:\"Solana Mainnet\",nativeToken:gu[\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/slip44:501\"]},\"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1\":{caip2Id:\"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1\",cluster:\"devnet\",name:\"Solana Devnet\",nativeToken:gu[\"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1/slip44:501\"]},\"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z\":{caip2Id:\"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z\",cluster:\"testnet\",name:\"Solana Testnet\",nativeToken:gu[\"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z/slip44:501\"]},\"solana:123456789abcdef\":{caip2Id:\"solana:123456789abcdef\",cluster:\"local\",name:\"Solana Localnet\",nativeToken:gu[\"solana:123456789abcdef/slip44:501\"]}},yu=ne(H(),/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/u),wu=ne(H(),/^(?!0\\d)(\\d+(\\.\\d+)?)$/u),vu=re(H(),\"safe-url\",e=>{try{const t=new URL(e),n=[\"http:\",\"https:\",\"wss:\"];if(!n.includes(t.protocol))return`URL must use one of the following protocols: ${n}`;if(!e.match(/^(https?|wss):\\/\\/[^/]+\\/?/u))return\"Malformed URL - incorrect protocol format\";const r=t.hostname.toLowerCase();if(!(\"localhost\"===r||r.includes(\".\")&&/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/u.test(r)))return\"Invalid hostname format\";const o=decodeURIComponent(e.toLowerCase());if(e.includes(\"\\\\\")||e.includes(\"@\")||o.includes(\"\\\\\")||o.includes(\"@\")||e.toLowerCase().includes(\"%2f@\")||e.toLowerCase().includes(\"%5c@\"))return\"URL contains protocol pollution attempts\";const i=decodeURIComponent(r);if(r.includes(\"\\\\\")||r.includes(\"@\")||i.includes(\"/\")||r.toLowerCase().includes(\"%2f\"))return\"Invalid hostname characters detected\";if(e.includes(\"../\")||e.includes(\"..%2f\")||e.includes(\"..%2F\"))return\"Directory traversal attempts are not allowed\";const a=[/<[^>]*>/u,/javascript:/u,/data:/u,/\\\\[@\\\\]/u,/%2f@/u,/[^\\x20-\\x7E]/u,/\\$\\{.*?\\}/u,/#\\{.*?\\}/u,/[|;]/u,/%0[acd]|%0[acd]/u,/\\/\\/\\w+@/u,/(?:[^a-z]|^)(?:union\\s+(?:all\\s+)?select|select\\s+(?:.*\\s+)?from|insert\\s+into|update\\s+.*\\s+set|delete\\s+from|drop\\s+table|alter\\s+table|create\\s+table|exec(?:ute)?|union|where\\s+[\\d\\w]\\s*=\\s*[\\d\\w]|\\bor\\b\\s*[\\d\\w]\\s*=\\s*[\\d\\w])/iu,/'.*?(?:OR|UNION|SELECT|FROM|WHERE).*?'/iu,/%27.*?(?:OR|UNION|SELECT|FROM|WHERE).*?(?:%27|')/iu,/%20(?:OR|UNION|SELECT|FROM|WHERE)%20/iu,/[?&](?:url|redirect|next|return_to|return_url|goto|destination|continue|redirect_uri)=(?:[^&]*\\/\\/|https?:)/iu,/[?&](?:url|redirect|next|return_to|return_url|goto|destination|continue|redirect_uri)=%(?:[^&]*\\/\\/|https?:)/iu];for(const e of a)if(e.test(o))return\"URL contains potentially malicious patterns\";return!(t.port&&!/^\\d+$/u.test(t.port))||\"Invalid port number\"}catch(e){return\"Invalid URL format\"}}),bu=K({accountId:yu}),Au=K({accountId:yu}),Su=K({accountId:yu}),Eu=K({accountId:yu,assets:U(We)}),xu=K({accountId:yu,pagination:K({limit:L(),next:q(D(H()))})}),ku=K({accountId:yu,options:q(Tt)}),Iu=V(We,K({amount:wu,unit:H()})),Tu=(U(We),z(Object.values(au)),z(Object.values(lu))),_u=(z([\"btc\",\"eth\",\"ltc\",\"bch\",\"bnb\",\"eos\",\"xrp\",\"xlm\",\"link\",\"dot\",\"yfi\",\"usd\",\"aed\",\"ars\",\"aud\",\"bdt\",\"bhd\",\"bmd\",\"brl\",\"cad\",\"chf\",\"clp\",\"cny\",\"czk\",\"dkk\",\"eur\",\"gbp\",\"gel\",\"hkd\",\"huf\",\"idr\",\"ils\",\"inr\",\"jpy\",\"krw\",\"kwd\",\"lkr\",\"mmk\",\"mxn\",\"myr\",\"ngn\",\"nok\",\"nzd\",\"php\",\"pkr\",\"pln\",\"rub\",\"sar\",\"sek\",\"sgd\",\"thb\",\"try\",\"twd\",\"uah\",\"vef\",\"vnd\",\"zar\",\"xdr\",\"xag\",\"xau\",\"bits\",\"sats\"]),K({transaction:H(),scope:z(Object.values(lu))})),Cu=K({value:D(wu)}),Bu=E(\"Base58\",e=>\"string\"!=typeof e?\"Expected a string, but received: \"+typeof e:!!/^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$/u.test(e)||\"Expected a Base58 encoded string, but received a string with invalid characters\"),Ru=ne(H(),/^(?:[A-Za-z0-9+/]{4})+(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/u),Pu=ne(H(),/^m\\/44'\\/501'/u),Nu=(ne(H(),/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{3})?Z$/u),E(\"SolanaAddress\",e=>{if(\"string\"!=typeof e)return\"Expected a string, but received: \"+typeof e;try{return Sa(e),!0}catch(e){return\"Invalid Solana address\"}}));function Ou(e){return e&&\"string\"==typeof e?e.replace(/[\\u0000-\\u0008\\u000A-\\u001F\\u007F]/gu,\"\"):\"\"}function Uu(e,t=1e3){if(!e||\"string\"!=typeof e)return\"\";let n=Ou(e);return n.length>t&&(n=n.substring(0,t)),n=n.trim(),n}function Mu(e){if(!e||\"string\"!=typeof e)return\"\";const t=Ou(e);return/^[1-9A-HJ-NP-Za-km-z]+$/u.test(t)?t.length<32||t.length>44?\"\":t:\"\"}function zu(e){if(!e||\"string\"!=typeof e)return\"\";const t=Ou(e);try{const e=new URL(t);return[\"http:\",\"https:\",\"wss:\",\"ipfs:\"].includes(e.protocol)?t.length>2048?\"\":t:\"\"}catch{return\"\"}}function Lu(e){const{baseUrl:t,path:n,pathParams:r,queryParams:o,encodePathParams:i=!0}=e,a=zu(t);if(\"\"===a)throw new Error(\"Invalid URL format\");v(a,vu);const s=n.replace(/\\{(\\w+)\\}/gu,(e,t)=>{const n=r?.[t];if(void 0===n)throw new Error(`Path parameter ${t} is undefined`);const o=Ou(n);return i?encodeURIComponent(o):o}).replace(/^\\/+/u,\"\").replace(/\\/+/gu,\"/\").replace(/\\/+$/u,\"\"),c=new URL(s,a);Object.entries(o??{}).filter(([e,t])=>void 0!==t).filter(([e,t])=>null!==t).forEach(([e,t])=>{if(t){const n=Ou(t);c.searchParams.append(e,n)}});const u=c.toString();return v(u,vu),u}const ju=async e=>{try{return await snap.request({method:\"snap_trackError\",params:{error:Nn(e)}})}catch(e){return void nu.warn({error:e},\"Failed to track error\")}},Fu=async e=>{try{return await e()}catch(e){(e=>!(e instanceof Yn))(e)&&await ju(e);const t=function(e){return[Pn,Fn,Yn,Dn,Fn,$n,Kn,qn,Wn,Vn,Hn,Gn,Zn,Un,Mn,zn,Ln,jn].some(t=>e instanceof t)}(e)?e:new Pn(e);throw nu.error({error:t},`[SnapError] ${JSON.stringify(t.toJSON(),null,2)}`),t}};var Du=n(5250);const $u=Y([z([\"btc\",\"eth\",\"ltc\",\"bch\",\"bnb\",\"eos\",\"xrp\",\"xlm\",\"link\",\"dot\",\"yfi\",\"bits\",\"sats\",\"sol\",\"sei\",\"sonic\"]),z([\"usd\",\"aed\",\"amd\",\"ars\",\"aud\",\"bam\",\"bdt\",\"bhd\",\"bmd\",\"brl\",\"cad\",\"chf\",\"clp\",\"cny\",\"cop\",\"crc\",\"czk\",\"dkk\",\"dop\",\"eur\",\"gbp\",\"gel\",\"gtq\",\"hkd\",\"hnl\",\"huf\",\"idr\",\"ils\",\"inr\",\"jpy\",\"kes\",\"krw\",\"kwd\",\"lbp\",\"lkr\",\"mmk\",\"mxn\",\"myr\",\"ngn\",\"nok\",\"nzd\",\"pen\",\"php\",\"pkr\",\"pln\",\"ron\",\"rub\",\"sar\",\"sek\",\"sgd\",\"svc\",\"thb\",\"try\",\"twd\",\"uah\",\"vef\",\"vnd\",\"xdr\",\"zar\",\"zmw\"]),z([\"xag\",\"xau\"])]),Ku=K({id:H(),price:ee($(),0),marketCap:q(D(ee($(),0))),allTimeHigh:q(D(ee($(),0))),allTimeLow:q(D(ee($(),0))),totalVolume:q(D(ee($(),0))),high1d:q(D(ee($(),0))),low1d:q(D(ee($(),0))),circulatingSupply:q(D(ee($(),0))),dilutedMarketCap:q(D(ee($(),0))),marketCapPercentChange1d:q(D($())),priceChange1d:q(D($())),pricePercentChange1h:q(D($())),pricePercentChange1d:q(D($())),pricePercentChange7d:q(D($())),pricePercentChange14d:q(D($())),pricePercentChange30d:q(D($())),pricePercentChange200d:q(D($())),pricePercentChange1y:q(D($())),bondingCurveProgressPercent:q(D($())),liquidity:q(D($())),totalSupply:q(D($())),holderCount:q(D($())),isMutable:q(D(M()))}),qu=V(We,D(Ku)),Wu=$u,Vu=K({assetType:We,timePeriod:q(ne(H(),/^[1-9][0-9]*[dmy]$/u)),from:q(ee($(),0)),to:q(ee($(),0)),vsCurrency:q(Wu)}),Hu=K({prices:U(G([$(),$()])),marketCaps:U(G([$(),$()])),totalVolumes:U(G([$(),$()]))}),Gu={prices:[],marketCaps:[],totalVolumes:[]};const Zu=function(e){if(e.length>=255)throw new TypeError(\"Alphabet too long\");const t=new Uint8Array(256);for(let e=0;e<t.length;e++)t[e]=255;for(let n=0;n<e.length;n++){const r=e.charAt(n),o=r.charCodeAt(0);if(255!==t[o])throw new TypeError(r+\" is ambiguous\");t[o]=n}const n=e.length,r=e.charAt(0),o=Math.log(n)/Math.log(256),i=Math.log(256)/Math.log(n);function a(e){if(\"string\"!=typeof e)throw new TypeError(\"Expected String\");if(0===e.length)return new Uint8Array;let i=0,a=0,s=0;for(;e[i]===r;)a++,i++;const c=(e.length-i)*o+1>>>0,u=new Uint8Array(c);for(;i<e.length;){const r=e.charCodeAt(i);if(r>255)return;let o=t[r];if(255===o)return;let a=0;for(let e=c-1;(0!==o||a<s)&&-1!==e;e--,a++)o+=n*u[e]>>>0,u[e]=o%256>>>0,o=o/256>>>0;if(0!==o)throw new Error(\"Non-zero carry\");s=a,i++}let l=c-s;for(;l!==c&&0===u[l];)l++;const d=new Uint8Array(a+(c-l));let f=a;for(;l!==c;)d[f++]=u[l++];return d}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError(\"Expected Uint8Array\");if(0===t.length)return\"\";let o=0,a=0,s=0;const c=t.length;for(;s!==c&&0===t[s];)s++,o++;const u=(c-s)*i+1>>>0,l=new Uint8Array(u);for(;s!==c;){let e=t[s],r=0;for(let t=u-1;(0!==e||r<a)&&-1!==t;t--,r++)e+=256*l[t]>>>0,l[t]=e%n>>>0,e=e/n>>>0;if(0!==e)throw new Error(\"Non-zero carry\");a=r,s++}let d=u-a;for(;d!==u&&0===l[d];)d++;let f=r.repeat(o);for(;d<u;++d)f+=e.charAt(l[d]);return f},decodeUnsafe:a,decode:function(e){const t=a(e);if(t)return t;throw new Error(\"Non-base\"+n+\" character\")}}};const Yu=Zu(\"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\");var Ju=n(1048).hp;const Xu={[lu.Mainnet]:\"mainnet\",[lu.Devnet]:\"devnet\",[lu.Testnet]:\"testnet\",[lu.Localnet]:\"localnet\"};const Qu=U(K({decimals:L(),assetId:hu,name:q(H()),symbol:q(H()),iconUrl:q(vu)})),el={name:\"UNKNOWN\",symbol:\"UNKNOWN\",fungible:!0,iconUrl:\"\",units:[{name:\"UNKNOWN\",symbol:\"UNKNOWN\",decimals:9}]};class tl{#o;#i;#a;#s;#c;static supportedNetworks=[lu.Mainnet,lu.Devnet];constructor(e,t=globalThis.fetch,n=nu){this.#o=t,this.#i=n;const{tokenApi:r,staticApi:o}=e.get(),{baseUrl:i,chunkSize:a}=r;v(i,vu),this.#a=i,this.#s=a,this.#c=o.baseUrl}async#u(e){v(e,U(fu));const t=Lu({baseUrl:this.#a,path:\"/v3/assets\",queryParams:{assetIds:e.join(\",\")}}),n=await this.#o(t);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const r=await n.json();return v(r,Qu),r}async getTokensMetadata(e){try{v(e,U(We));const t=e.filter(e=>{const{chainId:t}=tt(e);return tl.supportedNetworks.includes(t)});t.length!==e.length&&this.#i.warn(`[TokenApiClient] Received some asset types on networks that the Token API doesn't support. They will be ignored. Supported networks: ${tl.supportedNetworks.join(\", \")}`);const n=[];for(let e=0;e<t.length;e+=this.#s)n.push(t.slice(e,e+this.#s));const r=(await Promise.all(n.map(async e=>this.#u(e)))).flat(),o=new Map(r.map(e=>[e.assetId,e])),i=new Map;return e.forEach(e=>{const t=o.get(e),n=this.#l(t,e);i.set(e,n)}),Object.fromEntries(i)}catch(e){throw this.#i.error(e,\"Error fetching token metadata\"),e}}#d(e){return Lu({baseUrl:this.#c,path:\"/api/v2/tokenIcons/assets/{assetType}.png\",pathParams:{assetType:e.replace(/:/gu,\"/\")},encodePathParams:!1})}#l(e,t){const n=this.#d(t);if(!e)return this.#i.warn(`No metadata for ${t}. Returning default values.`),{...el,iconUrl:n};const r=e.name??el.name,o=e.symbol??el.symbol,i=e.decimals??9;return{name:r,symbol:o,fungible:!0,iconUrl:e.iconUrl??n,units:[{name:r,symbol:o,decimals:i}]}}}const nl=K({...ct.schema}),rl=K({fungible:j(!0),type:We,...nl.schema}),ol=K({fungible:j(!1),id:Ve}),il=Ie(e=>ce(e)&&!e.fungible?ol:rl),al=K({address:H(),asset:D(il)});var sl;!function(e){e.Base=\"base\",e.Priority=\"priority\"}(sl||(sl={}));const cl=K({type:z([`${sl.Base}`,`${sl.Priority}`]),asset:il});var ul,ll,dl;!function(e){e.Submitted=\"submitted\",e.Unconfirmed=\"unconfirmed\",e.Confirmed=\"confirmed\",e.Failed=\"failed\"}(ul||(ul={})),function(e){e.Send=\"send\",e.Receive=\"receive\",e.Swap=\"swap\",e.BridgeSend=\"bridge:send\",e.BridgeReceive=\"bridge:receive\",e.StakeDeposit=\"stake:deposit\",e.StakeWithdraw=\"stake:withdraw\",e.TokenApprove=\"token:approve\",e.TokenDisapprove=\"token:disapprove\",e.Unknown=\"unknown\"}(ll||(ll={})),function(e){e.Benign=\"Benign\",e.Warning=\"Warning\",e.Malicious=\"Malicious\"}(dl||(dl={}));const fl=K({origin:W(H()),securityAlertResponse:W(z([`${dl.Benign}`,`${dl.Warning}`,`${dl.Malicious}`])),typeLabel:W(H())}),hl=K({status:z([`${ul.Submitted}`,`${ul.Unconfirmed}`,`${ul.Confirmed}`,`${ul.Failed}`]),timestamp:D($())}),pl=K({id:H(),chain:Ke,account:k,status:z([`${ul.Submitted}`,`${ul.Unconfirmed}`,`${ul.Confirmed}`,`${ul.Failed}`]),timestamp:D($()),type:z([`${ll.Send}`,`${ll.Receive}`,`${ll.Swap}`,`${ll.BridgeSend}`,`${ll.BridgeReceive}`,`${ll.StakeDeposit}`,`${ll.StakeWithdraw}`,`${ll.TokenApprove}`,`${ll.TokenDisapprove}`,`${ll.Unknown}`]),from:U(al),to:U(al),fees:U(cl),events:U(hl),details:W(fl)}),gl=(K({data:U(pl),next:D(H())}),BigInt(2**32-1)),ml=BigInt(32);function yl(e,t=!1){return t?{h:Number(e&gl),l:Number(e>>ml&gl)}:{h:0|Number(e>>ml&gl),l:0|Number(e&gl)}}function wl(e,t=!1){const n=e.length;let r=new Uint32Array(n),o=new Uint32Array(n);for(let i=0;i<n;i++){const{h:n,l:a}=yl(e[i],t);[r[i],o[i]]=[n,a]}return[r,o]}const vl=(e,t,n)=>e>>>n,bl=(e,t,n)=>e<<32-n|t>>>n,Al=(e,t,n)=>e>>>n|t<<32-n,Sl=(e,t,n)=>e<<32-n|t>>>n,El=(e,t,n)=>e<<64-n|t>>>n-32,xl=(e,t,n)=>e>>>n-32|t<<64-n,kl=(e,t,n)=>e<<n|t>>>32-n,Il=(e,t,n)=>t<<n|e>>>32-n,Tl=(e,t,n)=>t<<n-32|e>>>64-n,_l=(e,t,n)=>e<<n-32|t>>>64-n;function Cl(e,t,n,r){const o=(t>>>0)+(r>>>0);return{h:e+n+(o/2**32|0)|0,l:0|o}}const Bl=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),Rl=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,Pl=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),Nl=(e,t,n,r,o)=>t+n+r+o+(e/2**32|0)|0,Ol=(e,t,n,r,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(o>>>0),Ul=(e,t,n,r,o,i)=>t+n+r+o+i+(e/2**32|0)|0,Ml=\"object\"==typeof globalThis&&\"crypto\"in globalThis?globalThis.crypto:void 0;function zl(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&\"Uint8Array\"===e.constructor.name}function Ll(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(\"positive integer expected, got \"+e)}function jl(e,...t){if(!zl(e))throw new Error(\"Uint8Array expected\");if(t.length>0&&!t.includes(e.length))throw new Error(\"Uint8Array expected of length \"+t+\", got length=\"+e.length)}function Fl(e){if(\"function\"!=typeof e||\"function\"!=typeof e.create)throw new Error(\"Hash should be wrapped by utils.createHasher\");Ll(e.outputLen),Ll(e.blockLen)}function Dl(e,t=!0){if(e.destroyed)throw new Error(\"Hash instance has been destroyed\");if(t&&e.finished)throw new Error(\"Hash#digest() has already been called\")}function $l(e,t){jl(e);const n=t.outputLen;if(e.length<n)throw new Error(\"digestInto() expects output buffer of length at least \"+n)}function Kl(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function ql(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Wl(e,t){return e<<32-t|e>>>t}function Vl(e,t){return e<<t|e>>>32-t>>>0}const Hl=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];function Gl(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const Zl=Hl?e=>e:function(e){for(let t=0;t<e.length;t++)e[t]=Gl(e[t]);return e},Yl=\"function\"==typeof Uint8Array.from([]).toHex&&\"function\"==typeof Uint8Array.fromHex,Jl=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,\"0\"));function Xl(e){if(jl(e),Yl)return e.toHex();let t=\"\";for(let n=0;n<e.length;n++)t+=Jl[e[n]];return t}const Ql=48,ed=57,td=65,nd=70,rd=97,od=102;function id(e){return e>=Ql&&e<=ed?e-Ql:e>=td&&e<=nd?e-(td-10):e>=rd&&e<=od?e-(rd-10):void 0}function ad(e){if(\"string\"!=typeof e)throw new Error(\"hex string expected, got \"+typeof e);if(Yl)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error(\"hex string expected, got unpadded hex of length \"+t);const r=new Uint8Array(n);for(let t=0,o=0;t<n;t++,o+=2){const n=id(e.charCodeAt(o)),i=id(e.charCodeAt(o+1));if(void 0===n||void 0===i){const t=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character \"'+t+'\" at index '+o)}r[t]=16*n+i}return r}function sd(e){if(\"string\"!=typeof e)throw new Error(\"string expected\");return new Uint8Array((new TextEncoder).encode(e))}function cd(e){return\"string\"==typeof e&&(e=sd(e)),jl(e),e}function ud(e){return\"string\"==typeof e&&(e=sd(e)),jl(e),e}function ld(...e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];jl(r),t+=r.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const o=e[t];n.set(o,r),r+=o.length}return n}class dd{}function fd(e){const t=t=>e().update(cd(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function hd(e=32){if(Ml&&\"function\"==typeof Ml.getRandomValues)return Ml.getRandomValues(new Uint8Array(e));if(Ml&&\"function\"==typeof Ml.randomBytes)return Uint8Array.from(Ml.randomBytes(e));throw new Error(\"crypto.getRandomValues must be defined\")}const pd=BigInt(0),gd=BigInt(1),md=BigInt(2),yd=BigInt(7),wd=BigInt(256),vd=BigInt(113),bd=[],Ad=[],Sd=[];for(let e=0,t=gd,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],bd.push(2*(5*r+n)),Ad.push((e+1)*(e+2)/2%64);let o=pd;for(let e=0;e<7;e++)t=(t<<gd^(t>>yd)*vd)%wd,t&md&&(o^=gd<<(gd<<BigInt(e))-gd);Sd.push(o)}const Ed=wl(Sd,!0),xd=Ed[0],kd=Ed[1],Id=(e,t,n)=>n>32?Tl(e,t,n):kl(e,t,n),Td=(e,t,n)=>n>32?_l(e,t,n):Il(e,t,n);class _d extends dd{constructor(e,t,n,r=!1,o=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=o,Ll(n),!(0<e&&e<200))throw new Error(\"only keccak-f1600 function is supported\");var i;this.state=new Uint8Array(200),this.state32=(i=this.state,new Uint32Array(i.buffer,i.byteOffset,Math.floor(i.byteLength/4)))}clone(){return this._cloneInto()}keccak(){Zl(this.state32),function(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const r=(t+8)%10,o=(t+2)%10,i=n[o],a=n[o+1],s=Id(i,a,1)^n[r],c=Td(i,a,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=s,e[t+n+1]^=c}let t=e[2],o=e[3];for(let n=0;n<24;n++){const r=Ad[n],i=Id(t,o,r),a=Td(t,o,r),s=bd[n];t=e[s],o=e[s+1],e[s]=i,e[s+1]=a}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=xd[r],e[1]^=kd[r]}Kl(n)}(this.state32,this.rounds),Zl(this.state32),this.posOut=0,this.pos=0}update(e){Dl(this),jl(e=cd(e));const{blockLen:t,state:n}=this,r=e.length;for(let o=0;o<r;){const i=Math.min(t-this.pos,r-o);for(let t=0;t<i;t++)n[this.pos++]^=e[o++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,128&t&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){Dl(this,!1),jl(e),this.finish();const t=this.state,{blockLen:n}=this;for(let r=0,o=e.length;r<o;){this.posOut>=n&&this.keccak();const i=Math.min(n-this.posOut,o-r);e.set(t.subarray(this.posOut,this.posOut+i),r),this.posOut+=i,r+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error(\"XOF is not possible for this instance\");return this.writeInto(e)}xof(e){return Ll(e),this.xofInto(new Uint8Array(e))}digestInto(e){if($l(e,this),this.finished)throw new Error(\"digest() was already called\");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Kl(this.state)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:r,rounds:o,enableXOF:i}=this;return e||(e=new _d(t,n,r,i,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=n,e.outputLen=r,e.enableXOF=i,e.destroyed=this.destroyed,e}}const Cd=(e,t,n)=>fd(()=>new _d(t,e,n)),Bd=Cd(1,136,32);const{memoize:Rd}=Du,Pd=/^(?:0x)?[0-9a-f]+$/iu,Nd=/^0x[0-9a-f]+$/iu,Od=/^0x[0-9a-f]{40}$/u,Ud=/^0x[0-9a-fA-F]{40}$/u,Md=(ne(H(),Pd),ne(H(),Nd)),zd=(ne(H(),Od),ne(H(),Ud),e=>\"string\"==typeof e);function Ld(e){return zd(e)&&Ud.test(e)}function jd(e){Ar(function(e){return zd(e)&&Pd.test(e)}(e),\"Value must be a hexadecimal string.\")}const Fd=Rd(function(e){Ar(Ld(e),\"Invalid hex address.\");const t=$d(e).toLowerCase(),n=Bd(t),{length:r}=t,o=new Array(r);for(let e=0;e<r;e++){const r=1&e,i=n[e>>1],a=0===r?i>>4:15&i;o[e]=a>=8?t[e].toUpperCase():t[e]}return`0x${o.join(\"\")}`});const Dd=Rd(function(e){return!!Ld(e)&&Fd(e)===e});Rd(function(e){return zd(t=e)&&Od.test(t)||Dd(e);var t});function $d(e){return e.startsWith(\"0x\")||e.startsWith(\"0X\")?e.substring(2):e}n(1048).hp;const Kd=function(){const e=[];return()=>{if(0===e.length)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,\"0\"));return e}}();function qd(e){return e instanceof Uint8Array}function Wd(e){Ar(qd(e),\"Value must be a Uint8Array.\")}function Vd(e){if(Wd(e),0===e.length)return\"0x\";const t=Kd(),n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=t[e[r]];return function(e){return e.startsWith(\"0x\")?e:e.startsWith(\"0X\")?`0x${e.substring(2)}`:`0x${e}`}(n.join(\"\"))}function Hd(e){if(\"0x\"===e?.toLowerCase?.())return new Uint8Array;jd(e);const t=$d(e).toLowerCase(),n=t.length%2==0?t:`0${t}`,r=new Uint8Array(n.length/2);for(let e=0;e<r.length;e++){const t=n.charCodeAt(2*e),o=n.charCodeAt(2*e+1),i=t-(t<58?48:87),a=o-(o<58?48:87);r[e]=16*i+a}return r}var Gd,Zd=\"ComputeBudget111111111111111111111111111111\",Yd=((Gd=Yd||{})[Gd.RequestUnits=0]=\"RequestUnits\",Gd[Gd.RequestHeapFrame=1]=\"RequestHeapFrame\",Gd[Gd.SetComputeUnitLimit=2]=\"SetComputeUnitLimit\",Gd[Gd.SetComputeUnitPrice=3]=\"SetComputeUnitPrice\",Gd[Gd.SetLoadedAccountsDataSizeLimit=4]=\"SetLoadedAccountsDataSizeLimit\",Gd);function Jd(e){const t=\"data\"in e?e.data:e;if(oi(t,$i().encode(0),0))return 0;if(oi(t,$i().encode(1),0))return 1;if(oi(t,$i().encode(2),0))return 2;if(oi(t,$i().encode(3),0))return 3;if(oi(t,$i().encode(4),0))return 4;throw new Error(\"The provided instruction could not be identified as a computeBudget instruction.\")}function Xd(){return gs([[\"discriminator\",Ki()],[\"bytes\",ji()]])}function Qd(){return gs([[\"discriminator\",Ki()],[\"units\",ji()],[\"additionalFee\",ji()]])}function ef(){return ki(ps([[\"discriminator\",$i()],[\"units\",Li()]]),e=>({...e,discriminator:2}))}function tf(){return gs([[\"discriminator\",Ki()],[\"units\",ji()]])}function nf(e,t){const n={...e};return{programAddress:t?.programAddress??Zd,data:ef().encode(n)}}function rf(e){return{programAddress:e.programAddress,data:tf().decode(e.data)}}function of(){return ki(ps([[\"discriminator\",$i()],[\"microLamports\",Fi()]]),e=>({...e,discriminator:3}))}function af(){return gs([[\"discriminator\",Ki()],[\"microLamports\",Di()]])}function sf(e,t){const n={...e};return{programAddress:t?.programAddress??Zd,data:of().encode(n)}}function cf(e){return{programAddress:e.programAddress,data:af().decode(e.data)}}function uf(){return gs([[\"discriminator\",Ki()],[\"accountDataSizeLimit\",ji()]])}var lf=e=>({__option:\"Some\",value:e}),df=e=>\"Some\"===e.__option;function ff(e,t={}){const n=null===t.prefix?Ii(hs(),()=>!1):Ya({size:t.prefix??Ki()}),r=\"zeroes\"===t.noneValue?(ui(e),yi(hs(),e.fixedSize)):t.noneValue?Qa(t.noneValue):hs();return ts([Ii(es([n,r]),()=>({__option:\"None\"})),Ii(es([n,e]),([,e])=>lf(e))],(e,o)=>{if(null===t.prefix&&!t.noneValue)return Number(o<e.length);if(null===t.prefix&&null!=t.noneValue){return oi(e,\"zeroes\"===t.noneValue?new Uint8Array(r.fixedSize).fill(0):t.noneValue,o)?0:1}return Number(n.read(e,o)[0])})}var hf,pf=((hf=pf||{})[hf.MintTokens=0]=\"MintTokens\",hf[hf.FreezeAccount=1]=\"FreezeAccount\",hf[hf.AccountOwner=2]=\"AccountOwner\",hf[hf.CloseAccount=3]=\"CloseAccount\",hf);function gf(){return us(pf)}var mf=\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\";var yf=\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\";var wf,vf=((wf=vf||{})[wf.InitializeMint=0]=\"InitializeMint\",wf[wf.InitializeAccount=1]=\"InitializeAccount\",wf[wf.InitializeMultisig=2]=\"InitializeMultisig\",wf[wf.Transfer=3]=\"Transfer\",wf[wf.Approve=4]=\"Approve\",wf[wf.Revoke=5]=\"Revoke\",wf[wf.SetAuthority=6]=\"SetAuthority\",wf[wf.MintTo=7]=\"MintTo\",wf[wf.Burn=8]=\"Burn\",wf[wf.CloseAccount=9]=\"CloseAccount\",wf[wf.FreezeAccount=10]=\"FreezeAccount\",wf[wf.ThawAccount=11]=\"ThawAccount\",wf[wf.TransferChecked=12]=\"TransferChecked\",wf[wf.ApproveChecked=13]=\"ApproveChecked\",wf[wf.MintToChecked=14]=\"MintToChecked\",wf[wf.BurnChecked=15]=\"BurnChecked\",wf[wf.InitializeAccount2=16]=\"InitializeAccount2\",wf[wf.SyncNative=17]=\"SyncNative\",wf[wf.InitializeAccount3=18]=\"InitializeAccount3\",wf[wf.InitializeMultisig2=19]=\"InitializeMultisig2\",wf[wf.InitializeMint2=20]=\"InitializeMint2\",wf[wf.GetAccountDataSize=21]=\"GetAccountDataSize\",wf[wf.InitializeImmutableOwner=22]=\"InitializeImmutableOwner\",wf[wf.AmountToUiAmount=23]=\"AmountToUiAmount\",wf[wf.UiAmountToAmount=24]=\"UiAmountToAmount\",wf);function bf(e){if(!e)throw new Error(\"Expected a Address.\");return\"object\"==typeof e&&\"address\"in e?e.address:Array.isArray(e)?e[0]:e}function Af(e,t){return t=>{if(!t.value)return Object.freeze({address:e,role:Wi.READONLY});const n=t.isWritable?Wi.WRITABLE:Wi.READONLY;return Object.freeze({address:bf(t.value),role:Sf(t.value)?Zi(n):n,...Sf(t.value)?{signer:t.value}:{}})}}function Sf(e){return!!e&&\"object\"==typeof e&&\"address\"in e&&Sc(e)}function Ef(){return gs([[\"discriminator\",Ki()],[\"amount\",Di()]])}function xf(){return ki(ps([[\"discriminator\",$i()],[\"amount\",Fi()]]),e=>({...e,discriminator:4}))}function kf(){return gs([[\"discriminator\",Ki()],[\"amount\",Di()]])}function If(e,t){const n=t?.programAddress??yf,r={source:{value:e.source??null,isWritable:!0},delegate:{value:e.delegate??null,isWritable:!1},owner:{value:e.owner??null,isWritable:!1}},o={...e},i=(o.multiSigners??[]).map(e=>({address:e.address,role:Wi.READONLY_SIGNER,signer:e})),a=Af(n);return{accounts:[a(r.source),a(r.delegate),a(r.owner),...i],programAddress:n,data:xf().encode(o)}}function Tf(){return gs([[\"discriminator\",Ki()],[\"amount\",Di()],[\"decimals\",Ki()]])}function _f(){return gs([[\"discriminator\",Ki()],[\"amount\",Di()]])}function Cf(){return gs([[\"discriminator\",Ki()],[\"amount\",Di()],[\"decimals\",Ki()]])}function Bf(){return gs([[\"discriminator\",Ki()]])}async function Rf(e,t={}){const{programAddress:n=\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\"}=t;return await async function({programAddress:e,seeds:t}){let n=255;for(;n>0;)try{return[await Oa({programAddress:e,seeds:[...t,new Uint8Array([n])]}),n]}catch(e){if(!Go(e,$r))throw e;n--}throw new Zo(Kr)}({programAddress:n,seeds:[Ea().encode(e.owner),Ea().encode(e.tokenProgram),Ea().encode(e.mint)]})}function Pf(){return ki(ps([[\"discriminator\",$i()]]),e=>({...e,discriminator:0}))}function Nf(e,t){const n=t?.programAddress??mf,r={payer:{value:e.payer??null,isWritable:!0},ata:{value:e.ata??null,isWritable:!0},owner:{value:e.owner??null,isWritable:!1},mint:{value:e.mint??null,isWritable:!1},systemProgram:{value:e.systemProgram??null,isWritable:!1},tokenProgram:{value:e.tokenProgram??null,isWritable:!1}};r.tokenProgram.value||(r.tokenProgram.value=\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\"),r.systemProgram.value||(r.systemProgram.value=\"11111111111111111111111111111111\");const o=Af(n);return{accounts:[o(r.payer),o(r.ata),o(r.owner),o(r.mint),o(r.systemProgram),o(r.tokenProgram)],programAddress:n,data:Pf().encode({})}}function Of(){return ki(ps([[\"discriminator\",$i()]]),e=>({...e,discriminator:1}))}function Uf(e,t){const n=t?.programAddress??mf,r={payer:{value:e.payer??null,isWritable:!0},ata:{value:e.ata??null,isWritable:!0},owner:{value:e.owner??null,isWritable:!1},mint:{value:e.mint??null,isWritable:!1},systemProgram:{value:e.systemProgram??null,isWritable:!1},tokenProgram:{value:e.tokenProgram??null,isWritable:!1}};r.tokenProgram.value||(r.tokenProgram.value=\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\"),r.systemProgram.value||(r.systemProgram.value=\"11111111111111111111111111111111\");const o=Af(n);return{accounts:[o(r.payer),o(r.ata),o(r.owner),o(r.mint),o(r.systemProgram),o(r.tokenProgram)],programAddress:n,data:Of().encode({})}}function Mf(){return gs([[\"discriminator\",Ki()]])}function zf(){return gs([[\"discriminator\",Ki()]])}function Lf(){return gs([[\"discriminator\",Ki()]])}function jf(){return gs([[\"discriminator\",Ki()],[\"owner\",xa()]])}function Ff(){return gs([[\"discriminator\",Ki()],[\"owner\",xa()]])}function Df(){return gs([[\"discriminator\",Ki()]])}function $f(){return gs([[\"discriminator\",Ki()],[\"decimals\",Ki()],[\"mintAuthority\",xa()],[\"freezeAuthority\",ff(xa())]])}function Kf(){return gs([[\"discriminator\",Ki()],[\"decimals\",Ki()],[\"mintAuthority\",xa()],[\"freezeAuthority\",ff(xa())]])}function qf(){return gs([[\"discriminator\",Ki()],[\"m\",Ki()]])}function Wf(){return gs([[\"discriminator\",Ki()],[\"m\",Ki()]])}function Vf(){return gs([[\"discriminator\",Ki()],[\"amount\",Di()]])}function Hf(){return gs([[\"discriminator\",Ki()],[\"amount\",Di()],[\"decimals\",Ki()]])}function Gf(){return gs([[\"discriminator\",Ki()]])}function Zf(){return gs([[\"discriminator\",Ki()],[\"authorityType\",gf()],[\"newAuthority\",ff(xa())]])}function Yf(){return gs([[\"discriminator\",Ki()]])}function Jf(){return gs([[\"discriminator\",Ki()]])}function Xf(){return gs([[\"discriminator\",Ki()],[\"amount\",Di()]])}function Qf(){return ki(ps([[\"discriminator\",$i()],[\"amount\",Fi()],[\"decimals\",$i()]]),e=>({...e,discriminator:12}))}function eh(){return gs([[\"discriminator\",Ki()],[\"amount\",Di()],[\"decimals\",Ki()]])}function th(e,t){const n=t?.programAddress??yf,r={source:{value:e.source??null,isWritable:!0},mint:{value:e.mint??null,isWritable:!1},destination:{value:e.destination??null,isWritable:!0},authority:{value:e.authority??null,isWritable:!1}},o={...e},i=(o.multiSigners??[]).map(e=>({address:e.address,role:Wi.READONLY_SIGNER,signer:e})),a=Af(n);return{accounts:[a(r.source),a(r.mint),a(r.destination),a(r.authority),...i],programAddress:n,data:Qf().encode(o)}}function nh(){return gs([[\"discriminator\",Ki()],[\"uiAmount\",ga()]])}function rh(e){return!(\"exists\"in e)||\"exists\"in e&&e.exists}function oh(e,t){if(!t)return Object.freeze({address:e,exists:!1});const n=ua().encode(t.data[0]);return Object.freeze({...ah(t),address:e,data:n,exists:!0})}function ih(e,t){if(!t)return Object.freeze({address:e,exists:!1});const n=t.data.parsed.info;return Object.freeze({...ah(t),address:e,data:n,exists:!0})}function ah(e){return Object.freeze({executable:e.executable,lamports:e.lamports,programAddress:e.owner,space:e.space})}function sh(e){if(!e.exists)throw new Zo(qr,{address:e.address})}var ch=(e=>(e[e.Uninitialized=0]=\"Uninitialized\",e[e.Initialized=1]=\"Initialized\",e[e.Frozen=2]=\"Frozen\",e))(ch||{});function uh(){return us(ch)}var lh=(e=>(e[e.MintTokens=0]=\"MintTokens\",e[e.FreezeAccount=1]=\"FreezeAccount\",e[e.AccountOwner=2]=\"AccountOwner\",e[e.CloseAccount=3]=\"CloseAccount\",e[e.TransferFeeConfig=4]=\"TransferFeeConfig\",e[e.WithheldWithdraw=5]=\"WithheldWithdraw\",e[e.CloseMint=6]=\"CloseMint\",e[e.InterestRate=7]=\"InterestRate\",e[e.PermanentDelegate=8]=\"PermanentDelegate\",e[e.ConfidentialTransferMint=9]=\"ConfidentialTransferMint\",e[e.TransferHookProgramId=10]=\"TransferHookProgramId\",e[e.ConfidentialTransferFeeConfig=11]=\"ConfidentialTransferFeeConfig\",e[e.MetadataPointer=12]=\"MetadataPointer\",e[e.GroupPointer=13]=\"GroupPointer\",e[e.GroupMemberPointer=14]=\"GroupMemberPointer\",e[e.ScaledUiAmount=15]=\"ScaledUiAmount\",e[e.Pause=16]=\"Pause\",e))(lh||{});function dh(){return us(lh)}function fh(){return yi(Xa(),36)}function hh(){return yi(Xa(),64)}function ph(){return is([[\"Uninitialized\",hs()],[\"TransferFeeConfig\",gi(gs([[\"transferFeeConfigAuthority\",xa()],[\"withdrawWithheldAuthority\",xa()],[\"withheldAmount\",Di()],[\"olderTransferFee\",vh()],[\"newerTransferFee\",vh()]]),zi())],[\"TransferFeeAmount\",gi(gs([[\"withheldAmount\",Di()]]),zi())],[\"MintCloseAuthority\",gi(gs([[\"closeAuthority\",xa()]]),zi())],[\"ConfidentialTransferMint\",gi(gs([[\"authority\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})],[\"autoApproveNewAccounts\",Ya()],[\"auditorElgamalPubkey\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})]]),zi())],[\"ConfidentialTransferAccount\",gi(gs([[\"approved\",Ya()],[\"elgamalPubkey\",xa()],[\"pendingBalanceLow\",hh()],[\"pendingBalanceHigh\",hh()],[\"availableBalance\",hh()],[\"decryptableAvailableBalance\",fh()],[\"allowConfidentialCredits\",Ya()],[\"allowNonConfidentialCredits\",Ya()],[\"pendingBalanceCreditCounter\",Di()],[\"maximumPendingBalanceCreditCounter\",Di()],[\"expectedPendingBalanceCreditCounter\",Di()],[\"actualPendingBalanceCreditCounter\",Di()]]),zi())],[\"DefaultAccountState\",gi(gs([[\"state\",uh()]]),zi())],[\"ImmutableOwner\",gi(gs([]),zi())],[\"MemoTransfer\",gi(gs([[\"requireIncomingTransferMemos\",Ya()]]),zi())],[\"NonTransferable\",gi(gs([]),zi())],[\"InterestBearingConfig\",gi(gs([[\"rateAuthority\",xa()],[\"initializationTimestamp\",Di()],[\"preUpdateAverageRate\",Pi()],[\"lastUpdateTimestamp\",Di()],[\"currentRate\",Pi()]]),zi())],[\"CpiGuard\",gi(gs([[\"lockCpi\",Ya()]]),zi())],[\"PermanentDelegate\",gi(gs([[\"delegate\",xa()]]),zi())],[\"NonTransferableAccount\",gi(gs([]),zi())],[\"TransferHook\",gi(gs([[\"authority\",xa()],[\"programId\",xa()]]),zi())],[\"TransferHookAccount\",gi(gs([[\"transferring\",Ya()]]),zi())],[\"ConfidentialTransferFee\",gi(gs([[\"authority\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})],[\"elgamalPubkey\",xa()],[\"harvestToMintEnabled\",Ya()],[\"withheldAmount\",hh()]]),zi())],[\"ConfidentialTransferFeeAmount\",gi(gs([[\"withheldAmount\",hh()]]),zi())],[\"MetadataPointer\",gi(gs([[\"authority\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})],[\"metadataAddress\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})]]),zi())],[\"TokenMetadata\",gi(gs([[\"updateAuthority\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})],[\"mint\",xa()],[\"name\",gi(ga(),ji())],[\"symbol\",gi(ga(),ji())],[\"uri\",gi(ga(),ji())],[\"additionalMetadata\",fs(gi(ga(),ji()),gi(ga(),ji()))]]),zi())],[\"GroupPointer\",gi(gs([[\"authority\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})],[\"groupAddress\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})]]),zi())],[\"TokenGroup\",gi(gs([[\"updateAuthority\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})],[\"mint\",xa()],[\"size\",Di()],[\"maxSize\",Di()]]),zi())],[\"GroupMemberPointer\",gi(gs([[\"authority\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})],[\"memberAddress\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})]]),zi())],[\"TokenGroupMember\",gi(gs([[\"mint\",xa()],[\"group\",xa()],[\"memberNumber\",Di()]]),zi())],[\"ConfidentialMintBurn\",hs()],[\"ScaledUiAmountConfig\",gi(gs([[\"authority\",xa()],[\"multiplier\",Ri()],[\"newMultiplierEffectiveTimestamp\",Di()],[\"newMultiplier\",Ri()]]),zi())],[\"PausableConfig\",gi(gs([[\"authority\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})],[\"paused\",Ya()]]),zi())],[\"PausableAccount\",hs()]],{size:zi()})}var gh,mh=((gh=mh||{})[gh.Uninitialized=0]=\"Uninitialized\",gh[gh.TransferFeeConfig=1]=\"TransferFeeConfig\",gh[gh.TransferFeeAmount=2]=\"TransferFeeAmount\",gh[gh.MintCloseAuthority=3]=\"MintCloseAuthority\",gh[gh.ConfidentialTransferMint=4]=\"ConfidentialTransferMint\",gh[gh.ConfidentialTransferAccount=5]=\"ConfidentialTransferAccount\",gh[gh.DefaultAccountState=6]=\"DefaultAccountState\",gh[gh.ImmutableOwner=7]=\"ImmutableOwner\",gh[gh.MemoTransfer=8]=\"MemoTransfer\",gh[gh.NonTransferable=9]=\"NonTransferable\",gh[gh.InterestBearingConfig=10]=\"InterestBearingConfig\",gh[gh.CpiGuard=11]=\"CpiGuard\",gh[gh.PermanentDelegate=12]=\"PermanentDelegate\",gh[gh.NonTransferableAccount=13]=\"NonTransferableAccount\",gh[gh.TransferHook=14]=\"TransferHook\",gh[gh.TransferHookAccount=15]=\"TransferHookAccount\",gh[gh.ConfidentialTransferFee=16]=\"ConfidentialTransferFee\",gh[gh.ConfidentialTransferFeeAmount=17]=\"ConfidentialTransferFeeAmount\",gh[gh.ScaledUiAmountConfig=18]=\"ScaledUiAmountConfig\",gh[gh.PausableConfig=19]=\"PausableConfig\",gh[gh.PausableAccount=20]=\"PausableAccount\",gh[gh.MetadataPointer=21]=\"MetadataPointer\",gh[gh.TokenMetadata=22]=\"TokenMetadata\",gh[gh.GroupPointer=23]=\"GroupPointer\",gh[gh.TokenGroup=24]=\"TokenGroup\",gh[gh.GroupMemberPointer=25]=\"GroupMemberPointer\",gh[gh.TokenGroupMember=26]=\"TokenGroupMember\",gh);function yh(){return us(mh,{size:zi()})}function wh(){return is([[\"Name\",hs()],[\"Symbol\",hs()],[\"Uri\",hs()],[\"Key\",gs([[\"fields\",es([gi(ga(),ji())])]])]])}function vh(){return gs([[\"epoch\",Di()],[\"maximumFee\",Di()],[\"transferFeeBasisPoints\",zi()]])}function bh(){return gs([[\"mintAuthority\",ff(xa(),{prefix:ji(),noneValue:\"zeroes\"})],[\"supply\",Di()],[\"decimals\",Ki()],[\"isInitialized\",Ya()],[\"freezeAuthority\",ff(xa(),{prefix:ji(),noneValue:\"zeroes\"})],[\"extensions\",ff(ds(Ga(ph(),{size:\"remainder\"}),[Qa(Ei($i(),83).encode(1))]),{prefix:null})]])}function Ah(e){return function(e,t){try{return\"exists\"in e&&!e.exists?e:Object.freeze({...e,data:t.decode(e.data)})}catch{throw new Zo(Vr,{address:e.address})}}(e,bh())}async function Sh(e,t,n){const r=await async function(e,t,n){const r=await async function(e,t,n={}){const{abortSignal:r,...o}=n;return oh(t,(await e.getAccountInfo(t,{...o,encoding:\"base64\"}).send({abortSignal:r})).value)}(e,t,n);return Ah(r)}(e,t,n);return sh(r),r}var Eh=\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\",xh=(e=>(e[e.CreateAssociatedToken=0]=\"CreateAssociatedToken\",e[e.CreateAssociatedTokenIdempotent=1]=\"CreateAssociatedTokenIdempotent\",e[e.RecoverNestedAssociatedToken=2]=\"RecoverNestedAssociatedToken\",e))(xh||{});var kh=\"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb\";var Ih,Th=((Ih=Th||{})[Ih.InitializeMint=0]=\"InitializeMint\",Ih[Ih.InitializeAccount=1]=\"InitializeAccount\",Ih[Ih.InitializeMultisig=2]=\"InitializeMultisig\",Ih[Ih.Transfer=3]=\"Transfer\",Ih[Ih.Approve=4]=\"Approve\",Ih[Ih.Revoke=5]=\"Revoke\",Ih[Ih.SetAuthority=6]=\"SetAuthority\",Ih[Ih.MintTo=7]=\"MintTo\",Ih[Ih.Burn=8]=\"Burn\",Ih[Ih.CloseAccount=9]=\"CloseAccount\",Ih[Ih.FreezeAccount=10]=\"FreezeAccount\",Ih[Ih.ThawAccount=11]=\"ThawAccount\",Ih[Ih.TransferChecked=12]=\"TransferChecked\",Ih[Ih.ApproveChecked=13]=\"ApproveChecked\",Ih[Ih.MintToChecked=14]=\"MintToChecked\",Ih[Ih.BurnChecked=15]=\"BurnChecked\",Ih[Ih.InitializeAccount2=16]=\"InitializeAccount2\",Ih[Ih.SyncNative=17]=\"SyncNative\",Ih[Ih.InitializeAccount3=18]=\"InitializeAccount3\",Ih[Ih.InitializeMultisig2=19]=\"InitializeMultisig2\",Ih[Ih.InitializeMint2=20]=\"InitializeMint2\",Ih[Ih.GetAccountDataSize=21]=\"GetAccountDataSize\",Ih[Ih.InitializeImmutableOwner=22]=\"InitializeImmutableOwner\",Ih[Ih.AmountToUiAmount=23]=\"AmountToUiAmount\",Ih[Ih.UiAmountToAmount=24]=\"UiAmountToAmount\",Ih[Ih.InitializeMintCloseAuthority=25]=\"InitializeMintCloseAuthority\",Ih[Ih.InitializeTransferFeeConfig=26]=\"InitializeTransferFeeConfig\",Ih[Ih.TransferCheckedWithFee=27]=\"TransferCheckedWithFee\",Ih[Ih.WithdrawWithheldTokensFromMint=28]=\"WithdrawWithheldTokensFromMint\",Ih[Ih.WithdrawWithheldTokensFromAccounts=29]=\"WithdrawWithheldTokensFromAccounts\",Ih[Ih.HarvestWithheldTokensToMint=30]=\"HarvestWithheldTokensToMint\",Ih[Ih.SetTransferFee=31]=\"SetTransferFee\",Ih[Ih.InitializeConfidentialTransferMint=32]=\"InitializeConfidentialTransferMint\",Ih[Ih.UpdateConfidentialTransferMint=33]=\"UpdateConfidentialTransferMint\",Ih[Ih.ConfigureConfidentialTransferAccount=34]=\"ConfigureConfidentialTransferAccount\",Ih[Ih.ApproveConfidentialTransferAccount=35]=\"ApproveConfidentialTransferAccount\",Ih[Ih.EmptyConfidentialTransferAccount=36]=\"EmptyConfidentialTransferAccount\",Ih[Ih.ConfidentialDeposit=37]=\"ConfidentialDeposit\",Ih[Ih.ConfidentialWithdraw=38]=\"ConfidentialWithdraw\",Ih[Ih.ConfidentialTransfer=39]=\"ConfidentialTransfer\",Ih[Ih.ApplyConfidentialPendingBalance=40]=\"ApplyConfidentialPendingBalance\",Ih[Ih.EnableConfidentialCredits=41]=\"EnableConfidentialCredits\",Ih[Ih.DisableConfidentialCredits=42]=\"DisableConfidentialCredits\",Ih[Ih.EnableNonConfidentialCredits=43]=\"EnableNonConfidentialCredits\",Ih[Ih.DisableNonConfidentialCredits=44]=\"DisableNonConfidentialCredits\",Ih[Ih.ConfidentialTransferWithFee=45]=\"ConfidentialTransferWithFee\",Ih[Ih.InitializeDefaultAccountState=46]=\"InitializeDefaultAccountState\",Ih[Ih.UpdateDefaultAccountState=47]=\"UpdateDefaultAccountState\",Ih[Ih.Reallocate=48]=\"Reallocate\",Ih[Ih.EnableMemoTransfers=49]=\"EnableMemoTransfers\",Ih[Ih.DisableMemoTransfers=50]=\"DisableMemoTransfers\",Ih[Ih.CreateNativeMint=51]=\"CreateNativeMint\",Ih[Ih.InitializeNonTransferableMint=52]=\"InitializeNonTransferableMint\",Ih[Ih.InitializeInterestBearingMint=53]=\"InitializeInterestBearingMint\",Ih[Ih.UpdateRateInterestBearingMint=54]=\"UpdateRateInterestBearingMint\",Ih[Ih.EnableCpiGuard=55]=\"EnableCpiGuard\",Ih[Ih.DisableCpiGuard=56]=\"DisableCpiGuard\",Ih[Ih.InitializePermanentDelegate=57]=\"InitializePermanentDelegate\",Ih[Ih.InitializeTransferHook=58]=\"InitializeTransferHook\",Ih[Ih.UpdateTransferHook=59]=\"UpdateTransferHook\",Ih[Ih.InitializeConfidentialTransferFee=60]=\"InitializeConfidentialTransferFee\",Ih[Ih.WithdrawWithheldTokensFromMintForConfidentialTransferFee=61]=\"WithdrawWithheldTokensFromMintForConfidentialTransferFee\",Ih[Ih.WithdrawWithheldTokensFromAccountsForConfidentialTransferFee=62]=\"WithdrawWithheldTokensFromAccountsForConfidentialTransferFee\",Ih[Ih.HarvestWithheldTokensToMintForConfidentialTransferFee=63]=\"HarvestWithheldTokensToMintForConfidentialTransferFee\",Ih[Ih.EnableHarvestToMint=64]=\"EnableHarvestToMint\",Ih[Ih.DisableHarvestToMint=65]=\"DisableHarvestToMint\",Ih[Ih.WithdrawExcessLamports=66]=\"WithdrawExcessLamports\",Ih[Ih.InitializeMetadataPointer=67]=\"InitializeMetadataPointer\",Ih[Ih.UpdateMetadataPointer=68]=\"UpdateMetadataPointer\",Ih[Ih.InitializeGroupPointer=69]=\"InitializeGroupPointer\",Ih[Ih.UpdateGroupPointer=70]=\"UpdateGroupPointer\",Ih[Ih.InitializeGroupMemberPointer=71]=\"InitializeGroupMemberPointer\",Ih[Ih.UpdateGroupMemberPointer=72]=\"UpdateGroupMemberPointer\",Ih[Ih.InitializeScaledUiAmountMint=73]=\"InitializeScaledUiAmountMint\",Ih[Ih.UpdateMultiplierScaledUiMint=74]=\"UpdateMultiplierScaledUiMint\",Ih[Ih.InitializePausableConfig=75]=\"InitializePausableConfig\",Ih[Ih.Pause=76]=\"Pause\",Ih[Ih.Resume=77]=\"Resume\",Ih[Ih.InitializeTokenMetadata=78]=\"InitializeTokenMetadata\",Ih[Ih.UpdateTokenMetadataField=79]=\"UpdateTokenMetadataField\",Ih[Ih.RemoveTokenMetadataKey=80]=\"RemoveTokenMetadataKey\",Ih[Ih.UpdateTokenMetadataUpdateAuthority=81]=\"UpdateTokenMetadataUpdateAuthority\",Ih[Ih.EmitTokenMetadata=82]=\"EmitTokenMetadata\",Ih[Ih.InitializeTokenGroup=83]=\"InitializeTokenGroup\",Ih[Ih.UpdateTokenGroupMaxSize=84]=\"UpdateTokenGroupMaxSize\",Ih[Ih.UpdateTokenGroupUpdateAuthority=85]=\"UpdateTokenGroupUpdateAuthority\",Ih[Ih.InitializeTokenGroupMember=86]=\"InitializeTokenGroupMember\",Ih);function _h(e){if(!e)throw new Error(\"Expected a Address.\");return\"object\"==typeof e&&\"address\"in e?e.address:Array.isArray(e)?e[0]:e}function Ch(e,t){return t=>{if(!t.value)return Object.freeze({address:e,role:Wi.READONLY});const n=t.isWritable?Wi.WRITABLE:Wi.READONLY;return Object.freeze({address:_h(t.value),role:Bh(t.value)?Zi(n):n,...Bh(t.value)?{signer:t.value}:{}})}}function Bh(e){return!!e&&\"object\"==typeof e&&\"address\"in e&&Sc(e)}function Rh(){return gs([[\"discriminator\",Ki()],[\"amount\",Di()]])}function Ph(){return gs([[\"discriminator\",Ki()],[\"confidentialTransferDiscriminator\",Ki()],[\"expectedPendingBalanceCreditCounter\",Di()],[\"newDecryptableAvailableBalance\",fh()]])}function Nh(){return ki(ps([[\"discriminator\",$i()],[\"amount\",Fi()]]),e=>({...e,discriminator:4}))}function Oh(){return gs([[\"discriminator\",Ki()],[\"amount\",Di()]])}function Uh(e,t){const n=t?.programAddress??kh,r={source:{value:e.source??null,isWritable:!0},delegate:{value:e.delegate??null,isWritable:!1},owner:{value:e.owner??null,isWritable:!1}},o={...e},i=(o.multiSigners??[]).map(e=>({address:e.address,role:Wi.READONLY_SIGNER,signer:e})),a=Ch(n);return{accounts:[a(r.source),a(r.delegate),a(r.owner),...i],programAddress:n,data:Nh().encode(o)}}function Mh(){return gs([[\"discriminator\",Ki()],[\"amount\",Di()],[\"decimals\",Ki()]])}function zh(){return gs([[\"discriminator\",Ki()],[\"confidentialTransferDiscriminator\",Ki()]])}function Lh(){return gs([[\"discriminator\",Ki()],[\"amount\",Di()]])}function jh(){return gs([[\"discriminator\",Ki()],[\"amount\",Di()],[\"decimals\",Ki()]])}function Fh(){return gs([[\"discriminator\",Ki()]])}function Dh(){return gs([[\"discriminator\",Ki()],[\"confidentialTransferDiscriminator\",Ki()],[\"amount\",Di()],[\"decimals\",Ki()]])}function $h(){return gs([[\"discriminator\",Ki()],[\"confidentialTransferDiscriminator\",Ki()],[\"newSourceDecryptableAvailableBalance\",fh()],[\"equalityProofInstructionOffset\",Oi()],[\"ciphertextValidityProofInstructionOffset\",Oi()],[\"rangeProofInstructionOffset\",Oi()]])}function Kh(){return gs([[\"discriminator\",Ki()],[\"confidentialTransferDiscriminator\",Ki()],[\"newSourceDecryptableAvailableBalance\",fh()],[\"equalityProofInstructionOffset\",Oi()],[\"transferAmountCiphertextValidityProofInstructionOffset\",Oi()],[\"feeSigmaProofInstructionOffset\",Oi()],[\"feeCiphertextValidityProofInstructionOffset\",Oi()],[\"rangeProofInstructionOffset\",Oi()]])}function qh(){return gs([[\"discriminator\",Ki()],[\"confidentialTransferDiscriminator\",Ki()],[\"amount\",Di()],[\"decimals\",Ki()],[\"newDecryptableAvailableBalance\",fh()],[\"equalityProofInstructionOffset\",Oi()],[\"rangeProofInstructionOffset\",Oi()]])}function Wh(){return gs([[\"discriminator\",Ki()],[\"confidentialTransferDiscriminator\",Ki()],[\"decryptableZeroBalance\",fh()],[\"maximumPendingBalanceCreditCounter\",Di()],[\"proofInstructionOffset\",Oi()]])}function Vh(){return ki(ps([[\"discriminator\",$i()]]),e=>({...e,discriminator:0}))}function Hh(){return gs([[\"discriminator\",Ki()]])}function Gh(e,t){const n=t?.programAddress??Eh,r={payer:{value:e.payer??null,isWritable:!0},ata:{value:e.ata??null,isWritable:!0},owner:{value:e.owner??null,isWritable:!1},mint:{value:e.mint??null,isWritable:!1},systemProgram:{value:e.systemProgram??null,isWritable:!1},tokenProgram:{value:e.tokenProgram??null,isWritable:!1}};r.tokenProgram.value||(r.tokenProgram.value=\"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb\"),r.systemProgram.value||(r.systemProgram.value=\"11111111111111111111111111111111\");const o=Ch(n);return{accounts:[o(r.payer),o(r.ata),o(r.owner),o(r.mint),o(r.systemProgram),o(r.tokenProgram)],programAddress:n,data:Vh().encode({})}}function Zh(){return ki(ps([[\"discriminator\",$i()]]),e=>({...e,discriminator:1}))}function Yh(){return gs([[\"discriminator\",Ki()]])}function Jh(e,t){const n=t?.programAddress??Eh,r={payer:{value:e.payer??null,isWritable:!0},ata:{value:e.ata??null,isWritable:!0},owner:{value:e.owner??null,isWritable:!1},mint:{value:e.mint??null,isWritable:!1},systemProgram:{value:e.systemProgram??null,isWritable:!1},tokenProgram:{value:e.tokenProgram??null,isWritable:!1}};r.tokenProgram.value||(r.tokenProgram.value=\"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb\"),r.systemProgram.value||(r.systemProgram.value=\"11111111111111111111111111111111\");const o=Ch(n);return{accounts:[o(r.payer),o(r.ata),o(r.owner),o(r.mint),o(r.systemProgram),o(r.tokenProgram)],programAddress:n,data:Zh().encode({})}}function Xh(){return gs([[\"discriminator\",Ki()]])}function Qh(){return gs([[\"discriminator\",Ki()],[\"confidentialTransferDiscriminator\",Ki()]])}function ep(){return gs([[\"discriminator\",Ki()],[\"cpiGuardDiscriminator\",Ki()]])}function tp(){return gs([[\"discriminator\",Ki()],[\"confidentialTransferFeeDiscriminator\",Ki()]])}function np(){return gs([[\"discriminator\",Ki()],[\"memoTransfersDiscriminator\",Ki()]])}function rp(){return gs([[\"discriminator\",Ki()],[\"confidentialTransferDiscriminator\",Ki()]])}new Uint8Array([250,166,180,250,13,12,184,70]);function op(){return gs([[\"discriminator\",Xa()],[\"start\",ff(Di())],[\"end\",ff(Di())]])}function ip(){return gs([[\"discriminator\",Ki()],[\"confidentialTransferDiscriminator\",Ki()],[\"proofInstructionOffset\",Oi()]])}function ap(){return gs([[\"discriminator\",Ki()],[\"confidentialTransferDiscriminator\",Ki()]])}function sp(){return gs([[\"discriminator\",Ki()],[\"cpiGuardDiscriminator\",Ki()]])}function cp(){return gs([[\"discriminator\",Ki()],[\"confidentialTransferFeeDiscriminator\",Ki()]])}function up(){return gs([[\"discriminator\",Ki()],[\"memoTransfersDiscriminator\",Ki()]])}function lp(){return gs([[\"discriminator\",Ki()],[\"confidentialTransferDiscriminator\",Ki()]])}function dp(){return gs([[\"discriminator\",Ki()]])}function fp(){return gs([[\"discriminator\",Ki()]])}function hp(){return gs([[\"discriminator\",Ki()],[\"transferFeeDiscriminator\",Ki()]])}function pp(){return gs([[\"discriminator\",Ki()],[\"confidentialTransferFeeDiscriminator\",Ki()]])}function gp(){return gs([[\"discriminator\",Ki()]])}function mp(){return gs([[\"discriminator\",Ki()],[\"owner\",xa()]])}function yp(){return gs([[\"discriminator\",Ki()],[\"owner\",xa()]])}function wp(){return gs([[\"discriminator\",Ki()],[\"confidentialTransferFeeDiscriminator\",Ki()],[\"authority\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})],[\"withdrawWithheldAuthorityElGamalPubkey\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})]])}function vp(){return gs([[\"discriminator\",Ki()],[\"confidentialTransferDiscriminator\",Ki()],[\"authority\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})],[\"autoApproveNewAccounts\",Ya()],[\"auditorElgamalPubkey\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})]])}function bp(){return gs([[\"discriminator\",Ki()],[\"defaultAccountStateDiscriminator\",Ki()],[\"state\",uh()]])}function Ap(){return gs([[\"discriminator\",Ki()],[\"groupMemberPointerDiscriminator\",Ki()],[\"authority\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})],[\"memberAddress\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})]])}function Sp(){return gs([[\"discriminator\",Ki()],[\"groupPointerDiscriminator\",Ki()],[\"authority\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})],[\"groupAddress\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})]])}function Ep(){return gs([[\"discriminator\",Ki()]])}function xp(){return gs([[\"discriminator\",Ki()],[\"interestBearingMintDiscriminator\",Ki()],[\"rateAuthority\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})],[\"rate\",Pi()]])}function kp(){return gs([[\"discriminator\",Ki()],[\"metadataPointerDiscriminator\",Ki()],[\"authority\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})],[\"metadataAddress\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})]])}function Ip(){return gs([[\"discriminator\",Ki()],[\"decimals\",Ki()],[\"mintAuthority\",xa()],[\"freezeAuthority\",ff(xa())]])}function Tp(){return gs([[\"discriminator\",Ki()],[\"decimals\",Ki()],[\"mintAuthority\",xa()],[\"freezeAuthority\",ff(xa())]])}function _p(){return gs([[\"discriminator\",Ki()],[\"closeAuthority\",ff(xa())]])}function Cp(){return gs([[\"discriminator\",Ki()],[\"m\",Ki()]])}function Bp(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{multisig:n(),rent:n()},data:Cp().decode(e.data)}}function Rp(){return gs([[\"discriminator\",Ki()]])}function Pp(){return gs([[\"discriminator\",Ki()],[\"pausableDiscriminator\",Ki()],[\"authority\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})]])}function Np(){return gs([[\"discriminator\",Ki()],[\"delegate\",xa()]])}function Op(){return gs([[\"discriminator\",Ki()],[\"scaledUiAmountMintDiscriminator\",Ki()],[\"authority\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})],[\"multiplier\",Ri()]])}new Uint8Array([121,113,108,39,54,51,0,4]);function Up(){return gs([[\"discriminator\",Xa()],[\"updateAuthority\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})],[\"maxSize\",Di()]])}new Uint8Array([152,32,222,176,223,237,116,134]);function Mp(){return gs([[\"discriminator\",Xa()]])}new Uint8Array([210,225,30,162,88,184,77,141]);function zp(){return gs([[\"discriminator\",Xa()],[\"name\",gi(ga(),ji())],[\"symbol\",gi(ga(),ji())],[\"uri\",gi(ga(),ji())]])}function Lp(){return gs([[\"discriminator\",Ki()],[\"transferFeeDiscriminator\",Ki()],[\"transferFeeConfigAuthority\",ff(xa())],[\"withdrawWithheldAuthority\",ff(xa())],[\"transferFeeBasisPoints\",zi()],[\"maximumFee\",Di()]])}function jp(){return gs([[\"discriminator\",Ki()],[\"transferHookDiscriminator\",Ki()],[\"authority\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})],[\"programId\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})]])}function Fp(){return gs([[\"discriminator\",Ki()],[\"amount\",Di()]])}function Dp(){return gs([[\"discriminator\",Ki()],[\"amount\",Di()],[\"decimals\",Ki()]])}function $p(){return gs([[\"discriminator\",Ki()],[\"pausableDiscriminator\",Ki()]])}function Kp(){return gs([[\"discriminator\",Ki()],[\"newExtensionTypes\",Ga(yh(),{size:\"remainder\"})]])}function qp(){return gs([[\"discriminator\",Ki()]])}new Uint8Array([234,18,32,56,89,141,37,181]);function Wp(){return gs([[\"discriminator\",Xa()],[\"idempotent\",Ya()],[\"key\",gi(ga(),ji())]])}function Vp(){return gs([[\"discriminator\",Ki()],[\"pausableDiscriminator\",Ki()]])}function Hp(){return gs([[\"discriminator\",Ki()]])}function Gp(){return gs([[\"discriminator\",Ki()],[\"authorityType\",dh()],[\"newAuthority\",ff(xa())]])}function Zp(){return gs([[\"discriminator\",Ki()],[\"transferFeeDiscriminator\",Ki()],[\"transferFeeBasisPoints\",zi()],[\"maximumFee\",Di()]])}function Yp(){return gs([[\"discriminator\",Ki()]])}function Jp(){return gs([[\"discriminator\",Ki()]])}function Xp(){return gs([[\"discriminator\",Ki()],[\"amount\",Di()]])}function Qp(){return ki(ps([[\"discriminator\",$i()],[\"amount\",Fi()],[\"decimals\",$i()]]),e=>({...e,discriminator:12}))}function eg(){return gs([[\"discriminator\",Ki()],[\"amount\",Di()],[\"decimals\",Ki()]])}function tg(e,t){const n=t?.programAddress??kh,r={source:{value:e.source??null,isWritable:!0},mint:{value:e.mint??null,isWritable:!1},destination:{value:e.destination??null,isWritable:!0},authority:{value:e.authority??null,isWritable:!1}},o={...e},i=(o.multiSigners??[]).map(e=>({address:e.address,role:Wi.READONLY_SIGNER,signer:e})),a=Ch(n);return{accounts:[a(r.source),a(r.mint),a(r.destination),a(r.authority),...i],programAddress:n,data:Qp().encode(o)}}function ng(){return gs([[\"discriminator\",Ki()],[\"transferFeeDiscriminator\",Ki()],[\"amount\",Di()],[\"decimals\",Ki()],[\"fee\",Di()]])}function rg(){return gs([[\"discriminator\",Ki()],[\"uiAmount\",ga()]])}function og(){return gs([[\"discriminator\",Ki()],[\"confidentialTransferDiscriminator\",Ki()],[\"autoApproveNewAccounts\",Ya()],[\"auditorElgamalPubkey\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})]])}function ig(){return gs([[\"discriminator\",Ki()],[\"defaultAccountStateDiscriminator\",Ki()],[\"state\",uh()]])}function ag(){return gs([[\"discriminator\",Ki()],[\"groupMemberPointerDiscriminator\",Ki()],[\"memberAddress\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})]])}function sg(){return gs([[\"discriminator\",Ki()],[\"groupPointerDiscriminator\",Ki()],[\"groupAddress\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})]])}function cg(){return gs([[\"discriminator\",Ki()],[\"metadataPointerDiscriminator\",Ki()],[\"metadataAddress\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})]])}function ug(){return gs([[\"discriminator\",Ki()],[\"scaledUiAmountMintDiscriminator\",Ki()],[\"multiplier\",Ri()],[\"effectiveTimestamp\",Ni()]])}function lg(){return gs([[\"discriminator\",Ki()],[\"interestBearingMintDiscriminator\",Ki()],[\"rate\",Pi()]])}new Uint8Array([108,37,171,143,248,30,18,110]);function dg(){return gs([[\"discriminator\",Xa()],[\"maxSize\",Di()]])}new Uint8Array([161,105,88,1,237,221,216,203]);function fg(){return gs([[\"discriminator\",Xa()],[\"newUpdateAuthority\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})]])}new Uint8Array([221,233,49,45,181,202,220,200]);function hg(){return gs([[\"discriminator\",Xa()],[\"field\",wh()],[\"value\",gi(ga(),ji())]])}new Uint8Array([215,228,166,228,84,100,86,123]);function pg(){return gs([[\"discriminator\",Xa()],[\"newUpdateAuthority\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})]])}function gg(){return gs([[\"discriminator\",Ki()],[\"transferHookDiscriminator\",Ki()],[\"programId\",ff(xa(),{prefix:null,noneValue:\"zeroes\"})]])}function mg(){return gs([[\"discriminator\",Ki()]])}function yg(){return gs([[\"discriminator\",Ki()],[\"transferFeeDiscriminator\",Ki()],[\"numTokenAccounts\",Ki()]])}function wg(){return gs([[\"discriminator\",Ki()],[\"confidentialTransferFeeDiscriminator\",Ki()],[\"numTokenAccounts\",Ki()],[\"proofInstructionOffset\",Oi()],[\"newDecryptableAvailableBalance\",fh()]])}function vg(){return gs([[\"discriminator\",Ki()],[\"transferFeeDiscriminator\",Ki()]])}function bg(){return gs([[\"discriminator\",Ki()],[\"confidentialTransferFeeDiscriminator\",Ki()],[\"proofInstructionOffset\",Oi()],[\"newDecryptableAvailableBalance\",fh()]])}function Ag(e,t,n){const r=t-e;if(r<0)throw new Error(\"Invalid timespan: end time before start time\");const o=n*r/31556736e4;return Math.exp(o)}function Sg({currentTimestamp:e,lastUpdateTimestamp:t,initializationTimestamp:n,preUpdateAverageRate:r,currentRate:o}){return Ag(n,t,r)*Ag(t,e,o)}function Eg(e){return Math.pow(10,e)}function xg(e,t,n,r,o,i,a){const s=parseFloat(e)*Eg(t)/Sg({currentTimestamp:n,lastUpdateTimestamp:r,initializationTimestamp:o,preUpdateAverageRate:i,currentRate:a});return BigInt(Math.trunc(s))}function kg(e,t,n){const r=parseFloat(e)*Eg(t)/n;return BigInt(Math.trunc(r))}var Ig=\"ComputeBudget111111111111111111111111111111\",Tg={blockhash:\"11111111111111111111111111111111\",lastValidBlockHeight:0n};function _g(e){return function(e,t){return e.programAddress===t}(e,Ig)&&function(e){return void 0!==e.data}(e)&&2===e.data[0]}async function Cg({abortSignal:e,rpc:t,transactionMessage:n,...r}){const o=rc(n);let i;i=o||Ss(n)?n:Es(Tg,n);const a=n.instructions.findIndex(_g),s=function(e){const t=new Uint8Array(5);return t[0]=2,Li().write(e,t,1),Object.freeze({data:t,programAddress:Ig})}(14e5);if(-1===a)i=ic(s,i);else{const e=[...i.instructions];e.splice(a,1,s),i=Object.freeze({...i,instructions:e})}const c=yc(hc(i));try{const{value:{err:n,unitsConsumed:i}}=await t.simulateTransaction(c,{...r,encoding:\"base64\",replaceRecentBlockhash:!o,sigVerify:!1}).send({abortSignal:e});if(null==i)throw new Zo(bo);const a=i>4294967295n?4294967295:Number(i);if(n)throw new Zo(Ao,{cause:n,unitsConsumed:a});return a}catch(e){if(Go(e,Ao))throw e;throw new Zo(bo,{cause:e})}}async function Bg(e,t,n){if(0===e.length)return{};const r=await async function(e,t,n={}){const{abortSignal:r,...o}=n;return(await e.getMultipleAccounts(t,{...o,encoding:\"jsonParsed\"}).send({abortSignal:r})).value.map((e,n)=>e&&\"object\"==typeof e&&\"parsed\"in e.data?ih(t[n],e):oh(t[n],e))}(t,e,n);return function(e){const t=e.filter(e=>rh(e)&&e.data instanceof Uint8Array);if(t.length>0){const e=t.map(e=>e.address);throw new Zo(Hr,{addresses:e})}}(r),function(e){const t=e.filter(e=>!e.exists);if(t.length>0){const e=t.map(e=>e.address);throw new Zo(Wr,{addresses:e})}}(r),r.reduce((e,t)=>({...e,[t.address]:t.data.addresses}),{})}async function Rg(e,t,n){const r=(\"addressTableLookups\"in e&&void 0!==e.addressTableLookups&&e.addressTableLookups.length>0?e.addressTableLookups:[]).map(e=>e.lookupTableAddress),{lastValidBlockHeight:o,...i}=n??{};return cc(e,{addressesByLookupTableAddress:r.length>0?await Bg(r,t,i):{},lastValidBlockHeight:o})}function Pg(e,t){return!t?.preflightCommitment&&function(e,t){return e===t?0:ws(e)<ws(t)?-1:1}(e,\"finalized\")<0?{...t,preflightCommitment:e}:t}async function Ng({abortSignal:e,commitment:t,rpc:n,transaction:r,...o}){const i=yc(r);return await n.sendTransaction(i,{...Pg(t,o),encoding:\"base64\"}).send({abortSignal:e})}const Og=async(e,t,n)=>As(e,ua().encode,Ks().decode,async e=>Rg(e,t,n)),Ug=async(e,t,n)=>As(e,Ks().decode,async e=>Rg(e,t,n)),Mg=e=>As(e,lc().encode,la().decode),zg=async e=>As(e,ua().encode,dc().decode),Lg=async(e,t,n)=>(async e=>new Promise((t,n)=>{if(0===e.length)return void n(new AggregateError([],\"No promises to resolve\"));let r=0;const o=[];e.forEach((i,a)=>{Promise.resolve(i).then(e=>t(e),t=>{o[a]=t,r+=1,r===e.length&&n(new AggregateError(o,\"All promises rejected\"))})})}))([zg(e),Og(e,t,n)]),jg=Sa(\"KeccakSecp256k11111111111111111111111111111\"),Fg=Sa(\"Secp256r1SigVerify1111111111111111111111111\");var Dg=function(e){return e[e.Verify=0]=\"Verify\",e}({});const $g=e=>0,Kg=e=>e.programAddress===jg,qg=e=>e.programAddress===Fg,Wg=()=>{return e=[[\"numSignatures\",di($i(),Ki())]],di(ps(e),gs(e));var e},Vg=e=>({programAddress:e.programAddress,data:Wg().decode(e.data??new Uint8Array)});const Hg={[Oc]:{identifier:function(e){const t=\"data\"in e?e.data:e;if(oi(t,Li().encode(0),0))return 0;if(oi(t,Li().encode(1),0))return 1;if(oi(t,Li().encode(2),0))return 2;if(oi(t,Li().encode(3),0))return 3;if(oi(t,Li().encode(4),0))return 4;if(oi(t,Li().encode(5),0))return 5;if(oi(t,Li().encode(6),0))return 6;if(oi(t,Li().encode(7),0))return 7;if(oi(t,Li().encode(8),0))return 8;if(oi(t,Li().encode(9),0))return 9;if(oi(t,Li().encode(10),0))return 10;if(oi(t,Li().encode(11),0))return 11;if(oi(t,Li().encode(12),0))return 12;throw new Error(\"The provided instruction could not be identified as a system instruction.\")},instructionEnum:Uc,typeToParserMap:{[Uc.Assign]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{account:(()=>{const n=e.accounts[t];return t+=1,n})()},data:$c().decode(e.data)}},[Uc.TransferSol]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{source:n(),destination:n()},data:Zc().decode(e.data)}},[Uc.CreateAccount]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{payer:n(),newAccount:n()},data:Wc().decode(e.data)}},[Uc.CreateAccountWithSeed]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{payer:n(),newAccount:n(),baseAccount:n()},data:Vc().decode(e.data)}},[Uc.AdvanceNonceAccount]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{nonceAccount:n(),recentBlockhashesSysvar:n(),nonceAuthority:n()},data:jc().decode(e.data)}},[Uc.WithdrawNonceAccount]:function(e){if(e.accounts.length<5)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{nonceAccount:n(),recipientAccount:n(),recentBlockhashesSysvar:n(),rentSysvar:n(),nonceAuthority:n()},data:Xc().decode(e.data)}},[Uc.InitializeNonceAccount]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{nonceAccount:n(),recentBlockhashesSysvar:n(),rentSysvar:n()},data:Hc().decode(e.data)}},[Uc.AuthorizeNonceAccount]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{nonceAccount:n(),nonceAuthority:n()},data:qc().decode(e.data)}},[Uc.Allocate]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{newAccount:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Fc().decode(e.data)}},[Uc.AllocateWithSeed]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{newAccount:n(),baseAccount:n()},data:Dc().decode(e.data)}},[Uc.AssignWithSeed]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),baseAccount:n()},data:Kc().decode(e.data)}},[Uc.TransferSolWithSeed]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{source:n(),baseAccount:n(),destination:n()},data:Yc().decode(e.data)}},[Uc.UpgradeNonceAccount]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{nonceAccount:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Jc().decode(e.data)}}}},[Zd]:{identifier:Jd,instructionEnum:Yd,typeToParserMap:{[Yd.RequestUnits]:function(e){return{programAddress:e.programAddress,data:Qd().decode(e.data)}},[Yd.RequestHeapFrame]:function(e){return{programAddress:e.programAddress,data:Xd().decode(e.data)}},[Yd.SetComputeUnitPrice]:cf,[Yd.SetComputeUnitLimit]:rf,[Yd.SetLoadedAccountsDataSizeLimit]:function(e){return{programAddress:e.programAddress,data:uf().decode(e.data)}}}},[yf]:{identifier:function(e){const t=\"data\"in e?e.data:e;if(oi(t,$i().encode(0),0))return 0;if(oi(t,$i().encode(1),0))return 1;if(oi(t,$i().encode(2),0))return 2;if(oi(t,$i().encode(3),0))return 3;if(oi(t,$i().encode(4),0))return 4;if(oi(t,$i().encode(5),0))return 5;if(oi(t,$i().encode(6),0))return 6;if(oi(t,$i().encode(7),0))return 7;if(oi(t,$i().encode(8),0))return 8;if(oi(t,$i().encode(9),0))return 9;if(oi(t,$i().encode(10),0))return 10;if(oi(t,$i().encode(11),0))return 11;if(oi(t,$i().encode(12),0))return 12;if(oi(t,$i().encode(13),0))return 13;if(oi(t,$i().encode(14),0))return 14;if(oi(t,$i().encode(15),0))return 15;if(oi(t,$i().encode(16),0))return 16;if(oi(t,$i().encode(17),0))return 17;if(oi(t,$i().encode(18),0))return 18;if(oi(t,$i().encode(19),0))return 19;if(oi(t,$i().encode(20),0))return 20;if(oi(t,$i().encode(21),0))return 21;if(oi(t,$i().encode(22),0))return 22;if(oi(t,$i().encode(23),0))return 23;if(oi(t,$i().encode(24),0))return 24;throw new Error(\"The provided instruction could not be identified as a token instruction.\")},instructionEnum:vf,typeToParserMap:{[vf.InitializeMint]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),rent:n()},data:$f().decode(e.data)}},[vf.InitializeAccount]:function(e){if(e.accounts.length<4)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n(),owner:n(),rent:n()},data:Lf().decode(e.data)}},[vf.InitializeMultisig]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{multisig:n(),rent:n()},data:qf().decode(e.data)}},[vf.Transfer]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{source:n(),destination:n(),authority:n()},data:Xf().decode(e.data)}},[vf.Approve]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{source:n(),delegate:n(),owner:n()},data:kf().decode(e.data)}},[vf.Revoke]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{source:n(),owner:n()},data:Gf().decode(e.data)}},[vf.SetAuthority]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{owned:n(),owner:n()},data:Zf().decode(e.data)}},[vf.MintTo]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),token:n(),mintAuthority:n()},data:Vf().decode(e.data)}},[vf.Burn]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n(),authority:n()},data:_f().decode(e.data)}},[vf.CloseAccount]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),destination:n(),owner:n()},data:Bf().decode(e.data)}},[vf.FreezeAccount]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n(),owner:n()},data:Mf().decode(e.data)}},[vf.ThawAccount]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n(),owner:n()},data:Jf().decode(e.data)}},[vf.TransferChecked]:function(e){if(e.accounts.length<4)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{source:n(),mint:n(),destination:n(),authority:n()},data:eh().decode(e.data)}},[vf.ApproveChecked]:function(e){if(e.accounts.length<4)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{source:n(),mint:n(),delegate:n(),owner:n()},data:Tf().decode(e.data)}},[vf.MintToChecked]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),token:n(),mintAuthority:n()},data:Hf().decode(e.data)}},[vf.BurnChecked]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n(),authority:n()},data:Cf().decode(e.data)}},[vf.InitializeAccount2]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n(),rent:n()},data:jf().decode(e.data)}},[vf.SyncNative]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{account:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Yf().decode(e.data)}},[vf.InitializeAccount3]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n()},data:Ff().decode(e.data)}},[vf.InitializeMultisig2]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{multisig:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Wf().decode(e.data)}},[vf.InitializeMint2]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Kf().decode(e.data)}},[vf.GetAccountDataSize]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:zf().decode(e.data)}},[vf.InitializeImmutableOwner]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{account:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Df().decode(e.data)}},[vf.AmountToUiAmount]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Ef().decode(e.data)}},[vf.UiAmountToAmount]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:nh().decode(e.data)}}}},[kh]:{identifier:function(e){const t=\"data\"in e?e.data:e;if(oi(t,$i().encode(0),0))return 0;if(oi(t,$i().encode(1),0))return 1;if(oi(t,$i().encode(2),0))return 2;if(oi(t,$i().encode(3),0))return 3;if(oi(t,$i().encode(4),0))return 4;if(oi(t,$i().encode(5),0))return 5;if(oi(t,$i().encode(6),0))return 6;if(oi(t,$i().encode(7),0))return 7;if(oi(t,$i().encode(8),0))return 8;if(oi(t,$i().encode(9),0))return 9;if(oi(t,$i().encode(10),0))return 10;if(oi(t,$i().encode(11),0))return 11;if(oi(t,$i().encode(12),0))return 12;if(oi(t,$i().encode(13),0))return 13;if(oi(t,$i().encode(14),0))return 14;if(oi(t,$i().encode(15),0))return 15;if(oi(t,$i().encode(16),0))return 16;if(oi(t,$i().encode(17),0))return 17;if(oi(t,$i().encode(18),0))return 18;if(oi(t,$i().encode(19),0))return 19;if(oi(t,$i().encode(20),0))return 20;if(oi(t,$i().encode(21),0))return 21;if(oi(t,$i().encode(22),0))return 22;if(oi(t,$i().encode(23),0))return 23;if(oi(t,$i().encode(24),0))return 24;if(oi(t,$i().encode(25),0))return 25;if(oi(t,$i().encode(26),0)&&oi(t,$i().encode(0),1))return 26;if(oi(t,$i().encode(26),0)&&oi(t,$i().encode(1),1))return 27;if(oi(t,$i().encode(26),0)&&oi(t,$i().encode(2),1))return 28;if(oi(t,$i().encode(26),0)&&oi(t,$i().encode(3),1))return 29;if(oi(t,$i().encode(26),0)&&oi(t,$i().encode(4),1))return 30;if(oi(t,$i().encode(26),0)&&oi(t,$i().encode(5),1))return 31;if(oi(t,$i().encode(27),0)&&oi(t,$i().encode(0),1))return 32;if(oi(t,$i().encode(27),0)&&oi(t,$i().encode(1),1))return 33;if(oi(t,$i().encode(27),0)&&oi(t,$i().encode(2),1))return 34;if(oi(t,$i().encode(27),0)&&oi(t,$i().encode(3),1))return 35;if(oi(t,$i().encode(27),0)&&oi(t,$i().encode(4),1))return 36;if(oi(t,$i().encode(27),0)&&oi(t,$i().encode(5),1))return 37;if(oi(t,$i().encode(27),0)&&oi(t,$i().encode(6),1))return 38;if(oi(t,$i().encode(27),0)&&oi(t,$i().encode(7),1))return 39;if(oi(t,$i().encode(27),0)&&oi(t,$i().encode(8),1))return 40;if(oi(t,$i().encode(27),0)&&oi(t,$i().encode(9),1))return 41;if(oi(t,$i().encode(27),0)&&oi(t,$i().encode(10),1))return 42;if(oi(t,$i().encode(27),0)&&oi(t,$i().encode(11),1))return 43;if(oi(t,$i().encode(27),0)&&oi(t,$i().encode(12),1))return 44;if(oi(t,$i().encode(27),0)&&oi(t,$i().encode(13),1))return 45;if(oi(t,$i().encode(28),0)&&oi(t,$i().encode(0),1))return 46;if(oi(t,$i().encode(28),0)&&oi(t,$i().encode(1),1))return 47;if(oi(t,$i().encode(29),0))return 48;if(oi(t,$i().encode(30),0)&&oi(t,$i().encode(0),1))return 49;if(oi(t,$i().encode(30),0)&&oi(t,$i().encode(1),1))return 50;if(oi(t,$i().encode(31),0))return 51;if(oi(t,$i().encode(32),0))return 52;if(oi(t,$i().encode(33),0)&&oi(t,$i().encode(0),1))return 53;if(oi(t,$i().encode(33),0)&&oi(t,$i().encode(1),1))return 54;if(oi(t,$i().encode(34),0)&&oi(t,$i().encode(0),1))return 55;if(oi(t,$i().encode(34),0)&&oi(t,$i().encode(1),1))return 56;if(oi(t,$i().encode(35),0))return 57;if(oi(t,$i().encode(36),0)&&oi(t,$i().encode(0),1))return 58;if(oi(t,$i().encode(36),0)&&oi(t,$i().encode(1),1))return 59;if(oi(t,$i().encode(37),0)&&oi(t,$i().encode(0),1))return 60;if(oi(t,$i().encode(37),0)&&oi(t,$i().encode(1),1))return 61;if(oi(t,$i().encode(37),0)&&oi(t,$i().encode(2),1))return 62;if(oi(t,$i().encode(37),0)&&oi(t,$i().encode(3),1))return 63;if(oi(t,$i().encode(37),0)&&oi(t,$i().encode(4),1))return 64;if(oi(t,$i().encode(37),0)&&oi(t,$i().encode(5),1))return 65;if(oi(t,$i().encode(38),0))return 66;if(oi(t,$i().encode(39),0)&&oi(t,$i().encode(0),1))return 67;if(oi(t,$i().encode(39),0)&&oi(t,$i().encode(1),1))return 68;if(oi(t,$i().encode(40),0)&&oi(t,$i().encode(0),1))return 69;if(oi(t,$i().encode(40),0)&&oi(t,$i().encode(1),1))return 70;if(oi(t,$i().encode(41),0)&&oi(t,$i().encode(0),1))return 71;if(oi(t,$i().encode(41),0)&&oi(t,$i().encode(1),1))return 72;if(oi(t,$i().encode(43),0)&&oi(t,$i().encode(0),1))return 73;if(oi(t,$i().encode(43),0)&&oi(t,$i().encode(1),1))return 74;if(oi(t,$i().encode(44),0)&&oi(t,$i().encode(0),1))return 75;if(oi(t,$i().encode(44),0)&&oi(t,$i().encode(1),1))return 76;if(oi(t,$i().encode(44),0)&&oi(t,$i().encode(2),1))return 77;if(oi(t,new Uint8Array([210,225,30,162,88,184,77,141]),0))return 78;if(oi(t,new Uint8Array([221,233,49,45,181,202,220,200]),0))return 79;if(oi(t,new Uint8Array([234,18,32,56,89,141,37,181]),0))return 80;if(oi(t,new Uint8Array([215,228,166,228,84,100,86,123]),0))return 81;if(oi(t,new Uint8Array([250,166,180,250,13,12,184,70]),0))return 82;if(oi(t,new Uint8Array([121,113,108,39,54,51,0,4]),0))return 83;if(oi(t,new Uint8Array([108,37,171,143,248,30,18,110]),0))return 84;if(oi(t,new Uint8Array([161,105,88,1,237,221,216,203]),0))return 85;if(oi(t,new Uint8Array([152,32,222,176,223,237,116,134]),0))return 86;throw new Error(\"The provided instruction could not be identified as a token-2022 instruction.\")},instructionEnum:Th,typeToParserMap:{[Th.InitializeMint]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),rent:n()},data:Ip().decode(e.data)}},[Th.InitializeAccount]:function(e){if(e.accounts.length<4)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n(),owner:n(),rent:n()},data:gp().decode(e.data)}},[Th.InitializeMultisig]:Bp,[Th.Transfer]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{source:n(),destination:n(),authority:n()},data:Xp().decode(e.data)}},[Th.Approve]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{source:n(),delegate:n(),owner:n()},data:Oh().decode(e.data)}},[Th.Revoke]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{source:n(),owner:n()},data:Hp().decode(e.data)}},[Th.SetAuthority]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{owned:n(),owner:n()},data:Gp().decode(e.data)}},[Th.MintTo]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),token:n(),mintAuthority:n()},data:Fp().decode(e.data)}},[Th.Burn]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n(),authority:n()},data:Lh().decode(e.data)}},[Th.CloseAccount]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),destination:n(),owner:n()},data:Fh().decode(e.data)}},[Th.FreezeAccount]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n(),owner:n()},data:dp().decode(e.data)}},[Th.ThawAccount]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n(),owner:n()},data:Jp().decode(e.data)}},[Th.TransferChecked]:function(e){if(e.accounts.length<4)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{source:n(),mint:n(),destination:n(),authority:n()},data:eg().decode(e.data)}},[Th.ApproveChecked]:function(e){if(e.accounts.length<4)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{source:n(),mint:n(),delegate:n(),owner:n()},data:Mh().decode(e.data)}},[Th.MintToChecked]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),token:n(),mintAuthority:n()},data:Dp().decode(e.data)}},[Th.BurnChecked]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n(),authority:n()},data:jh().decode(e.data)}},[Th.InitializeAccount2]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n(),rent:n()},data:mp().decode(e.data)}},[Th.SyncNative]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{account:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Yp().decode(e.data)}},[Th.InitializeAccount3]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n()},data:yp().decode(e.data)}},[Th.InitializeMultisig2]:Bp,[Th.InitializeMint2]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Tp().decode(e.data)}},[Th.GetAccountDataSize]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:fp().decode(e.data)}},[Th.InitializeImmutableOwner]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{account:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Ep().decode(e.data)}},[Th.AmountToUiAmount]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Rh().decode(e.data)}},[Th.UiAmountToAmount]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:rg().decode(e.data)}},[Th.InitializeMintCloseAuthority]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:_p().decode(e.data)}},[Th.InitializeTransferFeeConfig]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Lp().decode(e.data)}},[Th.TransferCheckedWithFee]:function(e){if(e.accounts.length<4)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{source:n(),mint:n(),destination:n(),authority:n()},data:ng().decode(e.data)}},[Th.WithdrawWithheldTokensFromMint]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),feeReceiver:n(),withdrawWithheldAuthority:n()},data:vg().decode(e.data)}},[Th.WithdrawWithheldTokensFromAccounts]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),feeReceiver:n(),withdrawWithheldAuthority:n()},data:yg().decode(e.data)}},[Th.HarvestWithheldTokensToMint]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:hp().decode(e.data)}},[Th.SetTransferFee]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),transferFeeConfigAuthority:n()},data:Zp().decode(e.data)}},[Th.InitializeConfidentialTransferMint]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:vp().decode(e.data)}},[Th.UpdateConfidentialTransferMint]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),authority:n()},data:og().decode(e.data)}},[Th.ConfigureConfidentialTransferAccount]:function(e){if(e.accounts.length<5)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),mint:n(),instructionsSysvarOrContextState:n(),record:(()=>{const e=n();return e.address===kh?void 0:e})(),authority:n()},data:Wh().decode(e.data)}},[Th.ApproveConfidentialTransferAccount]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),mint:n(),authority:n()},data:zh().decode(e.data)}},[Th.EmptyConfidentialTransferAccount]:function(e){if(e.accounts.length<4)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),instructionsSysvarOrContextState:n(),record:(()=>{const e=n();return e.address===kh?void 0:e})(),authority:n()},data:ip().decode(e.data)}},[Th.ConfidentialDeposit]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),mint:n(),authority:n()},data:Dh().decode(e.data)}},[Th.ConfidentialWithdraw]:function(e){if(e.accounts.length<6)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n},r=()=>{const e=n();return e.address===kh?void 0:e};return{programAddress:e.programAddress,accounts:{token:n(),mint:n(),instructionsSysvar:r(),equalityRecord:r(),rangeRecord:r(),authority:n()},data:qh().decode(e.data)}},[Th.ConfidentialTransfer]:function(e){if(e.accounts.length<8)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n},r=()=>{const e=n();return e.address===kh?void 0:e};return{programAddress:e.programAddress,accounts:{sourceToken:n(),mint:n(),destinationToken:n(),instructionsSysvar:r(),equalityRecord:r(),ciphertextValidityRecord:r(),rangeRecord:r(),authority:n()},data:$h().decode(e.data)}},[Th.ApplyConfidentialPendingBalance]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),authority:n()},data:Ph().decode(e.data)}},[Th.EnableConfidentialCredits]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),authority:n()},data:ap().decode(e.data)}},[Th.DisableConfidentialCredits]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),authority:n()},data:Qh().decode(e.data)}},[Th.EnableNonConfidentialCredits]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),authority:n()},data:lp().decode(e.data)}},[Th.DisableNonConfidentialCredits]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),authority:n()},data:rp().decode(e.data)}},[Th.ConfidentialTransferWithFee]:function(e){if(e.accounts.length<10)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n},r=()=>{const e=n();return e.address===kh?void 0:e};return{programAddress:e.programAddress,accounts:{sourceToken:n(),mint:n(),destinationToken:n(),instructionsSysvar:r(),equalityRecord:r(),transferAmountCiphertextValidityRecord:r(),feeSigmaRecord:r(),feeCiphertextValidityRecord:r(),rangeRecord:r(),authority:n()},data:Kh().decode(e.data)}},[Th.InitializeDefaultAccountState]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:bp().decode(e.data)}},[Th.UpdateDefaultAccountState]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),freezeAuthority:n()},data:ig().decode(e.data)}},[Th.Reallocate]:function(e){if(e.accounts.length<4)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),payer:n(),systemProgram:n(),owner:n()},data:Kp().decode(e.data)}},[Th.EnableMemoTransfers]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),owner:n()},data:up().decode(e.data)}},[Th.DisableMemoTransfers]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),owner:n()},data:np().decode(e.data)}},[Th.CreateNativeMint]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{payer:n(),nativeMint:n(),systemProgram:n()},data:Xh().decode(e.data)}},[Th.InitializeNonTransferableMint]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Rp().decode(e.data)}},[Th.InitializeInterestBearingMint]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:xp().decode(e.data)}},[Th.UpdateRateInterestBearingMint]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),rateAuthority:n()},data:lg().decode(e.data)}},[Th.EnableCpiGuard]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),owner:n()},data:sp().decode(e.data)}},[Th.DisableCpiGuard]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),owner:n()},data:ep().decode(e.data)}},[Th.InitializePermanentDelegate]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Np().decode(e.data)}},[Th.InitializeTransferHook]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:jp().decode(e.data)}},[Th.UpdateTransferHook]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),authority:n()},data:gg().decode(e.data)}},[Th.InitializeConfidentialTransferFee]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:wp().decode(e.data)}},[Th.WithdrawWithheldTokensFromMintForConfidentialTransferFee]:function(e){if(e.accounts.length<5)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),destination:n(),instructionsSysvarOrContextState:n(),record:(()=>{const e=n();return e.address===kh?void 0:e})(),authority:n()},data:bg().decode(e.data)}},[Th.WithdrawWithheldTokensFromAccountsForConfidentialTransferFee]:function(e){if(e.accounts.length<5)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),destination:n(),instructionsSysvarOrContextState:n(),record:(()=>{const e=n();return e.address===kh?void 0:e})(),authority:n()},data:wg().decode(e.data)}},[Th.HarvestWithheldTokensToMintForConfidentialTransferFee]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:pp().decode(e.data)}},[Th.EnableHarvestToMint]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),authority:n()},data:cp().decode(e.data)}},[Th.DisableHarvestToMint]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),authority:n()},data:tp().decode(e.data)}},[Th.WithdrawExcessLamports]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{sourceAccount:n(),destinationAccount:n(),authority:n()},data:mg().decode(e.data)}},[Th.InitializeMetadataPointer]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:kp().decode(e.data)}},[Th.UpdateMetadataPointer]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),metadataPointerAuthority:n()},data:cg().decode(e.data)}},[Th.InitializeGroupPointer]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Sp().decode(e.data)}},[Th.UpdateGroupPointer]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),groupPointerAuthority:n()},data:sg().decode(e.data)}},[Th.InitializeGroupMemberPointer]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Ap().decode(e.data)}},[Th.UpdateGroupMemberPointer]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),groupMemberPointerAuthority:n()},data:ag().decode(e.data)}},[Th.InitializeScaledUiAmountMint]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Op().decode(e.data)}},[Th.UpdateMultiplierScaledUiMint]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),authority:n()},data:ug().decode(e.data)}},[Th.InitializePausableConfig]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Pp().decode(e.data)}},[Th.Pause]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),authority:n()},data:$p().decode(e.data)}},[Th.Resume]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),authority:n()},data:Vp().decode(e.data)}},[Th.InitializeTokenMetadata]:function(e){if(e.accounts.length<4)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{metadata:n(),updateAuthority:n(),mint:n(),mintAuthority:n()},data:zp().decode(e.data)}},[Th.UpdateTokenMetadataField]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{metadata:n(),updateAuthority:n()},data:hg().decode(e.data)}},[Th.RemoveTokenMetadataKey]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{metadata:n(),updateAuthority:n()},data:Wp().decode(e.data)}},[Th.UpdateTokenMetadataUpdateAuthority]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{metadata:n(),updateAuthority:n()},data:pg().decode(e.data)}},[Th.EmitTokenMetadata]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{metadata:(()=>{const n=e.accounts[t];return t+=1,n})()},data:op().decode(e.data)}},[Th.InitializeTokenGroup]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{group:n(),mint:n(),mintAuthority:n()},data:Up().decode(e.data)}},[Th.UpdateTokenGroupMaxSize]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{group:n(),updateAuthority:n()},data:dg().decode(e.data)}},[Th.UpdateTokenGroupUpdateAuthority]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{group:n(),updateAuthority:n()},data:fg().decode(e.data)}},[Th.InitializeTokenGroupMember]:function(e){if(e.accounts.length<5)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{member:n(),memberMint:n(),memberMintAuthority:n(),group:n(),groupUpdateAuthority:n()},data:Mp().decode(e.data)}}}},[mf]:{identifier:function(e){const t=\"data\"in e?e.data:e;if(oi(t,$i().encode(0),0))return 0;if(oi(t,$i().encode(1),0))return 1;if(oi(t,$i().encode(2),0))return 2;throw new Error(\"The provided instruction could not be identified as a associatedToken instruction.\")},instructionEnum:xh,typeToParserMap:{[xh.CreateAssociatedToken]:function(e){if(e.accounts.length<6)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{payer:n(),ata:n(),owner:n(),mint:n(),systemProgram:n(),tokenProgram:n()},data:Hh().decode(e.data)}},[xh.CreateAssociatedTokenIdempotent]:function(e){if(e.accounts.length<6)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{payer:n(),ata:n(),owner:n(),mint:n(),systemProgram:n(),tokenProgram:n()},data:Yh().decode(e.data)}},[xh.RecoverNestedAssociatedToken]:function(e){if(e.accounts.length<7)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{nestedAssociatedAccountAddress:n(),nestedTokenMintAddress:n(),destinationAssociatedAccountAddress:n(),ownerAssociatedAccountAddress:n(),ownerTokenMintAddress:n(),walletAddress:n(),tokenProgram:n()},data:qp().decode(e.data)}}}},[jg]:{identifier:$g,instructionEnum:Dg,typeToParserMap:{[Dg.Verify]:Vg}},[Fg]:{identifier:$g,instructionEnum:Dg,typeToParserMap:{[Dg.Verify]:Vg}}},Gg=e=>{const{programAddress:t}=e,n={...e,dataBase58:ia().decode(e.data??new Uint8Array)};try{const r=Hg[t];if(!r)throw new Error(\"Unsupported program address\");const{identifier:o,typeToParserMap:i,instructionEnum:a}=r,s=o(e),c=a[s],u=i[s];if(!u)throw new Error(\"Unsupported instruction type\");return{type:c,encoded:n,parsed:u(e)}}catch(e){return ju(e),{type:\"Unknown\",encoded:n,parsed:null}}},Zg=(e,t)=>{const n=e.accounts.filter(e=>e<t.transaction.message.accountKeys.length).map(e=>({address:t.transaction.message.accountKeys[e],role:0})),r=t.transaction.message.accountKeys[e.programIdIndex];if(!r)throw new Error(\"Program address not found\");return{accounts:n,data:ia().encode(e.data),programAddress:r}};function Yg(e){const{type:t,id:n,address:r,options:o,methods:i,scopes:a}=e;return{type:t,id:n,address:r,options:o,methods:i,scopes:a}}const Jg={accountSubscribe:\"accountUnsubscribe\",programSubscribe:\"programUnsubscribe\",signatureSubscribe:\"signatureUnsubscribe\"},Xg=z([\"processed\",\"confirmed\",\"finalized\"]);const Qg=(e,t)=>(e=>Boolean(e.feePayer))(t)?t:oc(e,t),em=e=>e.programAddress===Zd&&Jd({data:new Uint8Array,...e})===Yd.SetComputeUnitPrice,tm=e=>e.instructions.filter(Boolean).some(em),nm=e=>e.programAddress===Zd&&Jd({data:new Uint8Array,...e})===Yd.SetComputeUnitLimit,rm=e=>e.instructions.filter(Boolean).some(nm),om=async(e,t,n)=>{try{const r=e.instructions.filter(Boolean),o=function({rpc:e}){return async function(t,n){return await Cg({...n,rpc:e,transactionMessage:t})}}({rpc:t}),i=await o(e,n?.getComputeUnitEstimateConfig).catch(e=>{if(Go(e,Ao))return e.context.unitsConsumed;throw e});return{...(0,Du.cloneDeep)(e),instructions:[...r.filter(e=>!nm(e)),nf({units:i},n?.getSetComputeUnitLimitInstructionConfig)]}}catch(t){return e}};class im extends Error{constructor(e){super(e),this.name=\"FeeCalculatorError\"}}class am extends im{constructor(e){super(e),this.name=\"FeeCalculatorUnsupportedInputTypeError\"}}const sm=e=>({ed25519Signatures:[\"signature\"],instructions:e.instructions.map(t=>({accounts:[],data:t.data??new Uint8Array,programAddress:e.staticAccounts[t.programAddressIndex]}))}),cm=e=>({...As(e.messageBytes,Ks().decode,sm),ed25519Signatures:Object.values(e.signatures)}),um=e=>As(e,ua().encode,dc().decode,cm),lm=e=>As(e,ua().encode,Ks().decode,sm);class dm{static calculateFee(e){const t=this.#f(e),{ed25519SignaturesCount:n,secp256k1SignaturesCount:r,secp256r1SignaturesCount:o,totalSignaturesCount:i}=this.#h(t),a=this.#p(i),s=this.#g(t),c=this.#m(t),u=this.#y(s,c);return{ed25519SignaturesCount:n,secp256k1SignaturesCount:r,secp256r1SignaturesCount:o,totalSignaturesCount:i,baseFee:a,computeUnitLimit:s,computeUnitPriceMicroLamportsPerComputeUnit:c,priorityFee:u,totalFee:bs(a+u)}}static#p(e){return bs(5000n*BigInt(e))}static#g(e){const{instructions:t}=e,n=t.find(nm);return n?rf(n).data.units:0}static#m(e){const{instructions:t}=e,n=t.find(em);return n?cf(n).data.microLamports:0n}static#y(e,t){return As(e,e=>wr(e),e=>e.multipliedBy(t.toString()),e=>e.dividedToIntegerBy(su.toString()),e=>e.toString(),BigInt,bs)}static#h(e){const{ed25519Signatures:t,instructions:n}=e,r=t.length,o=n.filter(Kg).map(Gg).reduce((e,t)=>e+(t.parsed?.data.numSignatures??0),0),i=n.filter(qg).map(Gg).reduce((e,t)=>e+(t.parsed?.data.numSignatures??0),0);return{ed25519SignaturesCount:r,secp256k1SignaturesCount:o,secp256r1SignaturesCount:i,totalSignaturesCount:r+o+i}}static#f(e){if(this.#w(e))return um(e);if(this.#v(e))return lm(e);if(this.#b(e))return sm(e);if(this.#A(e))return cm(e);if(this.#S(e))return(e=>({ed25519Signatures:e.transaction.signatures,instructions:e.transaction.message.instructions.map(t=>Zg(t,e))}))(e);throw new am(\"The fee calculator could not recognize the input type. It supports SolanaTransactions, kit Transactions, and base64 strings.\")}static#w(e){try{return\"string\"==typeof e&&(um(e),!0)}catch(e){return!1}}static#v(e){try{return\"string\"==typeof e&&(lm(e),!0)}catch(e){return!1}}static#b(e){return\"object\"==typeof e&&\"instructions\"in e&&\"staticAccounts\"in e}static#S(e){return\"object\"==typeof e&&\"transaction\"in e&&\"object\"==typeof e.transaction&&\"message\"in e.transaction&&\"object\"==typeof e.transaction.message&&\"accountKeys\"in e.transaction.message&&\"object\"==typeof e.transaction.message.accountKeys&&\"instructions\"in e.transaction.message&&\"object\"==typeof e.transaction.message.instructions&&\"signatures\"in e.transaction&&\"object\"==typeof e.transaction.signatures}static#A(e){return\"object\"==typeof e&&\"messageBytes\"in e&&\"object\"==typeof e.messageBytes&&\"signatures\"in e}}const fm=e=>wr(e.toString()).dividedBy(cu),hm=e=>wr(e.toString()).multipliedBy(cu).integerValue(wr.ROUND_DOWN);var pm=function(e){return e.SignAndSendTransactionWithoutConfirmation=\"signAndSendTransactionWithoutConfirmation\",e.ConfirmSend=\"confirmSend\",e.SignAndSendTransaction=\"signAndSendTransaction\",e.ComputeFee=\"computeFee\",e.OnAddressInput=\"onAddressInput\",e.OnAmountInput=\"onAmountInput\",e.SignRewardsMessage=\"signRewardsMessage\",e.SignCardMessage=\"signCardMessage\",e.ApproveCardAmount=\"approveCardAmount\",e.SignProofOfOwnership=\"signProofOfOwnership\",e}({});function gm(e){return E(JSON.stringify(e),j(e).validator)}var mm=function(e){return e.Required=\"Required\",e.Invalid=\"Invalid\",e.InsufficientBalanceToCoverFee=\"InsufficientBalanceToCoverFee\",e.InsufficientBalance=\"InsufficientBalance\",e}({});const ym=z(Object.values(lu)),wm=Z({address:X(H(),H(),e=>{if(!e||\"\"===e)throw new Error(\"Account address is required\");const t=Mu(e);if(\"\"===t)throw new Error(\"Invalid Solana address format\");return t})}),vm=j(\"ed25519\"),bm=X(H(),H(),e=>{const t=function(e){if(!e||\"string\"!=typeof e)return\"\";let t=Ou(e);const n=t.match(/^([a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)+)/u);return n?.[1]&&(t=n[1]),/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)+$/u.test(t)?t.length>253?\"\":t.toLowerCase():\"\"}(e);if(\"\"===t)throw new Error(\"Invalid domain format\");return t}),Am=X(H(),H(),e=>{const t=Mu(e);if(\"\"===t)throw new Error(\"Invalid Solana address format\");return t}),Sm=X(H(),H(),e=>{const t=Uu(e,1e3);if(\"\"===t)throw new Error(\"Statement cannot be empty. Control characters and excessive whitespace are removed for security. Please use plain text only.\");return t}),Em=X(H(),H(),e=>zu(e)),xm=X(H(),H(),e=>Uu(e,10)),km=X(H(),H(),e=>Uu(e,50)),Im=X(H(),H(),e=>Uu(e,100)),Tm=X(H(),H(),e=>function(e){if(!e||\"string\"!=typeof e)return\"\";const t=Ou(e);if(!/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{3})?Z?$/u.test(t))return\"\";const n=new Date(t);return isNaN(n.getTime())?\"\":t}(e)),_m=X(H(),H(),e=>Uu(e,100)),Cm=X(U(H()),U(H()),e=>{var t;return t=e,Array.isArray(t)?t.filter(e=>\"string\"==typeof e).map(e=>zu(e)).filter(e=>\"\"!==e):[]}),Bm=Z({domain:q(bm),address:q(Am),statement:q(Sm),uri:q(Em),version:q(xm),chainId:q(km),nonce:q(Im),issuedAt:q(Tm),expirationTime:q(Tm),notBefore:q(Tm),requestId:q(_m),resources:q(Cm)}),Rm=Z({account:wm,message:Ru}),Pm=z([\"processed\",\"confirmed\",\"finalized\"]),Nm=Z({preflightCommitment:q(Pm),minContextSlot:q($())}),Om=Z({account:wm,transaction:Ru,scope:ym,options:q(Nm)}),Um=Z({...Nm.schema,commitment:q(Pm),skipPreflight:q(M()),maxRetries:q($())}),Mm=Z({...Om.schema,scope:ym,options:q(Um)}),zm=K({method:z([au.SignAndSendTransaction]),params:Mm}),Lm=K({method:z([au.SignIn]),params:Bm}),jm=K({method:z([au.SignMessage]),params:Rm}),Fm=K({method:z([au.SignTransaction]),params:Om}),Dm=K({signature:Bu}),$m=K({signedTransaction:Ru}),Km=K({signature:Bu,signedMessage:Ru,signatureType:vm}),qm=K({account:wm,...Km.schema}),Wm=Y([zm,Lm,jm,Fm]),Vm=K({jsonrpc:me,id:ye,method:gm(pm.SignAndSendTransactionWithoutConfirmation),params:Mm}),Hm=K({transaction:Ru,accountId:yu,scope:ym,options:q(Um)}),Gm=K({jsonrpc:me,id:ye,method:gm(pm.SignAndSendTransaction),params:Hm}),Zm=K({transactionId:Bu}),Ym=K({fromAccountId:yu,toAddress:Nu,amount:wu,assetId:We}),Jm=K({jsonrpc:me,id:ye,method:gm(pm.ConfirmSend),params:Ym}),Xm=K({value:H(),scope:function(e,t,n={}){return X(e,J(),e=>{const r=\"function\"==typeof t?t():t;if(void 0===e)return r;if(!n.strict&&d(e)&&d(r)){const t={...e};let n=!1;for(const e in r)void 0===t[e]&&(t[e]=r[e],n=!0);if(n)return t}return e})}(ym,lu.Mainnet)}),Qm=K({jsonrpc:me,id:ye,method:gm(pm.OnAddressInput),params:Xm}),ey=K({value:wu,accountId:yu,assetId:We}),ty=K({jsonrpc:me,id:ye,method:gm(pm.OnAmountInput),params:ey});function ny(e){const t=As(e,da().encode,ma().decode);if(!t.startsWith(\"rewards,\"))throw new Error('Message must start with \"rewards,\"');const n=t.split(\",\");if(3!==n.length)throw new Error(\"Message must have exactly 3 parts: rewards,{address},{timestamp}\");const[r,o,i]=n;if(\"rewards\"!==r)throw new Error('Message must start with \"rewards\"');if(!A(o,Nu))throw new Error(\"Invalid Solana address\");if(!A(i,wu))throw new Error(\"Invalid timestamp format\");if(i.includes(\".\"))throw new Error(\"Invalid timestamp\");const a=parseInt(i,10);if(a<=0)throw new Error(\"Invalid timestamp\");return{address:o,timestamp:a}}const ry=re(Ru,\"RewardsMessage\",e=>{try{return ny(e),!0}catch(e){return e instanceof Error?e.message:\"Invalid rewards message\"}}),oy=K({accountId:yu,message:ry}),iy=K({jsonrpc:me,id:ye,method:gm(pm.SignRewardsMessage),params:oy});function ay(e){const t=As(e,da().encode,ma().decode),n=t.replaceAll(/\\s+/gu,\" \").trim(),r=/^(\\S+) wants you to sign in with your Solana account: (\\S{32,44}) (.+?) URI: (\\S+) Version: (\\d+) Chain ID: (\\d+) Nonce: (\\w+) Issued At: (\\S+)(?: Expiration Time: (\\S+))?$/u.exec(n);if(!r)throw new Error('Invalid card message format. Expected format: \"{domain} wants you to sign in with your Solana account: {address} {statement} URI: {uri} Version: {version} Chain ID: {chainId} Nonce: {nonce} Issued At: {issuedAt} [Expiration Time: {expirationTime}]\"');const[,o,i,,a,s,c,u,l,d]=r,f=t.indexOf(i),h=t.indexOf(\"URI:\"),p=t.slice(f+i.length,h).trim();if(!o||\"\"===o.trim())throw new Error(\"Invalid domain in card message\");if(!A(i,Nu))throw new Error(\"Invalid Solana address in card message\");try{if(!new URL(a).protocol)throw new Error(\"Invalid URI\")}catch{throw new Error(\"Invalid URI in card message\")}const g=new Date(l);if(isNaN(g.getTime()))throw new Error(\"Invalid Issued At date in card message\");if(void 0!==d){const e=new Date(d);if(isNaN(e.getTime()))throw new Error(\"Invalid Expiration Time date in card message\")}return{domain:o,address:i,statement:p,uri:a,version:s,chainId:c,nonce:u,issuedAt:l,...void 0!==d&&{expirationTime:d}}}const sy=re(Ru,\"CardMessage\",e=>{try{return ay(e),!0}catch(e){return e instanceof Error?e.message:\"Invalid card message\"}}),cy=K({accountId:yu,message:sy}),uy=K({jsonrpc:me,id:ye,method:gm(pm.SignCardMessage),params:cy}),ly=K({accountId:yu,amount:wu,mint:Nu,delegate:Nu,scope:ym}),dy=K({jsonrpc:me,id:ye,method:gm(pm.ApproveCardAmount),params:ly}),fy=K({signature:Bu}),hy=K({valid:M(),errors:U(K({code:z(Object.values(mm))}))}),py=K({transaction:Ru,accountId:yu,scope:ym}),gy=K({jsonrpc:me,id:ye,method:gm(pm.ComputeFee),params:py}),my=U(K({type:z(Object.values(sl)),asset:il})),yy=\"metamask:proof-of-ownership:\";function wy(e){if(!e.startsWith(yy))throw new Error(`Message must start with \"${yy}\"`);const t=e.slice(28),n=t.lastIndexOf(\":\");if(-1===n)throw new Error('Message must follow the format \"metamask:proof-of-ownership:{nonce}:{address}\"');const r=t.slice(0,n),o=t.slice(n+1);if(\"\"===r)throw new Error(\"Proof-of-ownership message must contain a non-empty nonce\");if(!A(o,Nu))throw new Error(\"Invalid Solana address in proof-of-ownership message\");return{nonce:r,address:o}}const vy=re(H(),\"ProofOfOwnershipMessage\",e=>{try{return wy(e),!0}catch(e){return e instanceof Error?e.message:\"Invalid proof-of-ownership message\"}}),by=K({accountId:yu,message:vy}),Ay=K({jsonrpc:me,id:ye,method:gm(pm.SignProofOfOwnership),params:by}),Sy=K({signature:Md});function Ey(e,t){return n=e,Boolean(\"string\"==typeof n?.prototype?.constructor?.name)?new e({message:t}):e({message:t});var n}class xy extends Error{constructor(e){super(e.message),this.code=\"ERR_ASSERTION\"}}function ky(e,t=\"Assertion failed.\",n=xy){if(!e){if(t instanceof Error)throw t;throw Ey(n,t)}}const Iy=32,Ty=4294967295,_y=\"bip32:44'\",Cy=/^\\d+$/u,By=/^bip32:\\d+'?$/u,Ry=/^slip10:\\d+'?$/u,Py=/^cip3:\\d+'?$/u,Ny=/^bip39:([a-z]+){1}( [a-z]+){11,23}$/u,Oy=2147483648;const Uy=ne(H(),/^(?:0x)?[0-9a-f]+$/iu);ne(H(),/^0x[0-9a-f]+$/iu),ne(H(),/^0x[0-9a-f]{40}$/u),ne(H(),/^0x[0-9a-fA-F]{40}$/u);function My(e){ky(function(e){return A(e,Uy)}(e),\"Value must be a hexadecimal string.\")}function zy(e){return e.startsWith(\"0x\")?e:e.startsWith(\"0X\")?`0x${e.substring(2)}`:`0x${e}`}function Ly(e){return e.startsWith(\"0x\")||e.startsWith(\"0X\")?e.substring(2):e}var jy=n(1048).hp;const Fy=48,Dy=58,$y=87;const Ky=function(){const e=[];return()=>{if(0===e.length)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,\"0\"));return e}}();function qy(e){return e instanceof Uint8Array}function Wy(e){ky(qy(e),\"Value must be a Uint8Array.\")}function Vy(e){if(Wy(e),0===e.length)return\"0x\";const t=Ky(),n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=t[e[r]];return zy(n.join(\"\"))}function Hy(e){Wy(e);const t=Vy(e);return BigInt(t)}function Gy(e){if(\"0x\"===e?.toLowerCase?.())return new Uint8Array;My(e);const t=Ly(e).toLowerCase(),n=t.length%2==0?t:`0${t}`,r=new Uint8Array(n.length/2);for(let e=0;e<r.length;e++){const t=n.charCodeAt(2*e),o=n.charCodeAt(2*e+1),i=t-(t<Dy?Fy:$y),a=o-(o<Dy?Fy:$y);r[e]=16*i+a}return r}function Zy(e){return ky(\"string\"==typeof e,\"Value must be a string.\"),(new TextEncoder).encode(e)}function Yy(e){if(\"bigint\"==typeof e)return function(e){return ky(\"bigint\"==typeof e,\"Value must be a bigint.\"),ky(e>=BigInt(0),\"Value must be a non-negative bigint.\"),Gy(e.toString(16))}(e);if(\"number\"==typeof e)return function(e){return ky(\"number\"==typeof e,\"Value must be a number.\"),ky(e>=0,\"Value must be a non-negative number.\"),ky(Number.isSafeInteger(e),\"Value is not a safe integer. Use `bigIntToBytes` instead.\"),Gy(e.toString(16))}(e);if(\"string\"==typeof e)return e.startsWith(\"0x\")?Gy(e):Zy(e);if(qy(e))return e;throw new TypeError(`Unsupported value type: \"${typeof e}\".`)}function Jy(e){const t=new Array(e.length);let n=0;for(let r=0;r<e.length;r++){const o=Yy(e[r]);t[r]=o,n+=o.length}const r=new Uint8Array(n);for(let e=0,n=0;e<t.length;e++)r.set(t[e],n),n+=t[e].length;return r}function Xy(e){if(void 0!==jy&&e instanceof jy){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Qy(e,t,n){return e&t^~e&n}function ew(e,t,n){return e&t^e&n^t&n}class tw extends dd{constructor(e,t,n,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=ql(this.buffer)}update(e){Dl(this),jl(e=cd(e));const{view:t,buffer:n,blockLen:r}=this,o=e.length;for(let i=0;i<o;){const a=Math.min(r-this.pos,o-i);if(a===r){const t=ql(e);for(;r<=o-i;i+=r)this.process(t,i);continue}n.set(e.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Dl(this),$l(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:r,isLE:o}=this;let{pos:i}=this;t[i++]=128,Kl(this.buffer.subarray(i)),this.padOffset>r-i&&(this.process(n,0),i=0);for(let e=i;e<r;e++)t[e]=0;!function(e,t,n,r){if(\"function\"==typeof e.setBigUint64)return e.setBigUint64(t,n,r);const o=BigInt(32),i=BigInt(4294967295),a=Number(n>>o&i),s=Number(n&i),c=r?4:0,u=r?0:4;e.setUint32(t+c,a,r),e.setUint32(t+u,s,r)}(n,r-8,BigInt(8*this.length),o),this.process(n,0);const a=ql(e),s=this.outputLen;if(s%4)throw new Error(\"_sha2: outputLen should be aligned to 32bit\");const c=s/4,u=this.get();if(c>u.length)throw new Error(\"_sha2: outputLen bigger than state\");for(let e=0;e<c;e++)a.setUint32(4*e,u[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:r,finished:o,destroyed:i,pos:a}=this;return e.destroyed=i,e.finished=o,e.length=r,e.pos=a,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}}const nw=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),rw=(Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]));const ow=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),iw=new Uint32Array(64);class aw extends tw{constructor(e=32){super(64,e,8,!1),this.A=0|nw[0],this.B=0|nw[1],this.C=0|nw[2],this.D=0|nw[3],this.E=0|nw[4],this.F=0|nw[5],this.G=0|nw[6],this.H=0|nw[7]}get(){const{A:e,B:t,C:n,D:r,E:o,F:i,G:a,H:s}=this;return[e,t,n,r,o,i,a,s]}set(e,t,n,r,o,i,a,s){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|o,this.F=0|i,this.G=0|a,this.H=0|s}process(e,t){for(let n=0;n<16;n++,t+=4)iw[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=iw[e-15],n=iw[e-2],r=Wl(t,7)^Wl(t,18)^t>>>3,o=Wl(n,17)^Wl(n,19)^n>>>10;iw[e]=o+iw[e-7]+r+iw[e-16]|0}let{A:n,B:r,C:o,D:i,E:a,F:s,G:c,H:u}=this;for(let e=0;e<64;e++){const t=u+(Wl(a,6)^Wl(a,11)^Wl(a,25))+Qy(a,s,c)+ow[e]+iw[e]|0,l=(Wl(n,2)^Wl(n,13)^Wl(n,22))+ew(n,r,o)|0;u=c,c=s,s=a,a=i+t|0,i=o,o=r,r=n,n=t+l|0}n=n+this.A|0,r=r+this.B|0,o=o+this.C|0,i=i+this.D|0,a=a+this.E|0,s=s+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(n,r,o,i,a,s,c,u)}roundClean(){Kl(iw)}destroy(){this.set(0,0,0,0,0,0,0,0),Kl(this.buffer)}}const sw=wl([\"0x428a2f98d728ae22\",\"0x7137449123ef65cd\",\"0xb5c0fbcfec4d3b2f\",\"0xe9b5dba58189dbbc\",\"0x3956c25bf348b538\",\"0x59f111f1b605d019\",\"0x923f82a4af194f9b\",\"0xab1c5ed5da6d8118\",\"0xd807aa98a3030242\",\"0x12835b0145706fbe\",\"0x243185be4ee4b28c\",\"0x550c7dc3d5ffb4e2\",\"0x72be5d74f27b896f\",\"0x80deb1fe3b1696b1\",\"0x9bdc06a725c71235\",\"0xc19bf174cf692694\",\"0xe49b69c19ef14ad2\",\"0xefbe4786384f25e3\",\"0x0fc19dc68b8cd5b5\",\"0x240ca1cc77ac9c65\",\"0x2de92c6f592b0275\",\"0x4a7484aa6ea6e483\",\"0x5cb0a9dcbd41fbd4\",\"0x76f988da831153b5\",\"0x983e5152ee66dfab\",\"0xa831c66d2db43210\",\"0xb00327c898fb213f\",\"0xbf597fc7beef0ee4\",\"0xc6e00bf33da88fc2\",\"0xd5a79147930aa725\",\"0x06ca6351e003826f\",\"0x142929670a0e6e70\",\"0x27b70a8546d22ffc\",\"0x2e1b21385c26c926\",\"0x4d2c6dfc5ac42aed\",\"0x53380d139d95b3df\",\"0x650a73548baf63de\",\"0x766a0abb3c77b2a8\",\"0x81c2c92e47edaee6\",\"0x92722c851482353b\",\"0xa2bfe8a14cf10364\",\"0xa81a664bbc423001\",\"0xc24b8b70d0f89791\",\"0xc76c51a30654be30\",\"0xd192e819d6ef5218\",\"0xd69906245565a910\",\"0xf40e35855771202a\",\"0x106aa07032bbd1b8\",\"0x19a4c116b8d2d0c8\",\"0x1e376c085141ab53\",\"0x2748774cdf8eeb99\",\"0x34b0bcb5e19b48a8\",\"0x391c0cb3c5c95a63\",\"0x4ed8aa4ae3418acb\",\"0x5b9cca4f7763e373\",\"0x682e6ff3d6b2b8a3\",\"0x748f82ee5defb2fc\",\"0x78a5636f43172f60\",\"0x84c87814a1f0ab72\",\"0x8cc702081a6439ec\",\"0x90befffa23631e28\",\"0xa4506cebde82bde9\",\"0xbef9a3f7b2c67915\",\"0xc67178f2e372532b\",\"0xca273eceea26619c\",\"0xd186b8c721c0c207\",\"0xeada7dd6cde0eb1e\",\"0xf57d4f7fee6ed178\",\"0x06f067aa72176fba\",\"0x0a637dc5a2c898a6\",\"0x113f9804bef90dae\",\"0x1b710b35131c471b\",\"0x28db77f523047d84\",\"0x32caab7b40c72493\",\"0x3c9ebe0a15c9bebc\",\"0x431d67c49c100d4c\",\"0x4cc5d4becb3e42b6\",\"0x597f299cfc657e2a\",\"0x5fcb6fab3ad6faec\",\"0x6c44198c4a475817\"].map(e=>BigInt(e))),cw=sw[0],uw=sw[1],lw=new Uint32Array(80),dw=new Uint32Array(80);class fw extends tw{constructor(e=64){super(128,e,16,!1),this.Ah=0|rw[0],this.Al=0|rw[1],this.Bh=0|rw[2],this.Bl=0|rw[3],this.Ch=0|rw[4],this.Cl=0|rw[5],this.Dh=0|rw[6],this.Dl=0|rw[7],this.Eh=0|rw[8],this.El=0|rw[9],this.Fh=0|rw[10],this.Fl=0|rw[11],this.Gh=0|rw[12],this.Gl=0|rw[13],this.Hh=0|rw[14],this.Hl=0|rw[15]}get(){const{Ah:e,Al:t,Bh:n,Bl:r,Ch:o,Cl:i,Dh:a,Dl:s,Eh:c,El:u,Fh:l,Fl:d,Gh:f,Gl:h,Hh:p,Hl:g}=this;return[e,t,n,r,o,i,a,s,c,u,l,d,f,h,p,g]}set(e,t,n,r,o,i,a,s,c,u,l,d,f,h,p,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|r,this.Ch=0|o,this.Cl=0|i,this.Dh=0|a,this.Dl=0|s,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|d,this.Gh=0|f,this.Gl=0|h,this.Hh=0|p,this.Hl=0|g}process(e,t){for(let n=0;n<16;n++,t+=4)lw[n]=e.getUint32(t),dw[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|lw[e-15],n=0|dw[e-15],r=Al(t,n,1)^Al(t,n,8)^vl(t,0,7),o=Sl(t,n,1)^Sl(t,n,8)^bl(t,n,7),i=0|lw[e-2],a=0|dw[e-2],s=Al(i,a,19)^El(i,a,61)^vl(i,0,6),c=Sl(i,a,19)^xl(i,a,61)^bl(i,a,6),u=Pl(o,c,dw[e-7],dw[e-16]),l=Nl(u,r,s,lw[e-7],lw[e-16]);lw[e]=0|l,dw[e]=0|u}let{Ah:n,Al:r,Bh:o,Bl:i,Ch:a,Cl:s,Dh:c,Dl:u,Eh:l,El:d,Fh:f,Fl:h,Gh:p,Gl:g,Hh:m,Hl:y}=this;for(let e=0;e<80;e++){const t=Al(l,d,14)^Al(l,d,18)^El(l,d,41),w=Sl(l,d,14)^Sl(l,d,18)^xl(l,d,41),v=l&f^~l&p,b=Ol(y,w,d&h^~d&g,uw[e],dw[e]),A=Ul(b,m,t,v,cw[e],lw[e]),S=0|b,E=Al(n,r,28)^El(n,r,34)^El(n,r,39),x=Sl(n,r,28)^xl(n,r,34)^xl(n,r,39),k=n&o^n&a^o&a,I=r&i^r&s^i&s;m=0|p,y=0|g,p=0|f,g=0|h,f=0|l,h=0|d,({h:l,l:d}=Cl(0|c,0|u,0|A,0|S)),c=0|a,u=0|s,a=0|o,s=0|i,o=0|n,i=0|r;const T=Bl(S,x,I);n=Rl(T,A,E,k),r=0|T}({h:n,l:r}=Cl(0|this.Ah,0|this.Al,0|n,0|r)),({h:o,l:i}=Cl(0|this.Bh,0|this.Bl,0|o,0|i)),({h:a,l:s}=Cl(0|this.Ch,0|this.Cl,0|a,0|s)),({h:c,l:u}=Cl(0|this.Dh,0|this.Dl,0|c,0|u)),({h:l,l:d}=Cl(0|this.Eh,0|this.El,0|l,0|d)),({h:f,l:h}=Cl(0|this.Fh,0|this.Fl,0|f,0|h)),({h:p,l:g}=Cl(0|this.Gh,0|this.Gl,0|p,0|g)),({h:m,l:y}=Cl(0|this.Hh,0|this.Hl,0|m,0|y)),this.set(n,r,o,i,a,s,c,u,l,d,f,h,p,g,m,y)}roundClean(){Kl(lw,dw)}destroy(){Kl(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);const hw=fd(()=>new aw),pw=fd(()=>new fw);class gw extends dd{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Fl(e);const n=cd(t);if(this.iHash=e.create(),\"function\"!=typeof this.iHash.update)throw new Error(\"Expected instance of class which extends utils.Hash\");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,o=new Uint8Array(r);o.set(n.length>r?e.create().update(n).digest():n);for(let e=0;e<o.length;e++)o[e]^=54;this.iHash.update(o),this.oHash=e.create();for(let e=0;e<o.length;e++)o[e]^=106;this.oHash.update(o),Kl(o)}update(e){return Dl(this),this.iHash.update(e),this}digestInto(e){Dl(this),jl(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:n,finished:r,destroyed:o,blockLen:i,outputLen:a}=this;return e.finished=r,e.destroyed=o,e.blockLen=i,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const mw=(e,t,n)=>new gw(e,t).update(n).digest();mw.create=(e,t)=>new gw(e,t);const yw=BigInt(0),ww=BigInt(1);function vw(e,t=\"\"){if(\"boolean\"!=typeof e){throw new Error((t&&`\"${t}\"`)+\"expected boolean, got type=\"+typeof e)}return e}function bw(e,t,n=\"\"){const r=zl(e),o=e?.length,i=void 0!==t;if(!r||i&&o!==t){throw new Error((n&&`\"${n}\" `)+\"expected Uint8Array\"+(i?` of length ${t}`:\"\")+\", got \"+(r?`length=${o}`:\"type=\"+typeof e))}return e}function Aw(e){const t=e.toString(16);return 1&t.length?\"0\"+t:t}function Sw(e){if(\"string\"!=typeof e)throw new Error(\"hex string expected, got \"+typeof e);return\"\"===e?yw:BigInt(\"0x\"+e)}function Ew(e){return Sw(Xl(e))}function xw(e){return jl(e),Sw(Xl(Uint8Array.from(e).reverse()))}function kw(e,t){return ad(e.toString(16).padStart(2*t,\"0\"))}function Iw(e,t){return kw(e,t).reverse()}function Tw(e,t,n){let r;if(\"string\"==typeof t)try{r=ad(t)}catch(t){throw new Error(e+\" must be hex string or Uint8Array, cause: \"+t)}else{if(!zl(t))throw new Error(e+\" must be hex string or Uint8Array\");r=Uint8Array.from(t)}const o=r.length;if(\"number\"==typeof n&&o!==n)throw new Error(e+\" of length \"+n+\" expected, got \"+o);return r}function _w(e){return Uint8Array.from(e)}const Cw=e=>\"bigint\"==typeof e&&yw<=e;function Bw(e,t,n,r){if(!function(e,t,n){return Cw(e)&&Cw(t)&&Cw(n)&&t<=e&&e<n}(t,n,r))throw new Error(\"expected valid \"+e+\": \"+n+\" <= n < \"+r+\", got \"+t)}function Rw(e){let t;for(t=0;e>yw;e>>=ww,t+=1);return t}const Pw=e=>(ww<<BigInt(e))-ww;function Nw(e,t,n={}){if(!e||\"object\"!=typeof e)throw new Error(\"expected valid options object\");function r(t,n,r){const o=e[t];if(r&&void 0===o)return;const i=typeof o;if(i!==n||null===o)throw new Error(`param \"${t}\" is invalid: expected ${n}, got ${i}`)}Object.entries(t).forEach(([e,t])=>r(e,t,!1)),Object.entries(n).forEach(([e,t])=>r(e,t,!0))}const Ow=()=>{throw new Error(\"not implemented\")};function Uw(e){const t=new WeakMap;return(n,...r)=>{const o=t.get(n);if(void 0!==o)return o;const i=e(n,...r);return t.set(n,i),i}}const Mw=BigInt(0),zw=BigInt(1),Lw=BigInt(2),jw=BigInt(3),Fw=BigInt(4),Dw=BigInt(5),$w=BigInt(7),Kw=BigInt(8),qw=BigInt(9),Ww=BigInt(16);function Vw(e,t){const n=e%t;return n>=Mw?n:t+n}function Hw(e,t,n){let r=e;for(;t-- >Mw;)r*=r,r%=n;return r}function Gw(e,t){if(e===Mw)throw new Error(\"invert: expected non-zero number\");if(t<=Mw)throw new Error(\"invert: expected positive modulus, got \"+t);let n=Vw(e,t),r=t,o=Mw,i=zw,a=zw,s=Mw;for(;n!==Mw;){const e=r/n,t=r%n,c=o-a*e,u=i-s*e;r=n,n=t,o=a,i=s,a=c,s=u}if(r!==zw)throw new Error(\"invert: does not exist\");return Vw(o,t)}function Zw(e,t,n){if(!e.eql(e.sqr(t),n))throw new Error(\"Cannot find square root\")}function Yw(e,t){const n=(e.ORDER+zw)/Fw,r=e.pow(t,n);return Zw(e,r,t),r}function Jw(e,t){const n=(e.ORDER-Dw)/Kw,r=e.mul(t,Lw),o=e.pow(r,n),i=e.mul(t,o),a=e.mul(e.mul(i,Lw),o),s=e.mul(i,e.sub(a,e.ONE));return Zw(e,s,t),s}function Xw(e){if(e<jw)throw new Error(\"sqrt is not defined for small field\");let t=e-zw,n=0;for(;t%Lw===Mw;)t/=Lw,n++;let r=Lw;const o=av(e);for(;1===ov(o,r);)if(r++>1e3)throw new Error(\"Cannot find square root: probably non-prime P\");if(1===n)return Yw;let i=o.pow(r,t);const a=(t+zw)/Lw;return function(e,r){if(e.is0(r))return r;if(1!==ov(e,r))throw new Error(\"Cannot find square root\");let o=n,s=e.mul(e.ONE,i),c=e.pow(r,t),u=e.pow(r,a);for(;!e.eql(c,e.ONE);){if(e.is0(c))return e.ZERO;let t=1,n=e.sqr(c);for(;!e.eql(n,e.ONE);)if(t++,n=e.sqr(n),t===o)throw new Error(\"Cannot find square root\");const r=zw<<BigInt(o-t-1),i=e.pow(s,r);o=t,s=e.sqr(i),c=e.mul(c,s),u=e.mul(u,i)}return u}}function Qw(e){return e%Fw===jw?Yw:e%Kw===Dw?Jw:e%Ww===qw?function(e){const t=av(e),n=Xw(e),r=n(t,t.neg(t.ONE)),o=n(t,r),i=n(t,t.neg(r)),a=(e+$w)/Ww;return(e,t)=>{let n=e.pow(t,a),s=e.mul(n,r);const c=e.mul(n,o),u=e.mul(n,i),l=e.eql(e.sqr(s),t),d=e.eql(e.sqr(c),t);n=e.cmov(n,s,l),s=e.cmov(u,c,d);const f=e.eql(e.sqr(s),t),h=e.cmov(n,s,f);return Zw(e,h,t),h}}(e):Xw(e)}const ev=(e,t)=>(Vw(e,t)&zw)===zw,tv=[\"create\",\"isValid\",\"is0\",\"neg\",\"inv\",\"sqrt\",\"sqr\",\"eql\",\"add\",\"sub\",\"mul\",\"pow\",\"div\",\"addN\",\"subN\",\"mulN\",\"sqrN\"];function nv(e,t,n){if(n<Mw)throw new Error(\"invalid exponent, negatives unsupported\");if(n===Mw)return e.ONE;if(n===zw)return t;let r=e.ONE,o=t;for(;n>Mw;)n&zw&&(r=e.mul(r,o)),o=e.sqr(o),n>>=zw;return r}function rv(e,t,n=!1){const r=new Array(t.length).fill(n?e.ZERO:void 0),o=t.reduce((t,n,o)=>e.is0(n)?t:(r[o]=t,e.mul(t,n)),e.ONE),i=e.inv(o);return t.reduceRight((t,n,o)=>e.is0(n)?t:(r[o]=e.mul(t,r[o]),e.mul(t,n)),i),r}function ov(e,t){const n=(e.ORDER-zw)/Lw,r=e.pow(t,n),o=e.eql(r,e.ONE),i=e.eql(r,e.ZERO),a=e.eql(r,e.neg(e.ONE));if(!o&&!i&&!a)throw new Error(\"invalid Legendre symbol result\");return o?1:i?0:-1}function iv(e,t){void 0!==t&&Ll(t);const n=void 0!==t?t:e.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function av(e,t,n=!1,r={}){if(e<=Mw)throw new Error(\"invalid field: expected ORDER > 0, got \"+e);let o,i,a,s=!1;if(\"object\"==typeof t&&null!=t){if(r.sqrt||n)throw new Error(\"cannot specify opts in two arguments\");const e=t;e.BITS&&(o=e.BITS),e.sqrt&&(i=e.sqrt),\"boolean\"==typeof e.isLE&&(n=e.isLE),\"boolean\"==typeof e.modFromBytes&&(s=e.modFromBytes),a=e.allowedLengths}else\"number\"==typeof t&&(o=t),r.sqrt&&(i=r.sqrt);const{nBitLength:c,nByteLength:u}=iv(e,o);if(u>2048)throw new Error(\"invalid field: expected ORDER of <= 2048 bytes\");let l;const d=Object.freeze({ORDER:e,isLE:n,BITS:c,BYTES:u,MASK:Pw(c),ZERO:Mw,ONE:zw,allowedLengths:a,create:t=>Vw(t,e),isValid:t=>{if(\"bigint\"!=typeof t)throw new Error(\"invalid field element: expected bigint, got \"+typeof t);return Mw<=t&&t<e},is0:e=>e===Mw,isValidNot0:e=>!d.is0(e)&&d.isValid(e),isOdd:e=>(e&zw)===zw,neg:t=>Vw(-t,e),eql:(e,t)=>e===t,sqr:t=>Vw(t*t,e),add:(t,n)=>Vw(t+n,e),sub:(t,n)=>Vw(t-n,e),mul:(t,n)=>Vw(t*n,e),pow:(e,t)=>nv(d,e,t),div:(t,n)=>Vw(t*Gw(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>Gw(t,e),sqrt:i||(t=>(l||(l=Qw(e)),l(d,t))),toBytes:e=>n?Iw(e,u):kw(e,u),fromBytes:(t,r=!0)=>{if(a){if(!a.includes(t.length)||t.length>u)throw new Error(\"Field.fromBytes: expected \"+a+\" bytes, got \"+t.length);const e=new Uint8Array(u);e.set(t,n?0:e.length-t.length),t=e}if(t.length!==u)throw new Error(\"Field.fromBytes: expected \"+u+\" bytes, got \"+t.length);let o=n?xw(t):Ew(t);if(s&&(o=Vw(o,e)),!r&&!d.isValid(o))throw new Error(\"invalid field element: outside of range 0..ORDER\");return o},invertBatch:e=>rv(d,e),cmov:(e,t,n)=>n?t:e});return Object.freeze(d)}function sv(e){if(\"bigint\"!=typeof e)throw new Error(\"field order must be bigint\");const t=e.toString(2).length;return Math.ceil(t/8)}function cv(e){const t=sv(e);return t+Math.ceil(t/2)}const uv=BigInt(0),lv=BigInt(1);function dv(e,t){const n=t.negate();return e?n:t}function fv(e,t){const n=rv(e.Fp,t.map(e=>e.Z));return t.map((t,r)=>e.fromAffine(t.toAffine(n[r])))}function hv(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error(\"invalid window size, expected [1..\"+t+\"], got W=\"+e)}function pv(e,t){hv(e,t);const n=2**e;return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1),mask:Pw(e),maxNumber:n,shiftBy:BigInt(e)}}function gv(e,t,n){const{windowSize:r,mask:o,maxNumber:i,shiftBy:a}=n;let s=Number(e&o),c=e>>a;s>r&&(s-=i,c+=lv);const u=t*r;return{nextN:c,offset:u+Math.abs(s)-1,isZero:0===s,isNeg:s<0,isNegF:t%2!=0,offsetF:u}}function mv(e,t){if(!Array.isArray(e))throw new Error(\"array expected\");e.forEach((e,n)=>{if(!(e instanceof t))throw new Error(\"invalid point at index \"+n)})}function yv(e,t){if(!Array.isArray(e))throw new Error(\"array of scalars expected\");e.forEach((e,n)=>{if(!t.isValid(e))throw new Error(\"invalid scalar at index \"+n)})}const wv=new WeakMap,vv=new WeakMap;function bv(e){return vv.get(e)||1}function Av(e){if(e!==uv)throw new Error(\"invalid wNAF\")}class Sv{constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,n=this.ZERO){let r=e;for(;t>uv;)t&lv&&(n=n.add(r)),r=r.double(),t>>=lv;return n}precomputeWindow(e,t){const{windows:n,windowSize:r}=pv(t,this.bits),o=[];let i=e,a=i;for(let e=0;e<n;e++){a=i,o.push(a);for(let e=1;e<r;e++)a=a.add(i),o.push(a);i=a.double()}return o}wNAF(e,t,n){if(!this.Fn.isValid(n))throw new Error(\"invalid scalar\");let r=this.ZERO,o=this.BASE;const i=pv(e,this.bits);for(let e=0;e<i.windows;e++){const{nextN:a,offset:s,isZero:c,isNeg:u,isNegF:l,offsetF:d}=gv(n,e,i);n=a,c?o=o.add(dv(l,t[d])):r=r.add(dv(u,t[s]))}return Av(n),{p:r,f:o}}wNAFUnsafe(e,t,n,r=this.ZERO){const o=pv(e,this.bits);for(let e=0;e<o.windows&&n!==uv;e++){const{nextN:i,offset:a,isZero:s,isNeg:c}=gv(n,e,o);if(n=i,!s){const e=t[a];r=r.add(c?e.negate():e)}}return Av(n),r}getPrecomputes(e,t,n){let r=wv.get(t);return r||(r=this.precomputeWindow(t,e),1!==e&&(\"function\"==typeof n&&(r=n(r)),wv.set(t,r))),r}cached(e,t,n){const r=bv(e);return this.wNAF(r,this.getPrecomputes(r,e,n),t)}unsafe(e,t,n,r){const o=bv(e);return 1===o?this._unsafeLadder(e,t,r):this.wNAFUnsafe(o,this.getPrecomputes(o,e,n),t,r)}createCache(e,t){hv(t,this.bits),vv.set(e,t),wv.delete(e)}hasCache(e){return 1!==bv(e)}}function Ev(e,t,n,r){mv(n,e),yv(r,t);const o=n.length,i=r.length;if(o!==i)throw new Error(\"arrays of points and scalars must have equal length\");const a=e.ZERO,s=Rw(BigInt(o));let c=1;s>12?c=s-3:s>4?c=s-2:s>0&&(c=2);const u=Pw(c),l=new Array(Number(u)+1).fill(a);let d=a;for(let e=Math.floor((t.BITS-1)/c)*c;e>=0;e-=c){l.fill(a);for(let t=0;t<i;t++){const o=r[t],i=Number(o>>BigInt(e)&u);l[i]=l[i].add(n[t])}let t=a;for(let e=l.length-1,n=a;e>0;e--)n=n.add(l[e]),t=t.add(n);if(d=d.add(t),0!==e)for(let e=0;e<c;e++)d=d.double()}return d}function xv(e,t,n){if(t){if(t.ORDER!==e)throw new Error(\"Field.ORDER must match order: Fp == p, Fn == n\");return function(e){const t=tv.reduce((e,t)=>(e[t]=\"function\",e),{ORDER:\"bigint\",MASK:\"bigint\",BYTES:\"number\",BITS:\"number\"});Nw(e,t)}(t),t}return av(e,{isLE:n})}function kv(e,t,n={},r){if(void 0===r&&(r=\"edwards\"===e),!t||\"object\"!=typeof t)throw new Error(`expected valid ${e} CURVE object`);for(const e of[\"p\",\"n\",\"h\"]){const n=t[e];if(!(\"bigint\"==typeof n&&n>uv))throw new Error(`CURVE.${e} must be positive bigint`)}const o=xv(t.p,n.Fp,r),i=xv(t.n,n.Fn,r),a=[\"Gx\",\"Gy\",\"a\",\"weierstrass\"===e?\"b\":\"d\"];for(const e of a)if(!o.isValid(t[e]))throw new Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return{CURVE:t=Object.freeze(Object.assign({},t)),Fp:o,Fn:i}}const Iv=(e,t)=>(e+(e>=0?t:-t)/Nv)/t;function Tv(e){if(![\"compact\",\"recovered\",\"der\"].includes(e))throw new Error('Signature format must be \"compact\", \"recovered\", or \"der\"');return e}function _v(e,t){const n={};for(let r of Object.keys(t))n[r]=void 0===e[r]?t[r]:e[r];return vw(n.lowS,\"lowS\"),vw(n.prehash,\"prehash\"),void 0!==n.format&&Tv(n.format),n}class Cv extends Error{constructor(e=\"\"){super(e)}}const Bv={Err:Cv,_tlv:{encode:(e,t)=>{const{Err:n}=Bv;if(e<0||e>256)throw new n(\"tlv.encode: wrong tag\");if(1&t.length)throw new n(\"tlv.encode: unpadded data\");const r=t.length/2,o=Aw(r);if(o.length/2&128)throw new n(\"tlv.encode: long form length too big\");const i=r>127?Aw(o.length/2|128):\"\";return Aw(e)+i+o+t},decode(e,t){const{Err:n}=Bv;let r=0;if(e<0||e>256)throw new n(\"tlv.encode: wrong tag\");if(t.length<2||t[r++]!==e)throw new n(\"tlv.decode: wrong tlv\");const o=t[r++];let i=0;if(!!(128&o)){const e=127&o;if(!e)throw new n(\"tlv.decode(long): indefinite length not supported\");if(e>4)throw new n(\"tlv.decode(long): byte length is too big\");const a=t.subarray(r,r+e);if(a.length!==e)throw new n(\"tlv.decode: length bytes not complete\");if(0===a[0])throw new n(\"tlv.decode(long): zero leftmost byte\");for(const e of a)i=i<<8|e;if(r+=e,i<128)throw new n(\"tlv.decode(long): not minimal encoding\")}else i=o;const a=t.subarray(r,r+i);if(a.length!==i)throw new n(\"tlv.decode: wrong value length\");return{v:a,l:t.subarray(r+i)}}},_int:{encode(e){const{Err:t}=Bv;if(e<Rv)throw new t(\"integer: negative integers are not allowed\");let n=Aw(e);if(8&Number.parseInt(n[0],16)&&(n=\"00\"+n),1&n.length)throw new t(\"unexpected DER parsing assertion: unpadded hex\");return n},decode(e){const{Err:t}=Bv;if(128&e[0])throw new t(\"invalid signature integer: negative\");if(0===e[0]&&!(128&e[1]))throw new t(\"invalid signature integer: unnecessary leading zero\");return Ew(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=Bv,o=Tw(\"signature\",e),{v:i,l:a}=r.decode(48,o);if(a.length)throw new t(\"invalid signature: left bytes after parsing\");const{v:s,l:c}=r.decode(2,i),{v:u,l}=r.decode(2,c);if(l.length)throw new t(\"invalid signature: left bytes after parsing\");return{r:n.decode(s),s:n.decode(u)}},hexFromSig(e){const{_tlv:t,_int:n}=Bv,r=t.encode(2,n.encode(e.r))+t.encode(2,n.encode(e.s));return t.encode(48,r)}},Rv=BigInt(0),Pv=BigInt(1),Nv=BigInt(2),Ov=BigInt(3),Uv=BigInt(4);function Mv(e,t){const{BYTES:n}=e;let r;if(\"bigint\"==typeof t)r=t;else{let o=Tw(\"private key\",t);try{r=e.fromBytes(o)}catch(e){throw new Error(`invalid private key: expected ui8a of size ${n}, got ${typeof t}`)}}if(!e.isValidNot0(r))throw new Error(\"invalid private key: out of range [1..N-1]\");return r}function zv(e,t={}){const n=kv(\"weierstrass\",e,t),{Fp:r,Fn:o}=n;let i=n.CURVE;const{h:a,n:s}=i;Nw(t,{},{allowInfinityPoint:\"boolean\",clearCofactor:\"function\",isTorsionFree:\"function\",fromBytes:\"function\",toBytes:\"function\",endo:\"object\",wrapPrivateKey:\"boolean\"});const{endo:c}=t;if(c&&(!r.is0(i.a)||\"bigint\"!=typeof c.beta||!Array.isArray(c.basises)))throw new Error('invalid endo: expected \"beta\": bigint and \"basises\": array');const u=jv(r,o);function l(){if(!r.isOdd)throw new Error(\"compression is not supported: Field does not have .isOdd()\")}const d=t.toBytes||function(e,t,n){const{x:o,y:i}=t.toAffine(),a=r.toBytes(o);if(vw(n,\"isCompressed\"),n){l();return ld(Lv(!r.isOdd(i)),a)}return ld(Uint8Array.of(4),a,r.toBytes(i))},f=t.fromBytes||function(e){bw(e,void 0,\"Point\");const{publicKey:t,publicKeyUncompressed:n}=u,o=e.length,i=e[0],a=e.subarray(1);if(o!==t||2!==i&&3!==i){if(o===n&&4===i){const e=r.BYTES,t=r.fromBytes(a.subarray(0,e)),n=r.fromBytes(a.subarray(e,2*e));if(!p(t,n))throw new Error(\"bad point: is not on curve\");return{x:t,y:n}}throw new Error(`bad point: got length ${o}, expected compressed=${t} or uncompressed=${n}`)}{const e=r.fromBytes(a);if(!r.isValid(e))throw new Error(\"bad point: is not on curve, wrong x\");const t=h(e);let n;try{n=r.sqrt(t)}catch(e){const t=e instanceof Error?\": \"+e.message:\"\";throw new Error(\"bad point: is not on curve, sqrt error\"+t)}l();return!(1&~i)!==r.isOdd(n)&&(n=r.neg(n)),{x:e,y:n}}};function h(e){const t=r.sqr(e),n=r.mul(t,e);return r.add(r.add(n,r.mul(e,i.a)),i.b)}function p(e,t){const n=r.sqr(t),o=h(e);return r.eql(n,o)}if(!p(i.Gx,i.Gy))throw new Error(\"bad curve params: generator point\");const g=r.mul(r.pow(i.a,Ov),Uv),m=r.mul(r.sqr(i.b),BigInt(27));if(r.is0(r.add(g,m)))throw new Error(\"bad curve params: a or b\");function y(e,t,n=!1){if(!r.isValid(t)||n&&r.is0(t))throw new Error(`bad point coordinate ${e}`);return t}function w(e){if(!(e instanceof E))throw new Error(\"ProjectivePoint expected\")}function v(e){if(!c||!c.basises)throw new Error(\"no endo\");return function(e,t,n){const[[r,o],[i,a]]=t,s=Iv(a*e,n),c=Iv(-o*e,n);let u=e-s*r-c*i,l=-s*o-c*a;const d=u<Rv,f=l<Rv;d&&(u=-u),f&&(l=-l);const h=Pw(Math.ceil(Rw(n)/2))+Pv;if(u<Rv||u>=h||l<Rv||l>=h)throw new Error(\"splitScalar (endomorphism): failed, k=\"+e);return{k1neg:d,k1:u,k2neg:f,k2:l}}(e,c.basises,o.ORDER)}const b=Uw((e,t)=>{const{X:n,Y:o,Z:i}=e;if(r.eql(i,r.ONE))return{x:n,y:o};const a=e.is0();null==t&&(t=a?r.ONE:r.inv(i));const s=r.mul(n,t),c=r.mul(o,t),u=r.mul(i,t);if(a)return{x:r.ZERO,y:r.ZERO};if(!r.eql(u,r.ONE))throw new Error(\"invZ was invalid\");return{x:s,y:c}}),A=Uw(e=>{if(e.is0()){if(t.allowInfinityPoint&&!r.is0(e.Y))return;throw new Error(\"bad point: ZERO\")}const{x:n,y:o}=e.toAffine();if(!r.isValid(n)||!r.isValid(o))throw new Error(\"bad point: x or y not field elements\");if(!p(n,o))throw new Error(\"bad point: equation left != right\");if(!e.isTorsionFree())throw new Error(\"bad point: not in prime-order subgroup\");return!0});function S(e,t,n,o,i){return n=new E(r.mul(n.X,e),n.Y,n.Z),t=dv(o,t),n=dv(i,n),t.add(n)}class E{constructor(e,t,n){this.X=y(\"x\",e),this.Y=y(\"y\",t,!0),this.Z=y(\"z\",n),Object.freeze(this)}static CURVE(){return i}static fromAffine(e){const{x:t,y:n}=e||{};if(!e||!r.isValid(t)||!r.isValid(n))throw new Error(\"invalid affine point\");if(e instanceof E)throw new Error(\"projective point not allowed\");return r.is0(t)&&r.is0(n)?E.ZERO:new E(t,n,r.ONE)}static fromBytes(e){const t=E.fromAffine(f(bw(e,void 0,\"point\")));return t.assertValidity(),t}static fromHex(e){return E.fromBytes(Tw(\"pointHex\",e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return k.createCache(this,e),t||this.multiply(Ov),this}assertValidity(){A(this)}hasEvenY(){const{y:e}=this.toAffine();if(!r.isOdd)throw new Error(\"Field doesn't support isOdd\");return!r.isOdd(e)}equals(e){w(e);const{X:t,Y:n,Z:o}=this,{X:i,Y:a,Z:s}=e,c=r.eql(r.mul(t,s),r.mul(i,o)),u=r.eql(r.mul(n,s),r.mul(a,o));return c&&u}negate(){return new E(this.X,r.neg(this.Y),this.Z)}double(){const{a:e,b:t}=i,n=r.mul(t,Ov),{X:o,Y:a,Z:s}=this;let c=r.ZERO,u=r.ZERO,l=r.ZERO,d=r.mul(o,o),f=r.mul(a,a),h=r.mul(s,s),p=r.mul(o,a);return p=r.add(p,p),l=r.mul(o,s),l=r.add(l,l),c=r.mul(e,l),u=r.mul(n,h),u=r.add(c,u),c=r.sub(f,u),u=r.add(f,u),u=r.mul(c,u),c=r.mul(p,c),l=r.mul(n,l),h=r.mul(e,h),p=r.sub(d,h),p=r.mul(e,p),p=r.add(p,l),l=r.add(d,d),d=r.add(l,d),d=r.add(d,h),d=r.mul(d,p),u=r.add(u,d),h=r.mul(a,s),h=r.add(h,h),d=r.mul(h,p),c=r.sub(c,d),l=r.mul(h,f),l=r.add(l,l),l=r.add(l,l),new E(c,u,l)}add(e){w(e);const{X:t,Y:n,Z:o}=this,{X:a,Y:s,Z:c}=e;let u=r.ZERO,l=r.ZERO,d=r.ZERO;const f=i.a,h=r.mul(i.b,Ov);let p=r.mul(t,a),g=r.mul(n,s),m=r.mul(o,c),y=r.add(t,n),v=r.add(a,s);y=r.mul(y,v),v=r.add(p,g),y=r.sub(y,v),v=r.add(t,o);let b=r.add(a,c);return v=r.mul(v,b),b=r.add(p,m),v=r.sub(v,b),b=r.add(n,o),u=r.add(s,c),b=r.mul(b,u),u=r.add(g,m),b=r.sub(b,u),d=r.mul(f,v),u=r.mul(h,m),d=r.add(u,d),u=r.sub(g,d),d=r.add(g,d),l=r.mul(u,d),g=r.add(p,p),g=r.add(g,p),m=r.mul(f,m),v=r.mul(h,v),g=r.add(g,m),m=r.sub(p,m),m=r.mul(f,m),v=r.add(v,m),p=r.mul(g,v),l=r.add(l,p),p=r.mul(b,v),u=r.mul(y,u),u=r.sub(u,p),p=r.mul(y,g),d=r.mul(b,d),d=r.add(d,p),new E(u,l,d)}subtract(e){return this.add(e.negate())}is0(){return this.equals(E.ZERO)}multiply(e){const{endo:n}=t;if(!o.isValidNot0(e))throw new Error(\"invalid scalar: out of range\");let r,i;const a=e=>k.cached(this,e,e=>fv(E,e));if(n){const{k1neg:t,k1:o,k2neg:s,k2:c}=v(e),{p:u,f:l}=a(o),{p:d,f}=a(c);i=l.add(f),r=S(n.beta,u,d,t,s)}else{const{p:t,f:n}=a(e);r=t,i=n}return fv(E,[r,i])[0]}multiplyUnsafe(e){const{endo:n}=t,r=this;if(!o.isValid(e))throw new Error(\"invalid scalar: out of range\");if(e===Rv||r.is0())return E.ZERO;if(e===Pv)return r;if(k.hasCache(this))return this.multiply(e);if(n){const{k1neg:t,k1:o,k2neg:i,k2:a}=v(e),{p1:s,p2:c}=function(e,t,n,r){let o=t,i=e.ZERO,a=e.ZERO;for(;n>uv||r>uv;)n&lv&&(i=i.add(o)),r&lv&&(a=a.add(o)),o=o.double(),n>>=lv,r>>=lv;return{p1:i,p2:a}}(E,r,o,a);return S(n.beta,s,c,t,i)}return k.unsafe(r,e)}multiplyAndAddUnsafe(e,t,n){const r=this.multiplyUnsafe(t).add(e.multiplyUnsafe(n));return r.is0()?void 0:r}toAffine(e){return b(this,e)}isTorsionFree(){const{isTorsionFree:e}=t;return a===Pv||(e?e(E,this):k.unsafe(this,s).is0())}clearCofactor(){const{clearCofactor:e}=t;return a===Pv?this:e?e(E,this):this.multiplyUnsafe(a)}isSmallOrder(){return this.multiplyUnsafe(a).is0()}toBytes(e=!0){return vw(e,\"isCompressed\"),this.assertValidity(),d(E,this,e)}toHex(e=!0){return Xl(this.toBytes(e))}toString(){return`<Point ${this.is0()?\"ZERO\":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(e=!0){return this.toBytes(e)}_setWindowSize(e){this.precompute(e)}static normalizeZ(e){return fv(E,e)}static msm(e,t){return Ev(E,o,e,t)}static fromPrivateKey(e){return E.BASE.multiply(Mv(o,e))}}E.BASE=new E(i.Gx,i.Gy,r.ONE),E.ZERO=new E(r.ZERO,r.ONE,r.ZERO),E.Fp=r,E.Fn=o;const x=o.BITS,k=new Sv(E,t.endo?Math.ceil(x/2):x);return E.BASE.precompute(8),E}function Lv(e){return Uint8Array.of(e?2:3)}function jv(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function Fv(e,t={}){const{Fn:n}=e,r=t.randomBytes||hd,o=Object.assign(jv(e.Fp,n),{seed:cv(n.ORDER)});function i(e){try{return!!Mv(n,e)}catch(e){return!1}}function a(e=r(o.seed)){return function(e,t,n=!1){const r=e.length,o=sv(t),i=cv(t);if(r<16||r<i||r>1024)throw new Error(\"expected \"+i+\"-1024 bytes of input, got \"+r);const a=Vw(n?xw(e):Ew(e),t-zw)+zw;return n?Iw(a,o):kw(a,o)}(bw(e,o.seed,\"seed\"),n.ORDER)}function s(t,r=!0){return e.BASE.multiply(Mv(n,t)).toBytes(r)}function c(t){if(\"bigint\"==typeof t)return!1;if(t instanceof e)return!0;const{secretKey:r,publicKey:i,publicKeyUncompressed:a}=o;if(n.allowedLengths||r===i)return;const s=Tw(\"key\",t).length;return s===i||s===a}const u={isValidSecretKey:i,isValidPublicKey:function(t,n){const{publicKey:r,publicKeyUncompressed:i}=o;try{const o=t.length;return(!0!==n||o===r)&&((!1!==n||o===i)&&!!e.fromBytes(t))}catch(e){return!1}},randomSecretKey:a,isValidPrivateKey:i,randomPrivateKey:a,normPrivateKeyToScalar:e=>Mv(n,e),precompute:(t=8,n=e.BASE)=>n.precompute(t,!1)};return Object.freeze({getPublicKey:s,getSharedSecret:function(t,r,o=!0){if(!0===c(t))throw new Error(\"first arg must be private key\");if(!1===c(r))throw new Error(\"second arg must be public key\");const i=Mv(n,t);return e.fromHex(r).multiply(i).toBytes(o)},keygen:function(e){const t=a(e);return{secretKey:t,publicKey:s(t)}},Point:e,utils:u,lengths:o})}function Dv(e,t,n={}){Fl(t),Nw(n,{},{hmac:\"function\",lowS:\"boolean\",randomBytes:\"function\",bits2int:\"function\",bits2int_modN:\"function\"});const r=n.randomBytes||hd,o=n.hmac||((e,...n)=>mw(t,e,ld(...n))),{Fp:i,Fn:a}=e,{ORDER:s,BITS:c}=a,{keygen:u,getPublicKey:l,getSharedSecret:d,utils:f,lengths:h}=Fv(e,n),p={prehash:!1,lowS:\"boolean\"==typeof n.lowS&&n.lowS,format:void 0,extraEntropy:!1},g=\"compact\";function m(e){return e>s>>Pv}function y(e,t){if(!a.isValidNot0(t))throw new Error(`invalid signature ${e}: out of range 1..Point.Fn.ORDER`);return t}class w{constructor(e,t,n){this.r=y(\"r\",e),this.s=y(\"s\",t),null!=n&&(this.recovery=n),Object.freeze(this)}static fromBytes(e,t=g){let n;if(function(e,t){Tv(t);const n=h.signature;bw(e,\"compact\"===t?n:\"recovered\"===t?n+1:void 0,`${t} signature`)}(e,t),\"der\"===t){const{r:t,s:n}=Bv.toSig(bw(e));return new w(t,n)}\"recovered\"===t&&(n=e[0],t=\"compact\",e=e.subarray(1));const r=a.BYTES,o=e.subarray(0,r),i=e.subarray(r,2*r);return new w(a.fromBytes(o),a.fromBytes(i),n)}static fromHex(e,t){return this.fromBytes(ad(e),t)}addRecoveryBit(e){return new w(this.r,this.s,e)}recoverPublicKey(t){const n=i.ORDER,{r,s:o,recovery:c}=this;if(null==c||![0,1,2,3].includes(c))throw new Error(\"recovery id invalid\");if(s*Nv<n&&c>1)throw new Error(\"recovery id is ambiguous for h>1 curve\");const u=2===c||3===c?r+s:r;if(!i.isValid(u))throw new Error(\"recovery id 2 or 3 invalid\");const l=i.toBytes(u),d=e.fromBytes(ld(Lv(!(1&c)),l)),f=a.inv(u),h=b(Tw(\"msgHash\",t)),p=a.create(-h*f),g=a.create(o*f),m=e.BASE.multiplyUnsafe(p).add(d.multiplyUnsafe(g));if(m.is0())throw new Error(\"point at infinify\");return m.assertValidity(),m}hasHighS(){return m(this.s)}toBytes(e=g){if(Tv(e),\"der\"===e)return ad(Bv.hexFromSig(this));const t=a.toBytes(this.r),n=a.toBytes(this.s);if(\"recovered\"===e){if(null==this.recovery)throw new Error(\"recovery bit must be present\");return ld(Uint8Array.of(this.recovery),t,n)}return ld(t,n)}toHex(e){return Xl(this.toBytes(e))}assertValidity(){}static fromCompact(e){return w.fromBytes(Tw(\"sig\",e),\"compact\")}static fromDER(e){return w.fromBytes(Tw(\"sig\",e),\"der\")}normalizeS(){return this.hasHighS()?new w(this.r,a.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes(\"der\")}toDERHex(){return Xl(this.toBytes(\"der\"))}toCompactRawBytes(){return this.toBytes(\"compact\")}toCompactHex(){return Xl(this.toBytes(\"compact\"))}}const v=n.bits2int||function(e){if(e.length>8192)throw new Error(\"input is too large\");const t=Ew(e),n=8*e.length-c;return n>0?t>>BigInt(n):t},b=n.bits2int_modN||function(e){return a.create(v(e))},A=Pw(c);function S(e){return Bw(\"num < 2^\"+c,e,Rv,A),a.toBytes(e)}function E(e,n){return bw(e,void 0,\"message\"),n?bw(t(e),void 0,\"prehashed message\"):e}return Object.freeze({keygen:u,getPublicKey:l,getSharedSecret:d,utils:f,lengths:h,Point:e,sign:function(n,i,s={}){n=Tw(\"message\",n);const{seed:c,k2sig:u}=function(t,n,o){if([\"recovered\",\"canonical\"].some(e=>e in o))throw new Error(\"sign() legacy options not supported\");const{lowS:i,prehash:s,extraEntropy:c}=_v(o,p);t=E(t,s);const u=b(t),l=Mv(a,n),d=[S(l),S(u)];if(null!=c&&!1!==c){const e=!0===c?r(h.secretKey):c;d.push(Tw(\"extraEntropy\",e))}const f=ld(...d),g=u;return{seed:f,k2sig:function(t){const n=v(t);if(!a.isValidNot0(n))return;const r=a.inv(n),o=e.BASE.multiply(n).toAffine(),s=a.create(o.x);if(s===Rv)return;const c=a.create(r*a.create(g+s*l));if(c===Rv)return;let u=(o.x===s?0:2)|Number(o.y&Pv),d=c;return i&&m(c)&&(d=a.neg(c),u^=1),new w(s,d,u)}}}(n,i,s),l=function(e,t,n){if(\"number\"!=typeof e||e<2)throw new Error(\"hashLen must be a number\");if(\"number\"!=typeof t||t<2)throw new Error(\"qByteLen must be a number\");if(\"function\"!=typeof n)throw new Error(\"hmacFn must be a function\");const r=e=>new Uint8Array(e),o=e=>Uint8Array.of(e);let i=r(e),a=r(e),s=0;const c=()=>{i.fill(1),a.fill(0),s=0},u=(...e)=>n(a,i,...e),l=(e=r(0))=>{a=u(o(0),e),i=u(),0!==e.length&&(a=u(o(1),e),i=u())},d=()=>{if(s++>=1e3)throw new Error(\"drbg: tried 1000 values\");let e=0;const n=[];for(;e<t;){i=u();const t=i.slice();n.push(t),e+=i.length}return ld(...n)};return(e,t)=>{let n;for(c(),l(e);!(n=t(d()));)l();return c(),n}}(t.outputLen,a.BYTES,o);return l(c,u)},verify:function(t,n,r,o={}){const{lowS:i,prehash:s,format:c}=_v(o,p);if(r=Tw(\"publicKey\",r),n=E(Tw(\"message\",n),s),\"strict\"in o)throw new Error(\"options.strict was renamed to lowS\");const u=void 0===c?function(e){let t;const n=\"string\"==typeof e||zl(e),r=!n&&null!==e&&\"object\"==typeof e&&\"bigint\"==typeof e.r&&\"bigint\"==typeof e.s;if(!n&&!r)throw new Error(\"invalid signature, expected Uint8Array, hex string or Signature instance\");if(r)t=new w(e.r,e.s);else if(n){try{t=w.fromBytes(Tw(\"sig\",e),\"der\")}catch(e){if(!(e instanceof Bv.Err))throw e}if(!t)try{t=w.fromBytes(Tw(\"sig\",e),\"compact\")}catch(e){return!1}}return t||!1}(t):w.fromBytes(Tw(\"sig\",t),c);if(!1===u)return!1;try{const t=e.fromBytes(r);if(i&&u.hasHighS())return!1;const{r:o,s}=u,c=b(n),l=a.inv(s),d=a.create(c*l),f=a.create(o*l),h=e.BASE.multiplyUnsafe(d).add(t.multiplyUnsafe(f));if(h.is0())return!1;return a.create(h.x)===o}catch(e){return!1}},recoverPublicKey:function(e,t,n={}){const{prehash:r}=_v(n,p);return t=E(t,r),w.fromBytes(e,\"recovered\").recoverPublicKey(t).toBytes()},Signature:w,hash:t})}function $v(e){const t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},n=e.Fp;let r=e.allowedPrivateKeyLengths?Array.from(new Set(e.allowedPrivateKeyLengths.map(e=>Math.ceil(e/2)))):void 0;return{CURVE:t,curveOpts:{Fp:n,Fn:av(t.n,{BITS:e.nBitLength,allowedLengths:r,modFromBytes:e.wrapPrivateKey}),allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes}}}function Kv(e){const{CURVE:t,curveOpts:n,hash:r,ecdsaOpts:o}=function(e){const{CURVE:t,curveOpts:n}=$v(e),r={hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:t,curveOpts:n,hash:e.hash,ecdsaOpts:r}}(e);return function(e,t){const n=t.Point;return Object.assign({},t,{ProjectivePoint:n,CURVE:Object.assign({},e,iv(n.Fn.ORDER,n.Fn.BITS))})}(e,Dv(zv(t,n),r,o))}const qv={p:BigInt(\"0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f\"),n:BigInt(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt(\"0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798\"),Gy:BigInt(\"0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8\")},Wv={beta:BigInt(\"0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee\"),basises:[[BigInt(\"0x3086d221a7d46bcde86c90e49284eb15\"),-BigInt(\"0xe4437ed6010e88286f547fa90abfe4c3\")],[BigInt(\"0x114ca50f7a8e2f3f657c1108d9d44cfd8\"),BigInt(\"0x3086d221a7d46bcde86c90e49284eb15\")]]},Vv=BigInt(2);const Hv=av(qv.p,{sqrt:function(e){const t=qv.p,n=BigInt(3),r=BigInt(6),o=BigInt(11),i=BigInt(22),a=BigInt(23),s=BigInt(44),c=BigInt(88),u=e*e*e%t,l=u*u*e%t,d=Hw(l,n,t)*l%t,f=Hw(d,n,t)*l%t,h=Hw(f,Vv,t)*u%t,p=Hw(h,o,t)*h%t,g=Hw(p,i,t)*p%t,m=Hw(g,s,t)*g%t,y=Hw(m,c,t)*m%t,w=Hw(y,s,t)*g%t,v=Hw(w,n,t)*l%t,b=Hw(v,a,t)*p%t,A=Hw(b,r,t)*u%t,S=Hw(A,Vv,t);if(!Hv.eql(Hv.sqr(S),e))throw new Error(\"Cannot find square root\");return S}}),Gv=function(e,t){const n=t=>Kv({...e,hash:t});return{...n(t),create:n}}({...qv,Fp:Hv,lowS:!0,endo:Wv},hw);var Zv=n(6925);const Yv=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]);new Uint32Array(80);const Jv=Math.pow(2,32);Array.from({length:64},(e,t)=>Math.floor(Jv*Math.abs(Math.sin(t+1)))),Yv.slice(0,4),new Uint32Array(16);const Xv=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Qv=Uint8Array.from(new Array(16).fill(0).map((e,t)=>t)),eb=Qv.map(e=>(9*e+5)%16),tb=(()=>{const e=[[Qv],[eb]];for(let t=0;t<4;t++)for(let n of e)n.push(n[t].map(e=>Xv[e]));return e})(),nb=tb[0],rb=tb[1],ob=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>Uint8Array.from(e)),ib=nb.map((e,t)=>e.map(e=>ob[t][e])),ab=rb.map((e,t)=>e.map(e=>ob[t][e])),sb=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),cb=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function ub(e,t,n,r){return 0===e?t^n^r:1===e?t&n|~t&r:2===e?(t|~n)^r:3===e?t&r|n&~r:t^(n|~r)}const lb=new Uint32Array(16);class db extends tw{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:t,h2:n,h3:r,h4:o}=this;return[e,t,n,r,o]}set(e,t,n,r,o){this.h0=0|e,this.h1=0|t,this.h2=0|n,this.h3=0|r,this.h4=0|o}process(e,t){for(let n=0;n<16;n++,t+=4)lb[n]=e.getUint32(t,!0);let n=0|this.h0,r=n,o=0|this.h1,i=o,a=0|this.h2,s=a,c=0|this.h3,u=c,l=0|this.h4,d=l;for(let e=0;e<5;e++){const t=4-e,f=sb[e],h=cb[e],p=nb[e],g=rb[e],m=ib[e],y=ab[e];for(let t=0;t<16;t++){const r=Vl(n+ub(e,o,a,c)+lb[p[t]]+f,m[t])+l|0;n=l,l=c,c=0|Vl(a,10),a=o,o=r}for(let e=0;e<16;e++){const n=Vl(r+ub(t,i,s,u)+lb[g[e]]+h,y[e])+d|0;r=d,d=u,u=0|Vl(s,10),s=i,i=n}}this.set(this.h1+a+u|0,this.h2+c+d|0,this.h3+l+r|0,this.h4+n+i|0,this.h0+o+s|0)}roundClean(){Kl(lb)}destroy(){this.destroyed=!0,Kl(this.buffer),this.set(0,0,0,0,0)}}const fb=fd(()=>new db);const hb=hw;function pb(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&\"Uint8Array\"===e.constructor.name}function gb(e,...t){if(!pb(e))throw new Error(\"Uint8Array expected\");if(t.length>0&&!t.includes(e.length))throw new Error(\"Uint8Array expected of length \"+t+\", got length=\"+e.length)}function mb(e,t){return!!Array.isArray(t)&&(0===t.length||(e?t.every(e=>\"string\"==typeof e):t.every(e=>Number.isSafeInteger(e))))}function yb(e){if(\"function\"!=typeof e)throw new Error(\"function expected\");return!0}function wb(e,t){if(\"string\"!=typeof t)throw new Error(`${e}: string expected`);return!0}function vb(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function bb(e){if(!Array.isArray(e))throw new Error(\"array expected\")}function Ab(e,t){if(!mb(!0,t))throw new Error(`${e}: array of strings expected`)}function Sb(e,t){if(!mb(!1,t))throw new Error(`${e}: array of numbers expected`)}function Eb(...e){const t=e=>e,n=(e,t)=>n=>e(t(n)),r=e.map(e=>e.encode).reduceRight(n,t),o=e.map(e=>e.decode).reduce(n,t);return{encode:r,decode:o}}function xb(e){const t=\"string\"==typeof e?e.split(\"\"):e,n=t.length;Ab(\"alphabet\",t);const r=new Map(t.map((e,t)=>[e,t]));return{encode:r=>(bb(r),r.map(r=>{if(!Number.isSafeInteger(r)||r<0||r>=n)throw new Error(`alphabet.encode: digit index outside alphabet \"${r}\". Allowed: ${e}`);return t[r]})),decode:t=>(bb(t),t.map(t=>{wb(\"alphabet.decode\",t);const n=r.get(t);if(void 0===n)throw new Error(`Unknown letter: \"${t}\". Allowed: ${e}`);return n}))}}function kb(e=\"\"){return wb(\"join\",e),{encode:t=>(Ab(\"join.decode\",t),t.join(e)),decode:t=>(wb(\"join.decode\",t),t.split(e))}}function Ib(e,t=\"=\"){return vb(e),wb(\"padding\",t),{encode(n){for(Ab(\"padding.encode\",n);n.length*e%8;)n.push(t);return n},decode(n){Ab(\"padding.decode\",n);let r=n.length;if(r*e%8)throw new Error(\"padding: invalid, string should have whole number of bytes\");for(;r>0&&n[r-1]===t;r--){if((r-1)*e%8==0)throw new Error(\"padding: invalid, string has too much padding\")}return n.slice(0,r)}}}function Tb(e){return yb(e),{encode:e=>e,decode:t=>e(t)}}function _b(e,t,n){if(t<2)throw new Error(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: invalid to=${n}, base cannot be less than 2`);if(bb(e),!e.length)return[];let r=0;const o=[],i=Array.from(e,e=>{if(vb(e),e<0||e>=t)throw new Error(`invalid integer: ${e}`);return e}),a=i.length;for(;;){let e=0,s=!0;for(let o=r;o<a;o++){const a=i[o],c=t*e,u=c+a;if(!Number.isSafeInteger(u)||c/t!==e||u-a!==c)throw new Error(\"convertRadix: carry overflow\");const l=u/n;e=u%n;const d=Math.floor(l);if(i[o]=d,!Number.isSafeInteger(d)||d*n+e!==u)throw new Error(\"convertRadix: carry overflow\");s&&(d?s=!1:r=o)}if(o.push(e),s)break}for(let t=0;t<e.length-1&&0===e[t];t++)o.push(0);return o.reverse()}const Cb=(e,t)=>0===t?e:Cb(t,e%t),Bb=(e,t)=>e+(t-Cb(e,t)),Rb=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function Pb(e,t,n,r){if(bb(e),t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(Bb(t,n)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${Bb(t,n)}`);let o=0,i=0;const a=Rb[t],s=Rb[n]-1,c=[];for(const r of e){if(vb(r),r>=a)throw new Error(`convertRadix2: invalid data word=${r} from=${t}`);if(o=o<<t|r,i+t>32)throw new Error(`convertRadix2: carry overflow pos=${i} from=${t}`);for(i+=t;i>=n;i-=n)c.push((o>>i-n&s)>>>0);const e=Rb[i];if(void 0===e)throw new Error(\"invalid carry\");o&=e-1}if(o=o<<n-i&s,!r&&i>=t)throw new Error(\"Excess padding\");if(!r&&o>0)throw new Error(`Non-zero padding: ${o}`);return r&&i>0&&c.push(o>>>0),c}function Nb(e){vb(e);return{encode:t=>{if(!pb(t))throw new Error(\"radix.encode input should be Uint8Array\");return _b(Array.from(t),256,e)},decode:t=>(Sb(\"radix.decode\",t),Uint8Array.from(_b(t,e,256)))}}function Ob(e,t=!1){if(vb(e),e<=0||e>32)throw new Error(\"radix2: bits should be in (0..32]\");if(Bb(8,e)>32||Bb(e,8)>32)throw new Error(\"radix2: carry overflow\");return{encode:n=>{if(!pb(n))throw new Error(\"radix2.encode input should be Uint8Array\");return Pb(Array.from(n),8,e,!t)},decode:n=>(Sb(\"radix2.decode\",n),Uint8Array.from(Pb(n,e,8,t)))}}function Ub(e){return yb(e),function(...t){try{return e.apply(null,t)}catch(e){}}}function Mb(e,t){return vb(e),yb(t),{encode(n){if(!pb(n))throw new Error(\"checksum.encode: input should be Uint8Array\");const r=t(n).slice(0,e),o=new Uint8Array(n.length+e);return o.set(n),o.set(r,n.length),o},decode(n){if(!pb(n))throw new Error(\"checksum.decode: input should be Uint8Array\");const r=n.slice(0,-e),o=n.slice(-e),i=t(r).slice(0,e);for(let t=0;t<e;t++)if(i[t]!==o[t])throw new Error(\"Invalid checksum\");return r}}}Eb(Ob(4),xb(\"0123456789ABCDEF\"),kb(\"\")),Eb(Ob(5),xb(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\"),Ib(5),kb(\"\")),Eb(Ob(5),xb(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\"),kb(\"\")),Eb(Ob(5),xb(\"0123456789ABCDEFGHIJKLMNOPQRSTUV\"),Ib(5),kb(\"\")),Eb(Ob(5),xb(\"0123456789ABCDEFGHIJKLMNOPQRSTUV\"),kb(\"\")),Eb(Ob(5),xb(\"0123456789ABCDEFGHJKMNPQRSTVWXYZ\"),kb(\"\"),Tb(e=>e.toUpperCase().replace(/O/g,\"0\").replace(/[IL]/g,\"1\")));const zb=\"function\"==typeof Uint8Array.from([]).toBase64&&\"function\"==typeof Uint8Array.fromBase64,Lb=(e,t)=>{wb(\"base64\",e);const n=t?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/,r=t?\"base64url\":\"base64\";if(e.length>0&&!n.test(e))throw new Error(\"invalid base64\");return Uint8Array.fromBase64(e,{alphabet:r,lastChunkHandling:\"strict\"})},jb=(zb||Eb(Ob(6),xb(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"),Ib(6),kb(\"\")),Eb(Ob(6),xb(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"),kb(\"\")),zb||Eb(Ob(6),xb(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\"),Ib(6),kb(\"\")),Eb(Ob(6),xb(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\"),kb(\"\")),e=>Eb(Nb(58),xb(e),kb(\"\"))),Fb=jb(\"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\"),Db=e=>Eb(Mb(4,t=>e(e(t))),Fb),$b=Eb(xb(\"qpzry9x8gf2tvdw0s3jn54khce6mua7l\"),kb(\"\")),Kb=[996825010,642813549,513874426,1027748829,705979059];function qb(e){const t=e>>25;let n=(33554431&e)<<5;for(let e=0;e<Kb.length;e++)1==(t>>e&1)&&(n^=Kb[e]);return n}function Wb(e,t,n=1){const r=e.length;let o=1;for(let t=0;t<r;t++){const n=e.charCodeAt(t);if(n<33||n>126)throw new Error(`Invalid prefix (${e})`);o=qb(o)^n>>5}o=qb(o);for(let t=0;t<r;t++)o=qb(o)^31&e.charCodeAt(t);for(let e of t)o=qb(o)^e;for(let e=0;e<6;e++)o=qb(o);return o^=n,$b.encode(Pb([o%Rb[30]],30,5,!1))}function Vb(e){const t=\"bech32\"===e?1:734539939,n=Ob(5),r=n.decode,o=n.encode,i=Ub(r);function a(e,n,r=90){wb(\"bech32.encode prefix\",e),pb(n)&&(n=Array.from(n)),Sb(\"bech32.encode\",n);const o=e.length;if(0===o)throw new TypeError(`Invalid prefix length ${o}`);const i=o+7+n.length;if(!1!==r&&i>r)throw new TypeError(`Length ${i} exceeds limit ${r}`);const a=e.toLowerCase(),s=Wb(a,n,t);return`${a}1${$b.encode(n)}${s}`}function s(e,n=90){wb(\"bech32.decode input\",e);const r=e.length;if(r<8||!1!==n&&r>n)throw new TypeError(`invalid string length: ${r} (${e}). Expected (8..${n})`);const o=e.toLowerCase();if(e!==o&&e!==e.toUpperCase())throw new Error(\"String must be lowercase or uppercase\");const i=o.lastIndexOf(\"1\");if(0===i||-1===i)throw new Error('Letter \"1\" must be present between prefix and data only');const a=o.slice(0,i),s=o.slice(i+1);if(s.length<6)throw new Error(\"Data must be at least 6 characters long\");const c=$b.decode(s).slice(0,-6),u=Wb(a,c,t);if(!s.endsWith(u))throw new Error(`Invalid checksum in ${e}: expected \"${u}\"`);return{prefix:a,words:c}}return{encode:a,decode:s,encodeFromBytes:function(e,t){return a(e,o(t))},decodeToBytes:function(e){const{prefix:t,words:n}=s(e,!1);return{prefix:t,words:n,bytes:r(n)}},decodeUnsafe:Ub(s),fromWords:r,fromWordsUnsafe:i,toWords:o}}Vb(\"bech32\"),Vb(\"bech32m\");const Hb={encode:e=>(gb(e),e.toHex()),decode:e=>(wb(\"hex\",e),Uint8Array.fromHex(e))},Gb=(\"function\"==typeof Uint8Array.from([]).toHex&&\"function\"==typeof Uint8Array.fromHex||Eb(Ob(4),xb(\"0123456789abcdef\"),kb(\"\"),Tb(e=>{if(\"string\"!=typeof e||e.length%2!=0)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()})),BigInt(0)),Zb=BigInt(1),Yb=BigInt(2),Jb=BigInt(8);class Xb{constructor(e){this.ep=e}static fromBytes(e){Ow()}static fromHex(e){Ow()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(e){return this.ep.toAffine(e)}toHex(){return Xl(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(e){return this.assertSame(e),this.init(this.ep.add(e.ep))}subtract(e){return this.assertSame(e),this.init(this.ep.subtract(e.ep))}multiply(e){return this.init(this.ep.multiply(e))}multiplyUnsafe(e){return this.init(this.ep.multiplyUnsafe(e))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(e,t){return this.init(this.ep.precompute(e,t))}toRawBytes(){return this.toBytes()}}function Qb(e,t,n={}){if(\"function\"!=typeof t)throw new Error('\"hash\" function param is required');Nw(n,{},{adjustScalarBytes:\"function\",randomBytes:\"function\",domain:\"function\",prehash:\"function\",mapToCurve:\"function\"});const{prehash:r}=n,{BASE:o,Fp:i,Fn:a}=e,s=n.randomBytes||hd,c=n.adjustScalarBytes||(e=>e),u=n.domain||((e,t,n)=>{if(vw(n,\"phflag\"),t.length||n)throw new Error(\"Contexts/pre-hash are not supported\");return e});function l(e){return a.create(xw(e))}function d(e){const{head:n,prefix:r,scalar:i}=function(e){const n=m.secretKey;e=Tw(\"private key\",e,n);const r=Tw(\"hashed private key\",t(e),2*n),o=c(r.slice(0,n));return{head:o,prefix:r.slice(n,2*n),scalar:l(o)}}(e),a=o.multiply(i),s=a.toBytes();return{head:n,prefix:r,scalar:i,point:a,pointBytes:s}}function f(e){return d(e).pointBytes}function h(e=Uint8Array.of(),...n){const o=ld(...n);return l(t(u(o,Tw(\"context\",e),!!r)))}const p={zip215:!0};const g=i.BYTES,m={secretKey:g,publicKey:g,signature:2*g,seed:g};function y(e=s(m.seed)){return bw(e,m.seed,\"seed\")}const w={getExtendedPublicKey:d,randomSecretKey:y,isValidSecretKey:function(e){return zl(e)&&e.length===a.BYTES},isValidPublicKey:function(t,n){try{return!!e.fromBytes(t,n)}catch(e){return!1}},toMontgomery(t){const{y:n}=e.fromBytes(t),r=m.publicKey,o=32===r;if(!o&&57!==r)throw new Error(\"only defined for 25519 and 448\");const a=o?i.div(Zb+n,Zb-n):i.div(n-Zb,n+Zb);return i.toBytes(a)},toMontgomerySecret(e){const n=m.secretKey;bw(e,n);const r=t(e.subarray(0,n));return c(r).subarray(0,n)},randomPrivateKey:y,precompute:(t=8,n=e.BASE)=>n.precompute(t,!1)};return Object.freeze({keygen:function(e){const t=w.randomSecretKey(e);return{secretKey:t,publicKey:f(t)}},getPublicKey:f,sign:function(e,t,n={}){e=Tw(\"message\",e),r&&(e=r(e));const{prefix:i,scalar:s,pointBytes:c}=d(t),u=h(n.context,i,e),l=o.multiply(u).toBytes(),f=h(n.context,l,c,e),p=a.create(u+f*s);if(!a.isValid(p))throw new Error(\"sign failed: invalid s\");return bw(ld(l,a.toBytes(p)),m.signature,\"result\")},verify:function(t,n,i,a=p){const{context:s,zip215:c}=a,u=m.signature;t=Tw(\"signature\",t,u),n=Tw(\"message\",n),i=Tw(\"publicKey\",i,m.publicKey),void 0!==c&&vw(c,\"zip215\"),r&&(n=r(n));const l=u/2,d=t.subarray(0,l),f=xw(t.subarray(l,u));let g,y,w;try{g=e.fromBytes(i,c),y=e.fromBytes(d,c),w=o.multiplyUnsafe(f)}catch(e){return!1}if(!c&&g.isSmallOrder())return!1;const v=h(s,y.toBytes(),g.toBytes(),n);return y.add(g.multiplyUnsafe(v)).subtract(w).clearCofactor().is0()},utils:w,Point:e,lengths:m})}function eA(e){const{CURVE:t,curveOpts:n,hash:r,eddsaOpts:o}=function(e){const t={a:e.a,d:e.d,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},n={Fp:e.Fp,Fn:av(t.n,e.nBitLength,!0),uvRatio:e.uvRatio},r={randomBytes:e.randomBytes,adjustScalarBytes:e.adjustScalarBytes,domain:e.domain,prehash:e.prehash,mapToCurve:e.mapToCurve};return{CURVE:t,curveOpts:n,hash:e.hash,eddsaOpts:r}}(e),i=function(e,t={}){const n=kv(\"edwards\",e,t,t.FpFnLE),{Fp:r,Fn:o}=n;let i=n.CURVE;const{h:a}=i;Nw(t,{},{uvRatio:\"function\"});const s=Yb<<BigInt(8*o.BYTES)-Zb,c=e=>r.create(e),u=t.uvRatio||((e,t)=>{try{return{isValid:!0,value:r.sqrt(r.div(e,t))}}catch(e){return{isValid:!1,value:Gb}}});if(!function(e,t,n,r){const o=e.sqr(n),i=e.sqr(r),a=e.add(e.mul(t.a,o),i),s=e.add(e.ONE,e.mul(t.d,e.mul(o,i)));return e.eql(a,s)}(r,i,i.Gx,i.Gy))throw new Error(\"bad curve params: generator point\");function l(e,t,n=!1){return Bw(\"coordinate \"+e,t,n?Zb:Gb,s),t}function d(e){if(!(e instanceof p))throw new Error(\"ExtendedPoint expected\")}const f=Uw((e,t)=>{const{X:n,Y:o,Z:i}=e,a=e.is0();null==t&&(t=a?Jb:r.inv(i));const s=c(n*t),u=c(o*t),l=r.mul(i,t);if(a)return{x:Gb,y:Zb};if(l!==Zb)throw new Error(\"invZ was invalid\");return{x:s,y:u}}),h=Uw(e=>{const{a:t,d:n}=i;if(e.is0())throw new Error(\"bad point: ZERO\");const{X:r,Y:o,Z:a,T:s}=e,u=c(r*r),l=c(o*o),d=c(a*a),f=c(d*d),h=c(u*t);if(c(d*c(h+l))!==c(f+c(n*c(u*l))))throw new Error(\"bad point: equation left != right (1)\");if(c(r*o)!==c(a*s))throw new Error(\"bad point: equation left != right (2)\");return!0});class p{constructor(e,t,n,r){this.X=l(\"x\",e),this.Y=l(\"y\",t),this.Z=l(\"z\",n,!0),this.T=l(\"t\",r),Object.freeze(this)}static CURVE(){return i}static fromAffine(e){if(e instanceof p)throw new Error(\"extended point not allowed\");const{x:t,y:n}=e||{};return l(\"x\",t),l(\"y\",n),new p(t,n,Zb,c(t*n))}static fromBytes(e,t=!1){const n=r.BYTES,{a:o,d:a}=i;e=_w(bw(e,n,\"point\")),vw(t,\"zip215\");const l=_w(e),d=e[n-1];l[n-1]=-129&d;const f=xw(l),h=t?s:r.ORDER;Bw(\"point.y\",f,Gb,h);const g=c(f*f),m=c(g-Zb),y=c(a*g-o);let{isValid:w,value:v}=u(m,y);if(!w)throw new Error(\"bad point: invalid y coordinate\");const b=(v&Zb)===Zb,A=!!(128&d);if(!t&&v===Gb&&A)throw new Error(\"bad point: x=0 and x_0=1\");return A!==b&&(v=c(-v)),p.fromAffine({x:v,y:f})}static fromHex(e,t=!1){return p.fromBytes(Tw(\"point\",e),t)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return g.createCache(this,e),t||this.multiply(Yb),this}assertValidity(){h(this)}equals(e){d(e);const{X:t,Y:n,Z:r}=this,{X:o,Y:i,Z:a}=e,s=c(t*a),u=c(o*r),l=c(n*a),f=c(i*r);return s===u&&l===f}is0(){return this.equals(p.ZERO)}negate(){return new p(c(-this.X),this.Y,this.Z,c(-this.T))}double(){const{a:e}=i,{X:t,Y:n,Z:r}=this,o=c(t*t),a=c(n*n),s=c(Yb*c(r*r)),u=c(e*o),l=t+n,d=c(c(l*l)-o-a),f=u+a,h=f-s,g=u-a,m=c(d*h),y=c(f*g),w=c(d*g),v=c(h*f);return new p(m,y,v,w)}add(e){d(e);const{a:t,d:n}=i,{X:r,Y:o,Z:a,T:s}=this,{X:u,Y:l,Z:f,T:h}=e,g=c(r*u),m=c(o*l),y=c(s*n*h),w=c(a*f),v=c((r+o)*(u+l)-g-m),b=w-y,A=w+y,S=c(m-t*g),E=c(v*b),x=c(A*S),k=c(v*S),I=c(b*A);return new p(E,x,I,k)}subtract(e){return this.add(e.negate())}multiply(e){if(!o.isValidNot0(e))throw new Error(\"invalid scalar: expected 1 <= sc < curve.n\");const{p:t,f:n}=g.cached(this,e,e=>fv(p,e));return fv(p,[t,n])[0]}multiplyUnsafe(e,t=p.ZERO){if(!o.isValid(e))throw new Error(\"invalid scalar: expected 0 <= sc < curve.n\");return e===Gb?p.ZERO:this.is0()||e===Zb?this:g.unsafe(this,e,e=>fv(p,e),t)}isSmallOrder(){return this.multiplyUnsafe(a).is0()}isTorsionFree(){return g.unsafe(this,i.n).is0()}toAffine(e){return f(this,e)}clearCofactor(){return a===Zb?this:this.multiplyUnsafe(a)}toBytes(){const{x:e,y:t}=this.toAffine(),n=r.toBytes(t);return n[n.length-1]|=e&Zb?128:0,n}toHex(){return Xl(this.toBytes())}toString(){return`<Point ${this.is0()?\"ZERO\":this.toHex()}>`}get ex(){return this.X}get ey(){return this.Y}get ez(){return this.Z}get et(){return this.T}static normalizeZ(e){return fv(p,e)}static msm(e,t){return Ev(p,o,e,t)}_setWindowSize(e){this.precompute(e)}toRawBytes(){return this.toBytes()}}p.BASE=new p(i.Gx,i.Gy,Zb,c(i.Gx*i.Gy)),p.ZERO=new p(Gb,Zb,Zb,Gb),p.Fp=r,p.Fn=o;const g=new Sv(p,o.BITS);return p.BASE.precompute(8),p}(t,n);return function(e,t){const n=t.Point;return Object.assign({},t,{ExtendedPoint:n,CURVE:e,nBitLength:n.Fn.BITS,nByteLength:n.Fn.BYTES})}(e,Qb(i,r,o))}const tA=BigInt(0),nA=BigInt(1),rA=BigInt(2),oA=(BigInt(3),BigInt(5)),iA=BigInt(8),aA=BigInt(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed\"),sA={p:aA,n:BigInt(\"0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed\"),h:iA,a:BigInt(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec\"),d:BigInt(\"0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3\"),Gx:BigInt(\"0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a\"),Gy:BigInt(\"0x6666666666666666666666666666666666666666666666666666666666666658\")};function cA(e){const t=BigInt(10),n=BigInt(20),r=BigInt(40),o=BigInt(80),i=aA,a=e*e%i*e%i,s=Hw(a,rA,i)*a%i,c=Hw(s,nA,i)*e%i,u=Hw(c,oA,i)*c%i,l=Hw(u,t,i)*u%i,d=Hw(l,n,i)*l%i,f=Hw(d,r,i)*d%i,h=Hw(f,o,i)*f%i,p=Hw(h,o,i)*f%i,g=Hw(p,t,i)*u%i;return{pow_p_5_8:Hw(g,rA,i)*e%i,b2:a}}function uA(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}const lA=BigInt(\"19681161376707505956807079304988542015446066515923890162744021073123829784752\");function dA(e,t){const n=aA,r=Vw(t*t*t,n),o=Vw(r*r*t,n);let i=Vw(e*r*cA(e*o).pow_p_5_8,n);const a=Vw(t*i*i,n),s=i,c=Vw(i*lA,n),u=a===e,l=a===Vw(-e,n),d=a===Vw(-e*lA,n);return u&&(i=s),(l||d)&&(i=c),ev(i,n)&&(i=Vw(-i,n)),{isValid:u||l,value:i}}const fA=av(sA.p,{isLE:!0}),hA=av(sA.n,{isLE:!0}),pA={...sA,Fp:fA,hash:pw,adjustScalarBytes:uA,uvRatio:dA},gA=eA(pA);const mA=lA,yA=BigInt(\"25063068953384623474111414158702152701244531502492656460079210482610430750235\"),wA=BigInt(\"54469307008909316920995813868745141605393597292927456921205312896311721017578\"),vA=BigInt(\"1159843021668779879193775521855586647937357759715417654439879720876111806838\"),bA=BigInt(\"40440834346308536858101042469323190826248399146238708352240133220865137265952\"),AA=e=>dA(nA,e),SA=BigInt(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\"),EA=e=>gA.Point.Fp.create(xw(e)&SA);function xA(e){const{d:t}=sA,n=aA,r=e=>fA.create(e),o=r(mA*e*e),i=r((o+nA)*vA);let a=BigInt(-1);const s=r((a-t*o)*r(o+t));let{isValid:c,value:u}=dA(i,s),l=r(u*e);ev(l,n)||(l=r(-l)),c||(u=l),c||(a=o);const d=r(a*(o-nA)*bA-s),f=u*u,h=r((u+u)*s),p=r(d*yA),g=r(nA-f),m=r(nA+f);return new gA.Point(r(h*m),r(g*p),r(p*m),r(h*g))}function kA(e){jl(e,64);const t=xA(EA(e.subarray(0,32))),n=xA(EA(e.subarray(32,64)));return new IA(t.add(n))}class IA extends Xb{constructor(e){super(e)}static fromAffine(e){return new IA(gA.Point.fromAffine(e))}assertSame(e){if(!(e instanceof IA))throw new Error(\"RistrettoPoint expected\")}init(e){return new IA(e)}static hashToCurve(e){return kA(Tw(\"ristrettoHash\",e,64))}static fromBytes(e){jl(e,32);const{a:t,d:n}=sA,r=aA,o=e=>fA.create(e),i=EA(e);if(!function(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return 0===n}(fA.toBytes(i),e)||ev(i,r))throw new Error(\"invalid ristretto255 encoding 1\");const a=o(i*i),s=o(nA+t*a),c=o(nA-t*a),u=o(s*s),l=o(c*c),d=o(t*n*u-l),{isValid:f,value:h}=AA(o(d*l)),p=o(h*c),g=o(h*p*d);let m=o((i+i)*p);ev(m,r)&&(m=o(-m));const y=o(s*g),w=o(m*y);if(!f||ev(w,r)||y===tA)throw new Error(\"invalid ristretto255 encoding 2\");return new IA(new gA.Point(m,y,nA,w))}static fromHex(e){return IA.fromBytes(Tw(\"ristrettoHex\",e,32))}static msm(e,t){return Ev(IA,gA.Point.Fn,e,t)}toBytes(){let{X:e,Y:t,Z:n,T:r}=this.ep;const o=aA,i=e=>fA.create(e),a=i(i(n+t)*i(n-t)),s=i(e*t),c=i(s*s),{value:u}=AA(i(a*c)),l=i(u*a),d=i(u*s),f=i(l*d*r);let h;if(ev(r*f,o)){let n=i(t*mA),r=i(e*mA);e=n,t=r,h=i(l*wA)}else h=d;ev(e*f,o)&&(t=i(-t));let p=i((n-t)*h);return ev(p,o)&&(p=i(-p)),fA.toBytes(p)}equals(e){this.assertSame(e);const{X:t,Y:n}=this.ep,{X:r,Y:o}=e.ep,i=e=>fA.create(e),a=i(t*o)===i(n*r),s=i(n*o)===i(t*r);return a||s}is0(){return this.equals(IA.ZERO)}}IA.BASE=new IA(gA.Point.BASE),IA.ZERO=new IA(gA.Point.ZERO),IA.Fp=fA,IA.Fn=hA;const TA=gA.CURVE,_A=\"ed25519\",CA=Zy(\"ed25519 seed\"),BA=e=>!0,RA=!1,PA=33,NA=(e,t)=>{const n=gA.getPublicKey(e);return Jy([new Uint8Array([0]),n])},OA=(e,t)=>{throw new Error(\"Ed25519 does not support public key derivation.\")},UA=e=>e,MA=e=>e,zA=32,LA=\"slip10\",jA=33;const FA=gA.CURVE,DA=\"ed25519Bip32\",$A=Zy(\"\");function KA(e,t){const n=e[t];return ky(void 0!==n,\"Private key is too short.\"),n}const qA=e=>!(7&KA(e,0))&&(!(128&KA(e,31))&&!(64&~KA(e,31))),WA=!0,VA=32,HA=e=>{return My(t=Vy(Uint8Array.from(e).reverse())),BigInt(zy(t));var t},GA=e=>{const t=Vw(HA(e),FA.n);return gA.ExtendedPoint.BASE.multiply(t).toRawBytes()},ZA=async(e,t)=>GA(e.slice(0,32)),YA=(e,t)=>gA.ExtendedPoint.fromHex(Ly(Vy(e))).add(gA.ExtendedPoint.fromHex(Ly(Vy(t)))).toRawBytes(),JA=e=>e,XA=e=>e,QA=64,eS=\"cip3\",tS=32,nS={secp256k1:o,ed25519:e,ed25519Bip32:t};function rS(e){return nS[e]}function oS(e){return sS(e),`${iS(e)}'`}function iS(e){return sS(e),`bip32:${e}`}function aS(e){if(\"number\"==typeof e)return iS(e);if(!e||!Number.isInteger(e.index)||\"boolean\"!=typeof e.hardened)throw new Error(\"Invalid BIP-32 index: Must be an object containing the index and whether it is hardened.\");return e.hardened?oS(e.index):iS(e.index)}function sS(e){if(!(fS(t=e)&&t<=Ty))throw new Error(\"Invalid BIP-32 index: Must be a non-negative integer.\");var t}function cS(e){return e.endsWith(\"'\")}function uS(e){return e instanceof Uint8Array?e:Gy(e)}function lS(e){if(void 0!==e)return uS(e)}function dS(e,t){if(e.length!==t)return!1;for(const t of e)if(0!==t)return!0;return!1}function fS(e){return\"number\"==typeof e&&Number.isInteger(e)&&e>=0}function hS(e,t){if(e instanceof Uint8Array)return gS(e,t),e;if(\"string\"==typeof e){const n=Gy(e);return gS(n,t),n}throw new Error(\"Invalid value: Expected an instance of Uint8Array or hexadecimal string.\")}function pS(e,t){if(e instanceof Uint8Array)return ky(e.length===t,`Invalid value: Must be a ${t}-byte byte array.`),e;if(\"string\"==typeof e)return pS(Gy(e),t);throw new Error(\"Invalid value: Expected an instance of Uint8Array or hexadecimal string.\")}function gS(e,t){if(!dS(e,t))throw new Error(`Invalid value: Must be a non-zero ${t}-byte byte array.`)}const mS=(e,t)=>{if(!dS(e,t))throw new Error(`Invalid public key: The key must be a ${t}-byte, non-zero byte array.`);return Xy(fb(hb(e))).getUint32(0,!1)};function yS(e){if(!e||\"string\"!=typeof e)throw new Error(\"Invalid curve: Must specify a curve.\");if(!Object.keys(nS).includes(e))throw new Error(`Invalid curve: Only the following curves are supported: ${Object.keys(nS).join(\", \")}.`)}function wS(e,t=!1){const n=new Uint8Array(4);return Xy(n).setUint32(0,e,t),n}const vS=Gv.CURVE,bS=\"secp256k1\",AS=Zy(\"Bitcoin seed\"),SS=!0,ES=65,xS=e=>Gv.utils.isValidPrivateKey(e),kS=(e,t=!1)=>Gv.getPublicKey(e,t),IS=(e,t)=>{ky(dS(t,32),\"Invalid tweak: Tweak must be a non-zero 32-byte Uint8Array.\");const n=Gv.ProjectivePoint.fromHex(e).add(Gv.ProjectivePoint.fromPrivateKey(t));return n.assertValidity(),n.toRawBytes(!1)},TS=e=>Gv.ProjectivePoint.fromHex(e).toRawBytes(!0),_S=e=>Gv.ProjectivePoint.fromHex(e).toRawBytes(!1),CS=32,BS=\"slip10\",RS=33,PS=76067358,NS=76066276,OS=e=>{const t=(e=>{const t=Db(hb);try{return t.decode(e)}catch{throw new Error(\"Invalid extended key: Value is not base58-encoded, or the checksum is invalid.\")}})(e);if(78!==t.length)throw new Error(`Invalid extended key: Expected a length of 78, got ${t.length}.`);const n=Xy(t),r=n.getUint32(0,!1),o=n.getUint8(4);jE(o);const i=n.getUint32(5,!1),a=n.getUint32(9,!1),s=t.slice(13,45);if(!dS(s,32))throw new Error(\"Invalid extended key: Chain code must be a 32-byte non-zero byte array.\");const c=t.slice(45,78);if(!dS(c,33))throw new Error(\"Invalid extended key: Key must be a 33-byte non-zero byte array.\");const u=Xy(c);if(r===PS){if(2!==u.getUint8(0)&&3!==u.getUint8(0))throw new Error(\"Invalid extended key: Public key must start with 0x02 or 0x03.\");return{version:r,depth:o,parentFingerprint:i,index:a,chainCode:s,publicKey:_S(c)}}if(r===NS){if(0!==u.getUint8(0))throw new Error(\"Invalid extended key: Private key must start with 0x00.\");return{version:r,depth:o,parentFingerprint:i,index:a,chainCode:s,privateKey:c.slice(1)}}throw new Error(\"Invalid extended key: Expected a public (xpub) or private key (xprv) version.\")},US=e=>{const{version:t,depth:n,parentFingerprint:r,index:o,chainCode:i}=e,a=new Uint8Array(78),s=Xy(a);if(s.setUint32(0,t,!1),s.setUint8(4,n),s.setUint32(5,r,!1),s.setUint32(9,o,!1),a.set(i,13),e.version===PS){const{publicKey:t}=e,n=TS(t);a.set(n,45)}if(e.version===NS){const{privateKey:t}=e;a.set(t,46)}return c=a,Db(hb).encode(c);var c};var MS,zS=function(e,t,n,r,o){if(\"m\"===r)throw new TypeError(\"Private method is not writable\");if(\"a\"===r&&!o)throw new TypeError(\"Private accessor was defined without a setter\");if(\"function\"==typeof t?e!==t||!o:!t.has(e))throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");return\"a\"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},LS=function(e,t,n,r){if(\"a\"===n&&!r)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?r:\"a\"===n?r.call(e):r?r.value:t.get(e)};class jS{constructor(e,t){MS.set(this,void 0),zS(this,MS,e,\"f\"),this.coin_type=t,this.path=function(e){return`m / ${_y} / ${oS(e)}`}(t),Object.freeze(this)}static async fromJSON(e,t){DS(t),FS(e.depth);const n=await LE.fromExtendedKey({depth:e.depth,index:e.index,parentFingerprint:e.parentFingerprint,chainCode:uS(e.chainCode),privateKey:lS(e.privateKey),publicKey:uS(e.publicKey)});return new jS(n,t)}static async fromDerivationPath(e){FS(e.length-1);const t=await LE.fromDerivationPath({derivationPath:e}),n=e[2].split(\":\")[1]?.replace(\"'\",\"\");ky(n,\"Invalid derivation path.\");const r=Number.parseInt(n,10);return new jS(t,r)}static async fromNode(e,t){if(!(e instanceof LE))throw new Error(\"Invalid node: Expected an instance of BIP44Node.\");return DS(t),FS(e.depth),Promise.resolve(new jS(e,t))}get depth(){return LS(this,MS,\"f\").depth}get privateKeyBytes(){return LS(this,MS,\"f\").privateKeyBytes}get publicKeyBytes(){return LS(this,MS,\"f\").publicKeyBytes}get chainCodeBytes(){return LS(this,MS,\"f\").chainCodeBytes}get privateKey(){return LS(this,MS,\"f\").privateKey}get publicKey(){return LS(this,MS,\"f\").publicKey}get compressedPublicKey(){return LS(this,MS,\"f\").compressedPublicKey}get compressedPublicKeyBytes(){return LS(this,MS,\"f\").compressedPublicKeyBytes}get chainCode(){return LS(this,MS,\"f\").chainCode}get address(){return LS(this,MS,\"f\").address}get masterFingerprint(){return LS(this,MS,\"f\").masterFingerprint}get parentFingerprint(){return LS(this,MS,\"f\").parentFingerprint}get fingerprint(){return LS(this,MS,\"f\").fingerprint}get index(){return LS(this,MS,\"f\").index}get curve(){return LS(this,MS,\"f\").curve}get extendedKey(){return LS(this,MS,\"f\").extendedKey}async deriveBIP44AddressKey({account:e=0,change:t=0,address_index:n}){return await LS(this,MS,\"f\").derive(function({account:e=0,change:t=0,address_index:n}){return[oS(e),aS(t),aS(n)]}({account:e,change:t,address_index:n}))}toJSON(){return{...LS(this,MS,\"f\").toJSON(),coin_type:this.coin_type,path:this.path}}}function FS(e){if(2!==e)throw new Error(`Invalid depth: Coin type nodes must be of depth 2. Received: \"${e}\"`)}function DS(e){if(\"number\"!=typeof e||!Number.isInteger(e)||e<0)throw new Error(\"Invalid coin type: The specified coin type must be a non-negative integer number.\")}MS=new WeakMap;const $S=pw;async function KS({path:e,node:t,curve:n},r){GS(t);const{childIndex:o,isHardened:i}=ZS(e,t,n),a={chainCode:t.chainCodeBytes,childIndex:o,isHardened:i,depth:t.depth,parentFingerprint:t.fingerprint,masterFingerprint:t.masterFingerprint,curve:n};if(t.privateKeyBytes){const e=await WS({privateKey:t.privateKeyBytes,childIndex:o,isHardened:i,curve:n}),s=HS({chainCode:t.chainCodeBytes,extension:e});return await qS({privateKey:t.privateKeyBytes,entropy:s,...a},r)}const s=VS({parentPublicKey:t.compressedPublicKeyBytes,childIndex:o}),c=HS({chainCode:t.chainCodeBytes,extension:s});return await qS({publicKey:t.compressedPublicKeyBytes,entropy:c,...a},r)}async function qS(e,t){const{privateKey:n,publicKey:r,entropy:o,childIndex:i,isHardened:a,depth:s,parentFingerprint:c,masterFingerprint:u,curve:l}=e;try{return n?await async function({entropy:e,privateKey:t,depth:n,masterFingerprint:r,parentFingerprint:o,childIndex:i,isHardened:a,curve:s}){const c=i+(a?Oy:0),{privateKey:u,chainCode:l}=await async function({privateKey:e,entropy:t,curve:n}){const r=t.slice(0,32),o=t.slice(32);if(\"ed25519\"===n.name){return{privateKey:r,publicKey:await n.getPublicKey(r),chainCode:o}}const i=function(e,t,n){ky(dS(t,32),\"Invalid tweak: Tweak must be a non-zero 32-byte Uint8Array.\");const r=Hy(e),o=Hy(t);if(o>=n.curve.n)throw new Error(\"Invalid tweak: Tweak is larger than the curve order.\");const i=Vw(r+o,n.curve.n),a=Gy(i.toString(16).padStart(64,\"0\"));if(!n.isValidPrivateKey(a))throw new Error(\"Invalid private key or tweak: The resulting private key is invalid.\");return a}(e,r,n),a=await n.getPublicKey(i);return{privateKey:i,publicKey:a,chainCode:o}}({privateKey:t,entropy:e,curve:s});return await PE.fromExtendedKey({privateKey:u,chainCode:l,depth:n+1,masterFingerprint:r,parentFingerprint:o,index:c,curve:s.name})}({entropy:o,privateKey:n,depth:s,masterFingerprint:u,parentFingerprint:c,childIndex:i,isHardened:a,curve:l}):await async function({entropy:e,publicKey:t,depth:n,masterFingerprint:r,parentFingerprint:o,childIndex:i,curve:a}){const{publicKey:s,chainCode:c}=function({publicKey:e,entropy:t,curve:n}){const r=t.slice(0,32),o=t.slice(32),i=n.publicAdd(e,r);return{publicKey:i,chainCode:o}}({publicKey:t,entropy:e,curve:a});return await PE.fromExtendedKey({publicKey:s,chainCode:c,depth:n+1,masterFingerprint:r,parentFingerprint:o,index:i,curve:a.name})}({entropy:o,publicKey:r,depth:s,masterFingerprint:u,parentFingerprint:c,childIndex:i,curve:l})}catch(n){return await qS(await t(n,e),t)}}async function WS({privateKey:e,childIndex:t,isHardened:n,curve:r}){if(n)return Jy([new Uint8Array([0]),e,wS(t+Oy)]);return VS({parentPublicKey:await r.getPublicKey(e,!0),childIndex:t})}function VS({parentPublicKey:e,childIndex:t}){return Jy([e,wS(t)])}function HS({chainCode:e,extension:t}){return mw($S,e,t)}function GS(e){ky(e,\"Invalid parameters: Must specify a node to derive from.\")}function ZS(e,t,n){!function(e,t,n){ky(\"string\"==typeof e,\"Invalid path: Must be a string.\");const r=e.endsWith(\"'\");ky(!r||t.privateKey,\"Invalid parameters: Cannot derive hardened child keys without a private key.\"),ky(r||n.deriveUnhardenedKeys,`Invalid path: Cannot derive unhardened child keys with ${n.name}.`)}(e,t,n);const r=e.split(\"'\")[0];ky(r);const o=parseInt(r,10);if(!Cy.test(r)||!Number.isInteger(o)||o<0||o>=Oy)throw new Error(`Invalid path: The index must be a non-negative decimal integer less than ${Oy}.`);return{childIndex:o,isHardened:e.includes(\"'\")}}function YS(e){ky(e instanceof Uint8Array&&dS(e,Iy),\"Invalid key: The key must be a 32-byte, non-zero Uint8Array.\");return JS(kS(e,!1))}function JS(e){return ky(e instanceof Uint8Array&&dS(e,ES),\"Invalid key: The key must be a 65-byte, non-zero Uint8Array.\"),Bd(e.slice(1)).slice(-20)}async function XS(e){return ky(\"secp256k1\"===e.curve.name,\"Invalid curve: Only secp256k1 is supported by BIP-32.\"),KS(e,QS)}async function QS(e,t){const{childIndex:n,privateKey:r,publicKey:o,isHardened:i,curve:a,chainCode:s}=t;if(sS(n+1),r){const e=HS({chainCode:s,extension:await WS({privateKey:r,childIndex:n+1,isHardened:i,curve:a})});return{...t,childIndex:n+1,entropy:e}}const c=HS({chainCode:s,extension:VS({parentPublicKey:o,childIndex:n+1})});return{...t,childIndex:n+1,entropy:c}}var eE=n(2091);function tE(e,t,n,r){Fl(e);const o=function(e,t){if(void 0!==t&&\"[object Object]\"!=={}.toString.call(t))throw new Error(\"options should be object or undefined\");return Object.assign(e,t)}({dkLen:32,asyncTick:10},r),{c:i,dkLen:a,asyncTick:s}=o;if(Ll(i),Ll(a),Ll(s),i<1)throw new Error(\"iterations (c) should be >= 1\");const c=ud(t),u=ud(n),l=new Uint8Array(a),d=mw.create(e,c),f=d._cloneInto().update(u);return{c:i,dkLen:a,asyncTick:s,DK:l,PRF:d,PRFSalt:f}}function nE(e,t,n,r,o){return e.destroy(),t.destroy(),r&&r.destroy(),Kl(o),n}function rE(e){return`bip39:${e.toLowerCase().trim()}`}async function oE({path:e,curve:t}){switch(t.masterNodeGenerationSpec){case\"slip10\":return iE(await(0,eE.nl)(e,Zv.p),t);case\"cip3\":return aE((0,eE.x2)(e,Zv.p),t);default:throw new Error(\"Unsupported master node generation spec.\")}}async function iE(e,t){ky(e.length>=16&&e.length<=64,\"Invalid seed: The seed must be between 16 and 64 bytes long.\");const n=mw($S,t.secret,e),r=n.slice(0,Iy),o=n.slice(Iy);ky(t.isValidPrivateKey(r),\"Invalid private key: The private key must greater than 0 and less than the curve order.\");const i=mS(await t.getPublicKey(r,!0),t.compressedPublicKeyLength);return PE.fromExtendedKey({privateKey:r,chainCode:o,masterFingerprint:i,depth:0,parentFingerprint:0,index:0,curve:t.name})}async function aE(e,t){ky(e.length>=16&&e.length<=64,\"Invalid entropy: The entropy must be between 16 and 64 bytes long.\");const n=function(e,t,n,r){const{c:o,dkLen:i,DK:a,PRF:s,PRFSalt:c}=tE(e,t,n,r);let u;const l=new Uint8Array(4),d=ql(l),f=new Uint8Array(s.outputLen);for(let e=1,t=0;t<i;e++,t+=s.outputLen){const n=a.subarray(t,t+s.outputLen);d.setInt32(0,e,!1),(u=c._cloneInto(u)).update(l).digestInto(f),n.set(f.subarray(0,n.length));for(let e=1;e<o;e++){s._cloneInto(u).update(f).digestInto(f);for(let e=0;e<n.length;e++)n[e]^=f[e]}}return nE(s,c,a,u,f)}($S,t.secret,e,{c:4096,dkLen:96});n[0]&=248,n[31]&=31,n[31]|=64;const r=n.slice(0,t.privateKeyLength),o=n.slice(t.privateKeyLength);ky(t.isValidPrivateKey(r),\"Invalid private key.\");const i=mS(await t.getPublicKey(r),t.compressedPublicKeyLength);return PE.fromExtendedKey({privateKey:r,chainCode:o,masterFingerprint:i,depth:0,parentFingerprint:0,index:0,curve:t.name})}const sE=e=>e.slice().reverse(),cE=e=>{const t=Vy(sE(e));return BigInt(t)},uE=e=>{const t=e.toString(16);return sE(Gy(t))},lE=e=>Jy([e,new Uint8Array(Math.max(32-e.length,0)).fill(0)]),dE=e=>{const t=cE(e.slice(0,28))*BigInt(8);return lE(uE(t))},fE=e=>lE(uE(Vw(cE(e),BigInt(2)**BigInt(256)))),hE=(e,t)=>{const n=cE(e)+cE(t);return lE(uE(n)).slice(0,32)},pE=(e,t,n)=>Jy([new Uint8Array([e]),t,wS(n,!0)]),gE=2,mE=0,yE=async({parentNode:e,childIndex:t,isHardened:n})=>{const r=n?pE(mE,e.privateKeyBytes,t+Oy):pE(gE,e.publicKeyBytes,t),o=HS({chainCode:e.chainCodeBytes,extension:r}),i=o.subarray(0,32),a=o.subarray(32),s=e.privateKeyBytes.subarray(0,32),c=e.privateKeyBytes.subarray(32);return Jy([hE(dE(i),s),hE(a,c)])},wE=3,vE=1,bE=async({parentNode:e,childIndex:t,isHardened:n})=>{const r=n?pE(vE,e.privateKeyBytes,t+Oy):pE(wE,e.publicKeyBytes,t);return HS({chainCode:e.chainCodeBytes,extension:r}).subarray(32)},AE=2,SE=async({parentNode:e,childIndex:t,curve:n})=>{const r=pE(AE,e.publicKeyBytes,t),o=HS({chainCode:e.chainCodeBytes,extension:r}).slice(0,32),i=await n.getPublicKey(dE(o));return n.publicAdd(e.publicKeyBytes,i)};async function EE(e){const{curve:t,node:n,path:r}=e;GS(n);const{childIndex:o,isHardened:i}=ZS(r,n,t);if(\"ed25519Bip32\"!==t.name||!n)throw new Error(\"Unsupported curve: Only ed25519Bip32 is supported by CIP3.\");const a=o+(i?Oy:0),{privateKeyBytes:s,chainCodeBytes:c,publicKeyBytes:u,masterFingerprint:l,depth:d,fingerprint:f}=n;if(s){const e={privateKeyBytes:s,chainCodeBytes:c,publicKeyBytes:u},n=await yE({parentNode:e,childIndex:o,isHardened:i}),r=await bE({parentNode:e,childIndex:o,isHardened:i});return PE.fromExtendedKey({privateKey:Vy(n),chainCode:Vy(r),masterFingerprint:l,depth:d+1,parentFingerprint:f,index:a,curve:t.name})}ky(!i,\"Invalid parameters: Cannot derive hardened child keys without a private key.\");const h={chainCodeBytes:c,publicKeyBytes:u},p=await SE({parentNode:h,childIndex:o,isHardened:!1,curve:t}),g=await bE({parentNode:h,childIndex:o,isHardened:!1});return PE.fromExtendedKey({publicKey:Vy(p),chainCode:Vy(g),masterFingerprint:l,depth:d+1,parentFingerprint:f,index:a,curve:t.name})}async function xE(e){return await KS(e,kE)}async function kE(e,t){const{curve:n,isHardened:r,childIndex:o,entropy:i,chainCode:a}=t;if(\"ed25519\"===n.name)throw e;const s=r?o+Oy:o,c=HS({chainCode:a,extension:Jy([1,i.slice(32,64),wS(s)])});return{...t,entropy:c}}const IE={bip32:i,bip39:a,slip10:c,cip3:s};async function TE(e){const{path:t,depth:n=t.length}=e,r=\"node\"in e?e.node:void 0,o=\"curve\"in e?e.curve:r?.curve;if(r&&!(r instanceof PE)&&!(r instanceof LE)&&!(r instanceof jS))throw new Error(\"Invalid arguments: Node must be a SLIP-10 node or a BIP-44 node when provided.\");if(!o)throw new Error(\"Invalid arguments: Must specify either a parent node or curve.\");return function(e,t,n){if(0===e.length)throw new Error(\"Invalid HD path segment: The segment must not be empty.\");let r=!1;if(e.forEach((e,t)=>{if(0===t){if(r=e instanceof Uint8Array||Ny.test(e),!(e instanceof Uint8Array||r||By.test(e)||Ry.test(e)||Py.test(e)))throw _E()}else if(e instanceof Uint8Array||!By.test(e)&&!Ry.test(e)&&!Py.test(e))throw _E()}),0===n&&(!r||1!==e.length))throw new Error(`Invalid HD path segment: The segment must consist of a single BIP-39 node for depths of 0. Received: \"${String(e)}\".`);if(!t&&!r)throw new Error(\"Invalid derivation parameters: Must specify parent key if the first node of the path segment is not a BIP-39 node.\");if(t&&r)throw new Error(\"Invalid derivation parameters: May not specify parent key if the path segment starts with a BIP-39 node.\");const o=r?e.slice(1):e;if(o.length>0){const e=o[0]?.split(\":\")[0];ky(e),ky(o.every(t=>t.startsWith(`${e}:`)),\"Invalid HD path segment: Cannot mix 'bip32' and 'slip10' path segments.\")}}(t,Boolean(r?.privateKey)||Boolean(r?.publicKey),n),await t.reduce(async(e,t,n)=>{const r=await e;if(\"string\"==typeof t){const[e,n]=t.split(\":\");ky(e),ky(n),ky(function(e){return e in IE}(e),`Unknown derivation type: \"${e}\".`);const i=IE[e];return await i.deriveChildKey({path:n,node:r,curve:rS(o)})}return ky(0===n,_E()),await IE.bip39.deriveChildKey({path:t,node:r,curve:rS(o)})},Promise.resolve(r))}function _E(){return new Error(\"Invalid HD path segment: The path segment is malformed.\")}var CE,BE,RE=function(e,t,n,r){if(\"a\"===n&&!r)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?r:\"a\"===n?r.call(e):r?r.value:t.get(e)};class PE{constructor({depth:e,masterFingerprint:t,parentFingerprint:n,index:r,chainCode:o,privateKey:i,publicKey:a,curve:s},c){ky(c===RE(PE,CE,\"f\",BE),\"SLIP10Node can only be constructed using `SLIP10Node.fromJSON`, `SLIP10Node.fromExtendedKey`, or `SLIP10Node.fromDerivationPath`.\"),this.depth=e,this.masterFingerprint=t,this.parentFingerprint=n,this.index=r,this.chainCodeBytes=o,this.privateKeyBytes=i,this.publicKeyBytes=a,this.curve=s,Object.freeze(this)}static async fromJSON(e){return PE.fromExtendedKey(e)}static async fromExtendedKey({depth:e,masterFingerprint:t,parentFingerprint:n,index:r,privateKey:o,publicKey:i,chainCode:a,curve:s}){const c=hS(a,Iy);yS(s),NE(e),sS(r),function(e,t){if(0===t&&0!==e)throw new Error(`Invalid index: The index of the root node must be 0. Received: \"${String(e)}\".`)}(r,e),function(e,t){if(!fS(e))throw new Error(`Invalid parent fingerprint: The fingerprint must be a positive integer. Received: \"${String(e)}\".`);if(0===t&&0!==e)throw new Error(`Invalid parent fingerprint: The fingerprint of the root node must be 0. Received: \"${String(e)}\".`);if(t>0&&0===e)throw new Error(`Invalid parent fingerprint: The fingerprint of a child node must not be 0. Received: \"${String(e)}\".`)}(n,e),function(e,t,n){if(!e)return;if(n>=2&&e===t)throw new Error(`Invalid parent fingerprint: The fingerprint of a child node cannot be equal to the master fingerprint. Received: \"${String(t)}\".`)}(t,n,e);const u=rS(s);if(o){const i=pS(o,u.privateKeyLength);return ky(u.isValidPrivateKey(i),`Invalid private key: Value is not a valid ${s} private key.`),new PE({depth:e,masterFingerprint:t,parentFingerprint:n,index:r,chainCode:c,privateKey:i,publicKey:await u.getPublicKey(i),curve:s},RE(this,CE,\"f\",BE))}if(i){const o=hS(i,u.publicKeyLength);return new PE({depth:e,masterFingerprint:t,parentFingerprint:n,index:r,chainCode:c,publicKey:o,curve:s},RE(this,CE,\"f\",BE))}throw new Error(\"Invalid options: Must provide either a private key or a public key.\")}static async fromDerivationPath({derivationPath:e,curve:t}){if(yS(t),!e)throw new Error(\"Invalid options: Must provide a derivation path.\");if(0===e.length)throw new Error(\"Invalid derivation path: May not specify an empty derivation path.\");return await TE({path:e,depth:e.length-1,curve:t})}get chainCode(){return Vy(this.chainCodeBytes)}get privateKey(){if(this.privateKeyBytes)return Vy(this.privateKeyBytes)}get publicKey(){return Vy(this.publicKeyBytes)}get compressedPublicKeyBytes(){return rS(this.curve).compressPublicKey(this.publicKeyBytes)}get compressedPublicKey(){return Vy(this.compressedPublicKeyBytes)}get address(){if(\"secp256k1\"!==this.curve)throw new Error(\"Unable to get address for this node: Only secp256k1 is supported.\");return Vy(JS(this.publicKeyBytes))}get fingerprint(){return mS(this.compressedPublicKeyBytes,rS(this.curve).compressedPublicKeyLength)}neuter(){return new PE({depth:this.depth,masterFingerprint:this.masterFingerprint,parentFingerprint:this.parentFingerprint,index:this.index,chainCode:this.chainCodeBytes,publicKey:this.publicKeyBytes,curve:this.curve},RE(PE,CE,\"f\",BE))}async derive(e){return await async function({path:e,node:t}){if(0===e.length)throw new Error(\"Invalid HD tree derivation path: Deriving a path of length 0 is not defined.\");const n=t.depth+e.length;return NE(n),await TE({path:e,node:t,depth:n})}({path:e,node:this})}toJSON(){return{depth:this.depth,masterFingerprint:this.masterFingerprint,parentFingerprint:this.parentFingerprint,index:this.index,curve:this.curve,privateKey:this.privateKey,publicKey:this.publicKey,chainCode:this.chainCode}}}function NE(e){if(!fS(e))throw new Error(`Invalid HD tree path depth: The depth must be a positive integer. Received: \"${String(e)}\".`)}CE=PE,BE={value:Symbol(\"SLIP10Node.constructor\")};var OE,UE,ME=function(e,t,n,r,o){if(\"m\"===r)throw new TypeError(\"Private method is not writable\");if(\"a\"===r&&!o)throw new TypeError(\"Private accessor was defined without a setter\");if(\"function\"==typeof t?e!==t||!o:!t.has(e))throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");return\"a\"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},zE=function(e,t,n,r){if(\"a\"===n&&!r)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?r:\"a\"===n?r.call(e):r?r.value:t.get(e)};class LE{constructor(e){OE.set(this,void 0),ME(this,OE,e,\"f\"),Object.freeze(this)}static async fromJSON(e){return LE.fromExtendedKey(e)}static async fromExtendedKey(e){if(\"string\"==typeof e){const t=OS(e),{chainCode:n,depth:r,parentFingerprint:o,index:i}=t;if(t.version===NS){const{privateKey:e}=t;return LE.fromExtendedKey({depth:r,parentFingerprint:o,index:i,privateKey:e,chainCode:n})}const{publicKey:a}=t;return LE.fromExtendedKey({depth:r,parentFingerprint:o,index:i,publicKey:a,chainCode:n})}const{privateKey:t,publicKey:n,chainCode:r,depth:o,parentFingerprint:i,index:a}=e;jE(o);const s=await PE.fromExtendedKey({privateKey:t,publicKey:n,chainCode:r,depth:o,parentFingerprint:i,index:a,curve:\"secp256k1\"});return new LE(s)}static async fromDerivationPath({derivationPath:e}){jE(e.length-1),FE(e,0);const t=await PE.fromDerivationPath({derivationPath:e,curve:\"secp256k1\"});return new LE(t)}get depth(){return zE(this,OE,\"f\").depth}get privateKeyBytes(){return zE(this,OE,\"f\").privateKeyBytes}get publicKeyBytes(){return zE(this,OE,\"f\").publicKeyBytes}get chainCodeBytes(){return zE(this,OE,\"f\").chainCodeBytes}get privateKey(){return zE(this,OE,\"f\").privateKey}get publicKey(){return zE(this,OE,\"f\").publicKey}get compressedPublicKey(){return zE(this,OE,\"f\").compressedPublicKey}get compressedPublicKeyBytes(){return zE(this,OE,\"f\").compressedPublicKeyBytes}get chainCode(){return zE(this,OE,\"f\").chainCode}get address(){return zE(this,OE,\"f\").address}get masterFingerprint(){return zE(this,OE,\"f\").masterFingerprint}get parentFingerprint(){return zE(this,OE,\"f\").parentFingerprint}get fingerprint(){return zE(this,OE,\"f\").fingerprint}get index(){return zE(this,OE,\"f\").index}get extendedKey(){const e={depth:this.depth,parentFingerprint:this.parentFingerprint,index:this.index,chainCode:this.chainCodeBytes};return this.privateKeyBytes?US({...e,version:NS,privateKey:this.privateKeyBytes}):US({...e,version:PS,publicKey:this.publicKeyBytes})}get curve(){return zE(this,OE,\"f\").curve}neuter(){const e=zE(this,OE,\"f\").neuter();return new LE(e)}async derive(e){if(5===this.depth)throw new Error(\"Illegal operation: This HD tree node is already a leaf node.\");jE(this.depth+e.length),FE(e,this.depth+1);const t=await zE(this,OE,\"f\").derive(e);return new LE(t)}toJSON(){return{depth:this.depth,masterFingerprint:this.masterFingerprint,parentFingerprint:this.parentFingerprint,index:this.index,privateKey:this.privateKey,publicKey:this.publicKey,chainCode:this.chainCode}}}function jE(e){if(NE(e),e<0||e>5)throw new Error(`Invalid HD tree path depth: The depth must be a positive integer N such that 0 <= N <= 5. Received: \"${e}\"`)}function FE(e,t){e.forEach((e,n)=>{const r=t+n;if(0!==r)switch(ky(\"string\"==typeof e),r){case 1:if(e!==_y)throw new Error(`Invalid derivation path: The \"purpose\" node (depth 1) must be the string \"${_y}\".`);break;case 2:if(!By.test(e)||!cS(e))throw new Error('Invalid derivation path: The \"coin_type\" node (depth 2) must be a hardened BIP-32 node.');break;case 3:if(!By.test(e)||!cS(e))throw new Error('Invalid derivation path: The \"account\" node (depth 3) must be a hardened BIP-32 node.');break;case 4:if(!By.test(e))throw new Error('Invalid derivation path: The \"change\" node (depth 4) must be a BIP-32 node.');break;case 5:if(!By.test(e))throw new Error('Invalid derivation path: The \"address_index\" node (depth 5) must be a BIP-32 node.')}else if(!(e instanceof Uint8Array||Ny.test(e)))throw new Error('Invalid derivation path: The \"m\" / seed node (depth 0) must be a BIP-39 node.')})}OE=new WeakMap,function(e){e.Devnet=\"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1\",e.Mainnet=\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp\",e.Testnet=\"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z\"}(UE||(UE={}));const DE=JSON.parse('{\"J6\":{\"t$\":{\"R\":{\"Wu\":[\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp\"]}}}}');async function $E({entropySource:e,path:t,curve:n}){return await snap.request({method:\"snap_getBip32Entropy\",params:{path:t,curve:n,...e?{source:e}:{}}})}async function KE({entropySource:e,derivationPath:t}){nu.log({derivationPath:t},\"Generating solana wallet\"),v(t,Pu);const n=t.split(\"/\");try{const t=await $E({entropySource:e,path:n,curve:\"ed25519\"});if(!t.privateKey||!t.publicKey)throw new Error(\"Unable to derive private key\");return{privateKeyBytes:Hd(t.privateKey),publicKeyBytes:Hd(t.publicKey)}}catch(e){throw nu.error({error:e},\"Error deriving keypair\"),new Error(e)}}async function qE({coinTypeNode:e,accountIndex:t}){const n=await e.derive([`slip10:${t}'`,\"slip10:0'\"]);if(!n.privateKeyBytes||!n.publicKeyBytes)throw new Error(\"Unable to derive private key\");return{privateKeyBytes:n.privateKeyBytes,publicKeyBytes:n.publicKeyBytes}}const WE=e=>JSON.parse(JSON.stringify(e),(e,t)=>t?\"undefined\"!==t.__type?\"BigNumber\"===t.__type?new wr(t.value):\"bigint\"===t.__type?BigInt(t.value):\"Uint8Array\"===t.__type?da().encode(t.value):t:void 0:t),VE=e=>(0,Du.cloneDeepWith)(e,e=>void 0===e?{__type:\"undefined\"}:e instanceof wr?{__type:\"BigNumber\",value:e.toString()}:\"bigint\"==typeof e?{__type:\"bigint\",value:e.toString()}:e instanceof Uint8Array?{__type:\"Uint8Array\",value:da().decode(e)}:void 0),HE=\"send-form\",GE=\"confirm-sign-and-send-transaction\";async function ZE(e,t){const n=VE(t);return snap.request({method:\"snap_createInterface\",params:{ui:e,context:n}})}async function YE(e,t,n){const r=VE(n);return snap.request({method:\"snap_updateInterface\",params:{id:e,ui:t,context:r}})}async function JE(e,t){return snap.request({method:\"snap_resolveInterface\",params:{id:e,value:t}})}async function XE(e){return snap.request({method:\"snap_dialog\",params:{id:e}})}async function QE(){return snap.request({method:\"snap_getPreferences\"})}async function ex(e){const t=await snap.request({method:\"snap_getInterfaceContext\",params:{id:e}});return t?WE(t):null}async function tx(){return await snap.request({method:\"snap_getClientStatus\"})}async function nx(e){try{return await snap.request({method:\"snap_endTrace\",params:{name:e}})}catch(e){return null}}var rx,ox=function(e){return e.StartSendTransactionFlow=\"startSendTransactionFlow\",e.GetFeeForTransaction=\"getFeeForTransaction\",e}({}),ix=function(e){return e.ListWebSockets=\"listWebSockets\",e.ListSubscriptions=\"listSubscriptions\",e.TestOnStart=\"testOnStart\",e.TestOnInstall=\"testOnInstall\",e.TestOnUpdate=\"testOnUpdate\",e.SynchronizeAccounts=\"synchronizeAccounts\",e.SetAccountSelected=\"setAccountSelected\",e.ConfirmSend=\"confirmSend\",e.SignRewardsMessage=\"signRewardsMessage\",e}({});!function(e){e[e.Millisecond=1]=\"Millisecond\",e[e.Second=1e3]=\"Second\",e[e.Minute=6e4]=\"Minute\",e[e.Hour=36e5]=\"Hour\",e[e.Day=864e5]=\"Day\",e[e.Week=6048e5]=\"Week\",e[e.Year=31536e6]=\"Year\"}(rx=rx||(rx={}));const ax=[lu.Mainnet,lu.Devnet],sx={production:[lu.Mainnet],local:[lu.Mainnet],test:[lu.Localnet]},cx=X(U(vu),H(),e=>e.split(\",\")),ux=X(U(H()),H(),e=>e.split(\",\")),lx=K({ENVIRONMENT:z([\"local\",\"test\",\"production\"]),RPC_URL_MAINNET_LIST:cx,RPC_URL_DEVNET_LIST:cx,RPC_URL_TESTNET_LIST:cx,RPC_URL_LOCALNET_LIST:ux,RPC_WEB_SOCKET_URL_MAINNET:vu,RPC_WEB_SOCKET_URL_DEVNET:vu,RPC_WEB_SOCKET_URL_TESTNET:vu,RPC_WEB_SOCKET_URL_LOCALNET:vu,EXPLORER_BASE_URL:vu,PRICE_API_BASE_URL:vu,TOKEN_API_BASE_URL:vu,STATIC_API_BASE_URL:vu,SECURITY_ALERTS_API_BASE_URL:vu,NFT_API_BASE_URL:vu,LOCAL_API_BASE_URL:H()});class dx{#E;#x;constructor(){const e=this.#k();this.#E=this.#I(e),this.#x=[]}#k(){return b({ENVIRONMENT:\"production\",RPC_URL_MAINNET_LIST:\"https://solana-mainnet.infura.io/v3/5b98a22672004ef1bf40a80123c5c48d\",RPC_URL_DEVNET_LIST:\"https://solana-devnet.infura.io/v3/5b98a22672004ef1bf40a80123c5c48d\",RPC_URL_TESTNET_LIST:\"https://api.testnet.solana.com\",RPC_URL_LOCALNET_LIST:\"http://localhost:8899\",RPC_WEB_SOCKET_URL_MAINNET:\"wss://solana-mainnet.infura.io/ws/v3/5b98a22672004ef1bf40a80123c5c48d\",RPC_WEB_SOCKET_URL_DEVNET:\"wss://solana-devnet.infura.io/ws/v3/5b98a22672004ef1bf40a80123c5c48d\",RPC_WEB_SOCKET_URL_TESTNET:\"wss://api.testnet.solana.com\",RPC_WEB_SOCKET_URL_LOCALNET:\"wss://localhost:8899\",EXPLORER_BASE_URL:\"https://solscan.io\",PRICE_API_BASE_URL:\"https://price.api.cx.metamask.io\",TOKEN_API_BASE_URL:\"https://tokens.api.cx.metamask.io\",STATIC_API_BASE_URL:\"https://static.cx.metamask.io\",SECURITY_ALERTS_API_BASE_URL:\"https://security-alerts.api.cx.metamask.io\",LOCAL_API_BASE_URL:\"http://localhost:8899\",NFT_API_BASE_URL:\"https://nft.api.cx.metamask.io\"},lx)}#I(e){return{environment:e.ENVIRONMENT,networks:[{...mu[lu.Mainnet],rpcUrls:e.RPC_URL_MAINNET_LIST,webSocketUrl:e.RPC_WEB_SOCKET_URL_MAINNET},{...mu[lu.Devnet],rpcUrls:e.RPC_URL_DEVNET_LIST,webSocketUrl:e.RPC_WEB_SOCKET_URL_DEVNET},{...mu[lu.Testnet],rpcUrls:e.RPC_URL_TESTNET_LIST,webSocketUrl:e.RPC_WEB_SOCKET_URL_TESTNET},{...mu[lu.Localnet],rpcUrls:e.RPC_URL_LOCALNET_LIST,webSocketUrl:e.RPC_WEB_SOCKET_URL_LOCALNET}],explorerBaseUrl:e.EXPLORER_BASE_URL,priceApi:{baseUrl:\"test\"===e.ENVIRONMENT?e.LOCAL_API_BASE_URL:e.PRICE_API_BASE_URL,chunkSize:50,cacheTtlsMilliseconds:{fiatExchangeRates:rx.Minute,spotPrices:rx.Minute,historicalPrices:rx.Minute}},tokenApi:{baseUrl:\"test\"===e.ENVIRONMENT?e.LOCAL_API_BASE_URL:e.TOKEN_API_BASE_URL,chunkSize:50},staticApi:{baseUrl:e.STATIC_API_BASE_URL},transactions:{storageLimit:10},securityAlertsApi:{baseUrl:\"test\"===e.ENVIRONMENT?e.LOCAL_API_BASE_URL:e.SECURITY_ALERTS_API_BASE_URL},nftApi:{baseUrl:\"test\"===e.ENVIRONMENT?e.LOCAL_API_BASE_URL:e.NFT_API_BASE_URL,cacheTtlsMilliseconds:{listAddressSolanaNfts:rx.Minute,getNftMetadata:rx.Minute}},subscriptions:{maxReconnectAttempts:5,reconnectDelayMilliseconds:rx.Second,closeConnectionsGracePeriodMilliseconds:5*rx.Minute}}}get(){return this.#E}getNetworkBy(e,t){const n=this.get().networks.find(n=>n[e]===t);if(!n)throw new Error(`Network ${e} not found`);return n}async getActiveNetworks(){if(this.#x.length>0)return this.#x;const e=(0,Du.uniq)([lu.Mainnet,...sx[this.#E.environment]??[]]);try{const{clientVersion:t}=await tx(),n=t.includes(\"flask\")?[lu.Devnet]:[],r=(0,Du.uniq)([...e,...n]);return this.#x=r,this.#x}catch(t){return e}}}const fx=(new dx).get(),hx=[\"local\",\"test\"].includes(fx.environment),px=hx?[\"http://localhost:3000\"]:[\"https://portfolio.metamask.io\"],gx=hx?new Set([zt.GetAccounts,zt.GetAccount,zt.DeleteAccount,zt.GetAccountBalances,zt.SubmitRequest,zt.GetAccountTransactions,zt.GetAccountAssets,zt.SetSelectedAccounts,bt.ListAccounts,bt.CreateAccount,bt.FilterAccountChains,bt.DiscoverAccounts,bt.ListAccountTransactions,bt.ListAccountAssets,ox.StartSendTransactionFlow,ox.GetFeeForTransaction,ix.ListWebSockets,ix.ListSubscriptions,ix.TestOnStart,ix.TestOnInstall,ix.TestOnUpdate,ix.SynchronizeAccounts,ix.SetAccountSelected,ix.ConfirmSend,ix.SignRewardsMessage]):new Set([]),mx=new Set([zt.GetAccounts,zt.GetAccount,zt.CreateAccounts,zt.DeleteAccount,zt.GetAccountBalances,zt.SubmitRequest,zt.GetAccountTransactions,zt.GetAccountAssets,zt.ResolveAccountAddress,zt.SetSelectedAccounts,zt.ExportAccount,bt.ListAccounts,bt.CreateAccount,bt.DiscoverAccounts,bt.ListAccountTransactions,bt.ListAccountAssets,ox.StartSendTransactionFlow,ox.GetFeeForTransaction,pm.SignAndSendTransactionWithoutConfirmation,pm.SignProofOfOwnership]),yx=new Map([]);for(const e of px)yx.set(e,gx);yx.set(\"metamask\",mx);const wx=(e,t)=>{if(!e)throw new Gn(\"Origin not found\");if(!yx.get(e)?.has(t))throw new Gn(\"Permission denied\")};function vx(e,t){try{v(e,t)}catch(e){throw new zn(e.message)}}function bx(e,t){try{v(e,t)}catch(e){throw new Pn(\"Invalid Response\",{data:{cause:Nn(e)}})}}const Ax=K({...ut.schema,scope:Tu,request:Wm}),Sx=(K({scopes:te(U(Tu)),entropySource:H(),groupIndex:ee($(),0)}),xa()),Ex=DE.J6.t$.R.Wu;var xx;!function(e){e.GetSelectedAccounts=\"getSelectedAccounts\"}(xx||(xx={}));K({method:j(xx.GetSelectedAccounts)});const kx=U(H());async function Ix(e,t,n){await e.request({method:\"snap_manageAccounts\",params:{method:t,params:{...n}}})}async function Tx(e){const t=await e.request({method:\"snap_manageAccounts\",params:{method:xx.GetSelectedAccounts}});return v(t,kx),t}const _x=K({metamask:W(K({correlationId:k}))});var Cx;!function(e){e.AccountCreated=\"notify:accountCreated\",e.AccountUpdated=\"notify:accountUpdated\",e.AccountDeleted=\"notify:accountDeleted\",e.RequestApproved=\"notify:requestApproved\",e.RequestRejected=\"notify:requestRejected\",e.AccountBalancesUpdated=\"notify:accountBalancesUpdated\",e.AccountAssetListUpdated=\"notify:accountAssetListUpdated\",e.AccountTransactionsUpdated=\"notify:accountTransactionsUpdated\"}(Cx||(Cx={}));K({method:j(`${Cx.AccountCreated}`),params:K({account:rt,accountNameSuggestion:W(H()),displayConfirmation:W(M()),displayAccountNameSuggestion:W(M()),..._x.schema})}),K({method:j(`${Cx.AccountUpdated}`),params:K({account:rt})}),K({method:j(`${Cx.AccountDeleted}`),params:K({id:k})}),K({method:j(`${Cx.RequestApproved}`),params:K({id:k,result:pe})}),K({method:j(`${Cx.RequestRejected}`),params:K({id:k})}),K({method:j(`${Cx.AccountBalancesUpdated}`),params:K({balances:V(I,V(We,nl))})}),K({method:j(`${Cx.AccountTransactionsUpdated}`),params:K({transactions:V(I,U(pl))})}),K({method:j(`${Cx.AccountAssetListUpdated}`),params:K({assets:V(I,K({added:U(He),removed:U(He)}))})});function Bx(e,t){return new wr(e.toString()).div(10**t).toFixed()}function Rx(e){return e.split(\"/\")[0]}function Px(e,t){return`${e}/token:${t}`}class Nx{#i;#T;#_;#C;#B;#R;#P;#N;static cacheTtlsMilliseconds={tokenAccountsByOwner:5*rx.Second};constructor({connection:e,logger:t,configProvider:n,assetsRepository:r,tokenApiClient:o,tokenPricesService:i,cache:a,nftApiClient:s}){this.#i=tu(t,\"[🪙 AssetsService]\"),this.#T=e,this.#_=n,this.#C=r,this.#R=o,this.#B=i,this.#P=a,this.#N=s}#O(e){return{nativeAssetTypes:e.filter(e=>e.endsWith(pu.SOL)),tokenAssetTypes:e.filter(e=>e.includes(\"/token:\")),nftAssetTypes:e.filter(e=>e.includes(\"/nft:\"))}}#U(e){const t={};for(const n of e){const{chain:{namespace:e,reference:r},assetNamespace:o,assetReference:i}=tt(n);t[n]={name:\"Solana\",symbol:\"SOL\",fungible:!0,iconUrl:`${this.#_.get().staticApi.baseUrl}/api/v2/tokenIcons/assets/${e}/${r}/${o}/${i}.png`,units:[{name:\"Solana\",symbol:\"SOL\",decimals:9}]}}return t}async#M(e){const t=await this.#N.getNftsMetadata(e.map(e=>{const{assetReference:t}=tt(e);return t})),n={};return e.forEach((e,r)=>{const o=t[r];if(!o)return;const i={name:o.name,symbol:o.name,imageUrl:o.imageUrl,description:o.description,fungible:!1,isPossibleSpam:!1,attributes:Object.fromEntries(o.attributes.map(e=>[e.key,e.value])),collection:{name:o.collectionName,address:o.onchainCollectionAddress,symbol:o.collectionSymbol,tokenCount:o.collectionCount,creator:\"\",imageUrl:o.collectionImageUrl??\"\"}};n[e]=i}),n}async getAssetsMetadata(e){this.#i.log(\"Fetching metadata for assets\",e);const{nativeAssetTypes:t,tokenAssetTypes:n,nftAssetTypes:r}=this.#O(e),[o,i]=await Promise.all([this.#U(t),this.#R.getTokensMetadata(n)]);return{...o,...i}}async#z(e,t=[yf,kh],n=[lu.Mainnet]){if(0===t.length||0===n.length)return[];const r=e.flatMap(e=>t.flatMap(t=>n.map(n=>({account:e,programId:t,scope:n})))),o=ou(this.#L.bind(this),this.#P,{functionName:\"AssetsService:fetchTokenAccounts\",ttlMilliseconds:Nx.cacheTtlsMilliseconds.tokenAccountsByOwner,generateCacheKey:(e,t)=>{const[n,r,o]=t;return`${e}:${n.id}:${r}:${o}`}});return(await Promise.allSettled(r.map(async({account:e,programId:t,scope:n})=>await o(e,t,n)))).flatMap(e=>\"fulfilled\"===e.status?e.value:[])}async#L(e,t=yf,n=lu.Mainnet){return(await this.#T.getRpc(n).getTokenAccountsByOwner(Sa(e.address),{programId:t},{encoding:\"jsonParsed\"}).send()).value.map(t=>({token:t,scope:n,assetType:Px(n,t.account.data.parsed.info.mint),keyringAccount:e}))}async fetch(e){const[t,n]=await Promise.all([this.#j(e),this.#z([e],[yf,kh],await this.#_.getActiveNetworks())]),r=n.map(e=>e.assetType),o=await this.#R.getTokensMetadata(r);return[...t,...n.filter(e=>e.assetType.includes(\"/token:\")).map(e=>{const{assetType:t}=e,{decimals:n,amount:r,uiAmountString:i}=e.token.account.data.parsed.info.tokenAmount;return{assetType:t,keyringAccountId:e.keyringAccount.id,network:e.scope,mint:e.token.account.data.parsed.info.mint,pubkey:e.token.pubkey,symbol:o[t]?.symbol??\"UNKNOWN\",decimals:n,rawAmount:r,uiAmount:i??Bx(r,n)}})]}async getNativeAssetTypes(){return(await this.#_.getActiveNetworks()).map(e=>`${e}/${pu.SOL}`)}async#j(e){const t=await this.getNativeAssetTypes(),n=Sa(e.address),r=t.map(async t=>{const r=await this.#T.getRpc(Rx(t)).getBalance(n).send();return{assetType:t,keyringAccountId:e.id,network:Rx(t),address:n,symbol:\"SOL\",decimals:9,rawAmount:r.value.toString(),uiAmount:Bx(r.value,9)}});return(await Promise.allSettled(r)).flatMap(e=>\"fulfilled\"===e.status?e.value:[])}async#F(e,t){const n=Sa(e.address),r=await this.#N.listAddressSolanaNfts(n),o={};for(const e of t){const{assetReference:t}=tt(e),n=r.find(e=>e.tokenAddress===t);n&&(o[e]={unit:n.nftToken.name,amount:n.balance.toString()})}return o}async fetchAssetsMarketData(e){this.#i.info(\"Fetching market data for assets\",e);return await this.#B.getMultipleTokensMarketData(e)}async save(e){await this.saveMany([e])}async saveMany(e){this.#i.info(\"Saving assets\",e);const t=e=>\"0\"===e.rawAmount||\"0\"===e.uiAmount;await this.getAll();await this.#C.saveMany(e);const n=e=>t(e)&&!(e=>e.assetType.includes(pu.SOL))(e),r=e=>!n(e)&&!0,o=e.reduce((e,t)=>({...e,[t.keyringAccountId]:{added:[...e[t.keyringAccountId]?.added??[],...r(t)?[t.assetType]:[]],removed:[...e[t.keyringAccountId]?.removed??[],...n(t)?[t.assetType]:[]]}}),{});Object.values(o).map(e=>e.added.length+e.removed.length).every(e=>0===e)||await Ix(snap,Cx.AccountAssetListUpdated,{assets:o});const i=e.filter(()=>!0).reduce((e,t)=>({...e,[t.keyringAccountId]:{...e[t.keyringAccountId]??{},[t.assetType]:{unit:t.symbol,amount:t.uiAmount}}}),{});Object.values(i).map(e=>Object.keys(e).length).some(e=>e>0)&&await Ix(snap,Cx.AccountBalancesUpdated,{balances:i})}static hasChanged(e,t){const n=t.find(t=>t.keyringAccountId===e.keyringAccountId&&t.assetType===e.assetType);if(!n)return!0;const r=n.rawAmount!==e.rawAmount,o=n.uiAmount!==e.uiAmount;return r||o}async getAll(){return this.#C.getAll()}async findByAccount(e){const{id:t,address:n}=e,r=await this.#C.findByKeyringAccountId(t),o=await this.getNativeAssetTypes(),i=[];for(const t of o){if(!r.some(e=>e.assetType===t)){const r=Rx(t);i.push({assetType:t,keyringAccountId:e.id,network:r,address:n,symbol:\"SOL\",decimals:9,rawAmount:\"0\",uiAmount:\"0\"})}}return[...r,...i]}}const Ox=bs(5000n);class Ux{#D;constructor(e){this.#D=e}#$(){const e=this.#D.getComputeUnitLimit(),t=this.#D.getComputeUnitPriceMicroLamportsPerComputeUnit();return As(e,e=>wr(e),e=>e.multipliedBy(t.toString()),e=>e.dividedToIntegerBy(su.toString()),e=>e.toString(),BigInt,bs)}getFee(){const e=this.#$();return bs(Ox+e)}}const Mx=\"Sending to this address may result in permanent loss of funds.\";class zx extends Error{constructor(e,t){super(e,t),this.name=\"RecipientClassificationError\"}}class Lx extends zx{constructor(){super(`Cannot send to this address. This appears to be a mint account, program data account, metadata account, or PDA. ${Mx} Only wallet addresses and token accounts are supported.`),this.name=\"RecipientUnsupportedError\"}}class jx extends zx{constructor(){super(`Cannot send to this address. This is a token account for a different token than the one you're trying to send. ${Mx}`),this.name=\"RecipientTokenAccountMintMismatchError\"}}class Fx{#K;#q;#T;#i;#W=4e4;#V=10000n;constructor(e,t,n,r){this.#K=e,this.#q=t,this.#T=n,this.#i=tu(r,\"[📩 SendSplTokenBuilder]\")}async buildTransactionMessage(e){this.#i.log(\"Build transfer SPL token transaction message\");const{from:{entropySource:t,derivationPath:n},to:r,mint:o,amount:i,network:a}=e;Ar(o,\"Mint is required\");const s=await this.#q.classify(r,a);if(\"UNSUPPORTED\"===s.type)throw new Lx;const[c,u,{privateKeyBytes:l},d]=await Promise.all([this.#T.fetchMint(o,a),this.#K.uiAmountToAmountForMint(o,a,i.toString()),KE({entropySource:t,derivationPath:n}),this.#T.getLatestBlockhash(a)]),{programAddress:f,data:{decimals:h}}=c,p=await Tc(l),g=await Fx.deriveAssociatedTokenAccountAddress({mint:o,owner:p.address,tokenProgram:f}),m=[],y=f===kh,w=y?Jh:Uf,v=y?tg:th;switch(s.type){case\"SYSTEM\":{const e=await Fx.deriveAssociatedTokenAccountAddress({mint:o,owner:r,tokenProgram:f});m.push(w({mint:o,payer:p,tokenProgram:f,owner:r,ata:e})),m.push(v({source:g,mint:o,destination:e,authority:p,amount:u,decimals:h}));break}case\"TOKEN_ACCOUNT\":if(s.mint!==o)throw new jx;m.push(v({source:g,mint:o,destination:r,authority:p,amount:u,decimals:h}));break;default:throw new Lx}const b=As(Js({version:0}),e=>oc(p.address,e),e=>Es(d,e),e=>ac(m,e));return sc([nf({units:this.#W}),sf({microLamports:this.#V})],b)}static async deriveAssociatedTokenAccountAddress({mint:e,owner:t,tokenProgram:n}){return(await Rf({mint:e,owner:t,tokenProgram:n}))[0]}getComputeUnitLimit(){return this.#W}getComputeUnitPriceMicroLamportsPerComputeUnit(){return this.#V}}class Dx{#T;#i;static defaultComputeUnitPriceInMicroLamportsPerComputeUnit=10000n;constructor(e,t){this.#T=e,this.#i=tu(t,\"[🖋️ Signer]\")}async partiallySignBase64String(e,t,n,r){this.#i.log(\"Partially sign base64 string\",{base64String:e,account:t,network:n,config:r});const o=this.#T.getRpc(n),i=await Lg(e,o,r);if(\"instructions\"in i)return this.#H(i,t,n);if(Object.values(i.signatures).every(e=>!e)){const{messageBytes:e}=i,a=await Ug(e,o,r);return this.#H(a,t,n)}return this.#G(i,t)}async#H(e,t,n){const r=Ss(e)?e.lifetimeConstraint:await this.#T.getLatestBlockhash(n),o=tm(e),i=Dx.defaultComputeUnitPriceInMicroLamportsPerComputeUnit,a=!rm(e)||!o,{privateKeyBytes:s}=await KE({entropySource:t.entropySource,derivationPath:t.derivationPath}),c=await Tc(s),u=await As(e,e=>Qg(c.address,e),e=>{return t=r,Ss(n=e)?n:Es(t,n);var t,n},e=>((e,t,n)=>tm(e)?e:sc([sf(t,n)],e))(e,{microLamports:i}),async e=>a?om(e,this.#T.getRpc(n)):e),l=kc([c],u);return await Cc(l)}async#G(e,t){const{privateKeyBytes:n}=await KE({entropySource:t.entropySource,derivationPath:t.derivationPath});return gc([await $a(n)],e)}}const $x=(e,t)=>{const{to:n,type:r,status:o}=e,{address:i}=t;if(!(r===ll.Receive||o===ul.Failed))return!1;const{hasReceivedSOL:a,receivedSOLAmount:s}=n.reduce((e,t)=>t.address!==i||!t.asset?.fungible||t.asset.type!==du.SolMainnet&&t.asset.type!==du.SolDevnet?e:{hasReceivedSOL:!0,receivedSOLAmount:e.receivedSOLAmount.plus(t.asset.amount)},{hasReceivedSOL:!1,receivedSOLAmount:new wr(0)});return a&&s.isLessThan(.001)};function Kx(e,t){return[$x].some(n=>n(e,t))}class qx{#Z;#Y;#J;#X;#Q;#K;#_;#i;#ee=[yf,kh];constructor(e,t,n,r,o,i,a,s){this.#Z=e,this.#Y=t,this.#J=n,this.#X=r,this.#Q=o,this.#K=i,this.#_=a,this.#i=tu(s,\"[🗝️ KeyringAccountMonitor]\"),this.#te()}#te(){this.#i.info(\"Binding handlers\"),ax.forEach(e=>{this.#Z.registerNotificationHandler(\"accountSubscribe\",e,this.#ne.bind(this)),this.#Z.registerNotificationHandler(\"programSubscribe\",e,this.#re.bind(this))}),ax.forEach(e=>{this.#Z.registerConnectionRecoveryHandler(e,this.#oe.bind(this))})}async setMonitoredAccounts(e){this.#i.info(\"Setting monitored accounts\",e);const[t,n,r]=await Promise.all([this.#Y.getAll(),this.#Z.getAll(),this.#_.getActiveNetworks()]),o=t.filter(e=>n.some(t=>e.address===(0,Du.get)(t,\"params[0]\")||e.address===(0,Du.get)(t,\"params[1].filters[0].memcmp.bytes\"))),i=o.filter(t=>!e.includes(t.id)),a=t.filter(t=>e.includes(t.id)).filter(e=>!o.includes(e));await Promise.allSettled([this.#ie(i,n),this.#ae(a,r)])}async#ae(e,t){try{this.#i.log(\"Monitoring keyring accounts\",e);const n=this.#Q.synchronize(e),r=e.flatMap(e=>{const n=t=>e.scopes.includes(t);return[...t.filter(n).map(async t=>this.#se(e,t)),...t.filter(n).map(async t=>{await Promise.all(this.#ee.map(async n=>this.#ce(e,n,t)))})]});await Promise.allSettled([...r,n])}catch(e){throw this.#i.error(\"Error monitoring keyring account\",e),e}}async#ie(e,t){this.#i.log(\"Stopping to monitor accounts\",e);const n=e.map(e=>e.address),r=t.filter(e=>qx.#ue(e)||qx.#le(e)).filter(e=>n.includes(qx.#de(e)));await Promise.allSettled(r.map(async e=>this.#Z.unsubscribe(e.id)))}async#se(e,t){this.#i.log(\"Monitoring native asset balance\",{account:e,network:t});const{address:n}=e;await this.#Z.subscribe({method:\"accountSubscribe\",network:t,params:[n,{commitment:\"confirmed\",encoding:\"jsonParsed\"}]})}async#ce(e,t,n){this.#i.log(\"Monitoring token program by owner\",{account:e,tokenProgramAddress:t,network:n});const{address:r}=e;await this.#Z.subscribe({method:\"programSubscribe\",network:n,params:[t,{commitment:\"confirmed\",encoding:\"jsonParsed\",filters:[{memcmp:{offset:32,bytes:r,encoding:\"base58\"}}]}]})}async#ne(e,t){this.#i.info(\"Account notification received\",{notification:e,subscription:t});const{network:n}=t,r=(0,Du.get)(t,\"params[0]\");v(r,H());const o=await this.#Y.findByAddress(r);if(!o)throw new Error(`No keyring account found for address: ${r}`);const{lamports:i}=e.params.result.value;v(i,$());await Promise.all([this.#J.save({assetType:`${n}/${pu.SOL}`,keyringAccountId:o.id,network:n,address:r,symbol:\"SOL\",decimals:9,rawAmount:i.toString(),uiAmount:Bx(i,9)}),this.#fe(o,n,r)])}async#re(e,t){this.#i.info(\"Handling program notification\",{notification:e,subscription:t});const{network:n}=t,r=(0,Du.get)(t,\"params[0]\");if(v(r,H()),r!==yf&&r!==kh)throw new Error(`Program not supported: ${r}`);const{owner:o}=e.params.result.value.account.data.parsed.info;v(o,H());const{mint:i}=e.params.result.value.account.data.parsed.info;v(i,H());const{amount:a,decimals:s,uiAmountString:c}=e.params.result.value.account.data.parsed.info.tokenAmount;v(a,H()),v(s,$()),v(c,H());const{pubkey:u}=e.params.result.value;v(u,H());const l=Px(n,i),d=await this.#Y.findByAddress(o);if(!d)throw new Error(`No keyring account found with address: ${o}`);const f=await this.#K.amountToUiAmountForMint(i,n,bs(BigInt(a))).catch(async e=>(await ju(e),this.#i.error(\"Error converting amount to uiAmount\",e),c)),h=(await this.#J.getAssetsMetadata([l]))[l];await Promise.all([this.#J.save({assetType:l,keyringAccountId:d.id,network:n,mint:i,pubkey:u,symbol:h?.symbol??\"UNKNOWN\",decimals:s,rawAmount:a,uiAmount:f}),this.#fe(d,n,u)])}async#fe(e,t,n){const r=(await this.#X.fetchLatestSignatures(t,Sa(n),{limit:1}))?.[0];if(!r)throw new Error(\"No signature found\");const o=await this.#X.fetchBySignature(r,e,t);if(!o)throw new Error(\"No transaction found\");Kx(o,e)?this.#i.info(`Transaction ${r} is spam. Skipping.`):await this.#X.save(o)}async#oe(e){this.#i.info(\"Handling connection recovery\",{network:e});const[t,n]=await Promise.all([this.#Y.getAll(),this.#Z.getAll()]),r=n.filter(e=>qx.#ue(e)||qx.#le(e)),o=(0,Du.uniq)(r.map(e=>qx.#de(e))),i=t.filter(e=>o.includes(e.address));i.length?await this.#Q.synchronize(i):this.#i.info(\"No monitored accounts found. Skipping connection recovery.\")}static#ue(e){return\"accountSubscribe\"===e.method}static#le(e){return\"programSubscribe\"===e.method}static#de(e){if(this.#ue(e))return(0,Du.get)(e,\"params[0]\");if(this.#le(e))return(0,Du.get)(e,\"params[1].filters[0].memcmp.bytes\");throw new Error(\"Invalid subscription\")}}class Wx{#he;#pe;#ge;#i;#me=new Map;constructor(e,t,n,r){this.#he=e,this.#pe=t,this.#ge=n,this.#i=tu(r,\"[🔔 SubscriptionService]\"),this.#te()}#te(){this.#ge.on(\"onInactive\",this.#ye.bind(this)),this.#ge.on(\"onWebSocketEvent\",this.#we.bind(this)),this.#ge.on(\"onListSubscriptions\",this.#ve.bind(this)),ax.forEach(e=>{this.#he.onConnectionRecovery(e,this.#be.bind(this))})}registerNotificationHandler(e,t,n){this.#i.info(\"Registering notification handler\",{network:t,method:e,handler:n});const r=`${e}:${t}`;this.#me.has(r)||this.#me.set(r,new Set),this.#me.get(r).add(n)}registerConnectionRecoveryHandler(e,t){this.#he.onConnectionRecovery(e,t)}async subscribe(e){this.#i.info(\"New subscription request\",e);const{method:t,params:n,network:r,expiryMilliseconds:o}=e,i=await this.#Ae(e),a=await this.#pe.getById(i);if(a){if(\"confirmed\"===a.status)return i;await this.#pe.delete(i)}const s={...e,id:i,status:\"pending\",requestId:i,createdAt:(new Date).toISOString(),...o?{expiresAt:new Date(Date.now()+o).toISOString()}:{}};await this.#pe.save(s);const c=await this.#he.findByNetwork(r),u=async e=>{const r={jsonrpc:\"2.0\",id:i,method:t,params:n};e&&await this.#Se(e,r)};return c&&await u(c.id),s.id}async unsubscribe(e){this.#i.info(\"Unsubscribing from\",e);const t=await this.#pe.getById(e);if(!t)return void this.#i.warn(`Subscription not found: ${e}`);const{id:n,network:r,method:o}=t,i=Jg[o];if(await this.#pe.delete(n),\"confirmed\"===t.status){const e=await this.#he.findByNetwork(r);e&&await this.#Se(e.id,{jsonrpc:\"2.0\",id:globalThis.crypto.randomUUID(),method:i,params:[t.rpcSubscriptionId]})}}async getAll(){return this.#pe.getAll()}async#we(e){if(\"message\"!==e.type)return;const t=(e=>{const{data:t}=e;let n;if(t&&\"object\"==typeof t&&\"type\"in t)if(\"text\"===t.type)n=\"string\"==typeof t.message?JSON.parse(t.message):t.message;else{if(\"binary\"!==t.type)throw new Error(\"Unknown message data\");{const e=t.message,r=String.fromCharCode(...e);n=JSON.parse(r)}}else n=\"string\"==typeof t?JSON.parse(t):t;return n})(e),n=await this.#he.findById(e.id);if(n)switch(this.#i.info(\"Received message\",e),t.method){case\"accountNotification\":case\"programNotification\":case\"signatureNotification\":await this.#Ee(t,n.network);break;default:this.#xe(t)?await this.#ke(t):this.#Ie(t)?await this.#Te(t):Se(t)?await this.#_e(t):this.#i.warn(\"Received unknown message\",t)}}async#Ee(e,t){const{subscription:n}=e.params,r=await this.#pe.findBy(\"rpcSubscriptionId\",n);if(!r)return void this.#i.warn(\"No subscription found for RPC ID:\",n);const o=`${r.method}:${t}`,i=this.#me.get(o);if(i&&i.size>0){(await Promise.allSettled(Array.from(i).map(async t=>t(e,r)))).forEach(e=>{\"rejected\"===e.status&&this.#i.error(`Handler failed for ${r.method}:`,e.reason)})}}async#Se(e,t){this.#i.info(`Sending message to connection ${e}`,t),await snap.request({method:\"snap_sendWebSocketMessage\",params:{id:e,message:JSON.stringify(t)}})}#xe(e){return\"jsonrpc\"in e&&\"2.0\"===e.jsonrpc&&\"id\"in e&&\"result\"in e&&\"number\"==typeof e.result}#Ie(e){return\"jsonrpc\"in e&&\"id\"in e&&\"result\"in e&&!0===e.result}async#ke(e){const{id:t,result:n}=e,r=await this.#pe.getById(String(t));r?(await this.#pe.update({...r,status:\"confirmed\",rpcSubscriptionId:n,confirmedAt:(new Date).toISOString()}),this.#i.info(`Subscription confirmed: request ID: ${t} -> RPC ID: ${n}`)):this.#i.warn(`Received subscription confirmation, but no matching pending subscription found for subscription ID: ${t}.`)}async#Te(e){this.#i.info(\"Received unsubscription confirmation\",e)}async#_e(e){if(\"id\"in e&&void 0!==e.id){const t=await this.#pe.getById(String(e.id));\"pending\"===t?.status?(await this.#pe.delete(t.id),this.#i.error(`Subscription establishment failed for ${t.id}:`,e.error)):this.#i.error(`Received error for request ID: ${e.id}`,e.error)}else this.#i.error(\"Connection-level error:\",e.error)}async#Ae(e){const t={method:e.method,params:e.params,network:e.network,metadata:e.metadata??null},n=this.#Ce(t),r=(new TextEncoder).encode(n),o=await globalThis.crypto.subtle.digest(\"SHA-256\",r),i=Array.from(new Uint8Array(o)).map(e=>e.toString(16).padStart(2,\"0\")).join(\"\");return i}#Ce(e){if(null==e)return JSON.stringify(e);if(\"object\"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(e=>this.#Ce(e)).join(\",\")}]`;const t=Object.keys(e).sort((e,t)=>e.localeCompare(t));return`{${t.map(t=>`\"${t}\":${this.#Ce(e[t])}`).join(\",\")}}`}async#ve(){const e=await this.#pe.getAll();this.#i.info(\"Subscriptions\",{subscriptions:e,notificationHandlers:this.#me})}#Be(e){return{method:e.method,params:e.params,network:e.network,...e.expiryMilliseconds?{expiryMilliseconds:e.expiryMilliseconds}:{},...e.metadata?{metadata:e.metadata}:{}}}async#be(e){this.#i.info(`Re-subscribing to all subscriptions for network ${e}`);const t=(await this.#pe.getAll()).filter(t=>t.network===e).filter(Wx.#Re),n=t.map(e=>e.id);await this.#pe.deleteMany(n),await Promise.allSettled(t.map(async e=>{await this.subscribe(this.#Be(e))}))}async#ye(){this.#i.info(\"Client became inactive\"),await this.#Pe()}async#Pe(){this.#i.info(\"Removing expired subscriptions\");const e=(await this.#pe.getAll()).filter(Wx.#Ne);await Promise.allSettled(e.map(async e=>{await this.unsubscribe(e.id)}))}static#Ne(e){const t=new Date;return Boolean(e.expiresAt&&new Date(e.expiresAt)<t)}static#Re(e){return!Wx.#Ne(e)}}function Vx(e,t,n){if(\"string\"==typeof e)throw new Error(`An HTML element (\"${String(e)}\") was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.`);if(!e)throw new Error(\"A JSX fragment was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.\");return e({...t,key:n})}function Hx(e,t,n){return Vx(e,t,n)}const Gx='<svg width=\"16\" height=\"16\" xmlns=\"http://www.w3.org/2000/svg\"><image width=\"16\" height=\"16\" href=\"data:image/png;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAUFBQUFBQUGBgUICAcICAsKCQkKCxEMDQwNDBEaEBMQEBMQGhcbFhUWGxcpIBwcICkvJyUnLzkzMzlHREddXX0BBQUFBQUFBQYGBQgIBwgICwoJCQoLEQwNDA0MERoQExAQExAaFxsWFRYbFykgHBwgKS8nJScvOTMzOUdER11dff/CABEIAPoA+gMBIgACEQEDEQH/xAA1AAEAAwEBAQEBAAAAAAAAAAAAAQIHBggEBQMBAQADAQEBAQAAAAAAAAAAAAACAwQBBQYH/9oADAMBAAIQAxAAAADxkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACx204cU3mdnnYLG+IQwNvsxhgLfrRh5/egLRh59egkYefXoRCPn6mv5BH2ajuwAAAACZdFZz6/SvzfofWfLWtS2jw7WpNGO01mjJaas+P+k0tRjtNbUY38Leccnq/DxFq5f2ao7cAAAAB+36W8/9p7+DZZxp6nl7LOM3qzbLOMqs2zzjF6suyzjNqqNlnGrU5NkY7zlHP75Wjzv0mg5pAAAAAAs6jqdsMuajacMsam5HLGqORytqkxjlTVbc5lLVpjDKGsfhQlwdb1p3QAAAAAADofSXk7q/cp9MT8n0/cebe1Jpx2tS2fJNqTRkvNLUY7TWaMdqXZ8vnHPvZHmrw/u+JTGL6EAAAAABMDuvQvkLQfo6PQU55P0WLRJztTl0Sc7U5tFnOppzaOzmacujTnSrLo3x8NNFOM8zsuM+H99Aq2AAAAAATMfpWPznbNXOJdqjHi47Wec4l2jnOLdo5zi57JFxrsp5HjadRy9d0CMgAAAAJPqm+j0X8fW/oV82rPvUWRNGObUmjHe1LUZLIUY7TDPk/opk2CP5uPy+U+1qKrwAAAAPo3zPdc+23fu2/BfYXdA/AmjL+/bn1GToZ55Tl6KedmjJ0c87anL0LnuZyUTgH9fm+Q9+Bk0AAAAAAWVdWVFlRZUWVFpo4uoLxV0HAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//EAEEQAAECAwQHBAgDBgcBAAAAAAECBAADBgURF1UQMUFRkpPSEiFSohYgIjBAYaPiBzLBEyRUYnCRFBVDRYGhstH/2gAIAQEAAT8A/qXdF0XRd8ou9a4R3aOz8AO+KUo95Uc1SyoyGcs+3OIvvPhQDrMYUWPmbzhRGFFj5m74URhRY2Zu+FEYT2NmbvhRGE1jZm84URhNY2ZvOFEYTWNmjzhRGEti5o84URhLYuaPP7IjCWxc0ecKIwksXM3nCiMJLFzN5wojCSxczd/2RGEliZm8/siKt/DthYNkTLRbWlNUqWtIKJwA7Xa8JHwFK0w6qN6EJvQ1lkGfO2AeEb1HZDRq2YNpLVrJTLkyk9lCAO4D9TtJ2nQIv0C/QDAOgGL9Lp22Yt5rl1NTLky03rWrUB+p+W2KyqubUr72SpDOSSJEonzKHiPv6dsB7UT1LduLkJuM2afyy0bzvO4RZdmtbIZSGTRHZlS069qlbVK3k6AYGkQDA0DQDonTpTaVMnTpqUSkJKlrUbkhI1kmK3rJdQuRIaKUiz5BPYB7jMV41CD3++sWx3ltv5LNqm9au9Sj+VCRrUo7hFg2IzsBhLZthftmzCO+Yvao7vkNA0AxfA0A6RAMCCpKUqJUAALySbgBFeVsLXUuzbPWQxQr25m2coH/AMiFa/f0rVK6ZmO1hkiemehIIKuwoFBvFyrjGLByIc89MYsnIxz/ALIxZORjn/ZGLJyMc89MYspyP6/2xi0nIvr/AGxi2nI/r/bGLYyL6/2xi5LyM8/7Yxbl5Gef9sYuSsjPPHTGLkrI1c8dMYuSMjXzh0xi63yRfOHTFR/iO9tpktk1bBpJWLpp7fbWtPh1CCTBJPwN3udfqk6vgKcph7Ui3KW02VKEhIK1zL9atQFwJjCu1szZ+fpjCy18zZ+fpjCu1syZefpjCu1syZefpjCq18yZ+fpjCq18yZ+fpjCm18zZ+fpjCi1s0Z+fpjCe1szZ+fpjCe1s0Z+fpjCa180Z+fpjCa1szZ+fpjCa1szZefpjCW1s0Zefpi36Etan2gdrVKcSAblqlX+wTvBAMKB7ou9/T9vPKffJctriki6bLP5Vo3H9DFl2m1tdlIetV9qXMGralW1KtxGgGAYvgQDoBi+L9A0TZUtxKmSp0tK5cwFK0K7wUnWCIrWjlU+4DltethOPsE95lK8CjB+ApipnVPPAtN62yyBPk7FDeNyhsMNHbZ+2kum04TJMxPaSobR+hG0bIEXwDpB0AwIHqO2rZ+2nNXMlM2TMR2VoVqI/Q7jsisKWn049ISVTGc4kyJvy1lCvmII9+DdFH1VNsB0JThalMJyh+1RrKD40jeIkzpLiVLnSZqZkqYkKQtJvSUnUQdAOi+BF+gHQNA0WjZzO1Wc5m8lCZKmC4jaDsUk7FDYYqWnHtOv1t56SqUq8yJwHctH/ANG2B78G4xR1ZKsLttXiVzGSzeAk3mUraUg6wdojEum9zzkp64xMprc85KeuMTKa8Lzkp64xMprwvOSnrjE2mvC85KeuMTaa8LzlJ64xNprwveSnrjE6mvC95KeuMT6Z3POSnrjE+mdzzlJ6oxOpnc85Q6oxPpjc85SeqMT6YOx5yU9cYn0xue8lPXFY1tYFuWKtk1kT1zzNQpCpqAkIuPeoHtHX8APWv9S+L4vGjVo/4+Bs6zHtquA3ZN1TphBNydgG0k9wEYfVR/Ao5qIw9qj+BRzURh/VWXDmojD6qsuHNRGH1VZcOaiMPqqy4c1EYf1Xlf1ZfVGH9WZX9VHVGH1WZX9WX1Rh9VeWfVl9UYf1blJ5qOqMP6tyo81HVGH1W5T9VHVGH1XZSeajqi0qSt+yGxdPrPXLkhQSV9pKgCd/ZJ+As6z3dpu5LVrKMybMNwA/7JOwDaYpun29PMBIRcufMuLib41bh/KNnq3iL4ECO6Bd6m0d0fiBWMp6ldj2esKkBX7xOGpage5Cd6RtPvhDRrPeOJTeRKVMnTFBKEDWSYpSmJNPNSVkLezUj9rM2Aa+wn5DadI9QQDovgQNAivK2S2TPsezZl80jsOZwP5AdaE/PeYJJ99KlrmrQhAJWSAABeSdwikaTRYklLp0Ap/MRcdolJOwfPeY1QDov0iBoBi+AdNb1l/k6FWcwX+/LR7ax/oAjZ/OYUpSiSSSSbyT3kn39BubFZv5860ZqJc5KB/h1zPyJO0/JW6PSanh/vTXjj0mp7OmvHAqens6a8celFO501449Kacztrxx6U05nbXjj0ppzPGnHHpTTeeNOOPSqnM8accelVN54044FVU3njTjj0rprPWnHAqums8accelVNZ4044qav7PYNDLsp0hy7mC4LR3oljxE7VbhE+dNcTVzpswrmLUVKUokqJOsknWfgAbovMXnfF/wAzHai+L4vMdo747R3x2jvgKO+O18zHa+cXnfBJ/rX/AP/EADQRAAEDAQUFBAkFAAAAAAAAAAIAAQQDBRIUU5IREzBCVBUjMkMGICExM0RQUqIQImFyof/aAAgBAgEBPwD6pTpnVK6A3iT2fJ+z/U8GQ3InhyG5FhqzcqehUbkW7qfYnE25eBTA6piADeIlCgNFD2/ELxIhRCiFEKIUQqq93gWXXs+NT3lQu+/qitWC/m/i6e04b+annxcxFOi5iKZGfmRSo78yORS2ftJETk+1+BRgTK4bylQMhT2XO6U12ZOb5c12dMyDTwJWQawUnKNYORlIo9YG2vS4NkWoUM92fwS/H+UziY3hRCiFEKIUQog2+9S4z0ivD4eDY9rYd9xXLu+UvtRWlA6oEVowepBFPhZ4IpsPPBFMiZ4IpUbNBHXjG2x6oKsICbsBXh4AAVQhAAvES7Om9Kel1gJnSnpdYGY3y56Vg5TeQelYSVkHpWGkZJ6Vh6+UaISF9hD64iREIj73Vh2Jg6bSKw98X4ohRCiFEKIUQqVWCPTvEq1YqxuRev6Nw4Aji5MgN5yARN7EU6D1YamRTYXVBqZFMh9QGpkUqJ1AamRSonUBqZFJi54amVaXGpgRb0FKlHKqXn8PLwNqvOrzra6vP+u36t//xAA2EQABBAEBAwkECwEAAAAAAAACAAEDBAWiEjFDBhETFDAyQkRSICFBkhYjM1BTVGBhcrHB0f/aAAgBAwEBPwD70llCGMpJC2RT5jHtxtLp85jm42l0/KDFtvsaXT8pMS3mdLp+U+HbzOl0/KvCN5vS6+l+Cbfb0uqOQq5KBp6x7Ufd7rt/ftkTA3O+5ZC0dk9lvsxRgjBGCMEYI41hMBLl7PpgDvn/AIq1aGpBHBCGzGDcw+3binmbZDuosbYfwo8VbfhosNdfhamR4PIPwtTIsBkX4GpkfJzKPug1MoOSuSmmAZI+jDxntMqVOvQrhBCGyI6v3fsHkAX95J7ELeNPbr/GVddqNxl1+m3HBPk6Db7QJ8tjvjaBRZOhNIMYWgci7GWPbZHGjBGCMFJGjBOxCTEKwmYG4HQTF9cOrsZYtv3sjryP4UdSV+EjpWH4SPH2X3QGjxlx+AaPE338qaHFZSIwOOuYkKoS2ZawPZi6OT4/97F3ZOYN4l0sbeNl08P4oJ7EDcUF1mv+YD5l1uq3mA+ZkMkcjc4GxD2DROze9GCMFICMEYIwVelJbl2B3KtWjqxDFHub260cXNtmYI3i9aNg9aMWRx86OE/Qjry+hdSnM+ZgVatHWjYQb+X6F//Z\" /></svg>';function Zx(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}function Yx(e){return t=>{const{key:n=null,...r}=t;return{type:e,props:Zx(r),key:n}}}const Jx=Yx(\"Container\"),Xx=Yx(\"Box\"),Qx=Yx(\"Heading\"),ek=Yx(\"Text\"),tk=Yx(\"Section\"),nk=Yx(\"Row\"),rk=Yx(\"Address\"),ok=Yx(\"Image\"),ik=Yx(\"Footer\"),ak=Yx(\"Button\"),sk=Yx(\"Link\");function ck(e,t,n){const{cluster:r}=mu[e];return Lu({baseUrl:\"https://solscan.io\",path:`/${t}/${n}`,queryParams:r?{cluster:r}:void 0})}const uk=({domain:e,scope:t,address:n})=>Vx(Xx,{direction:\"horizontal\",alignment:\"center\",children:Vx(sk,{href:ck(t,\"address\",n),children:e})});function lk(e,t){return`${e}:${t}`}const dk=JSON.parse('{\"D\":{\"send.title\":{\"message\":\"Send\"},\"send.balance\":{\"message\":\"Balance\"},\"send.maxButton\":{\"message\":\"Max\"},\"send.cancelButton\":{\"message\":\"Cancel\"},\"send.continueButton\":{\"message\":\"Continue\"},\"send.fromField\":{\"message\":\"From\"},\"send.toField\":{\"message\":\"To\"},\"send.amountField\":{\"message\":\"Amount\"},\"send.assetField\":{\"message\":\"Token\"},\"send.toPlaceholder\":{\"message\":\"Enter public address or domain name\"},\"send.fromRequiredError\":{\"message\":\"Account is required\"},\"send.amountRequiredError\":{\"message\":\"Amount is required\"},\"send.amountGreatherThanMinimumBalanceForRentExemptionError\":{\"message\":\"Amount must be greater than {minimumValue}\"},\"send.insuffientSolToCoverFee\":{\"message\":\"Insufficient SOL balance to cover the transaction fee\"},\"send.toRequiredError\":{\"message\":\"To address is required\"},\"send.toInvalidError\":{\"message\":\"Invalid Solana address or domain name\"},\"send.toInvalidErrorDomain\":{\"message\":\"Unable to resolve domain name\"},\"send.toDomainResolutionStatus.initial\":{\"message\":\"Domain\"},\"send.toDomainResolutionStatus.fetching\":{\"message\":\"Resolving domain name...\"},\"send.toDomainResolutionStatus.fetched\":{\"message\":\"Domain name resolved.\"},\"send.toDomainResolutionStatus.error\":{\"message\":\"Unable to resolve domain name.\"},\"send.insufficientBalance\":{\"message\":\"Insufficient balance\"},\"send.simulationTitleAPIError\":{\"message\":\"Because of an error, we couldn\\'t check for security alerts.\"},\"send.simulationMessageAPIError\":{\"message\":\"Only continue if you trust every address involved.\"},\"send.simulationTitleError\":{\"message\":\"Transaction simulation failed\"},\"send.simulationMessageError\":{\"message\":\"This transaction was reverted during simulation.\"},\"send.selectedTokenPriceNotAvailable\":{\"message\":\"Prices for tokens in {currency} are currently not available. You are still able to send tokens.\"},\"send.confirmation.title\":{\"message\":\"Review\"},\"send.confirmation.from\":{\"message\":\"From\"},\"send.confirmation.recipient\":{\"message\":\"Recipient\"},\"send.confirmation.network\":{\"message\":\"Network\"},\"send.confirmation.transactionSpeed\":{\"message\":\"Transaction speed\"},\"send.confirmation.fee\":{\"message\":\"Network fee\"},\"send.confirmation.sendButton\":{\"message\":\"Send\"},\"send.confirmation.cancelButton\":{\"message\":\"Cancel\"},\"send.confirmation.viewTransaction\":{\"message\":\"View transaction\"},\"send.send-pending.title\":{\"message\":\"Sending...\"},\"send.send-pending.subtitle\":{\"message\":\"Your transaction was submitted.\"},\"send.transaction-success.title\":{\"message\":\"Sent\"},\"send.transaction-success.subtitle\":{\"message\":\"{amount} {tokenSymbol} was successfully sent\"},\"send.transaction-failure.title\":{\"message\":\"Transaction failed\"},\"send.transaction-failure.subtitle\":{\"message\":\"Unable to send {amount} {tokenSymbol}\"},\"confirmation.account\":{\"message\":\"Account\"},\"confirmation.recipient\":{\"message\":\"Recipient\"},\"confirmation.network\":{\"message\":\"Network\"},\"confirmation.estimatedChanges\":{\"message\":\"Estimated changes\"},\"confirmation.estimatedChanges.send\":{\"message\":\"You send\"},\"confirmation.estimatedChanges.receive\":{\"message\":\"You receive\"},\"confirmation.estimatedChanges.notAvailable\":{\"message\":\"Not available\"},\"confirmation.estimatedChanges.noChanges\":{\"message\":\"No changes\"},\"confirmation.estimatedChanges.tooltip\":{\"message\":\"Estimated changes are what might happen if you go through with this transaction. This is just a prediction, not a guarantee.\"},\"confirmation.advanced.show\":{\"message\":\"Show advanced\"},\"confirmation.advanced.hide\":{\"message\":\"Hide advanced\"},\"confirmation.cancelButton\":{\"message\":\"Cancel\"},\"confirmation.confirmButton\":{\"message\":\"Confirm\"},\"confirmation.signAndSendTransaction.title\":{\"message\":\"Transaction request\"},\"confirmation.signTransaction.title\":{\"message\":\"Signing request\"},\"confirmation.sendAndConfirmTransaction.title\":{\"message\":\"Sending and confirming transaction\"},\"confirmation.advanced.unknownInstruction\":{\"message\":\"Unknown\"},\"confirmation.advanced.programId\":{\"message\":\"Program ID\"},\"confirmation.advanced.data\":{\"message\":\"Data\"},\"confirmation.fee\":{\"message\":\"Network fee\"},\"confirmation.feeError\":{\"message\":\"Unable to estimate fee\"},\"confirmation.origin\":{\"message\":\"Request from\"},\"confirmation.origin.tooltip\":{\"message\":\"This is the site asking for your confirmation.\"},\"confirmation.simulationErrorTitle\":{\"message\":\"This transaction was reverted during simulation.\"},\"confirmation.simulationErrorSubtitle\":{\"message\":\"{reason}\"},\"confirmation.validationErrorTitle\":{\"message\":\"This is a deceptive request\"},\"confirmation.validationErrorSubtitle\":{\"message\":\"If you approve this request, a third party known for scams will take all your assets.\"},\"confirmation.validationErrorLearnMore\":{\"message\":\"Learn more\"},\"confirmation.validationErrorSecurityAdviced\":{\"message\":\"Security advice by\"},\"confirmation.signMessage.title\":{\"message\":\"Sign message\"},\"confirmation.signMessage.message\":{\"message\":\"Message\"},\"confirmation.signIn.title\":{\"message\":\"Sign-in request\"},\"confirmation.signIn.description\":{\"message\":\"A site wants you to sign in to prove you own this account.\"},\"confirmation.signIn.domain\":{\"message\":\"Domain\"},\"confirmation.signIn.unknownDomain\":{\"message\":\"Unknown domain\"},\"confirmation.signIn.signingInWith\":{\"message\":\"Signing in with\"},\"confirmation.signIn.badAccount\":{\"message\":\"This site is asking you to sign in using the wrong account.\"},\"confirmation.signIn.message\":{\"message\":\"Message\"},\"confirmation.signIn.statement\":{\"message\":\"Statement\"},\"confirmation.signIn.version\":{\"message\":\"Version\"},\"confirmation.signIn.chainId\":{\"message\":\"Chain ID\"},\"confirmation.signIn.nonce\":{\"message\":\"Nonce\"},\"confirmation.signIn.issuedAt\":{\"message\":\"Issued at\"},\"confirmation.signIn.expirationTime\":{\"message\":\"Expiration time\"},\"confirmation.signIn.notBefore\":{\"message\":\"Not before\"},\"confirmation.signIn.requestId\":{\"message\":\"Request ID\"},\"confirmation.signIn.resources\":{\"message\":\"Resources\"},\"confirmation.signIn.badDomain\":{\"message\":\"This site is asking you to sign in using the wrong domain.\"},\"transactionScan.errors.accountAlreadyInUse\":{\"message\":\"An account with the same address already exists.\"},\"transactionScan.errors.insufficientSol\":{\"message\":\"Account does not have enough SOL to perform the operation.\"},\"transactionScan.errors.slippageToleranceExceeded\":{\"message\":\"The transaction was reverted because the slippage tolerance was exceeded.\"},\"transactionScan.errors.unknownError\":{\"message\":\"An unknown error occurred.\"}}}'),fk=JSON.parse('{\"D\":{\"send.title\":{\"message\":\"Enviar\"},\"send.balance\":{\"message\":\"Saldo\"},\"send.maxButton\":{\"message\":\"Máx.\"},\"send.cancelButton\":{\"message\":\"Cancelar\"},\"send.continueButton\":{\"message\":\"Continuar\"},\"send.fromField\":{\"message\":\"De\"},\"send.toField\":{\"message\":\"Para\"},\"send.amountField\":{\"message\":\"Monto\"},\"send.assetField\":{\"message\":\"Token\"},\"send.toPlaceholder\":{\"message\":\"Introduzca la dirección pública\"},\"send.fromRequiredError\":{\"message\":\"La cuenta es obligatoria\"},\"send.amountRequiredError\":{\"message\":\"El monto es obligatorio\"},\"send.amountGreatherThanMinimumBalanceForRentExemptionError\":{\"message\":\"El valor debe ser superior a {minimumValue}\"},\"send.insuffientSolToCoverFee\":{\"message\":\"Saldo de SOL insuficiente para cubrir la tarifa de transacción\"},\"send.toRequiredError\":{\"message\":\"La dirección del destinatario es obligatoria\"},\"send.toInvalidError\":{\"message\":\"Dirección de Solana no válida\"},\"send.insufficientBalance\":{\"message\":\"Saldo insuficiente\"},\"send.simulationTitleAPIError\":{\"message\":\"Debido a un error, no pudimos verificar las alertas de seguridad.\"},\"send.simulationMessageAPIError\":{\"message\":\"Continúa solo si confías en todas las direcciones involucradas.\"},\"send.simulationTitleError\":{\"message\":\"Simulación de transacción fallida\"},\"send.simulationMessageError\":{\"message\":\"Esta transacción se revirtió durante la simulación.\"},\"send.selectedTokenPriceNotAvailable\":{\"message\":\"Los precios de los tokens en {currency} no están disponibles actualmente. Aún puede enviar tokens.\"},\"send.confirmation.title\":{\"message\":\"Revisar\"},\"send.confirmation.from\":{\"message\":\"De\"},\"send.confirmation.recipient\":{\"message\":\"Destinatario\"},\"send.confirmation.network\":{\"message\":\"Red\"},\"send.confirmation.transactionSpeed\":{\"message\":\"Velocidad de la transacción\"},\"send.confirmation.fee\":{\"message\":\"Tarifa de red\"},\"send.confirmation.sendButton\":{\"message\":\"Enviar\"},\"send.confirmation.cancelButton\":{\"message\":\"Cancelar\"},\"send.confirmation.viewTransaction\":{\"message\":\"Ver transacción\"},\"send.send-pending.title\":{\"message\":\"Enviando...\"},\"send.send-pending.subtitle\":{\"message\":\"Se envió su transacción.\"},\"send.transaction-success.title\":{\"message\":\"Enviado\"},\"send.transaction-success.subtitle\":{\"message\":\"El envío de {amount} {tokenSymbol} se realizó correctamente\"},\"send.transaction-failure.title\":{\"message\":\"Transacción fallida\"},\"send.transaction-failure.subtitle\":{\"message\":\"Error al enviar {amount} {tokenSymbol}\"},\"confirmation.account\":{\"message\":\"Cuenta\"},\"confirmation.network\":{\"message\":\"Red\"},\"confirmation.estimatedChanges\":{\"message\":\"Cambios estimados\"},\"confirmation.estimatedChanges.send\":{\"message\":\"Usted envía\"},\"confirmation.estimatedChanges.receive\":{\"message\":\"Usted recibe\"},\"confirmation.estimatedChanges.notAvailable\":{\"message\":\"No disponible\"},\"confirmation.estimatedChanges.noChanges\":{\"message\":\"Sin cambios\"},\"confirmation.estimatedChanges.tooltip\":{\"message\":\"Los cambios estimados son los que podrían producirse si sigue adelante con esta transacción. Esto es solo una predicción, no una garantía.\"},\"confirmation.advanced.show\":{\"message\":\"Mostrar avanzadas\"},\"confirmation.advanced.hide\":{\"message\":\"Ocultar avanzadas\"},\"confirmation.cancelButton\":{\"message\":\"Cancelar\"},\"confirmation.confirmButton\":{\"message\":\"Confirmar\"},\"confirmation.signAndSendTransaction.title\":{\"message\":\"Solicitud de transacción\"},\"confirmation.signTransaction.title\":{\"message\":\"Signing request\"},\"confirmation.sendAndConfirmTransaction.title\":{\"message\":\"Sending and confirming transaction\"},\"confirmation.advanced.unknownInstruction\":{\"message\":\"Desconocida\"},\"confirmation.advanced.programId\":{\"message\":\"ID del programa\"},\"confirmation.advanced.data\":{\"message\":\"Datos\"},\"confirmation.fee\":{\"message\":\"Tarifa de red\"},\"confirmation.feeError\":{\"message\":\"No se puede calcular la tarifa\"},\"confirmation.origin\":{\"message\":\"Solicitud de\"},\"confirmation.origin.tooltip\":{\"message\":\"This is the site asking for your confirmation.\"},\"confirmation.simulationErrorTitle\":{\"message\":\"Esta transacción se revirtió durante la simulación.\"},\"confirmation.simulationErrorSubtitle\":{\"message\":\"Motivo: {reason}\"},\"confirmation.validationErrorTitle\":{\"message\":\"Esta es una solicitud engañosa\"},\"confirmation.validationErrorSubtitle\":{\"message\":\"Si aprueba esta solicitud, un tercero conocido por sus estafas se quedará con todos sus activos.\"},\"confirmation.validationErrorLearnMore\":{\"message\":\"Conozca más\"},\"confirmation.validationErrorSecurityAdviced\":{\"message\":\"Asesoramiento de seguridad por\"},\"confirmation.signMessage.title\":{\"message\":\"Firmar mensaje\"},\"confirmation.signMessage.message\":{\"message\":\"Mensaje\"},\"confirmation.signIn.title\":{\"message\":\"Solicitud de inicio de sesión\"},\"confirmation.signIn.description\":{\"message\":\"Un sitio quiere que inicie sesión para demostrar que usted es el titular de esta cuenta.\"},\"confirmation.signIn.domain\":{\"message\":\"Domain\"},\"confirmation.signIn.unknownDomain\":{\"message\":\"Dominio desconocido\"},\"confirmation.signIn.signingInWith\":{\"message\":\"Iniciar sesión con\"},\"confirmation.signIn.badAccount\":{\"message\":\"Este sitio le pide que inicie sesión con la cuenta incorrecta.\"},\"confirmation.signIn.message\":{\"message\":\"Mensaje\"},\"confirmation.signIn.statement\":{\"message\":\"Declaración\"},\"confirmation.signIn.version\":{\"message\":\"Versión\"},\"confirmation.signIn.chainId\":{\"message\":\"ID de cadena\"},\"confirmation.signIn.nonce\":{\"message\":\"Nonce\"},\"confirmation.signIn.issuedAt\":{\"message\":\"Emitido a las\"},\"confirmation.signIn.expirationTime\":{\"message\":\"Hora de caducidad\"},\"confirmation.signIn.notBefore\":{\"message\":\"No antes de\"},\"confirmation.signIn.requestId\":{\"message\":\"ID de solicitud\"},\"confirmation.signIn.resources\":{\"message\":\"Recursos\"},\"confirmation.signIn.badDomain\":{\"message\":\"This site is asking you to sign in using the wrong domain.\"},\"transactionScan.errors.accountAlreadyInUse\":{\"message\":\"Ya existe una cuenta con la misma dirección.\"},\"transactionScan.errors.insufficientSol\":{\"message\":\"La cuenta no tiene suficiente SOL para realizar la operación.\"},\"transactionScan.errors.slippageToleranceExceeded\":{\"message\":\"La transacción se revirtió porque se superó la tolerancia de deslizamiento.\"},\"transactionScan.errors.unknownError\":{\"message\":\"An unknown error occurred.\"}}}'),hk={en:dk.D,es:fk.D};function pk(e){const t=hk[e]??hk.en;return(e,n)=>{let r=t?.[e]?.message??e;return n&&r&&Object.keys(n).forEach(e=>{const t=new RegExp(`\\\\{${e}\\\\}`,\"gu\");r=r.replace(t,n[e]??\"\")}),r}}function gk(e){if(e===uu)return\"MetaMask\";try{return new URL(e).hostname}catch(e){throw new Error(\"Invalid URL\")}}const mk=({label:e,value:t})=>null!=t?Hx(Xx,{alignment:\"space-between\",direction:\"horizontal\",children:[Vx(ek,{fontWeight:\"medium\",color:\"alternative\",children:e}),Vx(ek,{children:t})]}):null,yk=1e-6,wk=new wr(yk).decimalPlaces();function vk(e,t){const[n]=t.split(\"_\");try{const r=new wr(e);if(r.isNaN())return\"0\";if(r.isZero())return\"0\";if(r.abs().lt(yk))return`<${function(e,t){const n=new wr(t),r=n.decimalPlaces(),o=n.toFixed(r??0),[i]=e.split(\"_\"),[a,s]=o.split(\".\"),c=new Intl.NumberFormat(i).format(a);return s?`${c}.${s}`:c}(t,yk)}`;if(r.abs().lt(1))return new Intl.NumberFormat(n,{maximumSignificantDigits:3}).format(Number(r.toFixed(wk??0)));const o=r.abs().integerValue().toString().length,i=Math.max(0,3-o+1);return new Intl.NumberFormat(t,{maximumFractionDigits:i}).format(r.toFixed(i))}catch(e){return nu.error(e),\"0\"}}function bk(e,t,n){const r=new wr(e).toNumber(),[o]=n.split(\"_\");return r.toLocaleString(o,{style:\"currency\",currency:t,maximumFractionDigits:2,minimumFractionDigits:2})}const Ak=({asset:e,preferences:t})=>{const n=e.type;return Hx(Xx,{direction:\"vertical\",crossAlignment:\"end\",children:[Hx(Xx,{direction:\"horizontal\",alignment:\"center\",children:[Hx(ek,{color:\"in\"===n?\"success\":\"error\",children:[\"in\"===n?\"+\":\"-\",vk(e.value??0,t.locale)]}),e.logo?Vx(Xx,{alignment:\"center\",center:!0,children:Vx(ok,{borderRadius:\"full\",src:e.logo,width:16,height:16})}):null,Vx(ek,{children:e.symbol??\"\"})]}),e.price?Vx(ek,{color:\"muted\",children:bk(e.price.toString(),t.currency,t.locale)}):null]})},Sk=Yx(\"Tooltip\");var Ek;!function(e){e.Accessibility=\"accessibility\",e.Activity=\"activity\",e.AddCard=\"add-card\",e.AddCircle=\"add-circle\",e.AddSquare=\"add-square\",e.Add=\"add\",e.Ai=\"ai\",e.AlternateEmail=\"alternate-email\",e.Apple=\"apple\",e.Apps=\"apps\",e.Arrow2Down=\"arrow-2-down\",e.Arrow2Left=\"arrow-2-left\",e.Arrow2Right=\"arrow-2-right\",e.Arrow2UpRight=\"arrow-2-up-right\",e.Arrow2Up=\"arrow-2-up\",e.ArrowCircleDown=\"arrow-circle-down\",e.ArrowCircleUp=\"arrow-circle-up\",e.ArrowDoubleLeft=\"arrow-double-left\",e.ArrowDoubleRight=\"arrow-double-right\",e.ArrowDown=\"arrow-down\",e.ArrowDropDownCircle=\"arrow-drop-down-circle\",e.ArrowLeft=\"arrow-left\",e.ArrowRight=\"arrow-right\",e.ArrowUp=\"arrow-up\",e.Attachment=\"attachment\",e.Ban=\"ban\",e.BankAssured=\"bank-assured\",e.Bank=\"bank\",e.Bold=\"bold\",e.Book=\"book\",e.Bookmark=\"bookmark\",e.Bridge=\"bridge\",e.Briefcase=\"briefcase\",e.Bulb=\"bulb\",e.BuySell=\"buy-sell\",e.Cake=\"cake\",e.Calculator=\"calculator\",e.Calendar=\"calendar\",e.Call=\"call\",e.Camera=\"camera\",e.Campaign=\"campaign\",e.CardPos=\"card-pos\",e.Card=\"card\",e.Cash=\"cash\",e.Category=\"category\",e.Chart=\"chart\",e.CheckBold=\"check-bold\",e.Check=\"check\",e.CircleX=\"circle-x\",e.ClockFilled=\"clock-filled\",e.Clock=\"clock\",e.Close=\"close\",e.CloudDownload=\"cloud-download\",e.CloudUpload=\"cloud-upload\",e.Cloud=\"cloud\",e.CodeCircle=\"code-circle\",e.Code=\"code\",e.Coin=\"coin\",e.Collapse=\"collapse\",e.Confirmation=\"confirmation\",e.Connect=\"connect\",e.CopySuccess=\"copy-success\",e.Copy=\"copy\",e.CreditCheck=\"credit-check\",e.CurrencyFranc=\"currency-franc\",e.CurrencyLira=\"currency-lira\",e.CurrencyPound=\"currency-pound\",e.CurrencyYuan=\"currency-yuan\",e.Customize=\"customize\",e.Danger=\"danger\",e.DarkFilled=\"dark-filled\",e.Dark=\"dark\",e.Data=\"data\",e.Description=\"description\",e.Details=\"details\",e.Diagram=\"diagram\",e.DocumentCode=\"document-code\",e.Download=\"download\",e.Draft=\"draft\",e.EcoLeaf=\"eco-leaf\",e.EditSquare=\"edit-square\",e.Edit=\"edit\",e.EncryptedAdd=\"encrypted-add\",e.Eraser=\"eraser\",e.Error=\"error\",e.Ethereum=\"ethereum\",e.Exchange=\"exchange\",e.ExpandVertical=\"expand-vertical\",e.Expand=\"expand\",e.ExploreFilled=\"explore-filled\",e.Explore=\"explore\",e.Export=\"export\",e.Extension=\"extension\",e.EyeSlash=\"eye-slash\",e.Eye=\"eye\",e.FaceId=\"face-id\",e.Feedback=\"feedback\",e.File=\"file\",e.Filter=\"filter\",e.Fingerprint=\"fingerprint\",e.Fire=\"fire\",e.FirstPage=\"first-page\",e.Flag=\"flag\",e.FlashSlash=\"flash-slash\",e.Flash=\"flash\",e.Flask=\"flask\",e.Flower=\"flower\",e.Folder=\"folder\",e.Forest=\"forest\",e.FullCircle=\"full-circle\",e.Gas=\"gas\",e.Gift=\"gift\",e.GlobalSearch=\"global-search\",e.Global=\"global\",e.Graph=\"graph\",e.Hardware=\"hardware\",e.HashTag=\"hash-tag\",e.HeartFilled=\"heart-filled\",e.Heart=\"heart\",e.Hierarchy=\"hierarchy\",e.HomeFilled=\"home-filled\",e.Home=\"home\",e.Image=\"image\",e.Info=\"info\",e.Inventory=\"inventory\",e.Joystick=\"joystick\",e.KeepFilled=\"keep-filled\",e.Keep=\"keep\",e.Key=\"key\",e.LastPage=\"last-page\",e.LightFilled=\"light-filled\",e.Light=\"light\",e.Link=\"link\",e.Loading=\"loading\",e.Location=\"location\",e.LockSlash=\"lock-slash\",e.Lock=\"lock\",e.LockedFilled=\"locked-filled\",e.Login=\"login\",e.Logout=\"logout\",e.Mail=\"mail\",e.Map=\"map\",e.Menu=\"menu\",e.MessageQuestion=\"message-question\",e.Messages=\"messages\",e.Mic=\"mic\",e.MinusBold=\"minus-bold\",e.MinusSquare=\"minus-square\",e.Minus=\"minus\",e.Mobile=\"mobile\",e.MoneyBag=\"money-bag\",e.Money=\"money\",e.Monitor=\"monitor\",e.MoreHorizontal=\"more-horizontal\",e.MoreVertical=\"more-vertical\",e.MountainFlag=\"mountain-flag\",e.MusicNote=\"music-note\",e.Notification=\"notification\",e.PageInfo=\"page-info\",e.Palette=\"palette\",e.PasswordCheck=\"password-check\",e.Pending=\"pending\",e.People=\"people\",e.PersonCancel=\"person-cancel\",e.Pin=\"pin\",e.Plant=\"plant\",e.Plug=\"plug\",e.PlusAndMinus=\"plus-and-minus\",e.PolicyAlert=\"policy-alert\",e.Print=\"print\",e.PriorityHigh=\"priority-high\",e.PrivacyTip=\"privacy-tip\",e.ProgrammingArrows=\"programming-arrows\",e.Publish=\"publish\",e.QrCode=\"qr-code\",e.Question=\"question\",e.Receive=\"receive\",e.Received=\"received\",e.Refresh=\"refresh\",e.RemoveMinus=\"remove-minus\",e.Report=\"report\",e.Rocket=\"rocket\",e.SaveFilled=\"save-filled\",e.Save=\"save\",e.Saving=\"saving\",e.ScanBarcode=\"scan-barcode\",e.ScanFocus=\"scan-focus\",e.Scan=\"scan\",e.Search=\"search\",e.SecurityAlert=\"security-alert\",e.SecurityCross=\"security-cross\",e.SecurityKey=\"security-key\",e.SecuritySearch=\"security-search\",e.SecuritySlash=\"security-slash\",e.SecurityTick=\"security-tick\",e.SecurityTime=\"security-time\",e.SecurityUser=\"security-user\",e.Security=\"security\",e.Send=\"send\",e.SentimentDissatisfied=\"sentiment-dissatisfied\",e.SentimentNeutral=\"sentiment-neutral\",e.SentimentSatisfied=\"sentiment-satisfied\",e.SentimentVerySatisfied=\"sentiment-very-satisfied\",e.SettingFilled=\"setting-filled\",e.Setting=\"setting\",e.Share=\"share\",e.ShieldLock=\"shield-lock\",e.ShoppingBag=\"shopping-bag\",e.ShoppingCart=\"shopping-cart\",e.SignalCellular=\"signal-cellular\",e.Slash=\"slash\",e.Sms=\"sms\",e.SnapsMobile=\"snaps-mobile\",e.SnapsPlus=\"snaps-plus\",e.SnapsRound=\"snaps-round\",e.Snaps=\"snaps\",e.SortByAlpha=\"sort-by-alpha\",e.Sort=\"sort\",e.Sparkle=\"sparkle\",e.Speed=\"speed\",e.Speedometer=\"speedometer\",e.Square=\"square\",e.Stake=\"stake\",e.StarFilled=\"star-filled\",e.Star=\"star\",e.Start=\"start\",e.Storefront=\"storefront\",e.Student=\"student\",e.SwapHorizontal=\"swap-horizontal\",e.SwapVertical=\"swap-vertical\",e.TabClose=\"tab-close\",e.TableRow=\"table-row\",e.Tablet=\"tablet\",e.Tag=\"tag\",e.ThumbDownFilled=\"thumb-down-filled\",e.ThumbDown=\"thumb-down\",e.ThumbUpFilled=\"thumb-up-filled\",e.ThumbUp=\"thumb-up\",e.Tint=\"tint\",e.Tooltip=\"tooltip\",e.Translate=\"translate\",e.Trash=\"trash\",e.TrendDown=\"trend-down\",e.TrendUp=\"trend-up\",e.TriangleUp=\"triangle-up\",e.TriangleDown=\"triangle-down\",e.Undo=\"undo\",e.Unfold=\"unfold\",e.UnlockedFilled=\"unlocked-filled\",e.Unpin=\"unpin\",e.UploadFile=\"upload-file\",e.Upload=\"upload\",e.Usb=\"usb\",e.UserCheck=\"user-check\",e.UserCircleAdd=\"user-circle-add\",e.UserCircleRemove=\"user-circle-remove\",e.UserCircle=\"user-circle\",e.User=\"user\",e.VerifiedFilled=\"verified-filled\",e.Verified=\"verified\",e.Videocam=\"videocam\",e.ViewColumn=\"view-column\",e.ViewInAr=\"view-in-ar\",e.VolumeOff=\"volume-off\",e.VolumeUp=\"volume-up\",e.WalletFilled=\"wallet-filled\",e.Wallet=\"wallet\",e.Warning=\"warning\",e.WebTraffic=\"web-traffic\",e.Widgets=\"widgets\",e.WifiOff=\"wifi-off\",e.Wifi=\"wifi\",e.X=\"x\"}(Ek||(Ek={}));const xk=Yx(\"Icon\"),kk=({preferences:e})=>{const t=pk(e.locale);return Hx(Xx,{direction:\"horizontal\",center:!0,children:[Vx(ek,{fontWeight:\"medium\",children:t(\"confirmation.estimatedChanges\")}),Vx(Sk,{content:t(\"confirmation.estimatedChanges.tooltip\"),children:Vx(xk,{name:\"info\"})})]})},Ik=Yx(\"Skeleton\"),Tk=({preferences:e})=>Hx(tk,{direction:\"vertical\",children:[Vx(kk,{preferences:e}),Hx(Xx,{alignment:\"space-between\",direction:\"horizontal\",children:[Vx(Ik,{width:60,height:20}),Vx(Xx,{children:Hx(Xx,{direction:\"vertical\",crossAlignment:\"end\",children:[Vx(Ik,{width:100,height:20}),Vx(Ik,{width:40,height:20})]})})]})]}),_k=({changes:e,preferences:t,scanFetchStatus:n,scanStatus:r})=>{const o=pk(t.locale),i=\"fetched\"===n,a=\"error\"===n;if(\"fetching\"===n)return Vx(Tk,{preferences:t});if(a||i&&\"ERROR\"===r)return Hx(tk,{direction:\"vertical\",children:[Vx(kk,{preferences:t}),Vx(ek,{color:\"alternative\",children:o(\"confirmation.estimatedChanges.notAvailable\")})]});const s=e?.assets.filter(e=>\"out\"===e.type)??[],c=e?.assets.filter(e=>\"in\"===e.type)??[],u=s.length>0||c.length>0;return Hx(tk,i&&!u?{direction:\"vertical\",children:[Vx(kk,{preferences:t}),Vx(ek,{color:\"alternative\",children:o(\"confirmation.estimatedChanges.noChanges\")})]}:{children:[Vx(kk,{preferences:t}),s?.length>0?Hx(Xx,{alignment:\"space-between\",direction:\"horizontal\",children:[Vx(ek,{fontWeight:\"medium\",color:\"alternative\",children:o(\"confirmation.estimatedChanges.send\")}),Vx(Xx,{children:Vx(Xx,{children:s?.map(e=>Vx(Ak,{asset:e,preferences:t}))})})]}):null,Vx(Xx,{children:null}),c?.length>0?Hx(Xx,{alignment:\"space-between\",direction:\"horizontal\",children:[Vx(ek,{fontWeight:\"medium\",color:\"alternative\",children:o(\"confirmation.estimatedChanges.receive\")}),Vx(Xx,{children:Vx(Xx,{children:c?.map(e=>Vx(Ak,{asset:e,preferences:t}))})})]}):null]})};var Ck=function(e){return e.Cancel=\"confirm-sign-in-cancel\",e.Confirm=\"confirm-sign-in-confirm\",e}({});const Bk={\"confirm-sign-in-cancel\":async function({id:e}){await JE(e,!1)},\"confirm-sign-in-confirm\":async function({id:e}){await JE(e,!0)}},Rk=({params:e,origin:t,account:n,accountDomain:r,scope:o,preferences:i,networkImage:a})=>{const s=pk(i.locale),c=t?gk(t):null,{domain:u,statement:l,uri:d,version:f,chainId:h,nonce:p,issuedAt:g,expirationTime:m,notBefore:y,requestId:w,resources:v,address:b}=e,A=lk(o,n.address),S=b?lk(o,b):null,E=S!==A,x=u!==c;return Hx(Jx,{children:[Hx(Xx,{children:[Hx(Xx,{alignment:\"center\",center:!0,children:[Vx(Xx,{children:null}),Vx(Qx,{size:\"lg\",children:s(\"confirmation.signIn.title\")}),Vx(ek,{color:\"muted\",alignment:\"center\",children:s(\"confirmation.signIn.description\")})]}),i.simulateOnChainActions?Vx(_k,{changes:null,scanStatus:null,preferences:i,scanFetchStatus:\"fetched\"}):null,Hx(tk,{children:[c?Vx(nk,{label:s(\"confirmation.origin\"),tooltip:s(\"confirmation.origin.tooltip\"),children:Vx(ek,{children:c})}):null,Vx(nk,{variant:x?\"critical\":\"default\",label:s(\"confirmation.signIn.domain\"),tooltip:x?s(\"confirmation.signIn.badDomain\"):void 0,children:Vx(ek,{children:u??s(\"confirmation.signIn.unknownDomain\")})}),Vx(nk,{label:s(\"confirmation.signIn.signingInWith\"),tooltip:E?s(\"confirmation.signIn.badAccount\"):void 0,variant:E?\"warning\":\"default\",children:r?Vx(uk,{domain:r,scope:o,address:n.address}):Vx(rk,{address:A,truncate:!0,displayName:!0,avatar:!0})})]}),Hx(tk,{children:[Vx(ek,{fontWeight:\"medium\",children:s(\"confirmation.signIn.message\")}),Vx(ek,{children:l??\"\"}),Vx(mk,{label:\"URL\",value:d??\"\"}),Hx(Xx,{alignment:\"space-between\",direction:\"horizontal\",children:[Vx(ek,{fontWeight:\"medium\",color:\"alternative\",children:s(\"confirmation.network\")}),Hx(Xx,{direction:\"horizontal\",alignment:\"center\",children:[Vx(Xx,{alignment:\"center\",center:!0,children:Vx(ok,{borderRadius:\"medium\",src:a??Gx})}),Vx(ek,{children:mu[o].name})]})]}),S?Hx(Xx,{alignment:\"space-between\",direction:\"horizontal\",children:[Vx(ek,{fontWeight:\"medium\",color:\"alternative\",children:s(\"confirmation.account\")}),Vx(rk,{address:S,truncate:!0,displayName:!0,avatar:!0})]}):null,Vx(mk,{label:s(\"confirmation.signIn.version\"),value:f??\"\"}),Vx(mk,{label:s(\"confirmation.signIn.chainId\"),value:h??\"\"}),Vx(mk,{label:s(\"confirmation.signIn.nonce\"),value:p??\"\"}),Vx(mk,{label:s(\"confirmation.signIn.issuedAt\"),value:g??\"\"}),Vx(mk,{label:s(\"confirmation.signIn.expirationTime\"),value:m??\"\"}),Vx(mk,{label:s(\"confirmation.signIn.notBefore\"),value:y??\"\"}),Vx(mk,{label:s(\"confirmation.signIn.requestId\"),value:w??\"\"}),v&&v.length>0?Hx(Xx,{alignment:\"space-between\",direction:\"vertical\",children:[Vx(ek,{fontWeight:\"medium\",color:\"alternative\",children:s(\"confirmation.signIn.resources\")}),Vx(Xx,{direction:\"vertical\",children:v.map(e=>Vx(ek,{children:e},e))})]}):null]})]}),Hx(ik,{children:[Vx(ak,{name:Ck.Cancel,children:s(\"confirmation.cancelButton\")}),Vx(ak,{name:Ck.Confirm,variant:x?\"destructive\":\"primary\",children:s(\"confirmation.confirmButton\")})]})]})};var Pk=function(e){return e.Cancel=\"confirm-sign-message-cancel\",e.Confirm=\"confirm-sign-message-confirm\",e}({});const Nk={\"confirm-sign-message-cancel\":async function({id:e}){await JE(e,!1)},\"confirm-sign-message-confirm\":async function({id:e}){await JE(e,!0)}},Ok=({message:e,account:t,accountDomain:n,scope:r,locale:o,networkImage:i,origin:a})=>{const s=pk(o),{address:c}=t,u=a?gk(a):null,l=lk(r,c);return Hx(Jx,{children:[Hx(Xx,{children:[Hx(Xx,{alignment:\"center\",center:!0,children:[Vx(Xx,{children:null}),Vx(Qx,{size:\"lg\",children:s(\"confirmation.signMessage.title\")})]}),Hx(tk,{children:[Vx(Xx,{direction:\"horizontal\",center:!0,children:Vx(ek,{fontWeight:\"medium\",children:s(\"confirmation.signMessage.message\")})}),Vx(Xx,{alignment:\"space-between\",children:Vx(ek,{children:e})})]}),Hx(tk,{children:[u?Hx(Xx,{alignment:\"space-between\",direction:\"horizontal\",children:[Hx(Xx,{alignment:\"space-between\",direction:\"horizontal\",center:!0,children:[Vx(ek,{fontWeight:\"medium\",color:\"alternative\",children:s(\"confirmation.origin\")}),Vx(Sk,{content:s(\"confirmation.origin.tooltip\"),children:Vx(xk,{name:\"question\",color:\"muted\"})})]}),Vx(ek,{children:u})]}):null,Hx(Xx,{alignment:\"space-between\",direction:\"horizontal\",children:[Vx(ek,{fontWeight:\"medium\",color:\"alternative\",children:s(\"confirmation.account\")}),n?Vx(uk,{domain:n,scope:r,address:c}):Vx(rk,{address:l,truncate:!0,displayName:!0,avatar:!0})]}),Hx(Xx,{alignment:\"space-between\",direction:\"horizontal\",children:[Vx(ek,{fontWeight:\"medium\",color:\"alternative\",children:s(\"confirmation.network\")}),Hx(Xx,{direction:\"horizontal\",alignment:\"center\",children:[Vx(Xx,{alignment:\"center\",center:!0,children:Vx(ok,{borderRadius:\"medium\",src:i??Gx})}),Vx(ek,{children:mu[r].name})]})]})]})]}),Hx(ik,{children:[Vx(ak,{name:Pk.Cancel,children:s(\"confirmation.cancelButton\")}),Vx(ak,{name:Pk.Confirm,children:s(\"confirmation.confirmButton\")})]})]})};const Uk=new Set([\"TransferSol\",\"TransferSolWithSeed\",\"Transfer\",\"TransferChecked\",\"TransferCheckedWithFee\"]);var Mk=function(e){return e.ShowAdvanced=\"confirm-sign-and-send-transaction-show-advanced\",e.Cancel=\"confirm-sign-and-send-transaction-cancel\",e.Confirm=\"confirm-sign-and-send-transaction-confirm\",e}({});const zk={\"confirm-sign-and-send-transaction-show-advanced\":async function({id:e,context:t}){const n={...t,advanced:{...t.advanced,shown:!t.advanced.shown}};await YE(e,Vx(Yk,{context:n}),n)},\"confirm-sign-and-send-transaction-cancel\":async function({id:e}){await JE(e,!1),await $B.deleteKey(`mapInterfaceNameToId.${GE}`)},\"confirm-sign-and-send-transaction-confirm\":async function({id:e}){await JE(e,!0),await $B.deleteKey(`mapInterfaceNameToId.${GE}`)}},Lk=e=>e.replace(/([A-Z])/gu,\" $1\").trim().replace(/^./u,e=>e.toUpperCase()),jk=({address:e,scope:t})=>Vx(sk,{href:ck(t,\"address\",e),children:Vx(rk,{avatar:!1,address:lk(t,e),truncate:!0})}),Fk=({instruction:e,scope:t,locale:n})=>{const r=pk(n),{type:o,encoded:i,parsed:a}=e,{programAddress:s,dataBase58:c}=i,u=null!==a,l=Lk(o);return Hx(tk,{alignment:\"start\",children:[Vx(ek,{color:\"alternative\",fontWeight:\"bold\",children:l}),Hx(Xx,{alignment:\"space-between\",direction:\"horizontal\",children:[Vx(ek,{color:\"alternative\",alignment:\"start\",children:r(\"confirmation.advanced.programId\")}),Vx(jk,{address:s,scope:t})]}),u&&Object.entries(a.accounts??{}).map(([e,n])=>Hx(Xx,{alignment:\"space-between\",direction:\"horizontal\",children:[Vx(ek,{color:\"alternative\",children:Lk(e)}),ba(n.address)?Vx(jk,{address:n.address,scope:t}):Vx(ek,{children:WE(n.address)?.toString()??\"\"})]})),u&&Object.entries(a.data).map(([e,n])=>Hx(Xx,{alignment:\"space-between\",direction:\"horizontal\",children:[Vx(ek,{color:\"alternative\",children:Lk(e)}),ba(n)?Vx(jk,{address:n,scope:t}):Vx(ek,{children:WE(n)?.toString()??\"\"})]})),!u&&Hx(Xx,{alignment:\"space-between\",direction:\"horizontal\",children:[Vx(ek,{color:\"alternative\",children:r(\"confirmation.advanced.data\")}),Vx(ek,{children:(d=c,d.length>12?`${d.slice(0,5)}...${d.slice(-5)}`:d)})]})]});var d},Dk=({instructions:e,showInstructions:t,locale:n,scope:r})=>{const o=pk(n),i=t?\"hide\":\"show\",a=t?\"arrow-up\":\"arrow-down\";return Hx(Xx,{alignment:\"start\",children:[Hx(ak,{name:Mk.ShowAdvanced,children:[o(`confirmation.advanced.${i}`),\"&nbsp;\",Vx(xk,{name:a,color:\"primary\"})]}),t&&Vx(Xx,{children:e.map(e=>Vx(Fk,{locale:n,scope:r,instruction:e}))})]})},$k=Yx(\"Banner\"),Kk={AccountAlreadyInUse:\"transactionScan.errors.accountAlreadyInUse\",ResultWithNegativeLamports:\"transactionScan.errors.insufficientSol\",SlippageToleranceExceeded:\"transactionScan.errors.slippageToleranceExceeded\",ExceededDesiredSlippageLimit:\"transactionScan.errors.slippageToleranceExceeded\"};function qk(e,t){const n=pk(t.locale),{code:r}=e;return n((r&&Kk[r])??\"transactionScan.errors.unknownError\")}const Wk={Malicious:\"danger\",Warning:\"warning\"},Vk=({preferences:e,validation:t,error:n,scanFetchStatus:r})=>{const o=pk(e.locale);if(\"error\"===r)return Vx($k,{title:o(\"send.simulationTitleAPIError\"),severity:\"danger\",children:Vx(ek,{children:o(\"send.simulationMessageAPIError\")})});if(!n&&!t)return Vx(Xx,{children:null});if(n)return Vx($k,{title:o(\"confirmation.simulationErrorTitle\"),severity:\"warning\",children:Vx(ek,{children:o(\"confirmation.simulationErrorSubtitle\",{reason:qk(n,e)})})});if(!t)return Vx(Xx,{children:null});const i=t?.type?Wk[t.type]:void 0;return i?Hx($k,{title:o(\"confirmation.validationErrorTitle\"),severity:i,children:[Vx(ek,{children:o(\"confirmation.validationErrorSubtitle\")}),Vx(ek,{size:\"sm\",children:Vx(sk,{href:\"https://support.metamask.io/configure/wallet/how-to-turn-on-security-alerts/\",children:o(\"confirmation.validationErrorLearnMore\")})}),Hx(ek,{size:\"sm\",children:[Vx(xk,{color:\"primary\",name:\"security-tick\"}),\" \",o(\"confirmation.validationErrorSecurityAdviced\"),\" \",Vx(sk,{href:\"https://www.blockaid.io\",children:\"Blockaid\"})]})]}):Vx(Xx,{children:null})};function Hk(e,t,n){return`${vk(e,n)} ${t}`}function Gk(e,t){return new wr(e).multipliedBy(t).toString()}const Zk=({origin:e,accountAddress:t,accountDomain:n,destinationAddress:r,destinationDomain:o,scope:i,feeInSol:a,nativePrice:s,fetchingPricesStatus:c,preferences:u,networkImage:l})=>{const{currency:d,locale:f}=u,h=pk(f),p=e&&!(e===uu)?gk(e):null,g=\"fetching\"===c,m=a&&s&&!(\"error\"===c)?bk(Gk(a,s),d,f):\"\";return Hx(tk,{children:[p?Hx(Xx,{children:[Hx(Xx,{alignment:\"space-between\",direction:\"horizontal\",children:[Hx(Xx,{alignment:\"space-between\",direction:\"horizontal\",center:!0,children:[Vx(ek,{fontWeight:\"medium\",color:\"alternative\",children:h(\"confirmation.origin\")}),Vx(Sk,{content:h(\"confirmation.origin.tooltip\"),children:Vx(xk,{name:\"question\",color:\"muted\"})})]}),Vx(ek,{children:p})]}),Vx(Xx,{children:null})]}):null,Hx(Xx,{alignment:\"space-between\",direction:\"horizontal\",children:[Vx(ek,{fontWeight:\"medium\",color:\"alternative\",children:h(\"confirmation.account\")}),n&&t?Vx(uk,{domain:n,scope:i,address:t}):null,!n&&t?Vx(rk,{address:lk(i,t),truncate:!0,displayName:!0,avatar:!0}):null]}),r?Hx(Xx,{children:[Vx(Xx,{children:null}),Hx(Xx,{alignment:\"space-between\",direction:\"horizontal\",children:[Vx(ek,{fontWeight:\"medium\",color:\"alternative\",children:h(\"confirmation.recipient\")}),o?Vx(uk,{domain:o,scope:i,address:r}):Vx(rk,{address:lk(i,r),truncate:!0,displayName:!0,avatar:!0})]})]}):null,Vx(Xx,{children:null}),Hx(Xx,{alignment:\"space-between\",direction:\"horizontal\",children:[Vx(ek,{fontWeight:\"medium\",color:\"alternative\",children:h(\"confirmation.network\")}),Hx(Xx,{direction:\"horizontal\",alignment:\"center\",children:[Vx(Xx,{alignment:\"center\",center:!0,children:Vx(ok,{borderRadius:\"medium\",src:l??\"\"})}),Vx(ek,{children:mu[i].name})]})]}),Vx(Xx,{children:null}),Hx(Xx,{alignment:\"space-between\",direction:\"horizontal\",children:[Vx(ek,{fontWeight:\"medium\",color:\"alternative\",children:h(\"confirmation.fee\")}),a?Hx(Xx,{direction:\"horizontal\",alignment:\"center\",children:[g?Vx(Ik,{width:80}):Vx(ek,{color:\"muted\",children:m}),Vx(ek,{children:Hk(a,mu[i].nativeToken.symbol,f)})]}):Vx(Sk,{content:h(\"confirmation.feeError\"),children:Vx(xk,{name:\"warning\"})})]})]})},Yk=({context:e})=>{const t=pk(e.preferences.locale),n=e.feeEstimatedInSol,{nativeToken:r}=mu[e.scope],o=e.tokenPrices[r.caip19Id]?.price??null,i=\"fetching\"===e.scanFetchStatus||\"ERROR\"===e.scan?.status;return Hx(Jx,{children:[Hx(Xx,{children:[e.preferences.useSecurityAlerts?Vx(Vk,{scanFetchStatus:e.scanFetchStatus,validation:e.scan?.validation??null,error:e.scan?.error??null,preferences:e.preferences}):null,Hx(Xx,{alignment:\"center\",center:!0,children:[Vx(Xx,{children:null}),Vx(Qx,{size:\"lg\",children:t(`confirmation.${e.method}.title`)}),Vx(Xx,{children:null})]}),e.preferences.simulateOnChainActions?Vx(_k,{scanStatus:e.scan?.status??null,scanFetchStatus:e.scanFetchStatus,changes:e.scan?.estimatedChanges??null,preferences:e.preferences}):null,Vx(Zk,{accountAddress:e.account?.address??null,accountDomain:e.accountDomain??null,destinationAddress:e.destinationAddress??null,destinationDomain:e.destinationDomain??null,scope:e.scope,feeInSol:n,nativePrice:o,fetchingPricesStatus:e.tokenPricesFetchStatus,preferences:e.preferences,networkImage:e.networkImage,origin:e.origin}),Vx(Dk,{instructions:e.advanced.instructions,showInstructions:e.advanced.shown,locale:e.preferences.locale,scope:e.scope})]}),Hx(ik,{children:[Vx(ak,{name:Mk.Cancel,children:t(\"confirmation.cancelButton\")}),Vx(ak,{name:Mk.Confirm,disabled:i,children:t(\"confirmation.confirmButton\")})]})]})},Jk={method:au.SignAndSendTransaction,scope:lu.Mainnet,networkImage:Gx,account:null,accountDomain:null,destinationAddress:null,destinationDomain:null,transaction:\"\",scan:null,scanFetchStatus:\"fetching\",feeEstimatedInSol:\"0\",tokenPrices:{},tokenPricesFetchStatus:\"fetching\",origin:\"\",preferences:{locale:\"en\",currency:\"usd\",hideBalances:!1,useSecurityAlerts:!0,useExternalPricingData:!0,simulateOnChainActions:!0,useTokenDetection:!0,batchCheckBalances:!0,displayNftMedia:!0,useNftDetection:!0},advanced:{shown:!1,instructions:[]}};async function Xk(e){const t={...Jk,...e},n=QE().then(e=>{t.preferences=e}).catch(()=>{t.preferences=Jk.preferences}),r=(async(e,t)=>{const n=await Lg(t,e),r=\"instructions\"in n?n:await Ug(n.messageBytes,e),{instructions:o}=r;return o.map(Gg)})(VB.getRpc(t.scope),t.transaction).then(async e=>{t.advanced.instructions=e;try{t.destinationAddress=function(e){for(const t of e){if(!t.parsed||!Uk.has(t.type))continue;const e=t.parsed.accounts?.destination;if(e?.address)return e.address}return null}(e)}catch(e){await ju(e),t.destinationAddress=null}}).catch(async e=>{await ju(e),nu.error(e),t.advanced.instructions=[]}),o=t.account?.address?aR.resolveAddress(t.scope,t.account.address).then(e=>{t.accountDomain=e}):Promise.resolve().then(()=>{t.accountDomain=null});await Promise.all([n,r,o]);const{currency:i,useExternalPricingData:a,useSecurityAlerts:s,simulateOnChainActions:c}=t.preferences,u=await ZE(Vx(Yk,{context:t}),t),l=XE(u),d={...t},f=t.destinationAddress?aR.resolveAddress(t.scope,t.destinationAddress).then(e=>{d.destinationDomain=e}).catch(async e=>{await ju(e),d.destinationDomain=null}):Promise.resolve(),h=[mu[t.scope].nativeToken.caip19Id],p=a?nR.getMultipleSpotPrices(h,i).then(e=>{d.tokenPrices=e,d.tokenPricesFetchStatus=\"fetched\"}).catch(async e=>{await ju(e),d.tokenPricesFetchStatus=\"error\"}):Promise.resolve().then(()=>{d.tokenPricesFetchStatus=\"fetched\",d.tokenPrices={}});await Promise.all([f,p]);let g=null;try{const{totalFee:e}=dm.calculateFee(t.transaction);g=fm(e).toString()}catch(e){await ju(e),g=null}d.feeEstimatedInSol=g,await YE(u,Vx(Yk,{context:d}),d);const m={...d},y=[];if(c&&y.push(\"simulation\"),s&&y.push(\"validation\"),c||s){const e=gR.scanTransaction({method:m.method,accountAddress:m.account?.address??\"\",transaction:m.transaction,scope:m.scope,origin:m.origin,options:y}).then(async e=>{m.scan=e,m.scanFetchStatus=e?\"fetched\":\"error\"}).catch(async e=>{await ju(e),m.scan=null,m.scanFetchStatus=\"error\"});await Promise.all([e])}else m.scanFetchStatus=\"fetched\",m.scan=null;return await YE(u,Vx(Yk,{context:m}),m),await $B.setKey(`mapInterfaceNameToId.${GE}`,u),await snap.request({method:\"snap_scheduleBackgroundEvent\",params:{duration:\"PT20S\",request:{method:\"refreshConfirmationEstimation\"}}}),l}var Qk=function(e){return e.OnTransactionAdded=\"onTransactionAdded\",e.OnTransactionApproved=\"onTransactionApproved\",e.OnTransactionRejected=\"onTransactionRejected\",e.RefreshSend=\"refreshSend\",e.RefreshConfirmationEstimation=\"refreshConfirmationEstimation\",e.CloseWebSocketConnections=\"closeWebSocketConnections\",e}({});function eI(e){return JSON.parse(function(e){const t=[];let n=!1;for(let r=0;r<e.length;r++){let o=!1;if(\"\\\\\"===e[r]&&(t.push(e[r++]),o=!o),'\"'!==e[r]){if(!n){const n=tI(e,r);if(n?.length){r+=n.length-1,n.match(/\\.|[eE]-/)?t.push(n):t.push(nI(n));continue}}t.push(e[r])}else t.push(e[r]),o||(n=!n)}return t.join(\"\")}(e),(e,t)=>function(e){return!!e&&\"object\"==typeof e&&\"$n\"in e&&\"string\"==typeof e.$n}(t)?function({$n:e}){if(e.match(/[eE]/)){const[t,n]=e.split(/[eE]/);return BigInt(t)*BigInt(10)**BigInt(n)}return BigInt(e)}(t):t)}function tI(e,t){if(!e[t]?.match(/[-\\d]/))return null;const n=e.slice(t).match(/^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?/);return n?n[0]:null}function nI(e){return`{\"$n\":\"${e}\"}`}var rI=0n;function oI(){const e=rI;return rI++,e.toString()}function iI(e){return function(e){return new Proxy(e.api,{defineProperty:()=>!1,deleteProperty:()=>!1,get:(t,n,r)=>function(...o){const i=n.toString(),a=Reflect.get(t,i,r);if(!a)throw new Zo(Ko,{method:i,params:o});const s=a(...o);return function({transport:e},t){return{send:async n=>await t.execute({signal:n?.abortSignal,transport:e})}}(e,s)}})}(e)}function aI(e){return new Proxy({},{defineProperty:()=>!1,deleteProperty:()=>!1,get(...t){const[n,r]=t,o=r.toString();return function(...t){const n=Object.freeze({methodName:o,params:t}),r=e?.requestTransformer?e?.requestTransformer(n):n;return Object.freeze({execute:async({signal:t,transport:n})=>{const o=function(e){return{id:oI(),jsonrpc:\"2.0\",method:e.methodName,params:e.params}}(r),i=await n({payload:o,signal:t});return e?.responseTransformer?e.responseTransformer(i,r):i}})}}})}function sI(e){return null!=e&&\"object\"==typeof e&&!Array.isArray(e)&&(\"jsonrpc\"in e&&\"2.0\"===e.jsonrpc&&\"method\"in e&&\"string\"==typeof e.method&&\"params\"in e)}var cI={};function uI(e){return function t(n,r){if(Array.isArray(n))return n.map((e,n)=>{const o={...r,keyPath:[...r.keyPath,n]};return t(e,o)});if(\"object\"==typeof n&&null!==n){const e={};for(const o in n){if(!Object.prototype.hasOwnProperty.call(n,o))continue;const i={...r,keyPath:[...r.keyPath,o]};e[o]=t(n[o],i)}return e}return e.reduce((e,t)=>t(e,r),n)}}function lI(e,t){return n=>{const r=uI(e);return Object.freeze({...n,params:r(n.params,t)})}}function dI(e){return\"bigint\"==typeof e?Number(e):e}function fI({commitmentPropertyName:e,params:t,optionsObjectPositionInParams:n,overrideCommitment:r}){const o=t[n];if(void 0===o||o&&\"object\"==typeof o&&!Array.isArray(o))if(o&&e in o){if(!o[e]||\"finalized\"===o[e]){const r=[...t],{[e]:i,...a}=o;return Object.keys(a).length>0?r[n]=a:n===r.length-1?r.length--:r[n]=void 0,r}}else if(\"finalized\"!==r){const i=[...t];return i[n]={...o,[e]:r},i}return t}function hI(e){return(t,{keyPath:n})=>(\"bigint\"==typeof t&&e&&(t>Number.MAX_SAFE_INTEGER||t<-Number.MAX_SAFE_INTEGER)&&e(n,t),t)}var pI={accountNotifications:1,blockNotifications:1,getAccountInfo:1,getBalance:1,getBlock:1,getBlockHeight:0,getBlockProduction:0,getBlocks:2,getBlocksWithLimit:2,getEpochInfo:0,getFeeForMessage:1,getInflationGovernor:0,getInflationReward:1,getLargestAccounts:0,getLatestBlockhash:0,getLeaderSchedule:1,getMinimumBalanceForRentExemption:1,getMultipleAccounts:1,getProgramAccounts:1,getSignaturesForAddress:1,getSlot:0,getSlotLeader:0,getStakeMinimumDelegation:0,getSupply:0,getTokenAccountBalance:1,getTokenAccountsByDelegate:2,getTokenAccountsByOwner:2,getTokenLargestAccounts:1,getTokenSupply:1,getTransaction:1,getTransactionCount:0,getVoteAccounts:0,isBlockhashValid:1,logsNotifications:1,programNotifications:1,requestAirdrop:2,sendTransaction:1,signatureNotifications:1,simulateTransaction:1};function gI(e){const t=e?.onIntegerOverflow;return n=>{return As(n,t?(r=t,e=>lI([hI((...t)=>r(e,...t))],{keyPath:[]})(e)):e=>e,lI([dI],{keyPath:[]}),function({defaultCommitment:e,optionsObjectPositionByMethod:t}){return n=>{const{params:r,methodName:o}=n;if(!Array.isArray(r))return n;const i=t[o];return null==i?n:Object.freeze({methodName:o,params:fI({commitmentPropertyName:\"sendTransaction\"===o?\"preflightCommitment\":\"commitment\",optionsObjectPositionInParams:i,overrideCommitment:e,params:r})})}}({defaultCommitment:e?.defaultCommitment,optionsObjectPositionByMethod:pI}));var r}}function mI(e){return t=[yI(e)],n={keyPath:[]},e=>uI(t)(e,n);var t,n}function yI(e){return function(t,{keyPath:n}){return\"number\"==typeof t&&Number.isInteger(t)||\"bigint\"==typeof t?function(e,t){return t.some(t=>{if(t.length!==e.length)return!1;for(let n=e.length-1;n>=0;n--){const r=e[n],o=t[n];if(o!==r&&(o!==cI||\"number\"!=typeof r))return!1}return!0})}(n,e)?Number(t):BigInt(t):t}}function wI(e){return(t,n)=>{const r=n.methodName,o=e?.allowedNumericKeyPaths&&r?e.allowedNumericKeyPaths[r]:void 0;return As(t,e=>(e=>{const t=e;if(\"error\"in t)throw ni(t.error);return t})(e),e=>e.result,e=>mI(o??[])(e,n))}}var vI,bI=[[\"data\",\"parsed\",\"info\",\"tokenAmount\",\"decimals\"],[\"data\",\"parsed\",\"info\",\"tokenAmount\",\"uiAmount\"],[\"data\",\"parsed\",\"info\",\"rentExemptReserve\",\"decimals\"],[\"data\",\"parsed\",\"info\",\"rentExemptReserve\",\"uiAmount\"],[\"data\",\"parsed\",\"info\",\"delegatedAmount\",\"decimals\"],[\"data\",\"parsed\",\"info\",\"delegatedAmount\",\"uiAmount\"],[\"data\",\"parsed\",\"info\",\"extensions\",cI,\"state\",\"olderTransferFee\",\"transferFeeBasisPoints\"],[\"data\",\"parsed\",\"info\",\"extensions\",cI,\"state\",\"newerTransferFee\",\"transferFeeBasisPoints\"],[\"data\",\"parsed\",\"info\",\"extensions\",cI,\"state\",\"preUpdateAverageRate\"],[\"data\",\"parsed\",\"info\",\"extensions\",cI,\"state\",\"currentRate\"]],AI=[...bI,[\"data\",\"parsed\",\"info\",\"lastExtendedSlotStartIndex\"],[\"data\",\"parsed\",\"info\",\"slashPenalty\"],[\"data\",\"parsed\",\"info\",\"warmupCooldownRate\"],[\"data\",\"parsed\",\"info\",\"decimals\"],[\"data\",\"parsed\",\"info\",\"numRequiredSigners\"],[\"data\",\"parsed\",\"info\",\"numValidSigners\"],[\"data\",\"parsed\",\"info\",\"stake\",\"delegation\",\"warmupCooldownRate\"],[\"data\",\"parsed\",\"info\",\"exemptionThreshold\"],[\"data\",\"parsed\",\"info\",\"burnPercent\"],[\"data\",\"parsed\",\"info\",\"commission\"],[\"data\",\"parsed\",\"info\",\"votes\",cI,\"confirmationCount\"]],SI=[[\"index\"],[\"instructions\",cI,\"accounts\",cI],[\"instructions\",cI,\"programIdIndex\"],[\"instructions\",cI,\"stackHeight\"]],EI=[[\"addressTableLookups\",cI,\"writableIndexes\",cI],[\"addressTableLookups\",cI,\"readonlyIndexes\",cI],[\"header\",\"numReadonlySignedAccounts\"],[\"header\",\"numReadonlyUnsignedAccounts\"],[\"header\",\"numRequiredSignatures\"],[\"instructions\",cI,\"accounts\",cI],[\"instructions\",cI,\"programIdIndex\"],[\"instructions\",cI,\"stackHeight\"]];function xI(e){return aI({requestTransformer:gI(e),responseTransformer:wI({allowedNumericKeyPaths:kI()})})}function kI(){return vI||(vI={getAccountInfo:AI.map(e=>[\"value\",...e]),getBlock:[[\"transactions\",cI,\"meta\",\"preTokenBalances\",cI,\"accountIndex\"],[\"transactions\",cI,\"meta\",\"preTokenBalances\",cI,\"uiTokenAmount\",\"decimals\"],[\"transactions\",cI,\"meta\",\"postTokenBalances\",cI,\"accountIndex\"],[\"transactions\",cI,\"meta\",\"postTokenBalances\",cI,\"uiTokenAmount\",\"decimals\"],[\"transactions\",cI,\"meta\",\"rewards\",cI,\"commission\"],...SI.map(e=>[\"transactions\",cI,\"meta\",\"innerInstructions\",cI,...e]),...EI.map(e=>[\"transactions\",cI,\"transaction\",\"message\",...e]),[\"rewards\",cI,\"commission\"]],getClusterNodes:[[cI,\"featureSet\"],[cI,\"shredVersion\"]],getInflationGovernor:[[\"initial\"],[\"foundation\"],[\"foundationTerm\"],[\"taper\"],[\"terminal\"]],getInflationRate:[[\"foundation\"],[\"total\"],[\"validator\"]],getInflationReward:[[cI,\"commission\"]],getMultipleAccounts:AI.map(e=>[\"value\",cI,...e]),getProgramAccounts:AI.flatMap(e=>[[\"value\",cI,\"account\",...e],[cI,\"account\",...e]]),getRecentPerformanceSamples:[[cI,\"samplePeriodSecs\"]],getTokenAccountBalance:[[\"value\",\"decimals\"],[\"value\",\"uiAmount\"]],getTokenAccountsByDelegate:bI.map(e=>[\"value\",cI,\"account\",...e]),getTokenAccountsByOwner:bI.map(e=>[\"value\",cI,\"account\",...e]),getTokenLargestAccounts:[[\"value\",cI,\"decimals\"],[\"value\",cI,\"uiAmount\"]],getTokenSupply:[[\"value\",\"decimals\"],[\"value\",\"uiAmount\"]],getTransaction:[[\"meta\",\"preTokenBalances\",cI,\"accountIndex\"],[\"meta\",\"preTokenBalances\",cI,\"uiTokenAmount\",\"decimals\"],[\"meta\",\"postTokenBalances\",cI,\"accountIndex\"],[\"meta\",\"postTokenBalances\",cI,\"uiTokenAmount\",\"decimals\"],[\"meta\",\"rewards\",cI,\"commission\"],...SI.map(e=>[\"meta\",\"innerInstructions\",cI,...e]),...EI.map(e=>[\"transaction\",\"message\",...e])],getVersion:[[\"feature-set\"]],getVoteAccounts:[[\"current\",cI,\"commission\"],[\"delinquent\",cI,\"commission\"]],simulateTransaction:[...AI.map(e=>[\"value\",\"accounts\",cI,...e]),...SI.map(e=>[\"value\",\"innerInstructions\",cI,...e])]}),vI}var II=[\"getAccountInfo\",\"getBalance\",\"getBlock\",\"getBlockCommitment\",\"getBlockHeight\",\"getBlockProduction\",\"getBlocks\",\"getBlocksWithLimit\",\"getBlockTime\",\"getClusterNodes\",\"getEpochInfo\",\"getEpochSchedule\",\"getFeeForMessage\",\"getFirstAvailableBlock\",\"getGenesisHash\",\"getHealth\",\"getHighestSnapshotSlot\",\"getIdentity\",\"getInflationGovernor\",\"getInflationRate\",\"getInflationReward\",\"getLargestAccounts\",\"getLatestBlockhash\",\"getLeaderSchedule\",\"getMaxRetransmitSlot\",\"getMaxShredInsertSlot\",\"getMinimumBalanceForRentExemption\",\"getMultipleAccounts\",\"getProgramAccounts\",\"getRecentPerformanceSamples\",\"getRecentPrioritizationFees\",\"getSignaturesForAddress\",\"getSignatureStatuses\",\"getSlot\",\"getSlotLeader\",\"getSlotLeaders\",\"getStakeMinimumDelegation\",\"getSupply\",\"getTokenAccountBalance\",\"getTokenAccountsByDelegate\",\"getTokenAccountsByOwner\",\"getTokenLargestAccounts\",\"getTokenSupply\",\"getTransaction\",\"getTransactionCount\",\"getVersion\",\"getVoteAccounts\",\"index\",\"isBlockhashValid\",\"minimumLedgerSlot\",\"requestAirdrop\",\"sendTransaction\",\"simulateTransaction\"];function TI(e){return sI(e)&&II.includes(e.method)}function _I(e){return function(e){const{fromJson:t,headers:n,toJson:r,url:o}=e,i=n&&function(e){const t={};for(const n in e)t[n.toLowerCase()]=e[n];return t}(n);return async function({payload:e,signal:n}){const a=r?r(e):JSON.stringify(e),s={body:a,headers:{...i,accept:\"application/json\",\"content-length\":a.length.toString(),\"content-type\":\"application/json; charset=utf-8\"},method:\"POST\",signal:n},c=await fetch(o,s);if(!c.ok)throw new Zo($o,{headers:c.headers,message:c.statusText,statusCode:c.status});return t?t(await c.text(),e):await c.json()}}({...e,fromJson:(e,t)=>TI(t)?eI(e):JSON.parse(e),toJson:e=>{return TI(e)?(t=e,function(e){return e.replace(/\\{\\s*\"\\$n\"\\s*:\\s*\"(-?\\d+)\"\\s*\\}/g,\"$1\")}(JSON.stringify(t,(e,t)=>\"bigint\"==typeof t?function(e){return{$n:`${e}`}}(t):t,n))):JSON.stringify(e);var t,n}})}var CI=Object.prototype.toString,BI=Object.keys||function(e){const t=[];for(const n in e)t.push(n);return t};function RI(e,t){let n,r,o,i,a,s,c;if(!0===e)return\"true\";if(!1===e)return\"false\";switch(typeof e){case\"object\":if(null===e)return null;if(\"toJSON\"in e&&\"function\"==typeof e.toJSON)return RI(e.toJSON(),t);if(c=CI.call(e),\"[object Array]\"===c){for(o=\"[\",r=e.length-1,n=0;n<r;n++)o+=RI(e[n],!0)+\",\";return r>-1&&(o+=RI(e[n],!0)),o+\"]\"}if(\"[object Object]\"===c){for(i=BI(e).sort(),r=i.length,o=\"\",n=0;n<r;)a=i[n],s=RI(e[a],!1),void 0!==s&&(o&&(o+=\",\"),o+=JSON.stringify(a)+\":\"+s),n++;return\"{\"+o+\"}\"}return JSON.stringify(e);case\"function\":case\"undefined\":return t?null:void 0;case\"bigint\":return`${e.toString()}n`;case\"string\":return JSON.stringify(e);default:return isFinite(e)?e:null}}function PI(e){const t=RI(e,!1);if(void 0!==t)return\"\"+t}function NI(e,t,n){let r=\"\";if(\"number\"==typeof t[0]){const e=t[0]+1,n=e%10,o=e%100;r=1==n&&11!=o?e+\"st\":2==n&&12!=o?e+\"nd\":3==n&&13!=o?e+\"rd\":e+\"th\"}else r=`\\`${t[0].toString()}\\``;const o=t.length>1?t.slice(1).map(e=>\"number\"==typeof e?`[${e}]`:e).join(\".\"):void 0,i=new Zo(Do,{argumentLabel:r,keyPath:t,methodName:e,optionalPathLabel:o?` at path \\`${o}\\``:\"\",value:n,...void 0!==o?{path:o}:void 0});return Yo(i,NI),i}var OI,UI={defaultCommitment:\"confirmed\",onIntegerOverflow(e,t,n){throw NI(e.methodName,t,n)}},MI=globalThis.AbortController;function zI(e){return sI(e)?PI([e.method,e.params]):void 0}function LI(e){const t={};for(const n in e)t[n.toLowerCase()]=e[n];return t}function jI(e){return As(_I({...e,headers:{...e.headers?LI(e.headers):void 0,\"solana-client\":\"js/2.1.0\"}}),e=>function(e,t){let n;return async function(r){const{payload:o,signal:i}=r,a=t(o);if(void 0===a)return await e(r);if(n||(queueMicrotask(()=>{n=void 0}),n={}),null==n[a]){const t=new MI,o=(async()=>{try{return await e({...r,signal:t.signal})}catch(e){if(e===(OI||={}))return;throw e}})();n[a]={abortController:t,numConsumers:0,responsePromise:o}}const s=n[a];if(s.numConsumers++,i){const e=s.responsePromise;return await new Promise((t,n)=>{const r=e=>{i.removeEventListener(\"abort\",r),s.numConsumers-=1,queueMicrotask(()=>{0===s.numConsumers&&s.abortController.abort(OI||={})}),n(e.target.reason)};i.addEventListener(\"abort\",r),e.then(t).catch(n).finally(()=>{i.removeEventListener(\"abort\",r)})})}return await s.responsePromise}}(e,zI))}function FI(e){return iI({api:xI(UI),transport:e})}const DI=eu,$I=[\"getTransaction\",\"getSignaturesForAddress\"],KI=e=>{const t=jI({url:e}),n=jI({url:e,headers:{\"x-bigtable\":\"disabled\"}});return async(...e)=>{const{payload:r}=e[0],{method:o}=r,i=$I.includes(o);return DI.info(`[🚌 ToggleInfuraBigtableLookupsTransport] RPC method is ${o}. ${i?\"Enabling\":\"Disabling\"} BigTable lookups.`),i?t(...e):n(...e)}},qI=eu;async function WI(e){try{await snap.request({method:\"snap_trackError\",params:{error:Nn(new Error(JSON.stringify(e)))}}),qI.info(`[🚌 ErrorTrackingTransport] Error tracked: ${e.method} - ${e.errorMessage}`)}catch(e){qI.warn(`[🚌 ErrorTrackingTransport] Failed to track error: ${e}`)}}const VI=e=>async(...t)=>{const{payload:n}=t[0],{method:r}=n;try{qI.info(`[🚌 ErrorTrackingTransport] Making RPC request: ${r}`);const o=await e(...t);if(function(e){return!(!Ee(e)&&!Se(e)&&!Go(e))}(o)){const e={method:r,errorMessage:`RPC error in response: ${JSON.stringify(o)}`,responseData:o,requestParams:n};return await WI(e),o}return o}catch(e){const t=function(e,t){const n={method:t,errorMessage:\"Unknown error\"};return e?.currentUrl&&(n.url=e.currentUrl),e instanceof Error?(n.errorMessage=e.message,n.errorStack=e.stack):\"string\"==typeof e?n.errorMessage=e:e?.message?n.errorMessage=e.message:e?.error&&(n.errorMessage=\"string\"==typeof e.error?e.error:JSON.stringify(e.error)),e?.status?n.statusCode=e.status:e?.statusCode&&(n.statusCode=e.statusCode),e?.response?n.responseData=e.response:e?.data&&(n.responseData=e.data),n}(e,r);throw await WI(t),e instanceof Error?e:new Error(t.errorMessage)}},HI=eu;async function GI(e){return new Promise(t=>setTimeout(t,e))}const ZI=eu;function YI(e){return Math.min(400*Math.pow(2,e),1500)}const JI=e=>async(...t)=>{const{payload:n}=t[0],{method:r}=n;let o;for(let n=0;n<4;n++)try{return ZI.info(`[🚌 RetryingTransport] Attempt \"${r}\" ${n+1} of 4`),await e(...t)}catch(e){if(ZI.error(`[🚌 RetryingTransport] Error during attempt \"${r}\" ${n+1} of 4: ${e}`),o=e,n<3){const e=YI(n);ZI.info(`[🚌 RetryingTransport] Sleeping for ${e}ms`),await GI(e)}}throw o},XI=e=>{return As(e,(t=KI,e=>e.map(t)),t=>((e,t)=>async(...n)=>{let r;const o=e.length;for(const[i,a]of e.entries())try{const e=t[i];return HI.info(`[🚌 FailoverTransport] Attempting to use transport ${i+1} of ${o} (URL: ${e})`),await a(...n)}catch(e){const n=t[i];r=e;const a=i===o-1;HI.error(`[🚌 FailoverTransport] Transport failed (URL: ${n}): ${e}. ${a?\"No more transports to try.\":\"Trying next transport...\"}`),e instanceof Error&&(e.currentUrl=n)}throw r})(t,e),JI,e=>VI(e));var t};var QI=-32602,eT=28e5,tT=2800001,nT=2800006,rT=2800007,oT=2800008,iT=2800009,aT=361e4,sT=3610001,cT=8078e3,uT=8078001,lT=8078002,dT=8078004,fT=8078005,hT=8078006,pT=8078007,gT=8078008,mT=8078010,yT=8078011,wT=8078012,vT=8078017,bT=8078018,AT=8078022;function ST(e){if(Array.isArray(e)){return\"%5B\"+e.map(ST).join(\"%2C%20\")+\"%5D\"}return\"bigint\"==typeof e?`${e}n`:encodeURIComponent(String(null!=e&&null===Object.getPrototypeOf(e)?{...e}:e))}function ET([e,t]){return`${e}=${ST(t)}`}function xT(e,t={}){{let n=`Solana error #${e}; Decode this error by running \\`npx @solana/errors decode -- ${e}`;return Object.keys(t).length&&(n+=` '${function(e){const t=Object.entries(e).map(ET).join(\"&\");return btoa(t)}(t)}'`),`${n}\\``}}function kT(e,t){return!!(e instanceof Error&&\"SolanaError\"===e.name)&&(void 0===t||e.context.__code===t)}var IT=class extends Error{cause=this.cause;context;constructor(...[e,t]){let n,r;if(t){const{cause:e,...o}=t;e&&(r={cause:e}),Object.keys(o).length>0&&(n=o)}super(xT(e,n),r),this.context={__code:e,...n},this.name=\"SolanaError\"}};var TT=(e,t)=>((e,t)=>{if(e.length>=t)return e;const n=new Uint8Array(t).fill(0);return n.set(e),n})(e.length<=t?e:e.slice(0,t),t);function _T(e,t,n){const r=0===n&&e.length===t.length?e:e.slice(n,n+t.length);return r.length===t.length&&t.every((e,t)=>e===r[t])}function CT(e,t){return\"fixedSize\"in t?t.fixedSize:t.getSizeFromValue(e)}function BT(e){return Object.freeze({...e,encode:t=>{const n=new Uint8Array(CT(t,e));return e.write(t,n,0),n}})}function RT(e){return Object.freeze({...e,decode:(t,n=0)=>e.read(t,n)[0]})}function PT(e){return\"fixedSize\"in e&&\"number\"==typeof e.fixedSize}function NT(e){if(!PT(e))throw new IT(lT)}function OT(e){return!PT(e)}function UT(e,t){if(PT(e)!==PT(t))throw new IT(dT);if(PT(e)&&PT(t)&&e.fixedSize!==t.fixedSize)throw new IT(fT,{decoderFixedSize:t.fixedSize,encoderFixedSize:e.fixedSize});if(!PT(e)&&!PT(t)&&e.maxSize!==t.maxSize)throw new IT(hT,{decoderMaxSize:t.maxSize,encoderMaxSize:e.maxSize});return{...t,...e,decode:t.decode,encode:e.encode,read:t.read,write:e.write}}function MT(e,t,n,r=0){const o=n.length-r;if(o<t)throw new IT(uT,{bytesLength:o,codecDescription:e,expected:t})}function zT(e,t){return BT({fixedSize:t,write:(n,r,o)=>{const i=e.encode(n),a=i.length>t?i.slice(0,t):i;return r.set(a,o),o+t}})}function LT(e,t){return RT({fixedSize:t,read:(n,r)=>{MT(\"fixCodecSize\",t,n,r),(r>0||n.length>t)&&(n=n.slice(r,r+t)),PT(e)&&(n=TT(n,e.fixedSize));const[o]=e.read(n,0);return[o,r+t]}})}function jT(e,t){return BT({...OT(e)?{...e,getSizeFromValue:n=>e.getSizeFromValue(t(n))}:e,write:(n,r,o)=>e.write(t(n),r,o)})}function FT(e,t){return RT({...e,read:(n,r)=>{const[o,i]=e.read(n,r);return[t(o,n,r),i]}})}function DT(e,t,n=t){if(!t.match(new RegExp(`^[${e}]*$`)))throw new IT(wT,{alphabet:e,base:e.length,value:n})}var $T=e=>BT({getSizeFromValue:t=>{const[n,r]=WT(t,e[0]);if(!r)return t.length;const o=VT(r,e);return n.length+Math.ceil(o.toString(16).length/2)},write(t,n,r){if(DT(e,t),\"\"===t)return r;const[o,i]=WT(t,e[0]);if(!i)return n.set(new Uint8Array(o.length).fill(0),r),r+o.length;let a=VT(i,e);const s=[];for(;a>0n;)s.unshift(Number(a%256n)),a/=256n;const c=[...Array(o.length).fill(0),...s];return n.set(c,r),r+c.length}}),KT=e=>RT({read(t,n){const r=0===n?t:t.slice(n);if(0===r.length)return[\"\",0];let o=r.findIndex(e=>0!==e);o=-1===o?r.length:o;const i=e[0].repeat(o);if(o===r.length)return[i,t.length];const a=function(e,t){const n=BigInt(t.length),r=[];for(;e>0n;)r.unshift(t[Number(e%n)]),e/=n;return r.join(\"\")}(r.slice(o).reduce((e,t)=>256n*e+BigInt(t),0n),e);return[i+a,t.length]}}),qT=e=>UT($T(e),KT(e));function WT(e,t){const[n,r]=e.split(new RegExp(`((?!${t}).*)`));return[n,r]}function VT(e,t){const n=BigInt(t.length);let r=0n;for(const o of e)r*=n,r+=BigInt(t.indexOf(o));return r}var HT=\"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\";var GT=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",ZT=()=>BT({getSizeFromValue:e=>{try{return atob(e).length}catch{throw new IT(wT,{alphabet:GT,base:64,value:e})}},write(e,t,n){try{const r=atob(e).split(\"\").map(e=>e.charCodeAt(0));return t.set(r,n),r.length+n}catch{throw new IT(wT,{alphabet:GT,base:64,value:e})}}}),YT=e=>e.replace(/\\u0000/g,\"\"),JT=globalThis.TextDecoder,XT=globalThis.TextEncoder;function QT(e,t){if(!t)return Object.freeze({address:e,exists:!1});const n=ZT().encode(t.data[0]);return Object.freeze({...e_(t),address:e,data:n,exists:!0})}function e_(e){return Object.freeze({executable:e.executable,lamports:e.lamports,programAddress:e.owner,space:e.space})}async function t_(e,t,n={}){const{abortSignal:r,...o}=n;return QT(t,(await e.getAccountInfo(t,{...o,encoding:\"base64\"}).send({abortSignal:r})).value)}async function n_(e,t,n={}){const{abortSignal:r,...o}=n;return(await e.getMultipleAccounts(t,{...o,encoding:\"base64\"}).send({abortSignal:r})).value.map((e,n)=>QT(t[n],e))}var r_,o_=[\"u8\",\"u16\",\"u32\",\"u64\",\"u128\",\"i8\",\"i16\",\"i32\",\"i64\",\"i128\",\"f32\",\"f64\"],i_=function(){function e(){this.offset=0,this.buffer_size=256,this.buffer=new ArrayBuffer(this.buffer_size),this.view=new DataView(this.buffer)}return e.prototype.resize_if_necessary=function(e){if(this.buffer_size-this.offset<e){this.buffer_size=Math.max(2*this.buffer_size,this.buffer_size+e);var t=new ArrayBuffer(this.buffer_size);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t,this.view=new DataView(t)}},e.prototype.get_used_buffer=function(){return new Uint8Array(this.buffer).slice(0,this.offset)},e.prototype.store_value=function(e,t){var n=t.substring(1),r=parseInt(n)/8;this.resize_if_necessary(r);var o=\"f\"===t[0]?\"setFloat\".concat(n):\"i\"===t[0]?\"setInt\".concat(n):\"setUint\".concat(n);this.view[o](this.offset,e,!0),this.offset+=r},e.prototype.store_bytes=function(e){this.resize_if_necessary(e.length),new Uint8Array(this.buffer).set(new Uint8Array(e),this.offset),this.offset+=e.length},e}(),a_=function(){function e(e){this.offset=0,this.buffer_size=e.length,this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e),this.view=new DataView(this.buffer)}return e.prototype.assert_enough_buffer=function(e){if(this.offset+e>this.buffer.byteLength)throw new Error(\"Error in schema, the buffer is smaller than expected\")},e.prototype.consume_value=function(e){var t=e.substring(1),n=parseInt(t)/8;this.assert_enough_buffer(n);var r=\"f\"===e[0]?\"getFloat\".concat(t):\"i\"===e[0]?\"getInt\".concat(t):\"getUint\".concat(t),o=this.view[r](this.offset,!0);return this.offset+=n,o},e.prototype.consume_bytes=function(e){this.assert_enough_buffer(e);var t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t},e}(),s_=(r_=function(e,t){return r_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r_(e,t)},function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Class extends value \"+String(t)+\" is not a constructor or null\");function n(){this.constructor=e}r_(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});function c_(e,t,n){if(typeof e!==t)throw new Error(\"Expected \".concat(t,\" not \").concat(typeof e,\"(\").concat(e,\") at \").concat(n.join(\".\")))}function u_(e,t,n){if(e!==t)throw new Error(\"Array length \".concat(e,\" does not match schema length \").concat(t,\" at \").concat(n.join(\".\")))}var l_=o_.concat([\"bool\",\"string\"]),d_=[\"option\",\"enum\",\"array\",\"set\",\"map\",\"struct\"],f_=function(e){function t(t,n){var r=\"Invalid schema: \".concat(JSON.stringify(t),\" expected \").concat(n);return e.call(this,r)||this}return s_(t,e),t}(Error);function h_(e){if(\"string\"!=typeof e||!l_.includes(e)){if(e&&\"object\"==typeof e){var t=Object.keys(e);if(1===t.length&&d_.includes(t[0])){var n=t[0];if(\"option\"===n)return h_(e[n]);if(\"enum\"===n)return function(e){if(!Array.isArray(e))throw new f_(e,\"Array\");for(var t=0,n=e;t<n.length;t++){var r=n[t];if(\"object\"!=typeof r||!(\"struct\"in r))throw new Error('Missing \"struct\" key in enum schema');if(\"object\"!=typeof r.struct||1!==Object.keys(r.struct).length)throw new Error('The \"struct\" in each enum must have a single key');h_({struct:r.struct})}}(e[n]);if(\"array\"===n)return function(e){if(\"object\"!=typeof e)throw new f_(e,\"{ type, len? }\");if(e.len&&\"number\"!=typeof e.len)throw new Error(\"Invalid schema: \".concat(e));if(\"type\"in e)return h_(e.type);throw new f_(e,\"{ type, len? }\")}(e[n]);if(\"set\"===n)return h_(e[n]);if(\"map\"===n)return function(e){if(\"object\"!=typeof e||!(\"key\"in e)||!(\"value\"in e))throw new f_(e,\"{ key, value }\");h_(e.key),h_(e.value)}(e[n]);if(\"struct\"===n)return function(e){if(\"object\"!=typeof e)throw new f_(e,\"object\");for(var t in e)h_(e[t])}(e[n])}}throw new f_(e,d_.join(\", \")+\" or \"+l_.join(\", \"))}}!function(){function e(e){this.encoded=new i_,this.fieldPath=[\"value\"],this.checkTypes=e}e.prototype.encode=function(e,t){return this.encode_value(e,t),this.encoded.get_used_buffer()},e.prototype.encode_value=function(e,t){if(\"string\"==typeof t){if(o_.includes(t))return this.encode_integer(e,t);if(\"string\"===t)return this.encode_string(e);if(\"bool\"===t)return this.encode_boolean(e)}if(\"object\"==typeof t){if(\"option\"in t)return this.encode_option(e,t);if(\"enum\"in t)return this.encode_enum(e,t);if(\"array\"in t)return this.encode_array(e,t);if(\"set\"in t)return this.encode_set(e,t);if(\"map\"in t)return this.encode_map(e,t);if(\"struct\"in t)return this.encode_struct(e,t)}},e.prototype.encode_integer=function(e,t){var n=parseInt(t.substring(1));n<=32||\"f64\"==t?(this.checkTypes&&c_(e,\"number\",this.fieldPath),this.encoded.store_value(e,t)):(this.checkTypes&&function(e,t){if(!([\"number\",\"string\",\"bigint\",\"boolean\"].includes(typeof e)||\"object\"==typeof e&&null!==e&&\"toString\"in e))throw new Error(\"Expected bigint, number, boolean or string not \".concat(typeof e,\"(\").concat(e,\") at \").concat(t.join(\".\")))}(e,this.fieldPath),this.encode_bigint(BigInt(e),n))},e.prototype.encode_bigint=function(e,t){for(var n=t/8,r=new Uint8Array(n),o=0;o<n;o++)r[o]=Number(e&BigInt(255)),e>>=BigInt(8);this.encoded.store_bytes(new Uint8Array(r))},e.prototype.encode_string=function(e){this.checkTypes&&c_(e,\"string\",this.fieldPath);for(var t=e,n=[],r=0;r<t.length;r++){var o=t.charCodeAt(r);o<128?n.push(o):o<2048?n.push(192|o>>6,128|63&o):o<55296||o>=57344?n.push(224|o>>12,128|o>>6&63,128|63&o):(r++,o=65536+((1023&o)<<10|1023&t.charCodeAt(r)),n.push(240|o>>18,128|o>>12&63,128|o>>6&63,128|63&o))}this.encoded.store_value(n.length,\"u32\"),this.encoded.store_bytes(new Uint8Array(n))},e.prototype.encode_boolean=function(e){this.checkTypes&&c_(e,\"boolean\",this.fieldPath),this.encoded.store_value(e?1:0,\"u8\")},e.prototype.encode_option=function(e,t){null==e?this.encoded.store_value(0,\"u8\"):(this.encoded.store_value(1,\"u8\"),this.encode_value(e,t.option))},e.prototype.encode_enum=function(e,t){this.checkTypes&&function(e,t){if(\"object\"!=typeof e||null===e)throw new Error(\"Expected object not \".concat(typeof e,\"(\").concat(e,\") at \").concat(t.join(\".\")))}(e,this.fieldPath);for(var n=Object.keys(e)[0],r=0;r<t.enum.length;r++){var o=t.enum[r];if(n===Object.keys(o.struct)[0])return this.encoded.store_value(r,\"u8\"),this.encode_struct(e,o)}throw new Error(\"Enum key (\".concat(n,\") not found in enum schema: \").concat(JSON.stringify(t),\" at \").concat(this.fieldPath.join(\".\")))},e.prototype.encode_array=function(e,t){if(function(e){return Array.isArray(e)||!!e&&\"object\"==typeof e&&\"length\"in e&&\"number\"==typeof e.length&&(0===e.length||e.length>0&&e.length-1 in e)}(e))return this.encode_arraylike(e,t);if(e instanceof ArrayBuffer)return this.encode_buffer(e,t);throw new Error(\"Expected Array-like not \".concat(typeof e,\"(\").concat(e,\") at \").concat(this.fieldPath.join(\".\")))},e.prototype.encode_arraylike=function(e,t){t.array.len?u_(e.length,t.array.len,this.fieldPath):this.encoded.store_value(e.length,\"u32\");for(var n=0;n<e.length;n++)this.encode_value(e[n],t.array.type)},e.prototype.encode_buffer=function(e,t){t.array.len?u_(e.byteLength,t.array.len,this.fieldPath):this.encoded.store_value(e.byteLength,\"u32\"),this.encoded.store_bytes(new Uint8Array(e))},e.prototype.encode_set=function(e,t){this.checkTypes&&c_(e,\"object\",this.fieldPath);var n=e instanceof Set?Array.from(e.values()):Object.values(e);this.encoded.store_value(n.length,\"u32\");for(var r=0,o=n;r<o.length;r++){var i=o[r];this.encode_value(i,t.set)}},e.prototype.encode_map=function(e,t){this.checkTypes&&c_(e,\"object\",this.fieldPath);var n=e instanceof Map,r=n?Array.from(e.keys()):Object.keys(e);this.encoded.store_value(r.length,\"u32\");for(var o=0,i=r;o<i.length;o++){var a=i[o];this.encode_value(a,t.map.key),this.encode_value(n?e.get(a):e[a],t.map.value)}},e.prototype.encode_struct=function(e,t){this.checkTypes&&c_(e,\"object\",this.fieldPath);for(var n=0,r=Object.keys(t.struct);n<r.length;n++){var o=r[n];this.fieldPath.push(o),this.encode_value(e[o],t.struct[o]),this.fieldPath.pop()}}}();var p_=function(){function e(e){this.buffer=new a_(e)}return e.prototype.decode=function(e){return this.decode_value(e)},e.prototype.decode_value=function(e){if(\"string\"==typeof e){if(o_.includes(e))return this.decode_integer(e);if(\"string\"===e)return this.decode_string();if(\"bool\"===e)return this.decode_boolean()}if(\"object\"==typeof e){if(\"option\"in e)return this.decode_option(e);if(\"enum\"in e)return this.decode_enum(e);if(\"array\"in e)return this.decode_array(e);if(\"set\"in e)return this.decode_set(e);if(\"map\"in e)return this.decode_map(e);if(\"struct\"in e)return this.decode_struct(e)}throw new Error(\"Unsupported type: \".concat(e))},e.prototype.decode_integer=function(e){var t=parseInt(e.substring(1));return t<=32||\"f64\"==e?this.buffer.consume_value(e):this.decode_bigint(t,e.startsWith(\"i\"))},e.prototype.decode_bigint=function(e,t){void 0===t&&(t=!1);var n=e/8,r=new Uint8Array(this.buffer.consume_bytes(n)),o=r.reduceRight(function(e,t){return e+t.toString(16).padStart(2,\"0\")},\"\");return t&&r[n-1]?BigInt.asIntN(e,BigInt(\"0x\".concat(o))):BigInt(\"0x\".concat(o))},e.prototype.decode_string=function(){for(var e=this.decode_integer(\"u32\"),t=new Uint8Array(this.buffer.consume_bytes(e)),n=[],r=0;r<e;++r){var o=t[r];if(o<128)n.push(o);else if(o<224)n.push((31&o)<<6|63&t[++r]);else if(o<240)n.push((15&o)<<12|(63&t[++r])<<6|63&t[++r]);else{var i=(7&o)<<18|(63&t[++r])<<12|(63&t[++r])<<6|63&t[++r];n.push(i)}}return String.fromCodePoint.apply(String,n)},e.prototype.decode_boolean=function(){return this.buffer.consume_value(\"u8\")>0},e.prototype.decode_option=function(e){var t=this.buffer.consume_value(\"u8\");if(1===t)return this.decode_value(e.option);if(0!==t)throw new Error(\"Invalid option \".concat(t));return null},e.prototype.decode_enum=function(e){var t,n=this.buffer.consume_value(\"u8\");if(n>e.enum.length)throw new Error(\"Enum option \".concat(n,\" is not available\"));var r=e.enum[n].struct,o=Object.keys(r)[0];return(t={})[o]=this.decode_value(r[o]),t},e.prototype.decode_array=function(e){for(var t=[],n=e.array.len?e.array.len:this.decode_integer(\"u32\"),r=0;r<n;++r)t.push(this.decode_value(e.array.type));return t},e.prototype.decode_set=function(e){for(var t=this.decode_integer(\"u32\"),n=new Set,r=0;r<t;++r)n.add(this.decode_value(e.set));return n},e.prototype.decode_map=function(e){for(var t=this.decode_integer(\"u32\"),n=new Map,r=0;r<t;++r){var o=this.decode_value(e.map.key),i=this.decode_value(e.map.value);n.set(o,i)}return n},e.prototype.decode_struct=function(e){var t={};for(var n in e.struct)t[n]=this.decode_value(e.struct[n]);return t},e}();function g_(e,t,n){return void 0===n&&(n=!0),n&&h_(e),new p_(t).decode(e)}function m_(e,t,n,r){if(r<t||r>n)throw new IT(yT,{codecDescription:e,max:n,min:t,value:r})}function y_(e){return 1!==e?.endian}function w_(e){return BT({fixedSize:e.size,write(t,n,r){e.range&&m_(e.name,e.range[0],e.range[1],t);const o=new ArrayBuffer(e.size);return e.set(new DataView(o),t,y_(e.config)),n.set(new Uint8Array(o),r),r+e.size}})}function v_(e){return RT({fixedSize:e.size,read(t,n=0){!function(e,t,n=0){if(t.length-n<=0)throw new IT(cT,{codecDescription:e})}(e.name,t,n),MT(e.name,e.size,t,n);const r=new DataView(function(e,t,n){const r=e.byteOffset+(t??0),o=n??e.byteLength;return e.buffer.slice(r,r+o)}(t,n,e.size));return[e.get(r,y_(e.config)),n+e.size]}})}var b_=(e={})=>w_({config:e,name:\"u32\",range:[0,Number(\"0xffffffff\")],set:(e,t,n)=>e.setUint32(0,Number(t),n),size:4}),A_=(e={})=>v_({config:e,get:(e,t)=>e.getUint32(0,t),name:\"u32\",size:4}),S_=(e={})=>w_({config:e,name:\"u64\",range:[0n,BigInt(\"0xffffffffffffffff\")],set:(e,t,n)=>e.setBigUint64(0,BigInt(t),n),size:8}),E_=(e={})=>v_({config:e,get:(e,t)=>e.getBigUint64(0,t),name:\"u64\",size:8}),x_=()=>w_({name:\"u8\",range:[0,Number(\"0xff\")],set:(e,t)=>e.setUint8(0,Number(t)),size:1}),k_=()=>v_({get:e=>e.getUint8(0),name:\"u8\",size:1});function I_(e,t,n){if(t!==n)throw new IT(pT,{actual:n,codecDescription:e,expected:t})}function T_(e){return e.reduce((e,t)=>null===e||null===t?null:e+t,0)}function __(e){return PT(e)?e.fixedSize:null}function C_(e){return PT(e)?e.fixedSize:e.maxSize??null}function B_(e={}){return jT(e.size??x_(),e=>e?1:0)}function R_(e={}){return FT(e.size??k_(),e=>1===Number(e))}function P_(e){return BT({fixedSize:e.length,write:(t,n,r)=>(n.set(e,r),r+e.length)})}function N_(e){return RT({fixedSize:e.length,read:(t,n)=>{const r=RT({read(e,t){const n=e.slice(t).reduce((e,t)=>e+t.toString(16).padStart(2,\"0\"),\"\");return[n,e.length]}});if(!_T(t,e,n))throw new IT(bT,{constant:e,data:t,hexConstant:r.decode(e),hexData:r.decode(t),offset:n});return[void 0,n+e.length]}})}function O_(e){const t=T_(e.map(__)),n=T_(e.map(C_))??void 0;return BT({...null===t?{getSizeFromValue:t=>e.map((e,n)=>CT(t[n],e)).reduce((e,t)=>e+t,0),maxSize:n}:{fixedSize:t},write:(t,n,r)=>(I_(\"tuple\",e.length,t.length),e.forEach((e,o)=>{r=e.write(t[o],n,r)}),r)})}function U_(e){const t=T_(e.map(__)),n=T_(e.map(C_))??void 0;return RT({...null===t?{maxSize:n}:{fixedSize:t},read:(t,n)=>{const r=[];return e.forEach(e=>{const[o,i]=e.read(t,n);r.push(o),n=i}),[r,n]}})}function M_(e,t){const n=j_(e),r=(n,r,o)=>{const i=t(n);return L_(e,i),e[i].write(n,r,o)};if(null!==n)return BT({fixedSize:n,write:r});const o=F_(e);return BT({...null!==o?{maxSize:o}:{},getSizeFromValue:n=>{const r=t(n);return L_(e,r),CT(n,e[r])},write:r})}function z_(e,t){const n=j_(e),r=(n,r)=>{const o=t(n,r);return L_(e,o),e[o].read(n,r)};if(null!==n)return RT({fixedSize:n,read:r});const o=F_(e);return RT({...null!==o?{maxSize:o}:{},read:r})}function L_(e,t){if(void 0===e[t])throw new IT(vT,{maxRange:e.length-1,minRange:0,variant:t})}function j_(e){if(0===e.length)return 0;if(!PT(e[0]))return null;const t=e[0].fixedSize;return e.every(e=>PT(e)&&e.fixedSize===t)?t:null}function F_(e){return e.map(e=>C_(e)).reduce((e,t)=>null===e||null===t?null:Math.max(e,t),0)}function D_(e){const t=[...new Set(Object.values(e).filter(e=>\"number\"==typeof e))].sort(),n=Object.fromEntries(Object.entries(e).slice(t.length)),r=Object.keys(n),o=Object.values(n),i=[...new Set([...r,...o.filter(e=>\"string\"==typeof e)])];return{enumKeys:r,enumRecord:n,enumValues:o,numericalValues:t,stringValues:i}}function $_(e,t){let n=e.length;for(;n--;)if(t(e[n],n,e))return n;return-1}function K_(e){if(0===e.length)return\"\";let t=[e[0],e[0]];const n=[];for(let r=1;r<e.length;r++){const o=e[r];t[1]+1===o?t[1]=o:(n.push(t[0]===t[1]?`${t[0]}`:`${t[0]}-${t[1]}`),t=[o,o])}return n.push(t[0]===t[1]?`${t[0]}`:`${t[0]}-${t[1]}`),n.join(\", \")}function q_(e,t={}){const n=t.size??x_(),r=t.useValuesAsDiscriminators??!1,{enumKeys:o,enumValues:i,numericalValues:a,stringValues:s}=D_(e);if(r&&i.some(e=>\"string\"==typeof e))throw new IT(AT,{stringValues:i.filter(e=>\"string\"==typeof e)});return jT(n,e=>{const t=function({enumKeys:e,enumValues:t,variant:n}){const r=$_(t,e=>e===n);return r>=0?r:e.findIndex(e=>e===n)}({enumKeys:o,enumValues:i,variant:e});if(t<0)throw new IT(mT,{formattedNumericalValues:K_(a),numericalValues:a,stringValues:s,variant:e});return r?i[t]:t})}function W_(e,t={}){const n=t.size??k_(),r=t.useValuesAsDiscriminators??!1,{enumKeys:o,enumValues:i,numericalValues:a}=D_(e);if(r&&i.some(e=>\"string\"==typeof e))throw new IT(AT,{stringValues:i.filter(e=>\"string\"==typeof e)});return FT(n,e=>{const t=Number(e),n=function({discriminator:e,enumKeys:t,enumValues:n,useValuesAsDiscriminators:r}){return r?$_(n,t=>t===e):e>=0&&e<t.length?e:-1}({discriminator:t,enumKeys:o,enumValues:i,useValuesAsDiscriminators:r});if(n<0){const e=r?a:[...Array(o.length).keys()];throw new IT(gT,{discriminator:t,formattedValidDiscriminators:K_(e),validDiscriminators:e})}return i[n]})}var V_,H_;function G_(){return BT({fixedSize:0,write:(e,t,n)=>n})}function Z_(){return RT({fixedSize:0,read:(e,t)=>[void 0,t]})}function Y_(e){const t=e.map(([,e])=>e),n=T_(t.map(__)),r=T_(t.map(C_))??void 0;return BT({...null===n?{getSizeFromValue:t=>e.map(([e,n])=>CT(t[e],n)).reduce((e,t)=>e+t,0),maxSize:r}:{fixedSize:n},write:(t,n,r)=>(e.forEach(([e,o])=>{r=o.write(t[e],n,r)}),r)})}function J_(e){const t=e.map(([,e])=>e),n=T_(t.map(__)),r=T_(t.map(C_))??void 0;return RT({...null===n?{maxSize:r}:{fixedSize:n},read:(t,n)=>{const r={};return e.forEach(([e,o])=>{const[i,a]=o.read(t,n);n=a,r[e]=i}),[r,n]}})}function X_(){if(!globalThis.isSecureContext)throw new IT(aT)}function Q_(){return V_||(V_=$T(HT)),V_}function eC(){return H_||(H_=KT(HT)),H_}function tC(e){if(e.length<32||e.length>44)throw new IT(tT,{actualLength:e.length});const t=Q_().encode(e).byteLength;if(32!==t)throw new IT(eT,{actualLength:t})}function nC(){return jT(zT(Q_(),32),e=>function(e){return tC(e),e}(e))}function rC(){return LT(eC(),32)}function oC(){return UT(nC(),rC())}var iC=57896044618658097711785492504343953926634992332820282019728792003956564819949n,aC=19681161376707505956807079304988542015446066515923890162744021073123829784752n;function sC(e){const t=e%iC;return t>=0n?t:iC+t}function cC(e,t){let n=e;for(;t-- >0n;)n*=n,n%=iC;return n}function uC(e,t){const n=sC(t*t*t),r=function(e){const t=e*e%iC*e%iC,n=cC(t,2n)*t%iC,r=cC(n,1n)*e%iC,o=cC(r,5n)*r%iC,i=cC(o,10n)*o%iC,a=cC(i,20n)*i%iC,s=cC(a,40n)*a%iC,c=cC(s,80n)*s%iC,u=cC(c,80n)*s%iC,l=cC(u,10n)*o%iC;return cC(l,2n)*e%iC}(e*sC(n*n*t));let o=sC(e*n*r);const i=sC(t*o*o),a=o,s=sC(o*aC),c=i===e,u=i===sC(-e),l=i===sC(-e*aC);return c&&(o=a),(u||l)&&(o=s),1n==(1n&sC(o))&&(o=sC(-o)),c||u?o:null}function lC(e){if(32!==e.byteLength)return!1;const t=function(e){const t=e.reduce((e,t,n)=>`${function(e){const t=e.toString(16);return 1===t.length?`0${t}`:t}(31===n?-129&t:t)}${e}`,\"\");return BigInt(`0x${t}`)}(e);return function(e,t){const n=sC(e*e),r=uC(sC(n-1n),sC(37095705934669439343138083508754565189542113879843219016388785533085940283555n*n+1n));return null!==r&&(0n!==r||!(128&t))}(t,e[31])}var dC=[80,114,111,103,114,97,109,68,101,114,105,118,101,100,65,100,100,114,101,115,115];async function fC({programAddress:e,seeds:t}){if(function(){if(X_(),void 0===globalThis.crypto||\"function\"!=typeof globalThis.crypto.subtle?.digest)throw new IT(sT)}(),t.length>16)throw new IT(nT,{actual:t.length,maxSeeds:16});let n;const r=t.reduce((e,t,r)=>{const o=\"string\"==typeof t?(n||=new TextEncoder).encode(t):t;if(o.byteLength>32)throw new IT(rT,{actual:o.byteLength,index:r,maxSeedLength:32});return e.push(...o),e},[]),o=oC(),i=o.encode(e),a=await crypto.subtle.digest(\"SHA-256\",new Uint8Array([...r,...i,...dC])),s=new Uint8Array(a);if(lC(s))throw new IT(oT);return o.decode(s)}async function hC({programAddress:e,seeds:t}){let n=255;for(;n>0;)try{return[await fC({programAddress:e,seeds:[...t,new Uint8Array([n])]}),n]}catch(e){if(!kT(e,oT))throw e;n--}throw new IT(iT)}var pC=e=>({__option:\"Some\",value:e}),gC=e=>!!(e&&\"object\"==typeof e&&\"__option\"in e&&(\"Some\"===e.__option&&\"value\"in e||\"None\"===e.__option)),mC=e=>\"Some\"===e.__option;function yC(e,t={}){const n=null===t.prefix?jT(G_(),e=>{}):B_({size:t.prefix??x_()});return M_([jT(O_([n,\"zeroes\"===t.noneValue?(NT(e),zT(G_(),e.fixedSize)):t.noneValue?P_(t.noneValue):G_()]),e=>[!1,void 0]),jT(O_([n,e]),e=>[!0,gC(e)&&mC(e)?e.value:e])],e=>{const t=gC(e)?e:(e=>null!==e?pC(e):{__option:\"None\"})(e);return Number(mC(t))})}function wC(e,t={}){const n=null===t.prefix?FT(Z_(),()=>!1):R_({size:t.prefix??k_()}),r=\"zeroes\"===t.noneValue?(NT(e),LT(Z_(),e.fixedSize)):t.noneValue?N_(t.noneValue):Z_();return z_([FT(U_([n,r]),()=>({__option:\"None\"})),FT(U_([n,e]),([,e])=>pC(e))],(e,o)=>{if(null===t.prefix&&!t.noneValue)return Number(o<e.length);if(null===t.prefix&&null!=t.noneValue){return _T(e,\"zeroes\"===t.noneValue?new Uint8Array(r.fixedSize).fill(0):t.noneValue,o)?0:1}return Number(n.read(e,o)[0])})}var vC=(e=>(e[e.Uninitialized=0]=\"Uninitialized\",e[e.Initialized=1]=\"Initialized\",e[e.Frozen=2]=\"Frozen\",e))(vC||{});const bC=oC(),AC=(qT(HT),UT(ZT(),RT({read(e,t=0){const n=e.slice(t);return[btoa(String.fromCharCode(...n)),e.length]}}))),SC=UT((()=>{let e;return BT({getSizeFromValue:t=>(e||=new XT).encode(t).length,write:(t,n,r)=>{const o=(e||=new XT).encode(t);return n.set(o,r),r+o.length}})})(),(()=>{let e;return RT({read(t,n){const r=(e||=new JT).decode(t.slice(n));return[YT(r),t.length]}})})()),EC=UT(Y_([[\"mint\",nC()],[\"owner\",nC()],[\"amount\",S_()],[\"delegate\",yC(nC(),{prefix:b_(),noneValue:\"zeroes\"})],[\"state\",q_(vC)],[\"isNative\",yC(S_(),{prefix:b_(),noneValue:\"zeroes\"})],[\"delegatedAmount\",S_()],[\"closeAuthority\",yC(nC(),{prefix:b_(),noneValue:\"zeroes\"})]]),J_([[\"mint\",rC()],[\"owner\",rC()],[\"amount\",E_()],[\"delegate\",wC(rC(),{prefix:A_(),noneValue:\"zeroes\"})],[\"state\",W_(vC)],[\"isNative\",wC(E_(),{prefix:A_(),noneValue:\"zeroes\"})],[\"delegatedAmount\",E_()],[\"closeAuthority\",wC(rC(),{prefix:A_(),noneValue:\"zeroes\"})]]));var xC;!function(e){e.SymbolNotFound=\"SymbolNotFound\",e.InvalidSubdomain=\"InvalidSubdomain\",e.PrimaryDomainNotFound=\"PrimaryDomainNotFound\",e.MissingParentOwner=\"MissingParentOwner\",e.U32Overflow=\"U32Overflow\",e.InvalidBufferLength=\"InvalidBufferLength\",e.U64Overflow=\"U64Overflow\",e.NoRecordData=\"NoRecordData\",e.InvalidRecordData=\"InvalidRecordData\",e.UnsupportedRecord=\"UnsupportedRecord\",e.InvalidEvmAddress=\"InvalidEvmAddress\",e.InvalidInjectiveAddress=\"InvalidInjectiveAddress\",e.InvalidARecord=\"InvalidARecord\",e.InvalidAAAARecord=\"InvalidAAAARecord\",e.InvalidRecordInput=\"InvalidRecordInput\",e.InvalidSignature=\"InvalidSignature\",e.AccountDoesNotExist=\"AccountDoesNotExist\",e.MultipleRegistries=\"MultipleRegistries\",e.InvalidReverseTwitter=\"InvalidReverseTwitter\",e.NoAccountData=\"NoAccountData\",e.InvalidInput=\"InvalidInput\",e.InvalidDomain=\"InvalidDomain\",e.InvalidCustomBg=\"InvalidCustomBackground\",e.UnsupportedSignature=\"UnsupportedSignature\",e.RecordDoestNotSupportGuardianSig=\"RecordDoestNotSupportGuardianSig\",e.RecordIsNotSigned=\"RecordIsNotSigned\",e.UnsupportedSignatureType=\"UnsupportedSignatureType\",e.InvalidSolRecordV2=\"InvalidSolRecordV2\",e.MissingVerifier=\"MissingVerifier\",e.PythFeedNotFound=\"PythFeedNotFound\",e.InvalidRoA=\"InvalidRoA\",e.InvalidPda=\"InvalidPda\",e.InvalidParent=\"InvalidParent\",e.NftAccountNotFound=\"NftRecordNotFound\",e.PdaOwnerNotAllowed=\"PdaOwnerNotAllowed\",e.DomainDoesNotExist=\"DomainDoesNotExist\",e.RecordMalformed=\"RecordMalformed\",e.CouldNotFindNftOwner=\"CouldNotFindNftOwner\",e.InvalidValidation=\"InvalidValidation\",e.InvalidSerializedData=\"InvalidSerializedData\"}(xC||(xC={}));class kC extends Error{type;constructor(e,t){super(t),this.name=\"SNSError\",this.type=e,Error.captureStackTrace&&Error.captureStackTrace(this,kC)}}class IC extends kC{constructor(e){super(xC.PrimaryDomainNotFound,e)}}class TC extends kC{constructor(e){super(xC.NoRecordData,e)}}class _C extends kC{constructor(e){super(xC.AccountDoesNotExist,e)}}class CC extends kC{constructor(e){super(xC.NoAccountData,e)}}class BC extends kC{constructor(e){super(xC.InvalidInput,e)}}class RC extends kC{constructor(e){super(xC.InvalidRoA,e)}}class PC extends kC{constructor(e){super(xC.NftAccountNotFound,e)}}class NC extends kC{constructor(e){super(xC.PdaOwnerNotAllowed,e)}}class OC extends kC{constructor(e){super(xC.DomainDoesNotExist,e)}}class UC extends kC{constructor(e){super(xC.RecordMalformed,e)}}class MC extends kC{constructor(e){super(xC.CouldNotFindNftOwner,e)}}class zC extends kC{constructor(e){super(xC.InvalidValidation,e)}}class LC extends kC{constructor(e){super(xC.InvalidSerializedData,e)}}class jC{static HEADER_LEN=96;parentName;owner;class;data;static schema={struct:{parentName:{array:{type:\"u8\",len:32}},owner:{array:{type:\"u8\",len:32}},class:{array:{type:\"u8\",len:32}}}};constructor(e){this.parentName=bC.decode(e.parentName),this.owner=bC.decode(e.owner),this.class=bC.decode(e.class)}static deserialize(e){try{const t=new jC(g_(this.schema,e));return t.data=e?.slice(this.HEADER_LEN),t}catch{throw new Error(\"Failed to deserialize RegistryState data\")}}static async retrieve(e,t){const n=await t_(e,t);if(!n.exists)throw new _C(\"The domain account does not exist\");return this.deserialize(n.data)}static async _retrieveBatch(e,t){return(await n_(e,t)).map(e=>e.exists?this.deserialize(e.data):void 0)}static async retrieveBatch(e,t){const n=[],r=[...t];for(;r.length>0;)n.push(...await this._retrieveBatch(e,r.splice(0,100)));return n}}function FC(e,t=!1){if(!e)return;const n=new DataView(e.buffer).getUint32(0,!0);return SC.decode(e.subarray(4,4+n)).replace(/^\\0/,t?\"\":\"\\0\")}const DC=\"58PwtjSDuFHuUkYjH9BYnnQKHfwo9reZhC2zMJv9JPkx\",$C=\"nftD3vbNkNqfj2Sd3HZwbpw4BxxKWr4AjGb9X38JeZk\",KC=\"33m47vH6Eav6jr5Ry86XjhRft2jRBLDnDgPSHoquXi2Z\",qC=\"2pMnqHvei2N5oDcVGCRdZx48gqti199wr5CsyTTafsbo\",WC=async(e,t,n)=>{const r=await(async e=>{const t=SC.encode(\"SPL Name Service\"+e),n=await crypto.subtle.digest(\"SHA-256\",t);return new Uint8Array(n)})(e);return await(async(e,t,n)=>{const r=[e];r.push(n?bC.encode(n):new Uint8Array(32)),r.push(t?bC.encode(t):new Uint8Array(32));const[o]=await hC({programAddress:\"namesLPneVptA9Z5rqUDD9tMTWEJwofgaYwp8cawRkX\",seeds:r});return o})(r,t,n)};var VC;!function(e){e[e.Uninitialized=0]=\"Uninitialized\",e[e.CentralState=1]=\"CentralState\",e[e.ActiveRecord=2]=\"ActiveRecord\",e[e.InactiveRecord=3]=\"InactiveRecord\"}(VC||(VC={}));class HC{tag;nonce;nameAccount;owner;nftMint;static LEN=98;static schema={struct:{tag:\"u8\",nonce:\"u8\",nameAccount:{array:{type:\"u8\",len:32}},owner:{array:{type:\"u8\",len:32}},nftMint:{array:{type:\"u8\",len:32}}}};constructor(e){this.tag=e.tag,this.nonce=e.nonce,this.nameAccount=bC.decode(e.nameAccount),this.owner=bC.decode(e.owner),this.nftMint=bC.decode(e.nftMint)}static deserialize(e){try{return new HC(g_(this.schema,e))}catch{throw new LC(\"Failed to deserialize NftState data\")}}static async retrieve(e,t){const n=await t_(e,t);if(!n.exists)throw new PC(`NFT not found: ${t}`);return this.deserialize(n.data)}static async retrieveFromMint(e,t){const n=await e.getProgramAccounts($C,{encoding:\"base64\",filters:[{dataSize:BigInt(HC.LEN)},{memcmp:{offset:BigInt(0),bytes:\"3\",encoding:\"base58\"}},{memcmp:{offset:BigInt(66),bytes:t,encoding:\"base58\"}}]}).send();if(1!==n.length)throw new PC(`NFT not found: ${t}`);return this.deserialize(AC.encode(n[0].account.data[0]))}static async getAddress(e){const[t]=await hC({programAddress:$C,seeds:[SC.encode(\"nft_record\"),bC.encode(e)]});return t}}const GC=SC.encode(\"tokenized_name\"),ZC=async(e,t)=>{try{const n=await(async e=>{const[t]=await hC({programAddress:$C,seeds:[GC,bC.encode(e)]});return t})(t),r=await e.getTokenLargestAccounts(n).send();if(0===r.value.length)return null;const o=await t_(e,r.value[0].address);if(!o.exists)return null;const i=EC.decode(o.data);return\"1\"===i.amount.toString()?i.owner:null}catch(e){if(kT(e,QI))return null;throw e}};class YC{tag;nameAccount;static schema={struct:{tag:\"u8\",nameAccount:{array:{type:\"u8\",len:32}}}};constructor(e){this.tag=e.tag,this.nameAccount=bC.decode(e.nameAccount)}static deserialize(e){try{return new YC(g_(this.schema,e))}catch{throw new LC(\"Failed to deserialize PrimaryDomainState data\")}}static async retrieve(e,t){const n=await t_(e,t);if(!n.exists)throw new IC(\"The favourite account does not exist\");return this.deserialize(n.data)}static async _retrieveBatch(e,t){return(await n_(e,t)).map(e=>e.exists?this.deserialize(e.data):void 0)}static async retrieveBatch(e,t){const n=[],r=[...t];for(;r.length>0;)n.push(...await this._retrieveBatch(e,r.splice(0,100)));return n}static async getAddress(e,t){const[n]=await hC({programAddress:e,seeds:[SC.encode(\"favourite_domain\"),bC.encode(t)]});return n}}async function JC(e,t,n){const r=await(async(e,t)=>await WC(e,t,KC))(t,n),o=await jC.retrieve(e,r);if(!o.data)throw new CC(\"The registry data is empty\");return FC(o.data,!!n)}var XC;!function(e){e.IPFS=\"IPFS\",e.ARWV=\"ARWV\",e.SOL=\"SOL\",e.ETH=\"ETH\",e.BTC=\"BTC\",e.LTC=\"LTC\",e.DOGE=\"DOGE\",e.Email=\"email\",e.Url=\"url\",e.Discord=\"discord\",e.Github=\"github\",e.Reddit=\"reddit\",e.Twitter=\"twitter\",e.Telegram=\"telegram\",e.Pic=\"pic\",e.SHDW=\"SHDW\",e.POINT=\"POINT\",e.BSC=\"BSC\",e.Injective=\"INJ\",e.Backpack=\"backpack\",e.A=\"A\",e.AAAA=\"AAAA\",e.CNAME=\"CNAME\",e.TXT=\"TXT\",e.Background=\"background\",e.BASE=\"BASE\",e.IPNS=\"IPNS\"}(XC||(XC={}));new Map([[XC.SOL,96],[XC.ETH,20],[XC.BSC,20],[XC.Injective,20],[XC.A,4],[XC.AAAA,16],[XC.Background,32]]);var QC;!function(e){e[e.V1=1]=\"V1\",e[e.V2=2]=\"V2\"}(QC||(QC={}));const eB=async(e,t)=>{e.endsWith(\".sol\")&&(e=e.slice(0,-4));const n=t===QC.V2?qC:void 0,r={[QC.V2]:\"\u0002\",[QC.V1]:\"\u0001\"}[t]||\"\\0\",o=e.split(\".\");if(2===o.length){const e=await WC(o[1],DC);return{address:await WC(r+o[0],e,n),parentAddress:e,isSub:!0}}if(3===o.length&&t){const e=await WC(o[2],DC),t=await WC(\"\\0\"+o[1],e);return{address:await WC(r+o[0],t,n),parentAddress:e,isSub:!0,isSubRecord:!0}}if(o.length>=3)throw new BC(\"The domain is malformed\");return{address:await WC(e,DC),isSub:!1}};function tB(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&\"Uint8Array\"===e.constructor.name}function nB(e,t){return!!Array.isArray(t)&&(0===t.length||(e?t.every(e=>\"string\"==typeof e):t.every(e=>Number.isSafeInteger(e))))}function rB(e,t){if(\"string\"!=typeof t)throw new Error(`${e}: string expected`);return!0}function oB(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function iB(e){if(!Array.isArray(e))throw new Error(\"array expected\")}function aB(e,t){if(!nB(!0,t))throw new Error(`${e}: array of strings expected`)}function sB(e,t){if(!nB(!1,t))throw new Error(`${e}: array of numbers expected`)}const cB=(e,t)=>0===t?e:cB(t,e%t),uB=(e,t)=>e+(t-cB(e,t)),lB=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function dB(e,t,n,r){if(iB(e),t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(uB(t,n)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${uB(t,n)}`);let o=0,i=0;const a=lB[t],s=lB[n]-1,c=[];for(const r of e){if(oB(r),r>=a)throw new Error(`convertRadix2: invalid data word=${r} from=${t}`);if(o=o<<t|r,i+t>32)throw new Error(`convertRadix2: carry overflow pos=${i} from=${t}`);for(i+=t;i>=n;i-=n)c.push((o>>i-n&s)>>>0);const e=lB[i];if(void 0===e)throw new Error(\"invalid carry\");o&=e-1}if(o=o<<n-i&s,!r&&i>=t)throw new Error(\"Excess padding\");if(!r&&o>0)throw new Error(`Non-zero padding: ${o}`);return r&&i>0&&c.push(o>>>0),c}function fB(e){return function(e){if(\"function\"!=typeof e)throw new Error(\"function expected\")}(e),function(...t){try{return e.apply(null,t)}catch(e){}}}const hB=function(...e){const t=e=>e,n=(e,t)=>n=>e(t(n));return{encode:e.map(e=>e.encode).reduceRight(n,t),decode:e.map(e=>e.decode).reduce(n,t)}}(function(e){const t=e.split(\"\"),n=t.length;aB(\"alphabet\",t);const r=new Map(t.map((e,t)=>[e,t]));return{encode:r=>(iB(r),r.map(r=>{if(!Number.isSafeInteger(r)||r<0||r>=n)throw new Error(`alphabet.encode: digit index outside alphabet \"${r}\". Allowed: ${e}`);return t[r]})),decode:t=>(iB(t),t.map(t=>{rB(\"alphabet.decode\",t);const n=r.get(t);if(void 0===n)throw new Error(`Unknown letter: \"${t}\". Allowed: ${e}`);return n}))}}(\"qpzry9x8gf2tvdw0s3jn54khce6mua7l\"),function(e=\"\"){return rB(\"join\",e),{encode:t=>(aB(\"join.decode\",t),t.join(e)),decode:t=>(rB(\"join.decode\",t),t.split(e))}}(\"\")),pB=[996825010,642813549,513874426,1027748829,705979059];function gB(e){const t=e>>25;let n=(33554431&e)<<5;for(let e=0;e<pB.length;e++)1==(t>>e&1)&&(n^=pB[e]);return n}function mB(e,t,n=1){const r=e.length;let o=1;for(let t=0;t<r;t++){const n=e.charCodeAt(t);if(n<33||n>126)throw new Error(`Invalid prefix (${e})`);o=gB(o)^n>>5}o=gB(o);for(let t=0;t<r;t++)o=gB(o)^31&e.charCodeAt(t);for(let e of t)o=gB(o)^e;for(let e=0;e<6;e++)o=gB(o);return o^=n,hB.encode(dB([o%lB[30]],30,5,!1))}!function(){const e=function(e,t=!1){if(oB(e),e<=0||e>32)throw new Error(\"radix2: bits should be in (0..32]\");if(uB(8,e)>32||uB(e,8)>32)throw new Error(\"radix2: carry overflow\");return{encode:n=>{if(!tB(n))throw new Error(\"radix2.encode input should be Uint8Array\");return dB(Array.from(n),8,e,!t)},decode:n=>(sB(\"radix2.decode\",n),Uint8Array.from(dB(n,e,8,t)))}}(5),t=e.decode,n=e.encode,r=fB(t);function o(e,t,n=90){rB(\"bech32.encode prefix\",e),tB(t)&&Array.from(t),sB(\"bech32.encode\",t);const r=e.length;if(0===r)throw new TypeError(`Invalid prefix length ${r}`);const o=r+7+t.length;if(!1!==n&&o>n)throw new TypeError(`Length ${o} exceeds limit ${n}`);const i=e.toLowerCase(),a=mB(i,t,1);return`${i}1${hB.encode(t)}${a}`}function i(e,t=90){rB(\"bech32.decode input\",e);const n=e.length;if(n<8||!1!==t&&n>t)throw new TypeError(`invalid string length: ${n} (${e}). Expected (8..${t})`);const r=e.toLowerCase();if(e!==r&&e!==e.toUpperCase())throw new Error(\"String must be lowercase or uppercase\");const o=r.lastIndexOf(\"1\");if(0===o||-1===o)throw new Error('Letter \"1\" must be present between prefix and data only');const i=r.slice(0,o),a=r.slice(o+1);if(a.length<6)throw new Error(\"Data must be at least 6 characters long\");const s=hB.decode(a).slice(0,-6),c=mB(i,s,1);if(!a.endsWith(c))throw new Error(`Invalid checksum in ${e}: expected \"${c}\"`);return{prefix:i,words:s}}fB(i)}();var yB,wB={exports:{}},vB=wB.exports;!function(){return yB||(yB=1,e=wB,function(t){const n=\"(0?\\\\d+|0x[a-f0-9]+)\",r={fourOctet:new RegExp(`^${n}\\\\.${n}\\\\.${n}\\\\.${n}$`,\"i\"),threeOctet:new RegExp(`^${n}\\\\.${n}\\\\.${n}$`,\"i\"),twoOctet:new RegExp(`^${n}\\\\.${n}$`,\"i\"),longValue:new RegExp(`^${n}$`,\"i\")},o=new RegExp(\"^0[0-7]+$\",\"i\"),i=new RegExp(\"^0x[a-f0-9]+$\",\"i\"),a=\"%[0-9a-z]{1,}\",s=\"(?:[0-9a-f]+::?)+\",c={zoneIndex:new RegExp(a,\"i\"),native:new RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${a})?$`,\"i\"),deprecatedTransitional:new RegExp(`^(?:::)(${n}\\\\.${n}\\\\.${n}\\\\.${n}(${a})?)$`,\"i\"),transitional:new RegExp(`^((?:${s})|(?:::)(?:${s})?)${n}\\\\.${n}\\\\.${n}\\\\.${n}(${a})?$`,\"i\")};function u(e,t){if(e.indexOf(\"::\")!==e.lastIndexOf(\"::\"))return null;let n,r,o=0,i=-1,a=(e.match(c.zoneIndex)||[])[0];for(a&&(a=a.substring(1),e=e.replace(/%.+$/,\"\"));(i=e.indexOf(\":\",i+1))>=0;)o++;if(\"::\"===e.substr(0,2)&&o--,\"::\"===e.substr(-2,2)&&o--,o>t)return null;for(r=t-o,n=\":\";r--;)n+=\"0:\";return\":\"===(e=e.replace(\"::\",n))[0]&&(e=e.slice(1)),\":\"===e[e.length-1]&&(e=e.slice(0,-1)),{parts:t=function(){const t=e.split(\":\"),n=[];for(let e=0;e<t.length;e++)n.push(parseInt(t[e],16));return n}(),zoneId:a}}function l(e,t,n,r){if(e.length!==t.length)throw new Error(\"ipaddr: cannot match CIDR for objects with different lengths\");let o,i=0;for(;r>0;){if(o=n-r,o<0&&(o=0),e[i]>>o!=t[i]>>o)return!1;r-=n,i+=1}return!0}function d(e){if(i.test(e))return parseInt(e,16);if(\"0\"===e[0]&&!isNaN(parseInt(e[1],10))){if(o.test(e))return parseInt(e,8);throw new Error(`ipaddr: cannot parse ${e} as octal`)}return parseInt(e,10)}function f(e,t){for(;e.length<t;)e=`0${e}`;return e}const h={};h.IPv4=function(){function e(e){if(4!==e.length)throw new Error(\"ipaddr: ipv4 octet count should be 4\");let t,n;for(t=0;t<e.length;t++)if(n=e[t],!(0<=n&&n<=255))throw new Error(\"ipaddr: ipv4 octet should fit in 8 bits\");this.octets=e}return e.prototype.SpecialRanges={unspecified:[[new e([0,0,0,0]),8]],broadcast:[[new e([255,255,255,255]),32]],multicast:[[new e([224,0,0,0]),4]],linkLocal:[[new e([169,254,0,0]),16]],loopback:[[new e([127,0,0,0]),8]],carrierGradeNat:[[new e([100,64,0,0]),10]],private:[[new e([10,0,0,0]),8],[new e([172,16,0,0]),12],[new e([192,168,0,0]),16]],reserved:[[new e([192,0,0,0]),24],[new e([192,0,2,0]),24],[new e([192,88,99,0]),24],[new e([198,18,0,0]),15],[new e([198,51,100,0]),24],[new e([203,0,113,0]),24],[new e([240,0,0,0]),4]],as112:[[new e([192,175,48,0]),24],[new e([192,31,196,0]),24]],amt:[[new e([192,52,193,0]),24]]},e.prototype.kind=function(){return\"ipv4\"},e.prototype.match=function(e,t){let n;if(void 0===t&&(n=e,e=n[0],t=n[1]),\"ipv4\"!==e.kind())throw new Error(\"ipaddr: cannot match ipv4 address with non-ipv4 one\");return l(this.octets,e.octets,8,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1;const n={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let r,o,i;for(r=3;r>=0;r-=1){if(o=this.octets[r],!(o in n))return null;if(i=n[o],t&&0!==i)return null;8!==i&&(t=!0),e+=i}return 32-e},e.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){return this.octets.slice(0)},e.prototype.toIPv4MappedAddress=function(){return h.IPv6.parse(`::ffff:${this.toString()}`)},e.prototype.toNormalizedString=function(){return this.toString()},e.prototype.toString=function(){return this.octets.join(\".\")},e}(),h.IPv4.broadcastAddressFromCIDR=function(e){try{const t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),o=[];let i=0;for(;i<4;)o.push(parseInt(n[i],10)|255^parseInt(r[i],10)),i++;return new this(o)}catch(e){throw new Error(\"ipaddr: the address does not have IPv4 CIDR format\")}},h.IPv4.isIPv4=function(e){return null!==this.parser(e)},h.IPv4.isValid=function(e){try{return new this(this.parser(e)),!0}catch(e){return!1}},h.IPv4.isValidCIDR=function(e){try{return this.parseCIDR(e),!0}catch(e){return!1}},h.IPv4.isValidFourPartDecimal=function(e){return!(!h.IPv4.isValid(e)||!e.match(/^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){3}$/))},h.IPv4.networkAddressFromCIDR=function(e){let t,n,r,o,i;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),i=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),o=[],n=0;n<4;)o.push(parseInt(r[n],10)&parseInt(i[n],10)),n++;return new this(o)}catch(e){throw new Error(\"ipaddr: the address does not have IPv4 CIDR format\")}},h.IPv4.parse=function(e){const t=this.parser(e);if(null===t)throw new Error(\"ipaddr: string is not formatted like an IPv4 Address\");return new this(t)},h.IPv4.parseCIDR=function(e){let t;if(t=e.match(/^(.+)\\/(\\d+)$/)){const e=parseInt(t[2]);if(e>=0&&e<=32){const n=[this.parse(t[1]),e];return Object.defineProperty(n,\"toString\",{value:function(){return this.join(\"/\")}}),n}}throw new Error(\"ipaddr: string is not formatted like an IPv4 CIDR range\")},h.IPv4.parser=function(e){let t,n,o;if(t=e.match(r.fourOctet))return function(){const e=t.slice(1,6),r=[];for(let t=0;t<e.length;t++)n=e[t],r.push(d(n));return r}();if(t=e.match(r.longValue)){if(o=d(t[1]),o>4294967295||o<0)throw new Error(\"ipaddr: address outside defined range\");return function(){const e=[];let t;for(t=0;t<=24;t+=8)e.push(o>>t&255);return e}().reverse()}return(t=e.match(r.twoOctet))?function(){const e=t.slice(1,4),n=[];if(o=d(e[1]),o>16777215||o<0)throw new Error(\"ipaddr: address outside defined range\");return n.push(d(e[0])),n.push(o>>16&255),n.push(o>>8&255),n.push(255&o),n}():(t=e.match(r.threeOctet))?function(){const e=t.slice(1,5),n=[];if(o=d(e[2]),o>65535||o<0)throw new Error(\"ipaddr: address outside defined range\");return n.push(d(e[0])),n.push(d(e[1])),n.push(o>>8&255),n.push(255&o),n}():null},h.IPv4.subnetMaskFromPrefixLength=function(e){if((e=parseInt(e))<0||e>32)throw new Error(\"ipaddr: invalid IPv4 prefix length\");const t=[0,0,0,0];let n=0;const r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<4&&(t[r]=Math.pow(2,e%8)-1<<8-e%8),new this(t)},h.IPv6=function(){function e(e,t){let n,r;if(16===e.length)for(this.parts=[],n=0;n<=14;n+=2)this.parts.push(e[n]<<8|e[n+1]);else{if(8!==e.length)throw new Error(\"ipaddr: ipv6 part count should be 8 or 16\");this.parts=e}for(n=0;n<this.parts.length;n++)if(r=this.parts[n],!(0<=r&&r<=65535))throw new Error(\"ipaddr: ipv6 part should fit in 16 bits\");t&&(this.zoneId=t)}return e.prototype.SpecialRanges={unspecified:[new e([0,0,0,0,0,0,0,0]),128],linkLocal:[new e([65152,0,0,0,0,0,0,0]),10],multicast:[new e([65280,0,0,0,0,0,0,0]),8],loopback:[new e([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new e([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new e([0,0,0,0,0,65535,0,0]),96],discard:[new e([256,0,0,0,0,0,0,0]),64],rfc6145:[new e([0,0,0,0,65535,0,0,0]),96],rfc6052:[new e([100,65435,0,0,0,0,0,0]),96],\"6to4\":[new e([8194,0,0,0,0,0,0,0]),16],teredo:[new e([8193,0,0,0,0,0,0,0]),32],benchmarking:[new e([8193,2,0,0,0,0,0,0]),48],amt:[new e([8193,3,0,0,0,0,0,0]),32],as112v6:[[new e([8193,4,274,0,0,0,0,0]),48],[new e([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new e([8193,16,0,0,0,0,0,0]),28],orchid2:[new e([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new e([8193,48,0,0,0,0,0,0]),28],reserved:[[new e([8193,0,0,0,0,0,0,0]),23],[new e([8193,3512,0,0,0,0,0,0]),32]]},e.prototype.isIPv4MappedAddress=function(){return\"ipv4Mapped\"===this.range()},e.prototype.kind=function(){return\"ipv6\"},e.prototype.match=function(e,t){let n;if(void 0===t&&(n=e,e=n[0],t=n[1]),\"ipv6\"!==e.kind())throw new Error(\"ipaddr: cannot match ipv6 address with non-ipv6 one\");return l(this.parts,e.parts,16,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1;const n={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};let r,o;for(let i=7;i>=0;i-=1){if(r=this.parts[i],!(r in n))return null;if(o=n[r],t&&0!==o)return null;16!==o&&(t=!0),e+=o}return 128-e},e.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){let e;const t=[],n=this.parts;for(let r=0;r<n.length;r++)e=n[r],t.push(e>>8),t.push(255&e);return t},e.prototype.toFixedLengthString=function(){const e=function(){const e=[];for(let t=0;t<this.parts.length;t++)e.push(f(this.parts[t].toString(16),4));return e}.call(this).join(\":\");let t=\"\";return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error(\"ipaddr: trying to convert a generic ipv6 address to ipv4\");const e=this.parts.slice(-2),t=e[0],n=e[1];return new h.IPv4([t>>8,255&t,n>>8,255&n])},e.prototype.toNormalizedString=function(){const e=function(){const e=[];for(let t=0;t<this.parts.length;t++)e.push(this.parts[t].toString(16));return e}.call(this).join(\":\");let t=\"\";return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toRFC5952String=function(){const e=/((^|:)(0(:|$)){2,})/g,t=this.toNormalizedString();let n,r=0,o=-1;for(;n=e.exec(t);)n[0].length>o&&(r=n.index,o=n[0].length);return o<0?t:`${t.substring(0,r)}::${t.substring(r+o)}`},e.prototype.toString=function(){return this.toRFC5952String()},e}(),h.IPv6.broadcastAddressFromCIDR=function(e){try{const t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),o=[];let i=0;for(;i<16;)o.push(parseInt(n[i],10)|255^parseInt(r[i],10)),i++;return new this(o)}catch(e){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},h.IPv6.isIPv6=function(e){return null!==this.parser(e)},h.IPv6.isValid=function(e){if(\"string\"==typeof e&&-1===e.indexOf(\":\"))return!1;try{const t=this.parser(e);return new this(t.parts,t.zoneId),!0}catch(e){return!1}},h.IPv6.isValidCIDR=function(e){if(\"string\"==typeof e&&-1===e.indexOf(\":\"))return!1;try{return this.parseCIDR(e),!0}catch(e){return!1}},h.IPv6.networkAddressFromCIDR=function(e){let t,n,r,o,i;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),i=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),o=[],n=0;n<16;)o.push(parseInt(r[n],10)&parseInt(i[n],10)),n++;return new this(o)}catch(e){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},h.IPv6.parse=function(e){const t=this.parser(e);if(null===t.parts)throw new Error(\"ipaddr: string is not formatted like an IPv6 Address\");return new this(t.parts,t.zoneId)},h.IPv6.parseCIDR=function(e){let t,n,r;if((n=e.match(/^(.+)\\/(\\d+)$/))&&(t=parseInt(n[2]),t>=0&&t<=128))return r=[this.parse(n[1]),t],Object.defineProperty(r,\"toString\",{value:function(){return this.join(\"/\")}}),r;throw new Error(\"ipaddr: string is not formatted like an IPv6 CIDR range\")},h.IPv6.parser=function(e){let t,n,r,o,i,a;if(r=e.match(c.deprecatedTransitional))return this.parser(`::ffff:${r[1]}`);if(c.native.test(e))return u(e,8);if((r=e.match(c.transitional))&&(a=r[6]||\"\",t=r[1],r[1].endsWith(\"::\")||(t=t.slice(0,-1)),t=u(t+a,6),t.parts)){for(i=[parseInt(r[2]),parseInt(r[3]),parseInt(r[4]),parseInt(r[5])],n=0;n<i.length;n++)if(o=i[n],!(0<=o&&o<=255))return null;return t.parts.push(i[0]<<8|i[1]),t.parts.push(i[2]<<8|i[3]),{parts:t.parts,zoneId:t.zoneId}}return null},h.IPv6.subnetMaskFromPrefixLength=function(e){if((e=parseInt(e))<0||e>128)throw new Error(\"ipaddr: invalid IPv6 prefix length\");const t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let n=0;const r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<16&&(t[r]=Math.pow(2,e%8)-1<<8-e%8),new this(t)},h.fromByteArray=function(e){const t=e.length;if(4===t)return new h.IPv4(e);if(16===t)return new h.IPv6(e);throw new Error(\"ipaddr: the binary input is neither an IPv6 nor IPv4 address\")},h.isValid=function(e){return h.IPv6.isValid(e)||h.IPv4.isValid(e)},h.isValidCIDR=function(e){return h.IPv6.isValidCIDR(e)||h.IPv4.isValidCIDR(e)},h.parse=function(e){if(h.IPv6.isValid(e))return h.IPv6.parse(e);if(h.IPv4.isValid(e))return h.IPv4.parse(e);throw new Error(\"ipaddr: the address has neither IPv6 nor IPv4 format\")},h.parseCIDR=function(e){try{return h.IPv6.parseCIDR(e)}catch(t){try{return h.IPv4.parseCIDR(e)}catch(e){throw new Error(\"ipaddr: the address has neither IPv6 nor IPv4 CIDR format\")}}},h.process=function(e){const t=this.parse(e);return\"ipv6\"===t.kind()&&t.isIPv4MappedAddress()?t.toIPv4Address():t},h.subnetMatch=function(e,t,n){let r,o,i,a;for(o in null==n&&(n=\"unicast\"),t)if(Object.prototype.hasOwnProperty.call(t,o))for(i=t[o],!i[0]||i[0]instanceof Array||(i=[i]),r=0;r<i.length;r++)if(a=i[r],e.kind()===a[0].kind()&&e.match.apply(e,a))return o;return n},e.exports?e.exports=h:t.ipaddr=h}(vB)),wB.exports;var e}();Math.floor,String.fromCharCode;new Map([[XC.CNAME,\"ExXjtfdQe8JacoqP9Z535WzQKjF4CzW1TTRKRgpxvya3\"],[XC.Url,\"ExXjtfdQe8JacoqP9Z535WzQKjF4CzW1TTRKRgpxvya3\"]]),new Set([XC.BASE,XC.BSC,XC.ETH,XC.Injective]),new Set([XC.BASE,XC.BSC,XC.ETH]),new Set([XC.ARWV,XC.Backpack,XC.BTC,XC.CNAME,XC.Discord,XC.DOGE,XC.Email,XC.Github,XC.IPFS,XC.IPNS,XC.LTC,XC.Pic,XC.POINT,XC.Reddit,XC.SHDW,XC.Telegram,XC.Twitter,XC.TXT,XC.Url]),new Set([XC.BASE,XC.BSC,XC.ETH,XC.Injective,XC.SOL]);new Map([[\"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",[234,160,32,198,28,196,121,113,40,19,70,28,225,83,137,74,150,166,192,11,33,237,12,252,39,152,209,249,169,233,201,74]],[\"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB\",[43,137,185,220,143,223,159,52,112,154,91,16,107,71,47,15,57,187,108,169,206,4,176,253,127,46,151,22,136,226,229,59]],[\"So11111111111111111111111111111111111111112\",[239,13,139,111,218,44,235,164,29,161,93,64,149,209,218,57,42,13,47,142,208,198,199,188,15,76,250,200,194,128,181,109]],[\"EchesyfXePKdLtoiZSL8pBe8Myagyy8ZRqsACNCFGnvp\",[200,6,87,183,246,243,234,194,114,24,208,157,90,78,84,228,123,37,118,141,159,94,16,172,21,254,44,249,0,136,20,0]],[\"mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So\",[194,40,154,106,67,210,206,145,198,245,92,174,195,112,244,172,195,138,46,212,119,245,136,19,51,76,109,3,116,159,242,164]],[\"DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263\",[114,176,33,33,124,163,254,104,146,42,25,170,249,144,16,156,185,216,78,154,208,4,180,210,2,90,214,245,41,49,68,25]],[\"EPeUFDgHRxs9xxEPVaL6kfGQvCon7jmAWKVUHuux1Tpz\",[142,134,15,183,78,96,229,115,107,69,93,130,246,11,55,40,4,156,52,142,148,150,26,221,95,150,27,2,253,238,37,53]],[\"HZ1JovNiVvGrGNiiYvEozEVgZ58xaU3RKwX8eACQBCt3\",[11,191,40,233,168,65,161,204,120,143,106,54,27,23,202,7,45,14,163,9,138,30,93,241,195,146,45,6,113,149,121,255]],[\"bSo13r4TkiE4KumL71LsHTPpL2euBYLFx6h9HP3piy1\",[137,135,83,121,231,15,143,186,220,23,174,243,21,173,243,168,213,209,96,184,17,67,85,55,224,60,151,232,170,201,125,156]],[\"6McPRfPV6bY1e9hLxWyG54W9i9Epq75QBvXg2oetBVTB\",[122,91,193,210,181,106,208,41,4,140,214,57,100,179,173,39,118,234,223,129,46,220,26,67,163,20,6,203,84,191,245,146]],[\"6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN\",[135,149,81,2,24,83,238,199,167,220,130,117,120,232,230,157,167,228,250,129,72,51,154,160,211,213,41,100,5,190,75,26]]]);var bB;!function(e){e[e.None=0]=\"None\",e[e.Solana=1]=\"Solana\",e[e.Ethereum=2]=\"Ethereum\",e[e.UnverifiedSolana=3]=\"UnverifiedSolana\"}(bB||(bB={}));const AB=e=>{switch(e){case bB.None:return 0;case bB.Ethereum:return 20;case bB.Solana:case bB.UnverifiedSolana:return 32;default:throw new Error(\"Invalid validation enum\")}};class SB{stalenessValidation;rightOfAssociationValidation;contentLength;static LEN=8;static schema={struct:{stalenessValidation:\"u16\",rightOfAssociationValidation:\"u16\",contentLength:\"u32\"}};constructor(e){this.stalenessValidation=e.stalenessValidation,this.rightOfAssociationValidation=e.rightOfAssociationValidation,this.contentLength=e.contentLength}static deserialize(e){return new SB(g_(this.schema,e,!0))}static async retrieve(e,t){const n=await t_(e,t);if(!n.exists)throw new Error(\"Record header account not found\");return this.deserialize(n.data.slice(96,96+this.LEN))}}class EB{header;data;constructor(e,t){this.data=t,this.header=e}static deserialize(e){const t=SB.deserialize(e.slice(96,96+SB.LEN));return new EB(t,e.slice(96+SB.LEN))}static async retrieve(e,t){const n=await t_(e,t);if(!n.exists)throw new TC(\"Record account not found\");return this.deserialize(n.data)}static async retrieveBatch(e,t){return(await n_(e,t)).map(e=>e.exists?this.deserialize(e.data):void 0)}getContent(){const e=AB(this.header.stalenessValidation)+AB(this.header.rightOfAssociationValidation);return this.data.slice(e)}getStalenessId(){const e=AB(this.header.stalenessValidation);return this.data.slice(0,e)}getRoAId(){const e=AB(this.header.stalenessValidation),t=e+AB(this.header.rightOfAssociationValidation);return this.data.slice(e,t)}}const xB=57896044618658097711785492504343953926634992332820282019728792003956564819949n,kB=19681161376707505956807079304988542015446066515923890162744021073123829784752n;function IB(e){const t=e%xB;return t>=0n?t:xB+t}function TB(e,t){let n=e;for(;t-- >0n;)n*=n,n%=xB;return n}function _B(e,t){const n=IB(e*e),r=function(e,t){const n=IB(t*t*t),r=function(e){const t=e*e%xB*e%xB,n=TB(t,2n)*t%xB,r=TB(n,1n)*e%xB,o=TB(r,5n)*r%xB,i=TB(o,10n)*o%xB,a=TB(i,20n)*i%xB,s=TB(a,40n)*a%xB,c=TB(s,80n)*s%xB,u=TB(c,80n)*s%xB,l=TB(u,10n)*o%xB;return TB(l,2n)*e%xB}(e*IB(n*n*t));let o=IB(e*n*r);const i=IB(t*o*o),a=o,s=IB(o*kB),c=i===e,u=i===IB(-e),l=i===IB(-e*kB);return c&&(o=a),(u||l)&&(o=s),1n==(1n&IB(o))&&(o=IB(-o)),c||u?o:null}(IB(n-1n),IB(37095705934669439343138083508754565189542113879843219016388785533085940283555n*n+1n));return null!==r&&(0n!==r||!(128&t))}const CB=async(e,t,n={allowPda:!1})=>{const{address:r}=await eB(t),o=await HC.getAddress(r),i=await(async(e,t)=>{const{address:n}=await eB(t+\".\"+e,QC.V1);return n})(t,XC.SOL),a=await(async(e,t)=>{const{address:n}=await eB(e);return await WC(`\u0002${t}`,n,qC)})(t,XC.SOL),[s,c,u,l]=await n_(e,[r,o,i,a]);if(!s.exists)throw new OC(`Domain ${t} does not exist`);const d=jC.deserialize(s.data);if(c.exists&&HC.deserialize(c.data).tag===VC.ActiveRecord){const t=await ZC(e,r);if(!t)throw new MC;return t}e:if(l.exists){const e=EB.deserialize(l.data),t=e.getStalenessId(),n=e.getRoAId(),r=e.getContent();if(32!==r.length)throw new UC(\"Record is malformed\");if(e.header.rightOfAssociationValidation!==bB.Solana||e.header.stalenessValidation!==bB.Solana)throw new zC;if(d.owner!==bC.decode(t))break e;if(((e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]))(n,r))return bC.decode(r);throw new RC(`The RoA ID shoudl be ${bC.decode(r)} but is ${bC.decode(n)} `)}if(u.exists){const e=new Uint8Array([...u.data.slice(jC.HEADER_LEN,jC.HEADER_LEN+32),...bC.encode(i)]),t=u.data.slice(jC.HEADER_LEN+32,jC.HEADER_LEN+32+64),n=await(async({data:e,signature:t,address:n})=>{const r=await async function(e){const t=nC().encode(e);return await crypto.subtle.importKey(\"raw\",t,{name:\"Ed25519\"},!0,[\"verify\"])}(n),o=SC.encode((e=>Array.from(e).map(e=>e.toString(16).padStart(2,\"0\")).join(\"\"))(e));return await crypto.subtle.verify({name:\"Ed25519\"},r,t,o)})({data:e,signature:t,address:d.owner});if(n)return bC.decode(u.data.slice(jC.HEADER_LEN,jC.HEADER_LEN+32))}if(!function(e){const t=bC.encode(e);if(32!==t.byteLength)return!1;const n=function(e){const t=e.reduce((e,t,n)=>`${function(e){const t=e.toString(16);return 1===t.length?`0${t}`:t}(31===n?-129&t:t)}${e}`,\"\");return BigInt(`0x${t}`)}(t);return _B(n,t[31])}(d.owner)){if(\"any\"===n.allowPda)return d.owner;if(n.allowPda){const t=await t_(e,d.owner);if(!t.exists)throw new NC(\"Invalid domain owner account\");const r=n.programIds?.some(e=>t.programAddress===e);if(r)return d.owner;throw new NC(`The program ${t.programAddress} is not allowed`)}throw new NC}return d.owner};new Error(\"timeout while waiting for mutex to become available\"),new Error(\"mutex already locked\");const BB=new Error(\"request for lock canceled\");var RB=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};class PB{constructor(e,t=BB){this._value=e,this._cancelError=t,this._queue=[],this._weightedWaiters=[]}acquire(e=1,t=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((n,r)=>{const o={resolve:n,reject:r,weight:e,priority:t},i=NB(this._queue,e=>t<=e.priority);-1===i&&e<=this._value?this._dispatchItem(o):this._queue.splice(i+1,0,o)})}runExclusive(e){return RB(this,arguments,void 0,function*(e,t=1,n=0){const[r,o]=yield this.acquire(t,n);try{return yield e(r)}finally{o()}})}waitForUnlock(e=1,t=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return this._couldLockImmediately(e,t)?Promise.resolve():new Promise(n=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),function(e,t){const n=NB(e,e=>t.priority<=e.priority);e.splice(n+1,0,t)}(this._weightedWaiters[e-1],{resolve:n,priority:t})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatchQueue()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatchQueue()}cancel(){this._queue.forEach(e=>e.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(e){const t=this._value;this._value-=e.weight,e.resolve([t,this._newReleaser(e.weight)])}_newReleaser(e){let t=!1;return()=>{t||(t=!0,this.release(e))}}_drainUnlockWaiters(){if(0===this._queue.length)for(let e=this._value;e>0;e--){const t=this._weightedWaiters[e-1];t&&(t.forEach(e=>e.resolve()),this._weightedWaiters[e-1]=[])}else{const e=this._queue[0].priority;for(let t=this._value;t>0;t--){const n=this._weightedWaiters[t-1];if(!n)continue;const r=n.findIndex(t=>t.priority<=e);(-1===r?n:n.splice(0,r)).forEach(e=>e.resolve())}}}_couldLockImmediately(e,t){return(0===this._queue.length||this._queue[0].priority<t)&&e<=this._value}}function NB(e,t){for(let n=e.length-1;n>=0;n--)if(t(e[n]))return n;return-1}var OB=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};class UB{constructor(e){this._semaphore=new PB(1,e)}acquire(){return OB(this,arguments,void 0,function*(e=0){const[,t]=yield this._semaphore.acquire(1,e);return t})}runExclusive(e,t=0){return this._semaphore.runExclusive(()=>e(),1,t)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(e=0){return this._semaphore.waitForUnlock(1,e)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}class MB{#Oe=new UB;#Ue=new UB;#Me=0;#ze=null;async#Le(){this.#Ue.isLocked()||(this.#ze=await this.#Ue.acquire())}async wrapRegularStateOperation(e){await Promise.all([this.#Oe.waitForUnlock(),this.#Le()]);try{return this.#Me+=1,await e()}finally{this.#Me-=1,0===this.#Me&&this.#ze&&this.#ze()}}async wrapManageStateOperation(e){return await this.#Ue.waitForUnlock(),await this.#Oe.runExclusive(e)}}function zB(e){return e.includes(\"swift:0/iso4217:\")}var LB=function(e){return e.Benign=\"Benign\",e.Warning=\"Warning\",e.Malicious=\"Malicious\",e}({}),jB=function(e){return e.SUCCESS=\"SUCCESS\",e.ERROR=\"ERROR\",e}({});const FB=new dx,DB=new class{#i;#je=new Map;constructor(e){this.#i=tu(e,\"[⚡ EventEmitter]\")}on(e,t){this.#i.info(`Adding listener for event ${e}`),this.#je.has(e)||this.#je.set(e,new Set),this.#je.get(e)?.add(t)}off(e,t){this.#i.info(`Removing listener for event ${e}`);const n=this.#je.get(e);n&&(n.delete(t),0===n.size&&this.#je.delete(e))}async emitSync(e,t){this.#i.info(`Emitting event ${e}`);const n=this.#je.get(e);if(n){const e=Array.from(n).map(async e=>await e(t));await Promise.allSettled(e)}}removeAllListeners(e){e?(this.#i.info(`Removing all listeners for event ${e}`),this.#je.delete(e)):(this.#i.info(\"Removing all listeners for all events\"),this.#je.clear())}listenerCount(e){const t=this.#je.get(e);return t?t.size:0}eventNames(){return Array.from(this.#je.keys())}}(nu),$B=new class{#Fe=new MB;#E;constructor(e,t){this.#E=t,e.on(\"onStart\",this.#De.bind(this)),e.on(\"onUpdate\",this.#De.bind(this)),e.on(\"onInstall\",this.#De.bind(this))}async#De(){await this.update(e=>(0,Du.omit)(e,[\"assets\"]))}async#$e(){const e=await snap.request({method:\"snap_getState\",params:{encrypted:this.#E.encrypted}}),t=WE(e??{});var n,r;return n=this.#E.defaultState,r=t,{...n,...Object.fromEntries(Object.entries(r).filter(([e,t])=>null!=t&&(!t||\"object\"!=typeof t||Object.keys(t).length>0)))}}async get(){return this.#Fe.wrapRegularStateOperation(async()=>this.#$e())}async getKey(e){return this.#Fe.wrapRegularStateOperation(async()=>{const t=await snap.request({method:\"snap_getState\",params:{key:e,encrypted:this.#E.encrypted}});if(null!==t)return WE(t)})}async setKey(e,t){await this.#Fe.wrapRegularStateOperation(async()=>{await snap.request({method:\"snap_setState\",params:{key:e,value:VE(t),encrypted:this.#E.encrypted}})})}async setKeyWith(e,t){await this.#Fe.wrapManageStateOperation(async()=>{const n=await snap.request({method:\"snap_getState\",params:{key:e,encrypted:this.#E.encrypted}}),r=null===n?void 0:WE(n),o=t(r);await snap.request({method:\"snap_setState\",params:{key:e,value:VE(o),encrypted:this.#E.encrypted}})})}async update(e){return await this.#Fe.wrapManageStateOperation(async()=>{const t=await this.#$e(),n=e(t);return await snap.request({method:\"snap_manageState\",params:{operation:\"update\",newState:VE(n),encrypted:this.#E.encrypted}}),n})}async deleteKey(e){return this.setKey(e,void 0)}async deleteKeys(e){await this.update(t=>(e.forEach(e=>{(0,Du.unset)(t,e)}),t))}}(DB,{encrypted:!1,defaultState:{keyringAccounts:{},mapInterfaceNameToId:{},transactions:{},signatures:{},assetEntities:{},tokenPrices:{},subscriptions:{},webSocketConnections:{closeWebSocketConnectionsBackgroundEventId:null}}}),KB=new class{#Ke;prefix;logger;constructor(e,t=console,n=\"__cache__default\"){this.#Ke=e,this.logger=t,this.prefix=n}async get(e){return(await this.mget([e]))[e]}async set(e,t,n=Number.MAX_SAFE_INTEGER){this.#qe(n),await this.#Ke.setKey(`${this.prefix}.${e}`,{value:t,expiresAt:Math.min(Date.now()+(n??Number.MAX_SAFE_INTEGER),Number.MAX_SAFE_INTEGER)})}#qe(e){if(void 0!==e){if(\"number\"!=typeof e)throw new Error(\"TTL must be a number\");if(e<0)throw new Error(\"TTL must be positive\");if(e>Number.MAX_SAFE_INTEGER)throw new Error(\"TTL must be less than 2^53 - 1\")}}async delete(e){return(await this.mdelete([e]))[e]??!1}async clear(){await this.#Ke.setKey(this.prefix,{})}async has(e){return void 0!==await this.get(e)}async keys(){const e=await this.#Ke.getKey(this.prefix);return Object.keys(e??{})}async size(){const e=await this.#Ke.getKey(this.prefix);return Object.keys(e??{}).length}async peek(e){const t=await this.#Ke.getKey(this.prefix),n=t?.[e];return n?.value}async mget(e){const t=await this.#Ke.getKey(this.prefix),n=Object.entries(t??{}).filter(([t])=>e.includes(t)),r=n.filter(([e,t])=>t&&t.expiresAt<Date.now());return await this.mdelete(r.map(([e])=>e)),n.reduce((e,[t,n])=>void 0===n?(this.logger.info(`[StateCache] ❌ Cache miss for key \"${t}\"`),e):(n.expiresAt<Date.now()?(this.logger.info(`[StateCache] ⌛ Cache expired for key \"${t}\"`),e[t]=void 0):(this.logger.info(`[StateCache] 🎉 Cache hit for key \"${t}\"`),e[t]=n.value),e),{})}async mset(e){if(0!==e.length){if(1===e.length){Ar(e[0]);const{key:t,value:n,ttlMilliseconds:r}=e[0];return void await this.set(t,n,r)}e.forEach(({ttlMilliseconds:e})=>{this.#qe(e)}),await this.#Ke.update(t=>{const n=t[this.prefix]??{};return e.forEach(({key:e,value:t,ttlMilliseconds:r})=>{void 0!==t&&(n[e]={value:t,expiresAt:Math.min(Date.now()+(r??Number.MAX_SAFE_INTEGER),Number.MAX_SAFE_INTEGER)})}),t[this.prefix]=n,t})}}async mdelete(e){const t={};return await this.#Ke.update(n=>{const r=n[this.prefix]??{};return e.forEach(e=>{void 0===r[e]?t[e]=!1:(delete r[e],t[e]=!0)}),n[this.prefix]=r,n}),t}}($B,nu),qB=new class{#P=new Map;logger;constructor(e){this.logger=tu(e,\"[💾 InMemoryCache]\")}#qe(e){if(void 0!==e){if(\"number\"!=typeof e)throw new Error(\"TTL must be a number\");if(e<0)throw new Error(\"TTL must be positive\");if(e>Number.MAX_SAFE_INTEGER)throw new Error(\"TTL must be less than 2^53 - 1\")}}#Ne(e){return e.expiresAt<Date.now()}async#We(){const e=[];for(const[t,n]of this.#P.entries())this.#Ne(n)&&e.push(t);await this.mdelete(e)}async get(e){return(await this.mget([e]))[e]}async set(e,t,n=Number.MAX_SAFE_INTEGER){this.#qe(n),this.#P.set(e,{value:t,expiresAt:Math.min(Date.now()+(n??Number.MAX_SAFE_INTEGER),Number.MAX_SAFE_INTEGER)})}async delete(e){return(await this.mdelete([e]))[e]??!1}async clear(){this.#P.clear()}async has(e){const t=this.#P.get(e);return!!t&&(!this.#Ne(t)||(this.#P.delete(e),!1))}async keys(){return await this.#We(),Array.from(this.#P.keys())}async size(){return await this.#We(),this.#P.size}async peek(e){const t=this.#P.get(e);if(t){if(!this.#Ne(t))return t.value;this.#P.delete(e)}}async mget(e){await this.#We();const t={};for(const n of e){const e=this.#P.get(n);e?(this.logger.info(`🎉 Cache hit for key \"${n}\"`),t[n]=e.value):(this.logger.info(`❌ Cache miss for key \"${n}\"`),t[n]=void 0)}return t}async mset(e){if(0!==e.length){if(1===e.length){Ar(e[0]);const{key:t,value:n,ttlMilliseconds:r}=e[0];return void await this.set(t,n,r)}e.forEach(({ttlMilliseconds:e})=>{this.#qe(e)}),e.forEach(({key:e,value:t,ttlMilliseconds:n})=>{void 0!==t&&this.#P.set(e,{value:t,expiresAt:Math.min(Date.now()+(n??Number.MAX_SAFE_INTEGER),Number.MAX_SAFE_INTEGER)})})}}async mdelete(e){return Object.fromEntries(e.map(e=>[e,this.#P.delete(e)]))}}(eu),WB=new class{#i;constructor(e=nu){this.#i=tu(e,\"[📣 AnalyticsService]\")}async#Ve(e,t){try{this.#i.log(`Tracking event ${e}`),await snap.request({method:\"snap_trackEvent\",params:{event:{event:e,properties:t}}})}catch(n){await ju(n),this.#i.warn(\"Error tracking event\",{error:n,event:e,properties:t})}}async trackEventTransactionAdded(e,t){await this.#Ve(\"Transaction Added\",{message:\"Snap transaction added\",origin:t.origin,account_type:e.type,chain_id_caip:t.scope})}async trackEventTransactionApproved(e,t){await this.#Ve(\"Transaction Approved\",{message:\"Snap transaction approved\",origin:t.origin,account_type:e.type,chain_id_caip:t.scope})}async trackEventTransactionSubmitted(e,t,n){await this.#Ve(\"Transaction Submitted\",{message:\"Snap transaction submitted\",origin:n.origin,account_type:e.type,chain_id_caip:n.scope})}async trackEventTransactionFinalized(e,t,n){await this.#Ve(\"Transaction Finalized\",{message:\"Snap transaction finalized\",origin:n.origin,account_type:e.type,chain_id_caip:t.chain,transaction_status:t.status,transaction_type:t.type})}async trackEventTransactionRejected(e,t){await this.#Ve(\"Transaction Rejected\",{message:\"Snap transaction rejected\",origin:t.origin,account_type:e.type,chain_id_caip:t.scope})}async trackEventSecurityAlertDetected(e,t,n,r,o,i){await this.#Ve(\"Security Alert Detected\",{message:\"Snap security alert detected\",origin:t,account_type:e.type,chain_id_caip:n,security_alert_response:r,security_alert_reason:o,security_alert_description:i})}async trackEventSecurityScanCompleted(e,t,n,r,o){await this.#Ve(\"Security Scan Completed\",{message:\"Snap security scan completed\",origin:t,account_type:e.type,chain_id_caip:n,scan_status:r,has_security_alerts:o})}async trackEventWebSocketConnectionClosedNotCleanly(e,t,n){await this.#Ve(\"WebSocket Connection Closed Not Cleanly\",{message:\"Snap WebSocket connection closed not cleanly\",origin:e,code:t,reason:n})}}(nu),VB=new class{#_;#P;#He={fetchMint:rx.Minute,fetchJsonParsedAccount:rx.Minute};#Ge=new Map;constructor(e,t){this.#_=e,this.#P=t}#Ze(e){const t=this.#_.getNetworkBy(\"caip2Id\",e),n=FI(XI(t.rpcUrls));return this.#Ge.set(e,n),n}getRpc(e){return v(e,Tu),this.#Ge.get(e)??this.#Ze(e)}async fetchJsonParsedAccount(e,t,n,r){const o=async(e,t,n)=>async function(e,t,n={}){const{abortSignal:r,...o}=n,{value:i}=await e.getAccountInfo(t,{...o,encoding:\"jsonParsed\"}).send({abortSignal:r});return i&&\"object\"==typeof i&&\"parsed\"in i.data?ih(t,i):oh(t,i)}(this.getRpc(t),Sa(e),n);if(r?.skipCache)return o(e,t,n);return ou(o,this.#P,{ttlMilliseconds:this.#He.fetchJsonParsedAccount,functionName:\"SolanaConnection::fetchJsonParsedAccount\"})(e,t,n)}async fetchMint(e,t,n){return ou(async(r,o,i)=>Sh(this.getRpc(t),Sa(e),n),this.#P,{ttlMilliseconds:this.#He.fetchMint,functionName:\"SolanaConnection::fetchMint\"})(Sa(e),t,n)}async getLatestBlockhash(e){return(await this.getRpc(e).getLatestBlockhash().send()).value}}(FB,qB),HB=new class{#_;constructor(e){this.#_=e}async getAll(){return(await snap.request({method:\"snap_getWebSockets\"})).map(e=>({...e,network:this.#Ye(e.url)}))}async getById(e){return(await this.getAll()).find(t=>t.id===e)??null}async findByNetwork(e){return(await this.getAll()).find(t=>t.network===e)??null}async save(e){const{url:t,protocols:n}=e,r=await snap.request({method:\"snap_openWebSocket\",params:{url:t,...n?{protocols:n}:{}}});return{...e,id:r}}async delete(e){await snap.request({method:\"snap_closeWebSocket\",params:{id:e}})}#Ye(e){const t=this.#_.getNetworkBy(\"webSocketUrl\",e);if(!t)throw new Error(`No network found for WebSocket URL: ${e}`);return t.caip2Id}}(FB),GB=new class{#Je;#Xe;#_;#Ke;#ge;#i;#Qe;#et;#tt=new Map;#nt=new Map;#rt;#ot=\"webSocketConnections\";constructor(e,t,n,r,o,i){const{maxReconnectAttempts:a,reconnectDelayMilliseconds:s,closeConnectionsGracePeriodMilliseconds:c}=n.get().subscriptions;this.#Je=e,this.#Xe=t,this.#_=n,this.#Ke=r,this.#ge=o,this.#i=tu(i,\"[🔌 WebSocketConnectionService]\"),this.#Qe=a,this.#et=s,this.#rt=c,this.#te()}#te(){const e=this.#it.bind(this),t=this.#at.bind(this),n=this.#ye.bind(this),r=this.#st.bind(this),o=this.#we.bind(this);this.#ge.on(\"onStart\",e),this.#ge.on(\"onUpdate\",e),this.#ge.on(\"onInstall\",e),this.#ge.on(\"onActive\",t),this.#ge.on(\"onInactive\",n),this.#ge.on(\"onWebSocketEvent\",o),this.#ge.on(\"onListWebSockets\",r)}async#it(){this.#i.log(\"Setting up connections\");const{active:e}=await tx();e?await this.#ct():await this.closeAllConnections()}async#ct(){this.#i.log(\"Opening connections for active networks\");const e=await this.#_.getActiveNetworks();this.#nt.clear(),await Promise.allSettled(e.map(async e=>{await this.openConnection(e)}))}async openConnection(e){this.#i.log(`Opening connection for network ${e}`);const t=this.#_.getNetworkBy(\"caip2Id\",e),{webSocketUrl:n}=t;await this.#Je.findByNetwork(e)?this.#i.log(`✅ Connection for network ${e} already exists`):await this.#Je.save({network:e,url:n,protocols:[]})}async closeAllConnections(){this.#i.log(\"Closing all connections\");const e=await this.#Je.getAll();await Promise.allSettled(e.map(this.#ut.bind(this))),await this.#Ke.setKey(`${this.#ot}.closeWebSocketConnectionsBackgroundEventId`,null)}async#ut(e){this.#i.log(`Closing connection for network ${e.network}`),await this.#Je.delete(e.id)}onConnectionRecovery(e,t){const n=this.#tt.get(e)??[];this.#tt.set(e,[...n,t])}async findByNetwork(e){return await this.#Je.findByNetwork(e)??null}async findById(e){return this.#Je.getById(e)}async#we(e){if(\"open\"!==e.type&&\"close\"!==e.type)return;const{id:t,type:n}=e;switch(this.#i.log(`Handling connection event \"${n}\" for ${t}`,e),n){case\"open\":await this.#lt(e);break;case\"close\":await this.#dt(e);break;default:this.#i.warn(`Unknown connection event type: ${n}`)}}async#lt(e){const{id:t}=e,n=await this.#Je.getById(t);if(!n)return void this.#i.warn(`No connection found with id: ${t}`);this.#i.log(`✅ Connected to ${t}`,e);const{network:r}=n;this.#nt.delete(r);const o=this.#tt.get(r)??[];this.#i.log(`Triggering ${o.length} connection recovery handlers`,r);const i=o.map(async e=>{try{await e(r)}catch(e){this.#i.error(\"Error in connection recovery handler\",e)}})??[];await Promise.allSettled(i)}async#dt(e){const{wasClean:t,origin:n,code:r,reason:o}=e;if(t)return void this.#i.log(\"✅ Connection closed cleanly\",e);const{networks:i}=this.#_.get(),a=i.find(e=>e.webSocketUrl.startsWith(n));a?(await this.#Xe.trackEventWebSocketConnectionClosedNotCleanly(n,r,o),await this.#ft(a.caip2Id)):this.#i.warn(\"No network found for origin\",n)}async#ft(e){const t=this.#nt.get(e)??0,n=t+1;if(this.#nt.set(e,n),n>this.#Qe)return void this.#i.error(`❌ Failed to reconnect to ${e} after ${this.#Qe}/${this.#Qe} attempts. Giving up.`);const r=this.#et*Math.pow(2,t);this.#i.warn(`❌ Disconnected from ${e}. Will try reconnecting in ${r}ms (attempt ${n}/${this.#Qe})`),await new Promise(t=>{setTimeout(()=>{this.openConnection(e).catch(t=>{this.#i.info(`Error opening connection for ${e}`,t)}).finally(()=>t())},r)})}async#st(){const e=await this.#Je.getAll();this.#i.log(\"All connections\",{connections:e,connectionRecoveryHandlers:this.#tt})}async#at(){this.#i.log(\"Client became active\"),await this.#ht(),await this.#ct()}async#ye(){this.#i.log(\"Client became inactive\"),await this.#ht();const e=Math.floor(this.#rt/1e3),t=await snap.request({method:\"snap_scheduleBackgroundEvent\",params:{duration:`PT${e}S`,request:{method:\"closeWebSocketConnections\"}}});await this.#Ke.setKey(`${this.#ot}.closeWebSocketConnectionsBackgroundEventId`,t),this.#i.log(`Scheduled background event to close connections after ${e}s`,t)}async#ht(){try{const e=await this.#Ke.getKey(`${this.#ot}.closeWebSocketConnectionsBackgroundEventId`);if(!e)return;await snap.request({method:\"snap_cancelBackgroundEvent\",params:{id:e}}),this.#i.log(\"🫸 Cancelled background event to close connections\",e)}catch(e){await ju(e),this.#i.warn(\"Failed to cancel background event\",e)}finally{await this.#Ke.setKey(`${this.#ot}.closeWebSocketConnectionsBackgroundEventId`,null)}}}(HB,WB,FB,$B,DB,nu),ZB=new class{#Ke;#ot=\"subscriptions\";constructor(e){this.#Ke=e}async getAll(){const e=await this.#Ke.getKey(`${this.#ot}`);return Object.values(e??{})}async getById(e){return await this.#Ke.getKey(`${this.#ot}.${e}`)}async save(e){await this.#Ke.setKey(`${this.#ot}.${e.id}`,e)}async delete(e){await this.#Ke.deleteKey(`${this.#ot}.${e}`)}async deleteMany(e){const t=e.map(e=>`${this.#ot}.${e}`);await this.#Ke.deleteKeys(t)}async update(e){await this.#Ke.setKey(`${this.#ot}.${e.id}`,e)}async findBy(e,t){const n=await this.getAll();if(0!==n.length)return n.find(n=>e in n&&n[e]===t)}async clear(){await this.#Ke.deleteKey(`${this.#ot}`)}}($B),YB=new Wx(GB,ZB,DB,nu),JB=new class{#T;constructor(e){this.#T=e}async uiAmountToAmountForMint(e,t,n){const r=await this.#T.fetchMint(e,t);return this.#pt(r,n)}async amountToUiAmountForMint(e,t,n){const r=await this.#T.fetchMint(e,t);return this.#gt(r,n)}#pt(e,t){try{const o=(n=e.data?.extensions,df(n)?n.value:r?r():null),{decimals:i}=e.data??{},a=o?.find(e=>\"InterestBearingConfig\"===e.__kind),s=o?.find(e=>\"ScaledUiAmountConfig\"===e.__kind);if(!a&&!s)return bs(BigInt(wr(t).multipliedBy(10**i).toFixed(0)));const c=Date.now()/1e3;if(a){return bs(xg(t,i,Number(c),Number(a.lastUpdateTimestamp),Number(a.initializationTimestamp),a.preUpdateAverageRate,a.currentRate))}if(s){let{multiplier:e}=s;c>=s.newMultiplierEffectiveTimestamp&&(e=s.newMultiplier);return bs(kg(t,i,e))}throw new Error(\"Unknown mint extension type\")}catch(n){const r=e?.data?.decimals??9;return bs(BigInt(wr(t).multipliedBy(10**r).toFixed(0)))}var n,r}#gt(e,t){try{const n=1000000000n,r=wr(this.#pt(e,n.toString()).toString()).dividedBy(n.toString());return wr(t.toString()).dividedBy(r).toString()}catch(n){const r=e.data?.decimals??9;return wr(t.toString()).dividedBy(10**r).toString()}}}(VB),XB=new Dx(VB,nu),QB=new class{#T;#i;#W=450;#V=10000n;constructor(e,t){this.#T=e,this.#i=t}async buildTransactionMessage(e){try{const{from:t,to:n,amount:r,network:o}=e,i=Sa(t.address),a=BigInt(hm(r).toString()),s=await this.#T.getLatestBlockhash(o),c=As(Js({version:0}),e=>oc(i,e),e=>Es(s,e),e=>ic(function(e,t){const n=t?.programAddress??Oc,r={source:{value:e.source??null,isWritable:!0},destination:{value:e.destination??null,isWritable:!0}},o={...e},i=zc(n);return{accounts:[i(r.source),i(r.destination)],programAddress:n,data:Gc().encode(o)}}({amount:a,destination:n,source:_c(i)}),e));return sc([nf({units:this.#W}),sf({microLamports:this.#V})],c)}catch(e){throw this.#i.error({error:e},\"Error building transaction message\"),e}}getComputeUnitLimit(){return this.#W}getComputeUnitPriceMicroLamportsPerComputeUnit(){return this.#V}}(VB,nu),eR=new class{#T;#i;constructor(e,t){this.#T=e,this.#i=tu(t,\"[👀 RecipientClassifier]\")}async classify(e,t){this.#i.info(\"Classifying recipient\",{recipientAddress:e,network:t});const n=await this.#T.fetchJsonParsedAccount(e,t);try{sh(n)}catch(e){return{type:\"SYSTEM\"}}const{programAddress:r}=n;if(r===Oc)return{type:\"SYSTEM\"};const o=(0,Du.get)(n,\"data.mint\"),i=(0,Du.get)(n,\"data.owner\");return(r===yf||r===kh)&&o&&i?{type:\"TOKEN_ACCOUNT\",mint:o}:{type:\"UNSUPPORTED\"}}}(VB,nu),tR=new Fx(JB,eR,VB,nu),nR=new class{#o;#i;#a;#s;#P;cacheTtlsMilliseconds;constructor(e,t,n=globalThis.fetch,r=nu){const{baseUrl:o,chunkSize:i,cacheTtlsMilliseconds:a}=e.get().priceApi;v(o,vu),this.#o=n,this.#i=r,this.#a=o,this.#s=i,this.cacheTtlsMilliseconds=a,this.#P=t}async getFiatExchangeRates(){return ou(this.#mt.bind(this),this.#P,{functionName:\"PriceApiClient:getFiatExchangeRates\",ttlMilliseconds:this.cacheTtlsMilliseconds.fiatExchangeRates})()}async#mt(){try{const e=await this.#o(`${this.#a}/v1/exchange-rates/fiat`);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return await e.json()}catch(e){throw this.#i.error(e,\"Error fetching fiat exchange rates\"),e}}async#yt(e,t=\"usd\"){try{if(v(e,U(We)),v(t,Wu),0===e.length)return{};const n=[...new Set(e)],r=[];for(let e=0;e<n.length;e+=this.#s)r.push(n.slice(e,e+this.#s));const o=await Promise.all(r.map(async e=>{const n=Lu({baseUrl:this.#a,path:\"/v3/spot-prices\",queryParams:{vsCurrency:t,assetIds:e.join(\",\"),includeMarketData:\"true\"}}),r=await this.#o(n);if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);const o=await r.json();return v(o,qu),o})),i=o.reduce((e,t)=>({...e,...t}),{});return await this.#P.mset(e.map(e=>({key:`PriceApiClient:getMultipleSpotPrices:${e}:${t}`,value:i[e],ttlMilliseconds:this.cacheTtlsMilliseconds.spotPrices}))),i}catch(e){throw this.#i.error(e,\"Error fetching spot prices\"),e}}async#wt(e,t=\"usd\"){const n=[...new Set(e)],r=\"PriceApiClient:getMultipleSpotPrices\",o=e=>`${r}:${e}:${t}`,i=await this.#P.mget(n.map(o)),a=(0,Du.mapKeys)(i,(e,t)=>(e=>{const t=new RegExp(`^${r}:(.+):(.+)$`,\"u\"),n=e.match(t);if(!n)throw new Error(\"Invalid cache key\");return n})(t)[1]),s=n.filter(e=>void 0===a[e]);if(0===s.length)return a;const c=await this.#yt(s,t);return await this.#P.mset(Object.entries(c).map(([e,t])=>({key:o(e),value:t,ttlMilliseconds:this.cacheTtlsMilliseconds.spotPrices}))),{...a,...c}}async getMultipleSpotPrices(e,t=\"usd\"){return this.#wt(e,t)}async#vt(e){v(e,Vu);const t=Lu({baseUrl:this.#a,path:\"/v3/historical-prices/{assetType}\",pathParams:{assetType:e.assetType},encodePathParams:!1,queryParams:{...e.timePeriod&&{timePeriod:e.timePeriod},...e.from&&{from:e.from.toString()},...e.to&&{to:e.to.toString()},...e.vsCurrency&&{vsCurrency:e.vsCurrency}}}),n=await this.#o(t),r=await n.json();return v(r,Hu),r}async getHistoricalPrices(e){return ou(this.#vt.bind(this),this.#P,{functionName:\"PriceApiClient:getHistoricalPrices\",ttlMilliseconds:this.cacheTtlsMilliseconds.historicalPrices})(e)}}(FB,qB),rR=new tl(FB),oR=new class{#o;#i;#a;#P;#He;constructor(e,t,n=globalThis.fetch,r=nu){const{baseUrl:o,cacheTtlsMilliseconds:i}=e.get().nftApi;v(o,vu),this.#o=n,this.#i=r,this.#a=o,this.#He=i,this.#P=t}#bt(e){return{cursor:e.cursor,error:e.error,items:e.items.map(e=>({chain:e.chain,address:e.address,tokenAddress:e.token_address,tokenId:e.token_id,balance:e.balance,acquiredAt:e.acquired_at,isSpam:e.isSpam,nftToken:this.#At(e.nft_token)}))}}async#St(e){let t,n=[];do{const r=Lu({baseUrl:this.#a,path:`/users/${e}/solana-tokens`,queryParams:t?{cursor:t}:void 0}),o=await this.#o(r,{headers:{\"Content-Type\":\"application/json\",accept:\"application/json\",version:\"1\"}}),i=await o.json(),a=this.#bt(i);n=[...n,...a.items],t=a.cursor??void 0}while(t);return n}async listAddressSolanaNfts(e){return ou(this.#St.bind(this),this.#P,{functionName:\"NftApiClient:listAddressSolanaNfts\",ttlMilliseconds:this.#He.listAddressSolanaNfts})(e)}#At(e){return{address:e.address,tokenId:e.token_id,tokenStandard:e.token_standard,name:e.name,description:e.description,metadata:e.metadata,imageUrl:e.image_url,mediaUrl:e.media_url,externalUrl:e.external_url,attributes:e.attributes.map(e=>({key:e.key,value:e.value})),tokenAccountAddress:e.token_account_address,creators:e.creators.map(e=>({address:e.address,share:e.share,verified:e.verified})),collectionName:e.collection_name,collectionSymbol:e.collection_symbol,collectionCount:e.collection_count,collectionImageUrl:e.collection_image_url,onchainCollectionAddress:e.onchain_collection_address,floorPrice:e.floor_price?{asset:{type:e.floor_price.asset.type,name:e.floor_price.asset.name,symbol:e.floor_price.asset.symbol,decimals:e.floor_price.asset.decimals,tokenId:e.floor_price.asset.token_id},amount:{rawAmount:e.floor_price.amount.raw_amount,amount:e.floor_price.amount.amount}}:null,lastSalePrice:e.last_sale_price?{asset:{type:e.last_sale_price.asset.type,name:e.last_sale_price.asset.name,symbol:e.last_sale_price.asset.symbol,decimals:e.last_sale_price.asset.decimals,tokenId:e.last_sale_price.asset.token_id},amount:{rawAmount:e.last_sale_price.amount.raw_amount,amount:e.last_sale_price.amount.amount}}:null,rarity:e.rarity?{ranking:{source:e.rarity.ranking.source,value:e.rarity.ranking.value},metadata:{howrare:{rank:e.rarity.metadata.howrare.rank},moonrank:{rank:e.rarity.metadata.moonrank.rank}}}:null}}async#Et(e){try{const t=Lu({baseUrl:this.#a,path:`/nfts/contracts/solana/${e}/1`}),n=await this.#o(t,{headers:{\"Content-Type\":\"application/json\",accept:\"application/json\",version:\"1\"}}),r=await n.json();return this.#At(r)}catch(e){return await ju(e),null}}async getNftMetadata(e){return ou(this.#Et.bind(this),this.#P,{functionName:\"NftApiClient:getNftMetadata\",ttlMilliseconds:this.#He.getNftMetadata})(e)}async getNftsMetadata(e){return await Promise.all(e.map(async e=>this.getNftMetadata(e)))}}(FB,qB),iR=new class{#xt;#i;cacheTtlsMilliseconds;constructor({configProvider:e,priceApiClient:t,logger:n}){this.#xt=t,this.#i=n;const{cacheTtlsMilliseconds:r}=e.get().priceApi;this.cacheTtlsMilliseconds=r}#kt(e){if(!zB(e))throw new Error(\"Passed caipAssetType is not a fiat asset\");return tt(e).assetReference.toLowerCase()}async#It(e){const t=e.filter(e=>!zB(e)),[n,r]=await Promise.all([this.#xt.getFiatExchangeRates(),this.#xt.getMultipleSpotPrices(t,\"usd\")]);return{fiatExchangeRates:n,cryptoPrices:r}}async getMultipleTokenConversions(e){if(0===e.length)return{};const t=e.flatMap(e=>[e.from,e.to]),{fiatExchangeRates:n,cryptoPrices:r}=await this.#It(t),o={};return e.forEach(e=>{const{from:t,to:i}=e;let a,s;if(o[t]||(o[t]={}),zB(t)){const e=n[this.#kt(t)]?.value;if(!e)return void(o[t][i]=null);a=new wr(1).dividedBy(e)}else a=new wr(r[t]?.price??0);if(zB(i)){const e=n[this.#kt(i)]?.value;if(!e)return void(o[t][i]=null);s=new wr(1).dividedBy(e)}else s=new wr(r[i]?.price??0);if(a.isZero()||s.isZero())return void(o[t][i]=null);const c=a.dividedBy(s).toString(),u=Date.now();o[t][i]={rate:c,conversionTime:u,expirationTime:u+this.cacheTtlsMilliseconds.historicalPrices}}),o}#Tt(e,t){const n=(0,Du.pick)(e,[\"marketCap\",\"totalVolume\",\"circulatingSupply\",\"allTimeHigh\",\"allTimeLow\",\"pricePercentChange1h\",\"pricePercentChange1d\",\"pricePercentChange7d\",\"pricePercentChange14d\",\"pricePercentChange30d\",\"pricePercentChange200d\",\"pricePercentChange1y\"]),r=e=>null==e?\"\":new wr(e).dividedBy(t).toString(),o=(e,t)=>null==t?{}:{[e]:t},i={...o(\"PT1H\",n.pricePercentChange1h),...o(\"P1D\",n.pricePercentChange1d),...o(\"P7D\",n.pricePercentChange7d),...o(\"P14D\",n.pricePercentChange14d),...o(\"P30D\",n.pricePercentChange30d),...o(\"P200D\",n.pricePercentChange200d),...o(\"P1Y\",n.pricePercentChange1y)};return{fungible:!0,marketCap:r(n.marketCap),totalVolume:r(n.totalVolume),circulatingSupply:(n.circulatingSupply??0).toString(),allTimeHigh:r(n.allTimeHigh),allTimeLow:r(n.allTimeLow),...Object.keys(i).length>0?{pricePercentChange:i}:{}}}async getMultipleTokensMarketData(e){if(0===e.length)return{};const t=e.flatMap(e=>[e.asset,e.unit]),{fiatExchangeRates:n,cryptoPrices:r}=await this.#It(t),o={};return e.forEach(e=>{const{asset:t,unit:i}=e;if(!r[t])return;let a;if(zB(i)){const e=n[this.#kt(i)]?.value;if(!e)return;a=new wr(1).dividedBy(e)}else a=new wr(r[i]?.price??0);a.isZero()||(o[t]||(o[t]={}),o[t][i]=this.#Tt(r[t],a))}),o}async getHistoricalPrice(e,t){v(e,We),v(t,We);const n=tt(t).assetReference.toLowerCase();v(n,Wu);const r=[\"1d\",\"7d\",\"1m\",\"3m\",\"1y\",\"1000y\"].map(async r=>this.#xt.getHistoricalPrices({assetType:e,timePeriod:r,vsCurrency:n}).then(e=>({timePeriod:r,response:e})).catch(async n=>(await ju(n),this.#i.warn(`Error fetching historical prices for ${e} to ${t} with time period ${r}. Returning null object.`,n),{timePeriod:r,response:Gu}))),o=(await Promise.all(r)).reduce((e,{timePeriod:t,response:n})=>(e[`P${t.toUpperCase()}`]=n.prices.map(e=>[e[0],e[1].toString()]),e),{}),i=Date.now();return{intervals:o,updateTime:i,expirationTime:i+this.cacheTtlsMilliseconds.historicalPrices}}}({configProvider:FB,priceApiClient:nR,logger:nu}),aR=new class{#T;#i;tld=\".sol\";constructor(e,t){this.#T=e,this.#i=t}async resolveDomain(e,t){const n=this.#T.getRpc(e);return CB(n,t)}async resolveAddress(e,t){try{const n=this.#T.getRpc(e),r=await(async(e,t)=>{const n=await YC.getAddress(\"85iDfUvr3HJyLM2zcq5BXSiDvUWfw6cSE1FfNBo8Ap29\",t),r=await YC.retrieve(e,n),[o,i]=await Promise.all([jC.retrieve(e,r.nameAccount),ZC(e,r.nameAccount)]),a=i||o.owner,s=o.parentName!==DC,c=[JC(e,r.nameAccount,s?o.parentName:void 0)];s&&c.push(JC(e,o.parentName));const u=(await Promise.all(c)).join(\".\");return{domainAddress:r.nameAccount,domainName:u,stale:t!==a}})(n,Sa(t));return`${r.domainName}.sol`}catch(e){return this.#i.error(\"Error resolving address\",e),null}}}(VB,nu),sR=new class{#Ke;constructor(e){this.#Ke=e}async findByKeyringAccountId(e){return await this.#Ke.getKey(`assetEntities.${e}`)??[]}async getAll(){const e=await this.#Ke.getKey(\"assetEntities\")??{};return Object.values(e).flat()}async saveMany(e){await this.#Ke.update(t=>{const n=(0,Du.cloneDeep)(t);for(const t of e){const{keyringAccountId:e}=t,r=(0,Du.cloneDeep)(n.assetEntities[e]??[]),o=r.findIndex(e=>e.assetType===t.assetType&&e.keyringAccountId===t.keyringAccountId);-1===o?r.push(t):r[o]=t,n.assetEntities[e]=r}return n})}}($B),cR=new Nx({connection:VB,logger:nu,configProvider:FB,assetsRepository:sR,tokenApiClient:rR,cache:qB,tokenPricesService:iR,nftApiClient:oR}),uR=new class{#Ke;constructor(e){this.#Ke=e}async getAll(){const e=await this.#Ke.getKey(\"keyringAccounts\");return Object.values(e??{})}async findById(e){return await this.#Ke.getKey(`keyringAccounts.${e}`)??null}async findByAddress(e){return(await this.getAll()).find(t=>t.address===e)??null}async save(e){await this.#Ke.setKey(`keyringAccounts.${e.id}`,e)}async delete(e){await this.#Ke.deleteKey(`keyringAccounts.${e}`)}}($B),lR=new class{#_t;constructor(e){this.#_t=e}async getAll(){return this.#_t.getAll()}async getAllSelected(){const[e,t]=await Promise.all([this.#_t.getAll(),Tx(snap)]);return e.filter(e=>t.includes(e.id))}async findById(e){return this.#_t.findById(e)}async findByAddress(e){return this.#_t.findByAddress(e)}async save(e){return this.#_t.save(e)}async delete(e){return this.#_t.delete(e)}}(uR),dR=new class{#Ke;#ot=\"transactions\";constructor(e){this.#Ke=e}async getAll(){const e=await this.#Ke.getKey(this.#ot);return Object.values(e??{}).flat()}async findByAccountId(e){return await this.#Ke.getKey(`${this.#ot}.${e}`)??[]}async save(e){await this.saveMany([e])}async saveMany(e){await this.#Ke.update(t=>{const n=t[this.#ot];return e.forEach(e=>{const r=e.id,o=e.account,i=n[o]??[],a=i.findIndex(e=>e.id===r);-1!==a&&(i[a]=e);const s=(0,Du.chain)([...i,e]).uniqBy(\"id\").sortBy(e=>-(e.timestamp??0)).value();t[this.#ot][o]=s}),t})}}($B),fR=new class{#K;#J;#i;constructor(e,t,n){this.#K=e,this.#J=t,this.#i=n}async mapRpcTransaction(e,t,n,r){try{const{blockTime:o}=e,{id:i,address:a}=t,s=e.transaction.signatures[0];if(!s)throw new Error(\"Transaction ID is required\");const c=Number(o),u=this.#Ct(e);let l=[],d=[],f=[];const h=(u===ul.Failed?this.#Bt.bind(this):this.#Rt.bind(this))({scope:n,transactionData:e});l=h.fees,d=h.from,f=h.to;const{from:p,to:g}=await this.#Pt({scope:n,transactionData:e});let m=[...p,...d],y=[...g,...f];const w=this.#Nt({address:Sa(a),status:u,from:m,to:y});w===ll.Swap&&(m=m.filter(e=>e.address===a),y=y.filter(e=>e.address===a)),w===ll.Receive&&(y=y.filter(e=>e.address===a),l=[]);const v=[...new Set([...m,...y].filter(e=>e.asset?.fungible).map(e=>e.asset.type))],b=r??await this.#J.getAssetsMetadata(v);return m.forEach(e=>{e.asset?.fungible&&b[e.asset.type]&&(e.asset.unit=b[e.asset.type]?.symbol??\"UNKNOWN\")}),y.forEach(e=>{e.asset?.fungible&&b[e.asset.type]&&(e.asset.unit=b[e.asset.type]?.symbol??\"UNKNOWN\")}),{id:s,account:i,timestamp:c,chain:n,status:u,type:w,from:m,to:y,fees:l,events:[{status:u,timestamp:c}]}}catch(e){return await ju(e),this.#i.warn(e,\"Error mapping transaction\"),null}}#Ct(e){return e.meta?.err||e.meta?.status&&\"Err\"in e.meta.status?ul.Failed:ul.Confirmed}#Nt({address:e,status:t,from:n,to:r}){if(0===n.length||0===r.length||t===ul.Failed)return ll.Unknown;const o=n.filter(t=>t.address===e),i=r.filter(t=>t.address===e),a=o.length>0,s=i.length>0,c=n.every(t=>r.some(n=>n.address===e&&!0===t.asset?.fungible&&!0===n.asset?.fungible&&t.asset.type===n.asset.type)),u=r.every(t=>n.some(n=>n.address===e&&!0===n.asset?.fungible&&!0===t.asset?.fungible&&n.asset.type===t.asset.type));return c&&u?ll.Send:a&&s?ll.Swap:a?ll.Send:ll.Receive}#Rt({scope:e,transactionData:t}){const n=this.#Ot({scope:e,transactionData:t}),r=[],o=[],i=new Map(t.meta?.preBalances?.map((e,t)=>[t,new wr(e.toString())])??[]),a=new Map(t.meta?.postBalances?.map((e,t)=>[t,new wr(e.toString())])??[]),s=[...t.transaction.message.accountKeys,...t.meta?.loadedAddresses?.writable??[],...t.meta?.loadedAddresses?.readonly??[]],c=new Set([...Array.from(i.keys()),...Array.from(a.keys())]);for(const n of c){const c=s[n]?.toString();if(!c)continue;const u=i.get(n)??new wr(0),l=a.get(n)??new wr(0),d=0===n?fm(t.meta?.fee??0):new wr(0),f=u.minus(l).dividedBy(new wr(cu)).minus(d);if(f.isZero())continue;const h=f.absoluteValue().toString();f.isPositive()&&r.push({address:c,asset:{fungible:!0,type:mu[e].nativeToken.caip19Id,unit:mu[e].nativeToken.symbol,amount:h}}),f.isNegative()&&o.push({address:c,asset:{fungible:!0,type:mu[e].nativeToken.caip19Id,unit:mu[e].nativeToken.symbol,amount:h}})}const u=this.#Ut({scope:e,transactionData:t});return u.from.length>0&&r.push(...u.from),u.to.length>0&&o.push(...u.to),{fees:n,from:r,to:o}}#Bt({scope:e,transactionData:t}){const n=this.#Ot({scope:e,transactionData:t}),r=[...t.transaction.message.accountKeys,...t.meta?.loadedAddresses?.writable??[],...t.meta?.loadedAddresses?.readonly??[]],o=[],i=[],{instructions:a}=t.transaction.message;a.forEach(t=>{const{accounts:n,data:a,programIdIndex:s}=t;if(r[s]!==Oc)return;const[c,u]=n;if(void 0===c||void 0===u)return;const l=r[c],d=r[u];if(!l||!d)return;const f=Yu.decode(a);if(2!==this.#Mt(f))return;const h=this.#zt(f);o.push({address:l,asset:{amount:h.toString(),fungible:!0,type:mu[e].nativeToken.caip19Id,unit:mu[e].nativeToken.symbol}}),i.push({address:d,asset:{amount:h.toString(),fungible:!0,type:mu[e].nativeToken.caip19Id,unit:mu[e].nativeToken.symbol}})});return{fees:n,from:this.#Lt(o),to:this.#Lt(i)}}#Ut({scope:e,transactionData:t}){const{instructions:n}=t.transaction.message,r=[],o=[],i=t.transaction.message.accountKeys.findIndex(e=>e===Oc);return-1===i||n.forEach(n=>{const{accounts:a,data:s,programIdIndex:c}=n;if(c!==i)return;const[u,l]=a;if(void 0===u||void 0===l||u!==l)return;const d=t.transaction.message.accountKeys[u],f=t.transaction.message.accountKeys[l];if(!d||!f||d!==f)return;const h=this.#zt(Yu.decode(s));r.push({address:d,asset:{amount:h.toString(),fungible:!0,type:mu[e].nativeToken.caip19Id,unit:mu[e].nativeToken.symbol}}),o.push({address:f,asset:{amount:h.toString(),fungible:!0,type:mu[e].nativeToken.caip19Id,unit:mu[e].nativeToken.symbol}})}),{from:r,to:o}}async#Pt({scope:e,transactionData:t}){const n=[],r=[],o=new Map(t.meta?.preTokenBalances?.map(e=>[e.accountIndex,new wr(e.uiTokenAmount.amount)])??[]),i=new Map(t.meta?.postTokenBalances?.map(e=>[e.accountIndex,new wr(e.uiTokenAmount.amount)])??[]),a=new Set([...t.meta?.preTokenBalances?.map(e=>e.accountIndex)??[],...t.meta?.postTokenBalances?.map(e=>e.accountIndex)??[]]);for(const s of a){const a=o.get(s)??new wr(0),c=(i.get(s)??new wr(0)).minus(a);if(c.isZero())continue;const u=t.meta?.preTokenBalances?.find(e=>e.accountIndex===s)??t.meta?.postTokenBalances?.find(e=>e.accountIndex===s);if(!u)continue;const{mint:l,owner:d}=u;if(!d)continue;const f=Px(e,l),h=c.absoluteValue().toString(),p=(await this.#K.amountToUiAmountForMint(l,e,bs(BigInt(h)))).toString();c.isNegative()&&n.push({address:d,asset:{fungible:!0,type:f,unit:\"\",amount:p}}),c.isPositive()&&r.push({address:d,asset:{fungible:!0,type:f,unit:\"\",amount:p}})}const s=this.#jt({scope:e,transactionData:t});return s.from.length>0&&n.push(...s.from),s.to.length>0&&r.push(...s.to),{from:n,to:r}}#jt({scope:e,transactionData:t}){const{instructions:n}=t.transaction.message,r=[],o=[];return n.map(e=>Zg(e,t)).map(Gg).filter(this.#Ft.bind(this)).forEach(n=>{const i=(0,Du.get)(n,\"parsed.accounts.authority.address\"),a=(0,Du.get)(n,\"parsed.accounts.source.address\");if(!i||!a)return;const s=t.transaction.message.accountKeys.indexOf(Sa(a)),{mint:c,uiTokenAmount:{decimals:u}={}}=t.meta?.preTokenBalances?.find(e=>e.accountIndex===s)??{};if(!c||void 0===u)return;const l=n.parsed?.data.amount,d=wr(l).dividedBy(new wr(10).pow(u)).toString(),f=Px(e,c);r.push({address:i,asset:{amount:d,fungible:!0,type:f,unit:\"\"}}),o.push({address:i,asset:{amount:d,fungible:!0,type:f,unit:\"\"}})}),{from:r,to:o}}#Ot({scope:e,transactionData:t}){const n=this.#Dt(t),r=this.#$t(t),o=n.minus(r),i=[{type:\"base\",asset:{fungible:!0,type:mu[e].nativeToken.caip19Id,unit:mu[e].nativeToken.symbol,amount:r.toString()}}];return o?.isGreaterThan(0)&&i.push({type:\"priority\",asset:{fungible:!0,type:mu[e].nativeToken.caip19Id,unit:mu[e].nativeToken.symbol,amount:o.toString()}}),i}#Dt(e){return new wr(e.meta?.fee?.toString()??\"0\").dividedBy(cu)}#$t(e){const t=e.transaction.signatures.length;return wr(5e3).dividedBy(cu).multipliedBy(t)}#Lt(e){return e.reduce((e,t)=>{const n=e.find(e=>!0===e?.asset?.fungible&&!0===t.asset?.fungible&&e.asset.type===t.asset.type&&e.address===t.address);if(n&&!0===n.asset?.fungible&&!0===t.asset?.fungible){const e=new wr(n.asset.amount).plus(t.asset.amount);n.asset.amount=e.toString()}else e.push(t);return e},[])}#Mt(e){let t=BigInt(0);for(let n=0;n<4;n++)t|=BigInt(e[n]??0)<<BigInt(8*n);return Number(t)}#zt(e){let t=BigInt(0);for(let n=4;n<12;n++)t|=BigInt(e[n]??0)<<BigInt(8*(n-4));return wr(t.toString()).dividedBy(cu)}#Ft(e){if(\"Transfer\"!==e.type&&\"TransferChecked\"!==e.type)return!1;if(!e.parsed)return!1;const{source:t,destination:n,authority:r}=e.parsed.accounts??{};return!!(t&&n&&r)&&t.address===n.address}}(JB,cR,nu),hR=new class{#Kt;#qt;#Wt;#J;#T;#i;constructor(e,t,n,r,o,i){this.#Kt=e,this.#qt=t,this.#Wt=n,this.#J=r,this.#T=o,this.#i=tu(i,\"[💱 TransactionsService]\")}async fetchBySignature(e,t,n){const r=await this.#T.getRpc(n).getTransaction(Fa(e),{maxSupportedTransactionVersion:0}).send();return r?this.#qt.mapRpcTransaction(r,t,n):null}async fetchAssetsTransactions(e,t){const n=await this.#Wt.getAll(),r=e.map(e=>e.assetType),o=await this.#J.getAssetsMetadata(r),i=await this.#Kt.getAll(),a=(await Promise.all(e.map(async e=>{const{network:t}=e,n=\"pubkey\"in e?e.pubkey:e.address,r=await(async e=>{const{network:t}=e,n=\"mint\"in e?e.mint:e.address,r=i.sort((e,t)=>(t.timestamp??0)-(e.timestamp??0)).find(e=>e.from.some(e=>Px(t,n)===(0,Du.get)(e,\"asset.type\"))||e.to.some(e=>Px(t,n)===(0,Du.get)(e,\"asset.type\")));return r||null})(e),o=r?Fa(r?.id):void 0;return(await this.#T.getRpc(t).getSignaturesForAddress(Sa(n),{limit:5,...o?{until:o}:{}}).send()).map(t=>({signatureResponse:{signature:t.signature,blockTime:Number(t.blockTime??0)},asset:e}))}))).flat(),s=t?.limit?a.sort((e,t)=>(t.signatureResponse.blockTime??0)-(e.signatureResponse.blockTime??0)).slice(0,t.limit):a,c=(await Promise.all(s.map(async e=>{try{const{signatureResponse:t,asset:n}=e;return{transaction:await this.#T.getRpc(n.network).getTransaction(Fa(t.signature),{maxSupportedTransactionVersion:0}).send(),asset:n}}catch(e){return await ju(e),null}}))).filter(e=>null!==e),u=e=>n.find(t=>t.id===e);return(await Promise.all(c.map(async e=>{const{transaction:t,asset:n}=e;if(!t)return null;const r=u(n.keyringAccountId);return r?this.#qt.mapRpcTransaction(t,r,n.network,o):null}))).filter(e=>null!==e).filter(e=>{const t=u(e.account);return!!t&&!Kx(e,t)})}async fetchLatestSignatures(e,t,n){return(await this.#T.getRpc(e).getSignaturesForAddress(t,n).send()).map(({signature:e})=>e)}async findByAccounts(e){return(await Promise.all(e.map(async e=>this.#Kt.findByAccountId(e.id)))).flat()}async save(e){await this.saveMany([e])}async saveMany(e){await this.#Kt.saveMany(e);const t=(0,Du.groupBy)(e,\"account\");await Ix(snap,Cx.AccountTransactionsUpdated,{transactions:t})}}(dR,fR,lR,cR,VB,nu),pR=new class{#Wt;#J;#X;#i;constructor(e,t,n,r){this.#Wt=e,this.#J=t,this.#X=n,this.#i=tu(r,\"[🔄 AccountsSynchronizer]\")}async synchronize(e){const t=e??await this.#Wt.getAll();this.#i.info(\"Synchronizing accounts\",t);const n=(await Promise.allSettled(t.map(async e=>this.#J.fetch(e)))).map(e=>\"fulfilled\"===e.status?e.value:[]).flat();await this.#J.saveMany(n);const r=await this.#X.fetchAssetsTransactions(n,{limit:20});await this.#X.saveMany(r)}}(lR,cR,hR,nu),gR=new class{#Vt;#i;#Xe;constructor(e,t,n){this.#Vt=e,this.#Xe=t,this.#i=n}async scanTransaction({method:e,accountAddress:t,transaction:n,scope:r,origin:o,options:i=[\"simulation\",\"validation\"],account:a}){try{const s=await this.#Vt.scanTransactions({method:e,accountAddress:t,transactions:[n],scope:r,origin:o===uu?\"https://metamask.io\":o,options:i}),c=this.#Ht(s);if(!c?.status)return this.#i.warn(\"Invalid scan result received from security alerts API\"),a&&await this.#Xe.trackEventSecurityScanCompleted(a,o,r,jB.ERROR,!1),null;if(a){const e=Object.values(jB).includes(c.status)?c.status:jB.ERROR,t=Boolean(c.validation?.type&&c.validation.type!==LB.Benign),n=[this.#Xe.trackEventSecurityScanCompleted(a,o,r,e,t)];if(t){const e=Object.values(LB).includes(c.validation.type)?c.validation.type:LB.Warning;n.push(this.#Xe.trackEventSecurityAlertDetected(a,o,r,e,c.validation.reason??\"unknown\",this.#Gt(c.validation)))}await Promise.all(n)}return c?.estimatedChanges?.assets?c:null}catch(e){return await ju(e),this.#i.error(e),a&&await this.#Xe.trackEventSecurityScanCompleted(a,o,r,jB.ERROR,!1),null}}#Gt(e){if(!e?.reason)return\"Security alert: Unknown reason\";return{unfair_trade:\"Unfair trade of assets, without adequate compensation to the owner's account\",transfer_farming:\"Substantial transfer of the account's assets to untrusted entities\",writable_accounts_farming:\"Transaction exposes unused writable account, can be utilized in BIT-FLIP attacks patterns\",native_ownership_change:\"The account transferred ownership of its native SOL to untrusted entities\",spl_token_ownership_change:\"The account transferred ownership of its SPL tokens to untrusted entities\",exposure_farming:\"The account delegates ownership, thereby exposing its assets to untrusted spenders\",known_attacker:\"A known attacker's account is involved in the transaction\",invalid_signature:\"One of the transactions provided contains non valid signatures, that can lead misleading simulation results\",honeypot:\"The account invests funds in a token that is part of an orchestrated honeypot scheme\",other:\"The transaction was marked as malicious for other reason, further details would be described in features field\"}[e.reason]??`Security alert: ${e.reason}`}#Ht(e){return e?{status:\"SUCCESS\"===e.status||\"ERROR\"===e.status?e.status:\"ERROR\",estimatedChanges:{assets:e.result?.simulation?.account_summary?.account_assets_diff?.map(e=>({type:e.in?\"in\":\"out\",symbol:\"symbol\"in e.asset?e.asset.symbol:e.asset_type,name:\"name\"in e.asset?e.asset.name:e.asset_type,logo:\"logo\"in e.asset?e.asset.logo:null,value:e.in?.value??e.out?.value??null,price:e.in?.usd_price??e.out?.usd_price??null}))??[]},validation:{type:e.result?.validation?.result_type??null,reason:e.result?.validation?.reason??null},error:e?.error_details?{type:\"type\"in e.error_details?e.error_details.type:null,code:\"code\"in e.error_details?e.error_details.code:null}:null}:null}}(new class{#o;#i;#a;constructor(e,t=globalThis.fetch,n=nu){const{baseUrl:r}=e.get().securityAlertsApi;this.#o=t,this.#i=n,this.#a=r}async scanTransactions({method:e,accountAddress:t,transactions:n,scope:r,origin:o,options:i}){const a=Ju.from(Yu.decode(t)).toString(\"base64\");this.#i.info(\"Scanning transaction\");return(await this.#o(`${this.#a}/solana/message/scan`,{headers:{\"Content-Type\":\"application/json\",accept:\"application/json\"},method:\"POST\",body:JSON.stringify({method:e,encoding:\"base64\",account_address:a,metadata:{url:o},chain:Xu[r],transactions:n,options:i})})).json()}}(FB),WB,nu),mR=new class{async handleKeyringRequest(e,t){const{request:{method:n}}=e;switch(n){case au.SignAndSendTransaction:case au.SignTransaction:return this.#Zt(e,t);case au.SignMessage:return this.#Yt(e,t);case au.SignIn:return this.#Jt(e,t);default:throw new Error(`Unsupported method: ${n}`)}}async#Zt(e,t){v(e.request,Y([zm,Fm]));const{request:{method:n,params:{transaction:r}},scope:o,account:i,origin:a}=e;await snap.request({method:\"snap_scheduleBackgroundEvent\",params:{duration:\"PT1S\",request:{method:Qk.OnTransactionAdded,params:{accountId:i,metadata:{scope:o,origin:a}}}}});return await Xk({...Jk,scope:o,method:n,origin:e.origin,transaction:r,account:t})?(await snap.request({method:\"snap_scheduleBackgroundEvent\",params:{duration:\"PT1S\",request:{method:Qk.OnTransactionApproved,params:{accountId:i,metadata:{scope:o,origin:a}}}}}),!0):(await snap.request({method:\"snap_scheduleBackgroundEvent\",params:{duration:\"PT1S\",request:{method:Qk.OnTransactionRejected,params:{accountId:i,metadata:{scope:o,origin:a}}}}}),!1)}async#Yt(e,t){const n=await async function(e,t){v(e.request,jm);const{request:{params:{message:n}},scope:r,origin:o}=e,i=da().encode(n),a=ma().decode(i),[s,c]=await Promise.all([QE().then(e=>e.locale).catch(()=>\"en\"),aR.resolveAddress(r,t.address)]);return XE(await ZE(Vx(Ok,{message:a,account:t,accountDomain:c,scope:r,locale:s,networkImage:Gx,origin:o}),{}))}(e,t);return Boolean(n)}async#Jt(e,t){const n=await async function(e,t){v(e.request,Lm);const{request:{params:n},scope:r,origin:o}=e,[i,a]=await Promise.all([QE(),aR.resolveAddress(r,t.address)]);return XE(await ZE(Vx(Rk,{params:n,account:t,accountDomain:a,scope:r,preferences:i,networkImage:Gx,origin:o}),{}))}(e,t);return Boolean(n)}},yR=new class{#Z;#Y;#X;#Xe;#T;#_;#i;#Xt=new Map;#Qt=10*rx.Minute;constructor(e,t,n,r,o,i,a){this.#Z=e,this.#Y=t,this.#X=n,this.#Xe=r,this.#T=o,this.#_=i,this.#i=tu(a,\"[✍️ SignatureMonitor]\"),this.#te()}#te(){ax.forEach(e=>{this.#Z.registerNotificationHandler(\"signatureSubscribe\",e,this.#en.bind(this)),this.#Z.registerConnectionRecoveryHandler(e,this.#oe.bind(this))})}async monitor(e,t,n,r,o){this.#i.info(\"Monitoring signature\",{signature:e,accountId:t,commitment:n,network:r,origin:o});const i={method:\"signatureSubscribe\",network:r,expiryMilliseconds:this.#Qt,params:[e,{commitment:n,enableReceivedNotification:!1}],metadata:{accountId:t,origin:o}},a=await this.#Z.subscribe(i);this.#Xt.set(a,i)}async#en(e,t){try{const{network:e}=t,n=(0,Du.get)(t,\"params[0]\");v(n,H());const r=(0,Du.get)(t,\"params[1].commitment\");v(r,Xg);const o=t.metadata?.accountId;v(o,H());const i=t.metadata?.origin;v(i,H());const a=await this.#Y.findById(o);if(!a)throw new Error(`Account not found: ${o}`);const s=await this.#X.fetchBySignature(n,a,e);if(!s)throw new Error(`Transaction with signature ${n} not found on network ${e}`);switch(await this.#X.save(s),r){case\"confirmed\":case\"finalized\":await this.#Xe.trackEventTransactionFinalized(a,s,{scope:e,origin:i});break;default:this.#i.warn(`⚠️ Commitment ${r} not supported`)}}catch(e){await ju(e),this.#i.error(\"Error handling signature notification\",e)}finally{await this.#Z.unsubscribe(t.id),this.#Xt.delete(t.id)}}async#oe(){this.#i.info(\"Handling connection recovery\"),await Promise.all(Array.from(this.#Xt.entries()).map(async([e,t])=>{await this.#tn(t,e)}))}async#tn(e,t){try{const{network:n}=e;v(n,H());const r=(0,Du.get)(e,\"params[0]\");v(r,H());const o=(0,Du.get)(e,\"params[1].commitment\");v(o,Xg);const i=await this.#nn(r,n);if(!i)throw new Error(`Signature ${r} not found via HTTP fetch during connection recovery`);if(!this.#rn(i,o))return void this.#i.info(\"Signature did not reach the desired commitment while connection was down. Skipping.\");const a={jsonrpc:\"2.0\",method:\"signatureNotification\",params:{subscription:1,result:{context:{slot:BigInt(0)},value:{err:null}}}},s={...e,id:t};await this.#en(a,s),this.#Xt.delete(t)}catch(e){this.#i.error(\"Error handling connection recovery\",e)}}async#nn(e,t){const n=await this.#T.getRpc(t).getSignatureStatuses([Fa(e)],{searchTransactionHistory:!0}).send(),r=n.value[0]?.confirmationStatus;if(!r)throw new Error(`Signature ${e} not found via HTTP fetch during connection recovery`);return r}#rn(e,t){return t===e||\"processed\"===t&&(\"confirmed\"===e||\"finalized\"===e)||\"confirmed\"===t&&\"finalized\"===e}}(YB,lR,hR,WB,VB,FB,nu),wR=new qx(YB,lR,cR,hR,pR,JB,FB,nu),vR=(new class{#Wt;#on;#ge;#i;constructor(e,t,n,r){this.#Wt=e,this.#on=t,this.#ge=n,this.#i=tu(r,\"[🥾 MonitoredAccountsInitializer]\"),this.#te()}#te(){this.#ge.on(\"onActive\",this.#in.bind(this))}async#in(){this.#i.info(\"Starting to monitor the selected accounts\");const e=await this.#Wt.getAllSelected();await this.#on.setMonitoredAccounts(e.map(e=>e.id))}}(lR,wR,DB,nu),new class{#T;#an;#sn;#Xe;#i;constructor(e,t,n,r,o=nu){this.#T=e,this.#an=t,this.#sn=n,this.#Xe=r,this.#i=tu(o,\"[👛 WalletService]\")}async resolveAccountAddress(e,t,n){this.#i.log(\"Resolving account address\",{keyringAccounts:e,scope:t,request:n});const{method:r,params:o}=n,i=e.filter(e=>e.scopes.includes(t));if(0===i.length)throw new Error(\"No accounts with this scope\");let a;switch(r){case au.SignIn:{const{address:e}=o;if(!e)throw new Error(\"No address\");a=e;break}case au.SignAndSendTransaction:case au.SignMessage:case au.SignTransaction:{const{account:e}=o;a=e.address;break}default:throw this.#i.warn({method:r},\"Unsupported method\"),new Error(\"Unsupported method\")}const s=i.find(e=>e.address===a);if(!s)throw new Error(\"Account not found\");return lk(t,a)}async signTransaction(e,t,n,r,o){this.#i.log(\"Signing transaction\",{account:e,transaction:t,scope:n,options:o});const i=o?.minContextSlot?{minContextSlot:BigInt(o.minContextSlot)}:void 0,a=await this.#an.partiallySignBase64String(t,e,n,i),s={signedTransaction:Mg(a)};v(s,$m);try{mc(a);const t=pc(a);await this.#sn.monitor(t,e.id,\"confirmed\",n,r)}catch(e){this.#i.warn(\"Transaction is not fully signed, skipping monitoring\",{error:e})}return s}async signAndSendTransaction(e,t,n,r,o){this.#i.log(\"Signing and sending transaction\",e);const i=o?.minContextSlot?{minContextSlot:BigInt(o.minContextSlot)}:void 0,a=await this.#an.partiallySignBase64String(t,e,n,i),s=pc(a),c=function({rpc:e}){return async function(t,n){await Ng({...n,rpc:e,transaction:t})}}({rpc:this.#T.getRpc(n)}),u=ck(n,\"tx\",s);this.#i.info(`Sending transaction: ${u}`),mc(a);const l={...o?.preflightCommitment?{preflightCommitment:o.preflightCommitment}:{},...o?.minContextSlot?{minContextSlot:BigInt(o.minContextSlot)}:{},...o?.maxRetries?{maxRetries:BigInt(o.maxRetries)}:{},skipPreflight:o?.skipPreflight??!0,commitment:\"confirmed\"};await c(a,l),await this.#Xe.trackEventTransactionSubmitted(e,s,{scope:n,origin:r}),await this.#sn.monitor(s,e.id,o?.commitment??\"confirmed\",n,r);const d={signature:s};return v(d,Dm),d}async signMessage(e,t){this.#i.log(\"Signing message\",e,t);const{address:n,entropySource:r,derivationPath:o}=e,i=Sa(n),a=da().encode(t),s=function(e,t={}){return Object.freeze({content:\"string\"==typeof e?(new Pc).encode(e):e,signatures:Object.freeze({...t})})}(ma().decode(a)),{privateKeyBytes:c}=await KE({entropySource:r,derivationPath:o}),u=await Tc(c),[l]=await u.signMessages([s]);v(l,K());const d=l[i];var h;v(d,(h=Uint8Array,E(\"instance\",e=>e instanceof h||`Expected a \\`${h.name}\\` instance, but received: ${f(e)}`)));const p={signature:oa().decode(d),signedMessage:t,signatureType:\"ed25519\"};return v(p,Km),p}async signIn(e,t){this.#i.log(\"Signing in\",e,t);const{address:n}=e,r=this.#cn(t),o=ma().encode(r),i=da().decode(o),a={account:{address:n},...await this.signMessage(e,i)};return v(a,qm),a}async verifySignature(e,t,n){this.#i.log(\"Verifying signature\",{account:e,signatureBase58:t,messageBase64:n}),v(t,Bu),v(n,Ru);const r=ia().encode(t),o=da().encode(n),{privateKeyBytes:i}=await KE({entropySource:e.entropySource,derivationPath:e.derivationPath}),a=await Tc(i);return await Da(a.keyPair.publicKey,r,o)}#cn(e){const{domain:t,address:n,statement:r,uri:o,version:i,chainId:a,nonce:s,issuedAt:c,expirationTime:u,notBefore:l,requestId:d,resources:f}=e;let h=`${t??\"\"} wants you to sign in with your Solana account:\\n`;h+=`${n??\"\"}`,r&&(h+=`\\n\\n${r}`);const p=[];if(o&&p.push(`URI: ${o}`),i&&p.push(`Version: ${i}`),a&&p.push(`Chain ID: ${a}`),s&&p.push(`Nonce: ${s}`),c&&p.push(`Issued At: ${c}`),u&&p.push(`Expiration Time: ${u}`),l&&p.push(`Not Before: ${l}`),d&&p.push(`Request ID: ${d}`),f&&f.length>0){p.push(\"Resources:\");for(const e of f)p.push(`- ${e}`)}return p.length&&(h+=`\\n\\n${p.join(\"\\n\")}`),h}}(VB,XB,yR,WB,nu)),bR=new class{#Ke;#i;#X;#J;#un;#ln;#on;#dn=\"Create Solana Account\";#fn=\"Create Solana Account Batch\";constructor({state:e,logger:t,transactionsService:n,assetsService:r,walletService:o,confirmationHandler:i,keyringAccountMonitor:a}){this.#Ke=e,this.#i=tu(t,\"[🔑 Keyring]\"),this.#X=n,this.#J=r,this.#un=o,this.#ln=i,this.#on=a}async#hn(){try{const e=await this.#Ke.getKey(\"keyringAccounts\")??{};return(0,Du.sortBy)(Object.values(e),[\"entropySource\",\"index\"])}catch(e){throw new Error(\"Error listing accounts\",{cause:e})}}async getAccount(e){try{vx({accountId:e},bu);return Yg(await this.getAccountOrThrow(e))}catch(e){throw this.#i.error({error:e},\"Error getting account\"),new Pn(e)}}async getAccounts(){try{return(await this.#hn()).map(Yg)}catch(e){throw this.#i.error({error:e},\"Error listing accounts\"),new Pn(e)}}async getAccountOrThrow(e){const t=await this.#pn(e);if(!t)throw new Error(`Account \"${e}\" not found`);return t}async#pn(e){return this.#Ke.getKey(`keyringAccounts.${e}`)}#gn(e){return`m/44'/501'/${e}'/0'`}async#mn(){const e=(await async function(){return await snap.request({method:\"snap_listEntropySources\"})}()).find(({primary:e})=>e);if(!e)throw new Error(\"No default entropy source found - this can never happen\");return e.id}#yn({id:e,entropySource:t,derivationPath:n,index:r,publicKeyBytes:o}){const i=Sx.decode(o.slice(1));return{id:e,entropySource:t,derivationPath:n,index:r,type:Je.DataAccount,address:i,scopes:[UE.Mainnet,UE.Testnet,UE.Devnet],options:{entropySource:t,derivationPath:n,index:r},methods:[au.SignAndSendTransaction,au.SignTransaction,au.SignMessage,au.SignIn]}}async createAccounts(e){try{!function(e,t){const{type:n}=e;if(!t.includes(n))throw new Error(`Unsupported create account option type: ${n}`)}(e,[`${wt.Bip44DeriveIndex}`,`${wt.Bip44DeriveIndexRange}`,`${wt.Bip44Discover}`]),await async function(e){try{return await snap.request({method:\"snap_startTrace\",params:{name:e}})}catch(e){return null}}(this.#fn);const t=e.entropySource??await this.#mn();if(e.type===wt.Bip44Discover&&!await this.#wn(t,e.groupIndex))return await nx(this.#fn),[];const n=new Map;for(const e of await this.#hn())e.entropySource===t&&n.set(e.index,e);let r;r=e.type===wt.Bip44DeriveIndexRange?e.range:{from:e.groupIndex,to:e.groupIndex};const o=await $E({entropySource:t,path:[\"m\",\"44'\",\"501'\"],curve:\"ed25519\"}),i=await PE.fromJSON(o);let a=0;const s={};for(let e=r.from;e<=r.to;e++)if(!n.has(e)){const r=globalThis.crypto.randomUUID(),o=this.#gn(e),{publicKeyBytes:c}=await qE({coinTypeNode:i,accountIndex:e}),u=this.#yn({id:r,entropySource:t,derivationPath:o,index:e,publicKeyBytes:c});n.set(e,u),s[r]=u,a+=1}await this.#Ke.setKeyWith(\"keyringAccounts\",e=>({...e,...s})),await nx(this.#fn);const c=[];for(let e=r.from;e<=r.to;e++){const t=n.get(e);t&&c.push(Yg(t))}return this.#i.info(`Created ${a} new accounts, returned ${c.length} total accounts`),c}catch(e){throw this.#i.error({error:e},\"Error creating accounts batch\"),new Pn(e)}}async#vn(e){await Promise.all([this.#Ke.deleteKey(`keyringAccounts.${e}`),this.#Ke.deleteKey(`transactions.${e}`),this.#Ke.deleteKey(`assets.${e}`)])}async deleteAccount(e){try{vx({accountId:e},Au),await this.#vn(e)}catch(e){throw this.#i.error({error:e},\"Error deleting account\"),new Pn(e)}}async getAccountAssets(e){try{vx({accountId:e},Su);const t=await this.getAccountOrThrow(e),n=(await this.#J.findByAccount(t)).filter(e=>e.assetType.endsWith(pu.SOL)||Number(e.rawAmount)>0).map(e=>e.assetType);return bx(n,xt),n}catch(e){throw this.#i.error({error:e},\"Error listing account assets\"),new Pn(e)}}async getAccountBalances(e,t){try{vx({accountId:e,assets:t},Eu);const n=await this.getAccountOrThrow(e),r=(await this.#J.findByAccount(n)).filter(e=>t.includes(e.assetType)).filter(e=>e.assetType.endsWith(pu.SOL)||Number(e.rawAmount)>0).reduce((e,t)=>(e[t.assetType]={unit:t.symbol,amount:t.uiAmount},e),{});return bx(r,Iu),r}catch(e){throw this.#i.error({error:e},\"Error getting account balances\"),new Pn(e)}}async submitRequest(e){v(e,Ax);const{request:{method:t,params:n},scope:r,account:o,origin:i}=e,a=await this.getAccountOrThrow(o);if(!a.scopes.includes(r))throw new Error(`Scope \"${r}\" is not allowed for this account`);if(!a.methods.includes(t))throw new Error(`Method \"${t}\" is not allowed for this account`);if(\"scope\"in n&&r!==n.scope)throw new Error(`Scope \"${r}\" does not match \"${n.scope}\" in request.params`);v(r,Tu);if(!await this.#ln.handleKeyringRequest(e,a))throw new Yn;switch(t){case au.SignAndSendTransaction:{const{transaction:e,options:t}=n;return this.#un.signAndSendTransaction(a,e,r,i,t)}case au.SignTransaction:{this.#bn(a,e);const{transaction:t,options:o}=n;return this.#un.signTransaction(a,t,r,i,o)}case au.SignMessage:{this.#bn(a,e);const{message:t}=n;return this.#un.signMessage(a,t)}case au.SignIn:return this.#un.signIn(a,n);default:throw new Fn(`Unsupported method: ${t}`)}}#bn(e,t){const{address:n}=e,{account:r}=t.request.params;try{Sa(r.address)}catch{throw new Error(\"Invalid Solana address format\")}if(r.address!==n)throw new Error(\"The requested account and/or method has not been authorized by the user.\")}async getAccountTransactions(e,t){try{vx({accountId:e,pagination:t},xu);const{limit:n,next:r}=t,o=await this.#pn(e);if(!o)throw new Error(\"Account not found\");const i=await this.#X.findByAccounts([o]),a=r?i.findIndex(e=>e.id===r):0,s=i.slice(a,a+n),c=a+t.limit<i.length;return{data:s,next:c?i[a+t.limit]?.id??null:null}}catch(e){throw this.#i.error({error:e},\"Error listing account transactions\"),new Pn(e)}}async resolveAccountAddress(e,t){try{v(e,Tu);const{method:n,params:r}=t,o={method:n,params:r};v(o,Wm);const i=await this.#hn();return{address:await this.#un.resolveAccountAddress(i,e,o)}}catch(e){return await ju(e),this.#i.error({error:e},\"Error resolving account address\"),null}}async#wn(e,t){const n=this.#gn(t),{publicKeyBytes:r}=await KE({entropySource:e,derivationPath:n}),o=Sx.decode(r.slice(1));return(await Promise.all(Ex.map(async e=>this.#X.fetchLatestSignatures(e,o,{limit:1})))).some(e=>e.length>0)}async setSelectedAccounts(e){vx(e,U(yu));const t=new Set((await this.#hn()).map(e=>e.id));if(!e.every(e=>t.has(e)))throw new zn(\"Account IDs were not part of existing accounts.\");await this.#on.setMonitoredAccounts(e)}async exportAccount(e,t){vx({accountId:e,options:t},ku);const n=await this.getAccountOrThrow(e),r=t?.encoding??\"base58\";if(\"base58\"!==r)throw new Error(\"Only base58 private key export is supported\");try{const{privateKeyBytes:e,publicKeyBytes:t}=await KE({entropySource:n.entropySource,derivationPath:n.derivationPath}),o=new Uint8Array(64);o.set(e,0),o.set(t.slice(1),32);const i=Yu.encode(o);if(!A(i,Bu))throw new Error(\"Derived private key failed encoding validation\");return{type:\"private-key\",encoding:r,privateKey:i}}catch(e){const t=\"Error exporting account\";throw this.#i.error(t),new Pn(t)}}}({state:$B,transactionsService:hR,logger:nu,assetsService:cR,walletService:vR,confirmationHandler:mR,keyringAccountMonitor:wR}),AR=new class{#T;#i;constructor(e,t=nu){this.#T=e,this.#i=t}static isMaybeNonFungible(e){const{tokenAmount:t}=e,{decimals:n}=t;return!1}}(VB,nu),SR=new class{#T;#An;#i;#P;#q;#Sn;#En;#J;#He={minimumBalanceForRentExemption:5*rx.Minute};constructor(e,t,n,r,o,i,a,s){this.#T=e,this.#An=t,this.#P=r,this.#i=tu(n,\"[📬 SendService]\"),this.#q=o,this.#Sn=i,this.#En=a,this.#J=s}async#xn(e){return ou(async t=>this.#T.getRpc(e).getMinimumBalanceForRentExemption(BigInt(0)).send().then(e=>yr(e.toString())),this.#P,{functionName:\"SendService:getMinimumBalanceForRentExemption\",ttlMilliseconds:this.#He.minimumBalanceForRentExemption,generateCacheKey:(e,t)=>{const[n]=t;return`${e}:${n}`}})(e)}async confirmSend(e){this.#i.log(\"Confirming send transaction\",e);const{fromAccountId:t,toAddress:n,amount:r,assetId:o}=e.params,i=await this.#An.getAccountOrThrow(t),{chainId:a,assetReference:s}=tt(o),c=a,u=o===mu[c].nativeToken.caip19Id,l=u?this.#Sn:this.#En,d={from:i,to:Sa(n),amount:r,network:c,...u?{}:{mint:Sa(s)}},f=hc(await l.buildTransactionMessage(d)),h=Mg(f),p={id:globalThis.crypto.randomUUID(),scope:c,account:t,origin:uu,request:{method:au.SignAndSendTransaction,params:{account:{address:i.address},transaction:h,scope:c}}};return this.#i.log(\"Submitting keyring request\",p),this.#An.submitRequest(p)}async onAddressInput(e,t){if(\"\"===e)return{valid:!1,errors:[{code:mm.Required}]};try{Sa(e);if(\"UNSUPPORTED\"===(await this.#q.classify(e,t)).type)throw new Error(\"Unsupported recipient\");return{valid:!0,errors:[]}}catch(e){return{valid:!1,errors:[{code:mm.Invalid}]}}}async onAmountInput(e){const{params:{value:t,accountId:n,assetId:r}}=e,o=await this.#An.getAccountOrThrow(n),{chainId:i}=tt(r),a=i,s=mu[a].nativeToken.caip19Id,c=r===s,u=await this.#J.findByAccount(o),l=u.find(e=>e.assetType===r),d=u.find(e=>e.assetType===s);if(!l)throw new Error(`Balance not found for asset ${r} and account ${n}`);if(\"\"===t)return{valid:!1,errors:[{code:mm.Required}]};const f=hm(l.uiAmount??\"0\"),h=hm(d?.uiAmount??\"0\"),p=hm(t),g=await this.#xn(a),m=c?this.#Sn:this.#En,y=new Ux(m).getFee(),w=yr(y.toString());if(h.isZero())return{valid:!1,errors:[{code:mm.InsufficientBalance}]};if(c){if(p.gt(h))return{valid:!1,errors:[{code:mm.InsufficientBalance}]};if(p.plus(w).plus(g).gt(h))return{valid:!1,errors:[{code:mm.InsufficientBalanceToCoverFee}]}}else{if(p.gt(f))return{valid:!1,errors:[{code:mm.InsufficientBalance}]};if(w.plus(g).gt(h))return{valid:!1,errors:[{code:mm.InsufficientBalanceToCoverFee}]}}return{valid:!0,errors:[]}}}(VB,bR,nu,qB,eR,QB,tR,cR),ER=new class{#T;#K;#i;#W=4e4;#V=10000n;constructor(e,t,n){this.#T=e,this.#K=t,this.#i=tu(n,\"[🔐 ApproveTokenService]\")}async buildApprovalTransactionMessage(e){this.#i.log(\"Building token approval transaction\",{mint:e.mint,delegate:e.delegate,amount:e.amount,network:e.network});const{account:{entropySource:t,derivationPath:n},mint:r,delegate:o,amount:i,network:a}=e,[s,c,{privateKeyBytes:u}]=await Promise.all([this.#T.fetchMint(r,a),this.#T.getLatestBlockhash(a),KE({entropySource:t,derivationPath:n})]),{programAddress:l}=s,d=await Tc(u),f=(await Rf({mint:r,owner:d.address,tokenProgram:l}))[0],[h,p]=await Promise.all([this.#K.uiAmountToAmountForMint(r,a,i),this.#T.fetchJsonParsedAccount(f,a,void 0,{skipCache:!0})]);let g=!1;try{sh(p),g=!0}catch{}const m=l===kh,y=[];if(!g){const e=m?Gh:Nf;y.push(e({ata:f,mint:r,owner:d.address,payer:d,tokenProgram:l}))}const w=m?Uh:If;y.push(w({source:f,delegate:o,owner:d,amount:h}));const v=[sf({microLamports:this.#V}),...y,nf({units:this.#W})];return As(Js({version:0}),e=>oc(d.address,e),e=>Es(c,e),e=>ac(v,e))}}(VB,JB,nu),xR=new class{#Wt;#un;#i;#kn;#In;constructor(e,t,n,r,o){this.#Wt=e,this.#un=t,this.#i=tu(n,\"[👋 ClientRequestHandler]\"),this.#kn=r,this.#In=o}async handle(e){this.#i.log(\"Handling client request\",e);const{method:t}=e;switch(t){case pm.SignAndSendTransactionWithoutConfirmation:return this.#Tn(e);case pm.ConfirmSend:return this.#_n(e);case pm.SignAndSendTransaction:return this.#Cn(e);case pm.ComputeFee:return this.#Bn(e);case pm.OnAddressInput:return this.#Rn(e);case pm.OnAmountInput:return this.#Pn(e);case pm.SignRewardsMessage:return this.#Nn(e);case pm.SignCardMessage:return this.#On(e);case pm.ApproveCardAmount:return this.#Un(e);case pm.SignProofOfOwnership:return this.#Mn(e);default:throw new Fn}}async#Tn(e){try{v(e,Vm)}catch(e){const t=new zn;throw t.cause=e,t}const{params:{transaction:t,options:n,account:{address:r},scope:o}}=e,i=await this.#Wt.findByAddress(r);if(!i)throw new zn(`Account not found: ${r}`);return this.#un.signAndSendTransaction(i,t,o,uu,n)}async#Cn(e){try{v(e,Gm)}catch(e){const t=new zn;throw t.cause=e,t}const{params:{transaction:t,options:n,accountId:r,scope:o}}=e,i=await this.#Wt.findById(r);if(!i)throw new zn(`Account not found: ${r}`);const{signature:a}=await this.#un.signAndSendTransaction(i,t,o,uu,n),s={transactionId:a};return v(s,Zm),s}async#_n(e){try{v(e,Jm)}catch(e){const t=new zn;throw t.cause=e,t}return await this.#kn.confirmSend(e)}async#Bn(e){try{v(e,gy)}catch(e){const t=new zn;throw t.cause=e,t}const{params:{transaction:t,scope:n}}=e,{baseFee:r,priorityFee:o}=dm.calculateFee(t),i=mu[n].nativeToken.symbol,a=mu[n].nativeToken.caip19Id,s=[{type:sl.Base,asset:{unit:i,type:a,amount:fm(r).toString(),fungible:!0}},{type:sl.Priority,asset:{unit:i,type:a,amount:fm(o).toString(),fungible:!0}}];return v(s,my),s}async#Rn(e){let t;try{t=b(e,Qm)}catch(e){const t=new zn;throw t.cause=e,t}const{params:{value:n,scope:r}}=t,o=await this.#kn.onAddressInput(n,r);return v(o,hy),o}async#Pn(e){try{v(e,ty)}catch(e){const t=new zn;throw t.cause=e,t}const t=await this.#kn.onAmountInput(e);return v(t,hy),t}async#Nn(e){v(e,iy);const{params:{accountId:t,message:n}}=e,r=await this.#Wt.findById(t);if(!r)throw new zn(`Account not found: ${t}`);const{address:o}=ny(n);if(o!==r.address)throw new zn(`Address in rewards message (${o}) does not match signing account address (${r.address})`);return await this.#un.signMessage(r,n)}async#On(e){try{v(e,uy)}catch(e){const t=new zn;throw t.cause=e,t}const{params:{accountId:t,message:n}}=e,r=await this.#Wt.findById(t);if(!r)throw new zn(`Account not found: ${t}`);const{address:o}=ay(n);if(o!==r.address)throw new zn(`Address in card message (${o}) does not match signing account address (${r.address})`);return await this.#un.signMessage(r,n)}async#Un(e){try{v(e,dy)}catch(e){const t=new zn;throw t.cause=e,t}const{params:{accountId:t,amount:n,mint:r,delegate:o,scope:i}}=e,a=await this.#Wt.findById(t);if(!a)throw new zn(`Account not found: ${t}`);const s=i,c=hc(await this.#In.buildApprovalTransactionMessage({account:a,mint:Sa(r),delegate:Sa(o),amount:n,network:s})),u=Mg(c),{signature:l}=await this.#un.signAndSendTransaction(a,u,s,uu),d={signature:l};return v(d,fy),d}async#Mn(e){v(e,Ay);const{params:{accountId:t,message:n}}=e,r=await this.#Wt.findById(t);if(!r)throw new zn(`Account not found: ${t}`);const{address:o}=wy(n);if(o!==r.address)throw new zn(`Address in proof-of-ownership message (${o}) does not match signing account address (${r.address})`);const i=As(n,ma().encode,da().decode),{signature:a}=await this.#un.signMessage(r,i),s={signature:Vd(Uint8Array.from(ia().encode(a)))};return v(s,Sy),s}}(lR,vR,nu,SR,ER),kR={configProvider:FB,connection:VB,keyring:bR,priceApiClient:nR,state:$B,cache:KB,assetsService:cR,tokenPricesService:iR,signer:XB,transactionsService:hR,sendSolBuilder:QB,sendSplTokenBuilder:tR,walletService:vR,transactionScanService:gR,analyticsService:WB,confirmationHandler:mR,nftService:AR,clientRequestHandler:xR,webSocketConnectionService:GB,subscriptionService:YB,eventEmitter:DB,nameResolutionService:aR,accountsService:lR,accountsSynchronizer:pR,tokenHelper:JB},IR=K({id:H(),jsonrpc:j(\"2.0\"),method:j(Qk.OnTransactionAdded),params:K({accountId:yu,metadata:K({scope:Tu,origin:H()})})}),TR=K({id:H(),jsonrpc:j(\"2.0\"),method:j(Qk.OnTransactionApproved),params:K({accountId:yu,metadata:K({scope:Tu,origin:H()})})}),_R=K({id:H(),jsonrpc:j(\"2.0\"),method:j(Qk.OnTransactionRejected),params:K({accountId:yu,metadata:K({scope:Tu,origin:H()})})}),CR=Yx(\"Form\"),BR=Yx(\"Field\"),RR=Yx(\"AccountSelector\"),PR=Yx(\"AssetSelector\"),NR=({title:e,backButtonName:t})=>Hx(Xx,{direction:\"horizontal\",alignment:\"space-between\",center:!0,children:[t?Vx(ak,{name:t,children:Vx(xk,{name:\"arrow-left\",color:\"primary\",size:\"md\"})}):null,Vx(Qx,{size:\"sm\",children:e}),Hx(Xx,{direction:\"horizontal\",children:[Vx(Xx,{children:null}),Vx(Xx,{children:null}),Vx(Xx,{children:null}),Vx(Xx,{children:null})]})]}),OR=Yx(\"Input\");var UR=function(e){return e.Form=\"send-form\",e.DestinationAccountInput=\"send-to\",e.BackButton=\"send-back-button\",e.SourceAccountSelector=\"send-account-selector\",e.AmountInput=\"send-amount-input\",e.AssetSelector=\"send-asset-selector\",e.SwapCurrencyButton=\"send-swap-currency\",e.MaxAmountButton=\"send-amount-input-max\",e.CancelButton=\"send-cancel-button\",e.SendButton=\"send-submit-button\",e.ClearButton=\"send-clear-button\",e.CloseButton=\"send-close-button\",e}({}),MR=function(e){return e.TOKEN=\"TOKEN\",e.FIAT=\"USD\",e}({});const zR=({name:e,value:t,tokenSymbol:n,currency:r,currencyType:o,locale:i,swapCurrencyButtonDisabled:a=!1})=>{const s=pk(i),c=o===MR.FIAT?r.toUpperCase():n;return Hx(BR,{label:s(\"send.amountField\"),children:[Vx(OR,{name:e,type:\"number\",min:0,placeholder:\"0\",step:.01,value:t??void 0}),Hx(Xx,{direction:\"horizontal\",center:!0,children:[Vx(Xx,{direction:\"vertical\",alignment:\"center\",children:Vx(ek,{size:\"sm\",children:c})}),Vx(ak,{name:UR.SwapCurrencyButton,disabled:a,children:Vx(xk,{name:\"swap-vertical\",color:a?\"muted\":\"primary\",size:\"md\"})})]})]})},LR={initial:null,fetching:\"default\",fetched:\"success\",error:null},jR=({name:e,value:t,error:n,locale:r,showClearButton:o,disabled:i,domainResolutionStatus:a})=>{const s=pk(r);return Hx(Xx,{children:[Hx(BR,{label:s(\"send.toField\"),error:n,children:[Vx(OR,{name:e,placeholder:i?\"\":s(\"send.toPlaceholder\"),value:t??void 0,disabled:i}),o?Vx(Xx,{children:Vx(ak,{name:UR.ClearButton,children:Vx(xk,{name:Ek.Close,color:\"primary\"})})}):null]}),a&&null!==LR[a]&&Vx(ek,{size:\"sm\",color:LR[a],children:s(`send.toDomainResolutionStatus.${a}`)})]})};const FR=e=>{const{amount:t,tokenPrices:n,tokenCaipId:r,currencyType:o}=e,i=n?.[r]?.price;if(o===MR.TOKEN)return t;if(void 0===i)throw new Error(\"Token price is undefined, cannot convert to fiat amount.\");return null===t?null:wr(t).dividedBy(wr(i)).toString()},DR=e=>{const{selectedTokenMetadata:t}=e;return{...t??{},tokenSymbol:t?.symbol??\"UNKNOWN\",tokenImage:t?.imageUrl??'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 48\" width=\"48\" height=\"48\">\\n  <path fill=\"#999999\" d=\"M42.75 24c0 10.59375-8.53125 19.21875-19.125 19.21875-10.6875 0-19.21875-8.625-19.21875-19.21875 0-10.59375 8.53125-19.21875 19.21875-19.21875 10.59375 0 19.125 8.625 19.125 19.21875zM23.625 14.0625c-3.09375 0-5.90625 2.25-5.90625 5.4375 0 0.84375 0.75 1.59375 1.59375 1.59375 0.84375 0 1.59375-0.75 1.59375-1.59375 0-1.125 1.03125-2.25 2.71875-2.25 1.59375 0 2.625 1.125 2.625 2.25 0 0.5625-0.375 1.03125-1.3125 1.59375l0 0c-1.125 0.75-3 1.96875-3 4.5l0 0.46875c0 0.84375 0.75 1.59375 1.6875 1.59375 0.84375 0 1.59375-0.75 1.59375-1.59375l0-0.46875c0-0.65625 0.28125-1.125 1.40625-1.78125 1.03125-0.65625 2.8125-1.875 2.8125-4.3125 0-3.1875-2.8125-5.4375-5.8125-5.4375zM23.53125 31.875c-0.84375 0-1.59375 0.65625-1.59375 1.59375 0 0.84375 0.75 1.59375 1.59375 1.59375l0.09375 0c0.84375 0 1.59375-0.75 1.59375-1.59375 0-0.9375-0.75-1.59375-1.59375-1.59375z\"/>\\n</svg>'}},$R=e=>{const{tokenCaipId:t,tokenPrices:n}=e;return n?.[t]?.price},KR=e=>{const{balances:t,fromAccountId:n,tokenCaipId:r}=e;return t?.[n]?.[r]?.amount??\"0\"},qR=e=>{const{tokenCaipId:t,scope:n}=e;return t===mu[n]?.nativeToken?.caip19Id},WR=Yx(\"Spinner\"),VR=({title:e,subtitle:t,iconSrc:n,isLoading:r})=>Hx(Xx,{alignment:\"center\",center:!0,children:[Hx(Xx,{direction:\"horizontal\",center:!0,children:[r?Vx(WR,{}):null,n&&!r?Vx(ok,{borderRadius:\"full\",src:n,width:16,height:16}):null]}),Vx(Qx,{size:\"lg\",children:e}),t?Vx(ek,{color:\"muted\",children:t}):null]}),HR=Yx(\"Value\"),GR=({context:e})=>{const{scope:t,fromAccountId:n,toAddress:r,accounts:o,feeEstimatedInSol:i,preferences:{locale:a,currency:s},transaction:c,feePaidInSol:u,tokenPrices:l,fromDomain:d,toDomain:f}=e,h=pk(a),p=mu[t],g=o.find(e=>e.id===n)?.address,m=lk(t,g),y=p.name,w=p.nativeToken.symbol,v=l[p.nativeToken.caip19Id]?.price,b=c?u:i,A=b?Hk(b,w,a):\"\",S=void 0===v||null===b?\"\":bk(Gk(b,v),s,a);return Hx(Xx,{children:[Hx(tk,{children:[Vx(nk,{label:h(\"send.confirmation.from\"),children:d?Vx(uk,{domain:d,scope:t,address:g}):Vx(sk,{href:ck(t,\"address\",g),children:Vx(rk,{address:m,displayName:!0})})}),r?Vx(nk,{label:h(\"send.confirmation.recipient\"),children:f?Vx(uk,{domain:f,scope:t,address:r}):Vx(sk,{href:ck(t,\"address\",r),children:Vx(rk,{address:lk(t,r),displayName:!0})})}):null]}),Hx(tk,{children:[Vx(nk,{label:h(\"send.confirmation.network\"),children:Vx(ek,{children:y})}),Vx(nk,{label:h(\"send.confirmation.transactionSpeed\"),children:Vx(ek,{children:\"<1s\"})}),Vx(nk,{label:h(\"send.confirmation.fee\"),children:Vx(HR,{extra:S,value:A})})]})]})};var ZR=function(e){return e.BackButton=\"transaction-confirmation-back-button\",e.CancelButton=\"transaction-confirmation-cancel-button\",e.ConfirmButton=\"transaction-confirmation-submit-button\",e}({});const YR={\"send-form\":({context:e,inputToAddress:t,inputAmount:n})=>{const{accounts:r,fromAccountId:o,amount:i,destinationAddressOrDomain:a,domainResolutionStatus:s,validation:c,currencyType:u,tokenCaipId:l,scope:d,balances:f,tokenPricesFetchStatus:h,buildingTransaction:p,error:g,loading:m,transactionMessage:y,preferences:{locale:w,currency:v}}=e,b=pk(w),A=f[o]?.[l],S=A?.amount,E=A?.unit??\"\",x=void 0!==S,k=r.find(e=>e.id===o),I=k?.address?lk(d,k.address):void 0,T=$R(e),_=void 0===S||\"0\"===S,C=void 0===T,B=\"error\"===h||\"fetched\"===h&&C,R=(x?{[MR.FIAT]:bk(Gk(S,T??0),v,w),[MR.TOKEN]:Hk(S,E,w)}:{[MR.FIAT]:\"\",[MR.TOKEN]:\"\"})[u],P=o.length>0&&!!a&&a.length>0&&oe(c?.[UR.DestinationAccountInput]),N=!oe(y)&&\"\"!==y,O=Boolean(a&&a.length>0),U=Boolean(c?.[UR.AmountInput]?.message),M=U?c?.[UR.AmountInput]?.message??\"\":`${b(\"send.balance\")}: ${R}`,z=o.length>0&&!!i&&i.length>0&&!!a&&a.length>0&&Object.values(c).every(oe)&&x&&!p&&N;return Hx(Jx,{backgroundColor:\"alternative\",children:[Hx(Xx,{children:[Vx(NR,{title:b(\"send.title\"),backButtonName:UR.BackButton}),Hx(CR,{name:UR.Form,children:[B&&Vx($k,{title:\"\",severity:\"info\",children:Vx(ek,{children:b(\"send.selectedTokenPriceNotAvailable\",{currency:v})})}),Vx(Xx,{children:null}),Vx(Xx,{children:null}),Vx(Xx,{children:null}),Vx(BR,{label:b(\"send.fromField\"),error:c?.[UR.SourceAccountSelector]?.message??\"\",children:Vx(RR,{name:UR.SourceAccountSelector,chainIds:[d],value:I??void 0,hideExternalAccounts:!0,switchGlobalAccount:!0})}),Vx(Xx,{children:null}),Vx(Xx,{children:null}),Vx(Xx,{children:null}),Vx(jR,{locale:w,disabled:m,name:UR.DestinationAccountInput,value:t??null,showClearButton:O,domainResolutionStatus:s,error:c?.[UR.DestinationAccountInput]?.message??\"\"}),P&&Hx(Xx,{children:[Vx(Xx,{children:null}),Vx(Xx,{children:null}),Vx(Xx,{children:null}),Hx(Xx,{direction:\"horizontal\",children:[Vx(BR,{label:b(\"send.assetField\"),children:Vx(PR,{chainIds:[d],value:l,name:UR.AssetSelector,addresses:I?[I]:[]})}),Vx(zR,{name:UR.AmountInput,currencyType:u,tokenSymbol:E,currency:v,value:n??null,locale:w,swapCurrencyButtonDisabled:C||_})]}),Hx(Xx,{direction:\"horizontal\",alignment:\"space-between\",crossAlignment:\"start\",children:[Vx(Xx,{direction:\"vertical\",alignment:\"start\",children:Vx(ek,{size:\"sm\",color:U?\"error\":\"muted\",children:M})}),Vx(ak,{size:\"sm\",name:UR.MaxAmountButton,disabled:_,children:b(\"send.maxButton\")})]})]}),g&&Hx(Xx,{children:[Vx(Xx,{children:null}),Vx($k,{title:b(g.title),severity:\"warning\",children:Vx(ek,{children:b(g.message)})})]})]})]}),Hx(ik,{children:[Vx(ak,{name:UR.CancelButton,children:b(\"send.cancelButton\")}),Vx(ak,{name:UR.SendButton,disabled:!z,loading:p,children:b(\"send.continueButton\")})]})]})},\"transaction-confirmation\":({context:e})=>{const{preferences:{currency:t,locale:n}}=e,r=pk(n),{tokenImage:o,tokenSymbol:i}=DR(e),a=FR(e),s=$R(e),c=void 0===s?\"\":bk(Gk(a??\"0\",s),t,n);return Hx(Jx,{children:[Hx(Xx,{children:[Vx(NR,{title:r(\"send.confirmation.title\"),backButtonName:\"transaction-confirmation-back-button\"}),Vx(VR,{title:Hk(a??\"0\",i,n),subtitle:c,iconSrc:o}),Vx(GR,{context:e})]}),Hx(ik,{children:[Vx(ak,{name:\"transaction-confirmation-cancel-button\",children:r(\"send.confirmation.cancelButton\")}),Vx(ak,{name:\"transaction-confirmation-submit-button\",loading:e.loading,disabled:e.loading,children:r(\"send.confirmation.sendButton\")})]})]})},\"send-pending\":({context:e})=>{const t=pk(e.preferences.locale);return Vx(Jx,{children:Hx(Xx,{children:[Vx(Xx,{children:null}),Vx(VR,{title:t(\"send.send-pending.title\"),subtitle:t(\"send.send-pending.subtitle\"),isLoading:!0}),Vx(GR,{context:e})]})})},\"transaction-success\":({context:e})=>{const{preferences:t,transaction:n,scope:r}=e,o=pk(t.locale),{tokenSymbol:i}=DR(e),a=FR(e);return Vx(Jx,{children:Hx(Xx,{children:[Vx(Xx,{children:null}),Vx(VR,{title:o(\"send.transaction-success.title\"),subtitle:o(\"send.transaction-success.subtitle\",{amount:vk(a??\"0\",t.locale),tokenSymbol:i}),iconSrc:'<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\\n<path d=\"M24.0002 3.99902C12.9802 3.99902 4.00024 12.979 4.00024 23.999C4.00024 35.019 12.9802 43.999 24.0002 43.999C35.0202 43.999 44.0002 35.019 44.0002 23.999C44.0002 12.979 35.0202 3.99902 24.0002 3.99902ZM33.5602 19.399L22.2202 30.739C21.9402 31.019 21.5602 31.179 21.1602 31.179C20.7602 31.179 20.3802 31.019 20.1002 30.739L14.4402 25.079C13.8602 24.499 13.8602 23.539 14.4402 22.959C15.0202 22.379 15.9802 22.379 16.5602 22.959L21.1602 27.559L31.4402 17.279C32.0202 16.699 32.9802 16.699 33.5602 17.279C34.1402 17.859 34.1402 18.799 33.5602 19.399Z\" fill=\"#1C8234\"/>\\n</svg>\\n'}),Vx(GR,{context:e}),n?.signature?Vx(Xx,{alignment:\"center\",center:!0,children:Vx(sk,{href:ck(r,\"tx\",n?.signature),children:o(\"send.confirmation.viewTransaction\")})}):null]})})},\"transaction-failure\":({context:e})=>{const{preferences:t}=e,n=pk(t.locale),{tokenSymbol:r}=DR(e),o=FR(e);return Vx(Jx,{children:Hx(Xx,{children:[Vx(Xx,{children:null}),Vx(VR,{title:n(\"send.transaction-failure.title\"),subtitle:n(\"send.transaction-failure.subtitle\",{amount:o??\"0\",tokenSymbol:r}),iconSrc:'<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\\n<path d=\"M40.8277 29.5283L29.7931 8.40143C28.3104 5.55884 26.2586 4 24 4C21.7414 4 19.6896 5.55884 18.2069 8.40143L7.17228 29.5283C5.77572 32.2241 5.62055 34.81 6.74125 36.8456C7.86194 38.8813 10.0689 40 12.9654 40H35.0346C37.9311 40 40.1381 38.8813 41.2588 36.8456C42.3795 34.81 42.2243 32.2058 40.8277 29.5283ZM22.7069 16.8375C22.7069 16.0856 23.2931 15.462 24 15.462C24.7069 15.462 25.2931 16.0856 25.2931 16.8375V26.0071C25.2931 26.759 24.7069 27.3826 24 27.3826C23.2931 27.3826 22.7069 26.759 22.7069 26.0071V16.8375ZM25.2241 32.811C25.1379 32.8844 25.0517 32.9577 24.9655 33.0311C24.8621 33.1044 24.7586 33.1595 24.6552 33.1961C24.5517 33.2511 24.4483 33.2878 24.3276 33.3062C24.2241 33.3245 24.1034 33.3428 24 33.3428C23.8965 33.3428 23.7759 33.3245 23.6552 33.3062C23.5517 33.2878 23.4483 33.2511 23.3448 33.1961C23.2414 33.1595 23.1379 33.1044 23.0345 33.0311C22.9483 32.9577 22.8621 32.8844 22.7759 32.811C22.4655 32.4626 22.2758 31.9857 22.2758 31.5089C22.2758 31.0321 22.4655 30.5553 22.7759 30.2068C22.8621 30.1335 22.9483 30.0601 23.0345 29.9868C23.1379 29.9134 23.2414 29.8584 23.3448 29.8217C23.4483 29.7667 23.5517 29.73 23.6552 29.7117C23.8793 29.6567 24.1207 29.6567 24.3276 29.7117C24.4483 29.73 24.5517 29.7667 24.6552 29.8217C24.7586 29.8584 24.8621 29.9134 24.9655 29.9868C25.0517 30.0601 25.1379 30.1335 25.2241 30.2068C25.5345 30.5553 25.7241 31.0321 25.7241 31.5089C25.7241 31.9857 25.5345 32.4626 25.2241 32.811Z\" fill=\"#BF5208\"/>\\n</svg>\\n'}),Vx(GR,{context:e})]})})}},JR=({context:e,inputToAddress:t,inputAmount:n})=>{const r=e.stage??\"send-form\";return Vx(YR[r],{context:e,inputToAddress:t,inputAmount:n})};function XR(e){if(!e)return!1;return/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*\\.sol$/u.test(e)}function QR(e,t,n){return n[e]?n[e]?.map(e=>e(t)).find(e=>null!==e)??null:null}function eP(e){const t=iP(e),n={[UR.SourceAccountSelector]:e.fromAccountId,[UR.AmountInput]:e.amount,[UR.DestinationAccountInput]:e.toAddress};return Object.entries(t).every(([e,t])=>{const r=n[e];return!!r&&t.every(e=>null===e(r))})}const tP=(e,t)=>{const n=pk(t);return t=>{const r=\"\"===t?{message:n(e),value:t}:null;return r?{message:r.message,value:t}:null}},nP=(e,t)=>{const n=pk(t);return t=>{try{return XR(t)||Sa(t),null}catch{return{message:n(e),value:t}}}},rP=e=>{const{minimumBalanceForRentExemptionSol:t,preferences:{locale:n},feeEstimatedInSol:r,selectedTokenMetadata:o}=e,i=pk(n);return n=>{if(\"\"===n)return{message:\"\",value:n};const a=FR({...e,amount:n}),s=hm(a??\"0\"),c=KR(e),u=hm(c),l=hm(r??\"0\"),d=hm(t??\"0\"),f=(e=>KR({...e,tokenCaipId:mu[e.scope].nativeToken.caip19Id}))(e),h=hm(f),p=qR(e);if(s.gt(u))return{message:`${i(\"send.insufficientBalance\")}: ${c} ${o?.symbol??\"\"}`,value:n};if(p){if(s.lt(d))return{message:i(\"send.amountGreatherThanMinimumBalanceForRentExemptionError\",{minimumValue:t}),value:n};if(s.plus(l).plus(d).gt(u))return{message:i(\"send.insuffientSolToCoverFee\"),value:n}}else{if(l.plus(d).gt(h))return{message:i(\"send.insuffientSolToCoverFee\"),value:n}}return s.isZero()?{message:\"\",value:n}:h.isZero()?{message:i(\"send.insuffientSolToCoverFee\"),value:n}:null}},oP=K({scope:z([...Object.values(lu)]),account:yu,assetId:q(We)}),iP=e=>({[UR.SourceAccountSelector]:[tP(\"send.fromRequiredError\",e.preferences.locale)],[UR.AmountInput]:[rP(e),tP(\"send.amountRequiredError\",e.preferences.locale)],[UR.DestinationAccountInput]:[tP(\"send.toRequiredError\",e.preferences.locale),nP(\"send.toInvalidError\",e.preferences.locale)]}),aP={scope:lu.Mainnet,fromAccountId:\"\",fromDomain:null,amount:\"\",destinationAddressOrDomain:null,toDomain:null,toAddress:null,domainResolutionStatus:null,feeEstimatedInSol:\"0\",feePaidInSol:\"0\",tokenCaipId:du.SolMainnet,accounts:[],currencyType:MR.TOKEN,validation:{},balances:{},assets:[],tokenPrices:{},selectedTokenMetadata:null,tokenPricesFetchStatus:\"initial\",preferences:{locale:\"en\",currency:\"usd\",hideBalances:!1,useSecurityAlerts:!0,useExternalPricingData:!0,simulateOnChainActions:!0,useTokenDetection:!0,batchCheckBalances:!0,displayNftMedia:!0,useNftDetection:!0},error:null,buildingTransaction:!1,transactionMessage:null,transaction:null,stage:\"send-form\",minimumBalanceForRentExemptionSol:\"0.002\",loading:!0},sP={[Qk.OnTransactionAdded]:async({request:e})=>{try{nu.info(\"[onTransactionAdded] Cronjob triggered\",e),v(e,IR);const{accountId:t,metadata:n}=e.params,r=await bR.getAccountOrThrow(t);await WB.trackEventTransactionAdded(r,n)}catch(e){throw nu.error(e),new Un(e)}},[Qk.OnTransactionApproved]:async({request:e})=>{try{nu.info(\"[onTransactionApproved] Cronjob triggered\",e),v(e,TR);const{accountId:t,metadata:n}=e.params,r=await bR.getAccountOrThrow(t);await WB.trackEventTransactionApproved(r,n)}catch(e){throw nu.error(e),new Un(e)}},[Qk.OnTransactionRejected]:async({request:e})=>{try{nu.info(\"[onTransactionRejected] Cronjob triggered\",e),v(e,_R);const{accountId:t,metadata:n}=e.params,r=await bR.getAccountOrThrow(t);await WB.trackEventTransactionRejected(r,n)}catch(e){throw nu.error(e),new Un(e)}},[Qk.RefreshSend]:async()=>{const e=tu(nu,\"[refreshSend]\");e.info(\"Background event triggered\");const[t,n,r]=await Promise.all([cR.getAll(),$B.getKey(\"mapInterfaceNameToId\"),QE().catch(()=>aP.preferences)]),o=t.flatMap(e=>e.assetType),i=n?.[HE];if(!i)return void e.info(\"No send form interface found\");if(await ex(i))try{const t=await nR.getMultipleSpotPrices(o,r.currency);await $B.setKey(\"tokenPrices\",t);const n=await ex(i);if(!n)return void e.info(\"Interface context no longer exists after fetching prices, skipping update\");const a={...n,tokenPrices:{...n.tokenPrices,...t}};await YE(i,Vx(JR,{context:a}),a),e.info(\"✅ Background event suceeded\"),await snap.request({method:\"snap_scheduleBackgroundEvent\",params:{duration:\"PT30S\",request:{method:\"refreshSend\"}}})}catch(t){await ju(t),e.warn({error:t},\"Could not refresh send interface\")}else e.info(\"Interface context no longer exists, skipping refresh\")},[Qk.RefreshConfirmationEstimation]:async()=>{const e=tu(nu,\"[refreshConfirmationEstimation]\");e.info(\"Background event triggered\");const t=(await $B.getKey(\"mapInterfaceNameToId\")??{})[GE];if(!t)return void e.info(\"No interface context found\");const n=await ex(t);if(n)try{if(!(n.account?.address&&n.transaction&&n.scope&&n.method))return void e.info(\"Context is missing required fields\");if(!n.preferences?.simulateOnChainActions)return void e.info(\"Transaction simulation is disabled in preferences\");const r={...n,scanFetchStatus:\"fetching\"};await YE(t,Vx(Yk,{context:VE(r)}),r);const[o,i]=await Promise.all([gR.scanTransaction({method:n.method,accountAddress:n.account.address,transaction:n.transaction,scope:n.scope,origin:n.origin,account:n.account}),ex(t)]);if(!i)return void e.info(\"Interface context no longer exists after scan, skipping update\");const a={...i,scanFetchStatus:\"fetched\",scan:o};e.info(\"New scan fetched\"),await YE(t,Vx(Yk,{context:VE(a)}),a),e.info(\"Background event suceeded\"),await snap.request({method:\"snap_scheduleBackgroundEvent\",params:{duration:\"PT20S\",request:{method:\"refreshConfirmationEstimation\"}}})}catch(n){await ju(n);const r=await ex(t);if(!r)return void e.info(\"Interface context no longer exists, skipping rollback\");const o={...r,scanFetchStatus:\"fetched\"};await YE(t,Vx(Yk,{context:VE(o)}),o),e.warn({error:n},\"Could not update the interface. But rolled back status to fetched.\")}else e.info(\"Interface context no longer exists, skipping refresh\")},[Qk.CloseWebSocketConnections]:async()=>{nu.info(\"Closing all WebSocket connections via background event\"),await GB.closeAllConnections()}},cP={...sP};var uP={};const lP=K({chainId:Tu,domain:q(H()),address:q(H())}),dP=\"Solana Name Service\";var fP=function(e){return e.GetGenesisHash=\"getGenesisHash\",e.GetLatestBlockhash=\"getLatestBlockhash\",e.GetMinimumBalanceForRentExemption=\"getMinimumBalanceForRentExemption\",e}({});const hP=K({jsonrpc:me,id:ye,method:j(\"getGenesisHash\"),params:q(U())}),pP=K({jsonrpc:me,id:ye,method:j(\"getLatestBlockhash\")}),gP=K({jsonrpc:me,id:ye,method:j(\"getMinimumBalanceForRentExemption\"),params:G([$(),q(K())])}),mP={[ox.GetFeeForTransaction]:async({request:e})=>{v(e.params,_u);const{transaction:t}=e.params;try{const{totalFee:e}=dm.calculateFee(t),n={value:e.toString()};return v(n,Cu),n}catch(e){throw nu.error(e),new Un(e)}},[ox.StartSendTransactionFlow]:async({request:e})=>{const{params:t}=e;v(t,oP);const{scope:n,account:r}=t,o=t.assetId??mu[n].nativeToken.caip19Id,i={...aP,scope:n,fromAccountId:r,tokenCaipId:o,loading:!0},[a,s,c,u]=await Promise.all([cR.getAll(),lR.getAll(),$B.getKey(\"tokenPrices\"),QE().catch(()=>aP.preferences)]);i.balances=function(e,t){return t.filter(t=>{const n=t.assetType===mu[e].nativeToken.caip19Id,r=t.assetType.startsWith(e),o=\"0\"!==t.rawAmount;return n||r&&o}).reduce((e,t)=>(e[t.keyringAccountId]={...e[t.keyringAccountId],[t.assetType]:{unit:t.symbol,amount:t.uiAmount}},e),{})}(n,a),i.assets=a.map(e=>e.assetType),i.accounts=s,i.preferences=u,i.tokenPrices=c??{};const l=await ZE(Vx(JR,{context:i}),i),d=XE(l),f=cR.getAssetsMetadata([i.tokenCaipId]).then(e=>{const t=e[i.tokenCaipId];t?.symbol&&t?.name&&(i.selectedTokenMetadata={symbol:t.symbol,name:t.name,asset:i.tokenCaipId,imageUrl:null})}).catch(async e=>(await ju(e),null));let h;i.preferences.useExternalPricingData?h=nR.getMultipleSpotPrices(i.assets,i.preferences.currency).then(e=>{i.tokenPrices={...i.tokenPrices,...e},i.tokenPricesFetchStatus=\"fetched\"}).catch(async e=>{await ju(e),i.tokenPricesFetchStatus=\"error\"}):i.tokenPricesFetchStatus=\"fetched\";const p=VB.getRpc(n).getMinimumBalanceForRentExemption(BigInt(0)).send().then(e=>{i.minimumBalanceForRentExemptionSol=fm(e).toString()}).catch(async e=>{await ju(e)});return i.loading=!0,await YE(l,Vx(JR,{context:i}),i),i.loading=!1,await Promise.all([h,f,p]),await YE(l,Vx(JR,{context:i}),i),await $B.setKey(`mapInterfaceNameToId.${HE}`,l),await snap.request({method:\"snap_scheduleBackgroundEvent\",params:{duration:\"PT30S\",request:{method:\"refreshSend\"}}}),d},[ix.ListWebSockets]:async()=>(await DB.emitSync(\"onListWebSockets\"),null),[ix.ListSubscriptions]:async()=>(await DB.emitSync(\"onListSubscriptions\"),null),[ix.TestOnStart]:async()=>(await DB.emitSync(\"onStart\"),null),[ix.TestOnInstall]:async()=>(await DB.emitSync(\"onInstall\"),null),[ix.TestOnUpdate]:async()=>(await DB.emitSync(\"onUpdate\"),null),[ix.SynchronizeAccounts]:async()=>(await pR.synchronize(),null),[ix.SetAccountSelected]:async({request:e})=>(await bR.setSelectedAccounts(e.params.accountIds),null),[ix.ConfirmSend]:async({request:e})=>(await xR.handle(e),null),[ix.SignRewardsMessage]:async({request:e})=>xR.handle({...e,method:pm.SignRewardsMessage})};var yP=n(4255),wP=n.n(yP),vP=n(3804),bP=n.n(vP);class AP extends Error{constructor(e=\"Operation cancelled\"){super(e),this.name=\"CancellationError\"}}const SP=async e=>{const{fromAccountId:t,tokenCaipId:n,scope:r,toAddress:o}=e,i=FR(e),a=await bR.getAccountOrThrow(t);if(!o||!i)throw new Error(\"Invalid transaction parameters\");const s=n===mu[r].nativeToken.caip19Id,c=s?QB:tR,u=new Ux(c),l={from:a,to:Sa(o),amount:i,network:r,...s?{}:{mint:Sa(tt(n).assetReference)}},d=await c.buildTransactionMessage(l),f=await(async e=>As(e,Ys,$s().encode,la().decode))(d);return{feeInLamports:u.getFee(),base64EncodedTransactionMessage:f}},EP=bP()(async(e,t)=>{try{if(!eP(t))return;const n={buildingTransaction:!0,transactionMessage:null,feeEstimatedInSol:null};await YE(e,Vx(JR,{context:{...t,...n}}),{...t,...n});const{feeInLamports:r,base64EncodedTransactionMessage:o}=await SP(t),i={transactionMessage:o,feeEstimatedInSol:r?fm(r).toString():null,buildingTransaction:!1},a=await ex(e);if(!a)return;await YE(e,Vx(JR,{context:{...a,...i}}),{...a,...i})}catch(t){nu.error(\"Could not build the send transaction\",t);const n={error:{title:\"send.simulationTitleError\",message:\"send.simulationMessageError\"},transactionMessage:null,feeEstimatedInSol:null,buildingTransaction:!1},r=await ex(e);if(!r)return;await YE(e,Vx(JR,{context:{...r,...n}}),{...r,...n})}},function(e){const t=(e=>(...t)=>{const n=new AbortController,r=[...t];r.some(e=>e instanceof AbortSignal)||r.push(n.signal);const o=Promise.race([e(...r),new Promise((e,t)=>{n.signal.addEventListener(\"abort\",()=>{t(new AP)})})]);return o.cancel=()=>n.abort(),o})(e);let n=null;return async(...e)=>{if(n&&\"function\"==typeof n.cancel){const e=\"Cancelling previous task\";nu.warn(e),n.cancel()}const r=t(...e);n=r;try{return await r}finally{n===r&&(n=null)}}},wP()(500));const xP={[UR.BackButton]:async function({id:e}){await JE(e,!1),await $B.deleteKey(`mapInterfaceNameToId.${HE}`)},[UR.SourceAccountSelector]:async function({id:e,event:t,context:n}){const r=t.value;n.fromAccountId=r.accountId,n.error=null,n.validation[UR.SourceAccountSelector]=QR(UR.SourceAccountSelector,n.fromAccountId,iP(n)),n.amount&&(n.validation[UR.AmountInput]=QR(UR.AmountInput,n.amount,iP(n))),await YE(e,Vx(JR,{context:n}),n),await EP(e,n)},[UR.AmountInput]:async function({id:e,event:t,context:n}){const r={...n};r.amount=t.value,r.error=null;const o=QR(UR.AmountInput,r.amount,iP(r));if(o&&r.validation[UR.AmountInput]?.message!==o?.message)return r.validation[UR.AmountInput]=o,void await YE(e,Vx(JR,{context:r}),r);null===o&&(r.validation[UR.AmountInput]=null,await YE(e,Vx(JR,{context:r}),r),await EP(e,r))},[UR.AssetSelector]:async function({id:e,event:t,context:n}){if(\"object\"!=typeof t.value||!t.value||!(\"asset\"in t.value))return;const r=t.value.asset;if(n.tokenCaipId===r)return;const o=r===mu[n.scope].nativeToken.caip19Id?QB:tR,i=new Ux(o).getFee(),a={tokenCaipId:r,feeEstimatedInSol:fm(i).toString(),selectedTokenMetadata:{symbol:t.value.symbol,name:t.value.name,asset:t.value.asset,imageUrl:null},amount:\"\",error:null},s=(0,Du.merge)(n,a);await YE(e,Vx(JR,{context:s,inputAmount:\"\"}),s),await EP(e,n)},[UR.SwapCurrencyButton]:async function({id:e,context:t}){if(t.error=null,t.currencyType=t.currencyType===MR.TOKEN?MR.FIAT:MR.TOKEN,!t.amount)return void await YE(e,Vx(JR,{context:t}),t);const n=wr(t.amount??\"0\"),{price:r}=t.tokenPrices[t.tokenCaipId]??{price:0};t.currencyType===MR.TOKEN&&(t.amount=n.dividedBy(r).toString()),t.currencyType===MR.FIAT&&(t.amount=n.multipliedBy(r).toString()),await YE(e,Vx(JR,{context:t,inputAmount:t.amount}),t)},[UR.MaxAmountButton]:async function({id:e,context:t}){const{currencyType:n,minimumBalanceForRentExemptionSol:r,tokenCaipId:o,tokenPrices:i}=t,a={...t},s=KR(t);if(qR(t)){const e=hm(s),t=new Ux(QB).getFee().toString(),n=hm(r),o=e.minus(t).minus(n).minus(1),i=wr.maximum(o,o.isNegative()?e:wr(0)),c=fm(i);a.amount=c.toString()}else a.amount=s;if(n===MR.FIAT){const{price:e}=i[o]??{price:0};a.amount=Gk(a.amount,e)}a.error=null,a.validation[UR.AmountInput]=QR(UR.AmountInput,a.amount,iP(a)),await YE(e,Vx(JR,{context:a,inputAmount:a.amount}),a),await EP(e,a)},[UR.DestinationAccountInput]:async function({id:e,event:t,context:n}){const r={...n};r.destinationAddressOrDomain=t.value,r.domainResolutionStatus=null,r.error=null;const o=QR(UR.DestinationAccountInput,r.destinationAddressOrDomain,iP(r));r.validation[UR.DestinationAccountInput]=o,XR(r?.destinationAddressOrDomain)?(r.domainResolutionStatus=\"fetching\",await YE(e,Vx(JR,{context:r}),r),r.toAddress=await aR.resolveDomain(r.scope,r.destinationAddressOrDomain).catch(()=>{const e=pk(r.preferences.locale);return r.validation[UR.DestinationAccountInput]={message:e(\"send.toInvalidErrorDomain\"),value:r.destinationAddressOrDomain??\"\"},null}),r.domainResolutionStatus=r.toAddress?\"fetched\":\"error\"):r.toAddress=r.destinationAddressOrDomain,await YE(e,Vx(JR,{context:r}),r),null===o&&await EP(e,r)},[UR.ClearButton]:async function({id:e,context:t}){t.destinationAddressOrDomain=\"\",t.toAddress=\"\",t.domainResolutionStatus=null,t.error=null,t.validation[UR.DestinationAccountInput]=null,await YE(e,Vx(JR,{context:t,inputToAddress:t.toAddress}),t)},[UR.CancelButton]:async function({id:e}){await JE(e,!1),await $B.deleteKey(`mapInterfaceNameToId.${HE}`)},[UR.SendButton]:async function({id:e,context:t}){if(!eP(t))return;const n={...t};n.stage=\"transaction-confirmation\",n.loading=!0,await YE(e,Vx(JR,{context:n}),n);const r=t.accounts.find(e=>e.id===t.fromAccountId)?.address,[o,i,a]=await Promise.all([r?aR.resolveAddress(t.scope,r):null,t.toAddress?aR.resolveAddress(t.scope,t.toAddress):null,nR.getMultipleSpotPrices(t.assets,t.preferences.currency).then(e=>e).catch(async e=>(await ju(e),null))]);if(n.fromDomain=o,n.toDomain=i,a&&(n.tokenPrices=a),t.selectedTokenMetadata){const e=Lu({baseUrl:FB.get().staticApi.baseUrl,path:\"/api/v2/tokenIcons/assets/{assetId}.png\",pathParams:{assetId:t.selectedTokenMetadata.asset.replace(/:/gu,\"/\")},encodePathParams:!1});n.selectedTokenMetadata={...t.selectedTokenMetadata,imageUrl:e}}n.loading=!1,await YE(e,Vx(JR,{context:n}),n),await snap.request({method:\"snap_scheduleBackgroundEvent\",params:{duration:\"PT1S\",request:{method:Qk.OnTransactionAdded,params:{accountId:t.fromAccountId,metadata:{scope:t.scope,origin:uu}}}}})}};const kP={[ZR.BackButton]:async function({id:e,context:t}){const n={...t,stage:\"send-form\"};await YE(e,Vx(JR,{context:n,inputAmount:t.amount??\"\",inputToAddress:t.destinationAddressOrDomain??\"\"}),n)},[ZR.CancelButton]:async function({id:e,context:t}){const{fromAccountId:n,transactionMessage:r,scope:o}=t;await snap.request({method:\"snap_scheduleBackgroundEvent\",params:{duration:\"PT1S\",request:{method:Qk.OnTransactionRejected,params:{accountId:n,metadata:{scope:o,origin:uu}}}}}),await JE(e,!1),await $B.deleteKey(`mapInterfaceNameToId.${HE}`)},[ZR.ConfirmButton]:async function({id:e,context:t}){const{scope:n,fromAccountId:r,feeEstimatedInSol:o,transactionMessage:i}=t;if(t.error=null,!i)return t.stage=\"send-form\",void await YE(e,Vx(JR,{context:t}),t);await snap.request({method:\"snap_scheduleBackgroundEvent\",params:{duration:\"PT1S\",request:{method:Qk.OnTransactionApproved,params:{accountId:t.fromAccountId,metadata:{scope:t.scope,origin:uu}}}}});const a={...t,stage:\"send-pending\"};await YE(e,Vx(JR,{context:a}),a);let s=null;try{const e=await bR.getAccountOrThrow(r);s=(await vR.signAndSendTransaction(e,i,n,uu)).signature}catch(e){await ju(e),nu.error({error:e},\"Error submitting request\")}const c={...t,stage:s?\"transaction-success\":\"transaction-failure\",feePaidInSol:o,transaction:{result:s?\"success\":\"failure\",signature:s}};await YE(e,Vx(JR,{context:c}),c),await $B.deleteKey(`mapInterfaceNameToId.${HE}`)}};const IP=2n**255n-19n,TP=2n**252n+27742317777372353535851937790883648493n,_P=0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51an,CP=0x6666666666666666666666666666666666666666666666666666666666666658n,BP={a:-1n,d:37095705934669439343138083508754565189542113879843219016388785533085940283555n,p:IP,n:TP,h:8,Gx:_P,Gy:CP},RP=(e=\"\")=>{throw new Error(e)},PP=e=>\"string\"==typeof e,NP=(e,t)=>!(e=>e instanceof Uint8Array||null!=e&&\"object\"==typeof e&&\"Uint8Array\"===e.constructor.name)(e)||\"number\"==typeof t&&t>0&&e.length!==t?RP(\"Uint8Array of valid length expected\"):e,OP=e=>new Uint8Array(e),UP=(e,t)=>NP(PP(e)?KP(e):OP(NP(e)),t),MP=(e,t=IP)=>{let n=e%t;return n>=0n?n:t+n},zP=e=>e instanceof LP?e:RP(\"Point expected\");class LP{constructor(e,t,n,r){this.ex=e,this.ey=t,this.ez=n,this.et=r}static fromAffine(e){return new LP(e.x,e.y,1n,MP(e.x*e.y))}static fromHex(e,t=!1){const{d:n}=BP,r=(e=UP(e,32)).slice(),o=e[31];r[31]=-129&o;const i=WP(r);!t||0n<=i&&i<2n**256n||RP(\"bad y coord 1\"),t||0n<=i&&i<IP||RP(\"bad y coord 2\");const a=MP(i*i),s=MP(a-1n),c=MP(n*a+1n);let{isValid:u,value:l}=YP(s,c);u||RP(\"bad y coordinate 3\");const d=1n==(1n&l),f=!!(128&o);return!t&&0n===l&&f&&RP(\"bad y coord 3\"),f!==d&&(l=MP(-l)),new LP(l,i,1n,MP(l*i))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}equals(e){const{ex:t,ey:n,ez:r}=this,{ex:o,ey:i,ez:a}=zP(e),s=MP(t*a),c=MP(o*r),u=MP(n*a),l=MP(i*r);return s===c&&u===l}is0(){return this.equals(FP)}negate(){return new LP(MP(-this.ex),this.ey,this.ez,MP(-this.et))}double(){const{ex:e,ey:t,ez:n}=this,{a:r}=BP,o=MP(e*e),i=MP(t*t),a=MP(2n*MP(n*n)),s=MP(r*o),c=e+t,u=MP(MP(c*c)-o-i),l=s+i,d=l-a,f=s-i,h=MP(u*d),p=MP(l*f),g=MP(u*f),m=MP(d*l);return new LP(h,p,m,g)}add(e){const{ex:t,ey:n,ez:r,et:o}=this,{ex:i,ey:a,ez:s,et:c}=zP(e),{a:u,d:l}=BP,d=MP(t*i),f=MP(n*a),h=MP(o*l*c),p=MP(r*s),g=MP((t+n)*(i+a)-d-f),m=MP(p-h),y=MP(p+h),w=MP(f-u*d),v=MP(g*m),b=MP(y*w),A=MP(g*w),S=MP(m*y);return new LP(v,b,S,A)}mul(e,t=!0){if(0n===e)return!0===t?RP(\"cannot multiply by 0\"):FP;if(\"bigint\"==typeof e&&0n<e&&e<TP||RP(\"invalid scalar, must be < L\"),!t&&this.is0()||1n===e)return this;if(this.equals(jP))return hN(e).p;let n=FP,r=jP;for(let o=this;e>0n;o=o.double(),e>>=1n)1n&e?n=n.add(o):t&&(r=r.add(o));return n}multiply(e){return this.mul(e)}clearCofactor(){return this.mul(BigInt(BP.h),!1)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){let e=this.mul(TP/2n,!1).double();return e=e.add(this),e.is0()}toAffine(){const{ex:e,ey:t,ez:n}=this;if(this.equals(FP))return{x:0n,y:1n};const r=HP(n);return 1n!==MP(n*r)&&RP(\"invalid inverse\"),{x:MP(e*r),y:MP(t*r)}}toRawBytes(){const{x:e,y:t}=this.toAffine(),n=qP(t);return n[31]|=1n&e?128:0,n}toHex(){return $P(this.toRawBytes())}}LP.BASE=new LP(_P,CP,1n,MP(_P*CP)),LP.ZERO=new LP(0n,1n,1n,0n);const{BASE:jP,ZERO:FP}=LP,DP=(e,t)=>e.toString(16).padStart(t,\"0\"),$P=e=>Array.from(e).map(e=>DP(e,2)).join(\"\"),KP=e=>{const t=e.length;(!PP(e)||t%2)&&RP(\"hex invalid 1\");const n=OP(t/2);for(let t=0;t<n.length;t++){const r=2*t,o=e.slice(r,r+2),i=Number.parseInt(o,16);(Number.isNaN(i)||i<0)&&RP(\"hex invalid 2\"),n[t]=i}return n},qP=e=>KP(DP(e,64)).reverse(),WP=e=>BigInt(\"0x\"+$P(OP(NP(e)).reverse())),VP=(...e)=>{const t=OP(e.reduce((e,t)=>e+NP(t).length,0));let n=0;return e.forEach(e=>{t.set(e,n),n+=e.length}),t},HP=(e,t=IP)=>{(0n===e||t<=0n)&&RP(\"no inverse n=\"+e+\" mod=\"+t);let n=MP(e,t),r=t,o=0n,i=1n,a=1n,s=0n;for(;0n!==n;){const e=r/n,t=r%n,c=o-a*e,u=i-s*e;r=n,n=t,o=a,i=s,a=c,s=u}return 1n===r?MP(o,t):RP(\"no inverse\")},GP=(e,t)=>{let n=e;for(;t-- >0n;)n*=n,n%=IP;return n},ZP=19681161376707505956807079304988542015446066515923890162744021073123829784752n,YP=(e,t)=>{const n=MP(t*t*t),r=(e=>{const t=e*e%IP*e%IP,n=GP(t,2n)*t%IP,r=GP(n,1n)*e%IP,o=GP(r,5n)*r%IP,i=GP(o,10n)*o%IP,a=GP(i,20n)*i%IP,s=GP(a,40n)*a%IP,c=GP(s,80n)*s%IP,u=GP(c,80n)*s%IP,l=GP(u,10n)*o%IP;return{pow_p_5_8:GP(l,2n)*e%IP,b2:t}})(e*MP(n*n*t)).pow_p_5_8;let o=MP(e*n*r);const i=MP(t*o*o),a=o,s=MP(o*ZP),c=i===e,u=i===MP(-e),l=i===MP(-e*ZP);return c&&(o=a),(u||l)&&(o=s),1n==(1n&MP(o))&&(o=MP(-o)),{isValid:c||u,value:o}},JP=e=>MP(WP(e),TP);let XP;const QP=(...e)=>lN.sha512Async(...e),eN=(...e)=>\"function\"==typeof XP?XP(...e):RP(\"etc.sha512Sync not set\"),tN=e=>{const t=e.slice(0,32);t[0]&=248,t[31]&=127,t[31]|=64;const n=e.slice(32,64),r=JP(t),o=jP.mul(r),i=o.toRawBytes();return{head:t,prefix:n,scalar:r,point:o,pointBytes:i}},nN=e=>QP(UP(e,32)).then(tN),rN=e=>tN(eN(UP(e,32))),oN=e=>nN(e).then(e=>e.pointBytes);function iN(e,t){return e?QP(t.hashable).then(t.finish):t.finish(eN(t.hashable))}const aN=(e,t,n)=>{const{pointBytes:r,scalar:o}=e,i=JP(t),a=jP.mul(i).toRawBytes();return{hashable:VP(a,r,n),finish:e=>{const t=MP(i+JP(e)*o,TP);return NP(VP(a,qP(t)),64)}}},sN={zip215:!0},cN=(e,t,n,r=sN)=>{t=UP(t),e=UP(e,64);const{zip215:o}=r;let i,a,s,c,u=new Uint8Array;try{i=LP.fromHex(n,o),a=LP.fromHex(e.slice(0,32),o),s=WP(e.slice(32,64)),c=jP.mul(s,!1),u=VP(a.toRawBytes(),i.toRawBytes(),t)}catch(e){}return{hashable:u,finish:e=>{if(null==c)return!1;if(!o&&i.isSmallOrder())return!1;const t=JP(e);return a.add(i.mul(t,!1)).add(c.negate()).clearCofactor().is0()}}},uN=()=>\"object\"==typeof globalThis&&\"crypto\"in globalThis?globalThis.crypto:void 0,lN={bytesToHex:$P,hexToBytes:KP,concatBytes:VP,mod:MP,invert:HP,randomBytes:(e=32)=>{const t=uN();return t&&t.getRandomValues||RP(\"crypto.getRandomValues must be defined\"),t.getRandomValues(OP(e))},sha512Async:async(...e)=>{const t=uN();t&&t.subtle||RP(\"crypto.subtle or etc.sha512Async must be defined\");const n=VP(...e);return OP(await t.subtle.digest(\"SHA-512\",n.buffer))},sha512Sync:void 0};Object.defineProperties(lN,{sha512Sync:{configurable:!1,get:()=>XP,set(e){XP||(XP=e)}}});const dN={getExtendedPublicKeyAsync:nN,getExtendedPublicKey:rN,randomPrivateKey:()=>lN.randomBytes(32),precompute:(e=8,t=jP)=>(t.multiply(3n),t)};let fN;const hN=e=>{const t=fN||(fN=(()=>{const e=[];let t=jP,n=t;for(let r=0;r<33;r++){n=t,e.push(n);for(let r=1;r<128;r++)n=n.add(t),e.push(n);t=n.double()}return e})()),n=(e,t)=>{let n=t.negate();return e?n:t};let r=FP,o=jP;const i=BigInt(255),a=BigInt(8);for(let s=0;s<33;s++){const c=128*s;let u=Number(e&i);e>>=a,u>128&&(u-=256,e+=1n);const l=c,d=c+Math.abs(u)-1,f=s%2!=0,h=u<0;0===u?o=o.add(n(f,t[l])):r=r.add(n(h,t[d]))}return{p:r,f:o}};function pN(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}var gN=n(1048).hp;const mN=\"8d9df0f7-1363-4d2c-8152-ce4ed78f27d8\",yN=[48,46,2,1,0,48,5,6,3,43,101,112,4,34,4,32];function wN(e){return gN.from(e).toString(\"base64\").replace(/\\+/gu,\"-\").replace(/\\//gu,\"_\").replace(/[=]/gu,\"\")}function vN(e){const t=e.replace(/-/gu,\"+\").replace(/_/gu,\"/\");return new Uint8Array(gN.from(t,\"base64\"))}async function bN(e,t,n){if(\"private\"!==t.type)throw new DOMException(\"Key is not private\",\"NotAllowedError\");if(!t.usages.includes(\"sign\"))throw new DOMException(\"Key usage not allowed\",\"NotAllowedError\");const r=pN(n),o=t[mN],i=await(async(e,t)=>{const n=UP(e),r=await nN(t),o=await QP(r.prefix,n);return iN(!0,aN(r,o,n))})(r,o),a=function(e){return e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteLength)}(i);return a}async function AN(e,t,n,r){if(\"public\"!==t.type)throw new DOMException(\"Key is not public\",\"NotAllowedError\");if(!t.usages.includes(\"verify\"))throw new DOMException(\"Key usage not allowed\",\"NotAllowedError\");const o=pN(n),i=pN(r),a=t[mN],s=await(async(e,t,n,r=sN)=>iN(!0,cN(e,t,n,r)))(o,i,a);return s}function SN(e){return\"Ed25519\"===e||\"object\"==typeof e&&\"Ed25519\"===e.name}function EN(){const{subtle:e}=globalThis.crypto;Object.defineProperty(globalThis,\"isSecureContext\",{value:!0,writable:!0,configurable:!0}),Object.defineProperty(e,\"generateKey\",{value:async(...e)=>SN(e[0])?await async function(e,t,n){const r=dN.randomPrivateKey(),o=await oN(r),i=Array.from(n);return{privateKey:{algorithm:{name:\"Ed25519\"},extractable:t,type:\"private\",usages:i,[mN]:r},publicKey:{algorithm:{name:\"Ed25519\"},extractable:!0,type:\"public\",usages:i,[mN]:o}}}(...e):await globalThis.crypto.subtle.generateKey(...e),writable:!0,configurable:!0}),Object.defineProperty(e,\"exportKey\",{value:async(...e)=>SN(e[1].algorithm)?await async function(e,t){if(!t.extractable)throw new DOMException(\"key is not extractable\",\"InvalidAccessException\");const n=t[mN];switch(e){case\"raw\":if(\"public\"!==t.type)throw new DOMException(\"Unable to export a raw Ed25519 private key\",\"InvalidAccessError\");return n.buffer;case\"pkcs8\":if(\"private\"!==t.type)throw new DOMException(\"Unable to export a pkcs8 Ed25519 public key\",\"InvalidAccessError\");return new Uint8Array([...yN,...n]).buffer;case\"jwk\":{const e={crv:\"Ed25519\",ext:t.extractable,key_ops:t.usages,kty:\"OKP\"};if(\"private\"===t.type){const t=await oN(n);return Object.freeze({...e,d:wN(n),x:wN(t)})}return Object.freeze({...e,x:wN(n)})}case\"spki\":{if(\"public\"!==t.type)throw new DOMException(\"Only public keys can be exported as SPKI\",\"InvalidAccessError\");const e=new Uint8Array([48,5,6,3,43,101,112]),r=new Uint8Array([3,n.length+1,0,...n]);return new Uint8Array([48,e.length+r.length,...e,...r]).buffer}default:throw new Error(`Unsupported export format: ${e}`)}}(...e):await globalThis.crypto.subtle.exportKey(...e),writable:!0,configurable:!0}),Object.defineProperty(e,\"sign\",{value:async(...e)=>{const[t,n]=e;return SN(t)&&SN(n.algorithm)?await bN(...e):await globalThis.crypto.subtle.sign(...e)},writable:!0,configurable:!0}),Object.defineProperty(e,\"verify\",{value:async(...e)=>{const[t,n]=e;return SN(t)&&SN(n.algorithm)?await AN(...e):await globalThis.crypto.subtle.verify(...e)},writable:!0,configurable:!0}),Object.defineProperty(e,\"importKey\",{value:async(...e)=>SN(e[2])?await async function(e,t,n,r,o){const i=Array.from(o);switch(e){case\"raw\":{const e=pN(t);if(32!==e.length)throw new DOMException(\"Ed25519 raw keys must be exactly 32-bytes\",\"DataError\");return{algorithm:{name:\"Ed25519\"},extractable:r,type:\"public\",usages:i.filter(e=>\"verify\"===e),[mN]:e}}case\"pkcs8\":{const e=pN(t);if(48!==e.length)throw new DOMException(\"Invalid PKCS8 key data length\",\"DataError\");if(!e.slice(0,16).every((e,t)=>e===yN[t]))throw new DOMException(\"Invalid PKCS8 header\",\"DataError\");return{algorithm:{name:\"Ed25519\"},extractable:r,type:\"private\",usages:i.filter(e=>\"sign\"===e),[mN]:e.slice(16)}}case\"jwk\":{const e=t;if(\"OKP\"!==e.kty||\"Ed25519\"!==e.crv)throw new DOMException(\"Invalid Ed25519 JWK\",\"DataError\");const n=\"d\"in e?\"private\":\"public\";if(\"public\"===n&&!e.x)throw new DOMException(\"Ed25519 JWK is missing public key\",\"DataError\");if(!(\"private\"!==n||e.d&&e.x))throw new DOMException(\"Ed25519 JWK is missing key data\",\"DataError\");const o=\"private\"===n?e.d:e.x;return{algorithm:{name:\"Ed25519\"},extractable:r,type:n,usages:i.filter(e=>\"private\"===n?\"sign\"===e:\"verify\"===e),[mN]:vN(o)}}case\"spki\":{const e=pN(t);if(48!==e[0])throw new DOMException(\"Invalid SPKI format\",\"DataError\");const n=2;if(48!==e[n]||6!==e[n+2]||3!==e[n+3]||43!==e[n+4]||101!==e[n+5]||112!==e[n+6])throw new DOMException(\"Not an Ed25519 key\",\"DataError\");const r=n+7+2;return{algorithm:{name:\"Ed25519\"},extractable:!0,type:\"public\",usages:i.filter(e=>\"verify\"===e),[mN]:e.slice(r)}}default:throw new Error(`Unsupported import format: ${e}`)}}(...e):await globalThis.crypto.subtle.importKey(...e),writable:!0,configurable:!0})}const xN=async e=>Promise.resolve().then(e);Object.defineProperty(globalThis,\"DOMException\",{value:Error,writable:!0,configurable:!0,enumerable:!0}),EN(),Object.defineProperty(globalThis,\"queueMicrotask\",{value:xN,writable:!0,configurable:!0,enumerable:!0}),wr.config({EXPONENTIAL_AT:16});const kN=async({origin:e,request:t})=>{nu.log(\"[🔄 onRpcRequest]\",t.method,t);const{method:n}=t;wx(e,n);const r=mP[n];if(!r)throw new Fn(`RpcRequest method ${n} not found. Available methods: ${Object.values(ox).toString()}`);return await Fu(async()=>r({origin:e,request:t}))??null},IN=async({origin:e,request:t})=>{nu.log(\"[🔑 onKeyringRequest]\",t.method,t),wx(e,t.method),t.method===bt.SubmitRequest&&t.params&&!(\"origin\"in t.params)&&(t.params.origin=\"https://metamask.io\");return await Fu(async()=>Xn(bR,t))??null},TN=async({id:e,event:t,context:n})=>{if(nu.log(\"[👇 onUserInput]\",e,t),!t.name)return;const r={...xP,...kP,...zk,...Nk,...Bk}[t.name];r&&await Fu(async()=>r({id:e,event:t,context:n,snapContext:kR}))},_N=async({request:e})=>{const t=tu(nu,\"[⏱️ onCronjob]\");t.log(e.method,e);const{method:n}=e;v(n,z([...Object.values(uP),...Object.values(Qk)]));return await Fu(async()=>{t.log(\"Running cronjob\",{method:n});const r=cP[n];if(!r)throw new Fn(`Cronjob / ScheduleBackgroundEvent method ${n} not found. Available methods: ${Object.values([...Object.values(uP),...Object.values(Qk)]).toString()}`);return r({request:e})})??null},CN=async e=>{const t=await Fu(async()=>(async e=>{nu.log(\"[🔍 onAssetsLookup]\",e);const{assets:t}=e,n=t.filter(e=>{const{assetNamespace:t}=tt(e);return\"token\"===t||\"slip44\"===t});return{assets:await cR.getAssetsMetadata(n)}})(e));return t??null},BN=async e=>{const t=await Fu(async()=>(async e=>{nu.log(\"[💱 onAssetsConversion]\",e);const{conversions:t}=e;return{conversionRates:await iR.getMultipleTokenConversions(t)}})(e));return t??null},RN=async e=>await Fu(async()=>(async({scope:e,request:t})=>{switch(v(e,Tu),t.method){case fP.GetGenesisHash:return v(t,hP),VB.getRpc(e).getGenesisHash().send();case fP.GetLatestBlockhash:return v(t,pP),(await VB.getLatestBlockhash(e)).blockhash;case fP.GetMinimumBalanceForRentExemption:return v(t,gP),(await VB.getRpc(e).getMinimumBalanceForRentExemption(BigInt(t.params[0]),t.params[1]).send()).toString();default:throw new Error(`Unsupported method: ${t.method}`)}})(e))??null,PN=async e=>{const t=await Fu(async()=>(async e=>{nu.log(\"[📈 onAssetHistoricalPrice]\",e);const{from:t,to:n}=e;return v(t,We),v(n,We),{historicalPrice:await iR.getHistoricalPrice(t,n)}})(e));return t??null},NN=async({request:e})=>await Fu(async()=>xR.handle(e))??null,ON=async({event:e})=>Fu(async()=>{await DB.emitSync(\"onWebSocketEvent\",e)}),UN=async()=>Fu(async()=>{await DB.emitSync(\"onStart\")}),MN=async()=>Fu(async()=>{await DB.emitSync(\"onUpdate\")}),zN=async()=>Fu(async()=>{await DB.emitSync(\"onInstall\")}),LN=async()=>Fu(async()=>{await DB.emitSync(\"onActive\")}),jN=async()=>Fu(async()=>{await DB.emitSync(\"onInactive\")}),FN=async e=>{const t=await Fu(async()=>(async e=>{v(e,lP);const{chainId:t,domain:n,address:r}=e,o=new RegExp(`^.+\\\\${aR.tld}$`,\"u\");if(n&&o.test(n)){const e=await aR.resolveDomain(t,n);if(e)return{resolvedAddresses:[{resolvedAddress:e,protocol:dP,domainName:n}]}}if(r){const e=await aR.resolveAddress(t,r);if(e)return{resolvedDomains:[{resolvedDomain:e,protocol:dP}]}}return null})(e));return t??null},DN=async e=>{const t=await Fu(async()=>(async e=>{nu.log(\"[💰 onAssetsMarketData]\",e);const{assets:t}=e;return{marketData:await cR.fetchAssetsMarketData(t)}})(e));return t??null}})(),module.exports=r})();"},{"path":"locales/en.json","value":"{\n  \"locale\": \"en\",\n  \"messages\": {\n    \"send.title\": {\n      \"message\": \"Send\"\n    },\n    \"send.balance\": {\n      \"message\": \"Balance\"\n    },\n    \"send.maxButton\": {\n      \"message\": \"Max\"\n    },\n    \"send.cancelButton\": {\n      \"message\": \"Cancel\"\n    },\n    \"send.continueButton\": {\n      \"message\": \"Continue\"\n    },\n    \"send.fromField\": {\n      \"message\": \"From\"\n    },\n    \"send.toField\": {\n      \"message\": \"To\"\n    },\n    \"send.amountField\": {\n      \"message\": \"Amount\"\n    },\n    \"send.assetField\": {\n      \"message\": \"Token\"\n    },\n    \"send.toPlaceholder\": {\n      \"message\": \"Enter public address or domain name\"\n    },\n    \"send.fromRequiredError\": {\n      \"message\": \"Account is required\"\n    },\n    \"send.amountRequiredError\": {\n      \"message\": \"Amount is required\"\n    },\n    \"send.amountGreatherThanMinimumBalanceForRentExemptionError\": {\n      \"message\": \"Amount must be greater than {minimumValue}\"\n    },\n    \"send.insuffientSolToCoverFee\": {\n      \"message\": \"Insufficient SOL balance to cover the transaction fee\"\n    },\n    \"send.toRequiredError\": {\n      \"message\": \"To address is required\"\n    },\n    \"send.toInvalidError\": {\n      \"message\": \"Invalid Solana address or domain name\"\n    },\n    \"send.toInvalidErrorDomain\": {\n      \"message\": \"Unable to resolve domain name\"\n    },\n    \"send.toDomainResolutionStatus.initial\": {\n      \"message\": \"Domain\"\n    },\n    \"send.toDomainResolutionStatus.fetching\": {\n      \"message\": \"Resolving domain name...\"\n    },\n    \"send.toDomainResolutionStatus.fetched\": {\n      \"message\": \"Domain name resolved.\"\n    },\n    \"send.toDomainResolutionStatus.error\": {\n      \"message\": \"Unable to resolve domain name.\"\n    },\n    \"send.insufficientBalance\": {\n      \"message\": \"Insufficient balance\"\n    },\n    \"send.simulationTitleAPIError\": {\n      \"message\": \"Because of an error, we couldn't check for security alerts.\"\n    },\n    \"send.simulationMessageAPIError\": {\n      \"message\": \"Only continue if you trust every address involved.\"\n    },\n    \"send.simulationTitleError\": {\n      \"message\": \"Transaction simulation failed\"\n    },\n    \"send.simulationMessageError\": {\n      \"message\": \"This transaction was reverted during simulation.\"\n    },\n    \"send.selectedTokenPriceNotAvailable\": {\n      \"message\": \"Prices for tokens in {currency} are currently not available. You are still able to send tokens.\"\n    },\n    \"send.confirmation.title\": {\n      \"message\": \"Review\"\n    },\n    \"send.confirmation.from\": {\n      \"message\": \"From\"\n    },\n    \"send.confirmation.recipient\": {\n      \"message\": \"Recipient\"\n    },\n    \"send.confirmation.network\": {\n      \"message\": \"Network\"\n    },\n    \"send.confirmation.transactionSpeed\": {\n      \"message\": \"Transaction speed\"\n    },\n    \"send.confirmation.fee\": {\n      \"message\": \"Network fee\"\n    },\n    \"send.confirmation.sendButton\": {\n      \"message\": \"Send\"\n    },\n    \"send.confirmation.cancelButton\": {\n      \"message\": \"Cancel\"\n    },\n    \"send.confirmation.viewTransaction\": {\n      \"message\": \"View transaction\"\n    },\n    \"send.send-pending.title\": {\n      \"message\": \"Sending...\"\n    },\n    \"send.send-pending.subtitle\": {\n      \"message\": \"Your transaction was submitted.\"\n    },\n    \"send.transaction-success.title\": {\n      \"message\": \"Sent\"\n    },\n    \"send.transaction-success.subtitle\": {\n      \"message\": \"{amount} {tokenSymbol} was successfully sent\"\n    },\n    \"send.transaction-failure.title\": {\n      \"message\": \"Transaction failed\"\n    },\n    \"send.transaction-failure.subtitle\": {\n      \"message\": \"Unable to send {amount} {tokenSymbol}\"\n    },\n    \"confirmation.account\": {\n      \"message\": \"Account\"\n    },\n    \"confirmation.recipient\": {\n      \"message\": \"Recipient\"\n    },\n    \"confirmation.network\": {\n      \"message\": \"Network\"\n    },\n    \"confirmation.estimatedChanges\": {\n      \"message\": \"Estimated changes\"\n    },\n    \"confirmation.estimatedChanges.send\": {\n      \"message\": \"You send\"\n    },\n    \"confirmation.estimatedChanges.receive\": {\n      \"message\": \"You receive\"\n    },\n    \"confirmation.estimatedChanges.notAvailable\": {\n      \"message\": \"Not available\"\n    },\n    \"confirmation.estimatedChanges.noChanges\": {\n      \"message\": \"No changes\"\n    },\n    \"confirmation.estimatedChanges.tooltip\": {\n      \"message\": \"Estimated changes are what might happen if you go through with this transaction. This is just a prediction, not a guarantee.\"\n    },\n    \"confirmation.advanced.show\": {\n      \"message\": \"Show advanced\"\n    },\n    \"confirmation.advanced.hide\": {\n      \"message\": \"Hide advanced\"\n    },\n    \"confirmation.cancelButton\": {\n      \"message\": \"Cancel\"\n    },\n    \"confirmation.confirmButton\": {\n      \"message\": \"Confirm\"\n    },\n    \"confirmation.signAndSendTransaction.title\": {\n      \"message\": \"Transaction request\"\n    },\n    \"confirmation.signTransaction.title\": {\n      \"message\": \"Signing request\"\n    },\n    \"confirmation.sendAndConfirmTransaction.title\": {\n      \"message\": \"Sending and confirming transaction\"\n    },\n    \"confirmation.advanced.unknownInstruction\": {\n      \"message\": \"Unknown\"\n    },\n    \"confirmation.advanced.programId\": {\n      \"message\": \"Program ID\"\n    },\n    \"confirmation.advanced.data\": {\n      \"message\": \"Data\"\n    },\n    \"confirmation.fee\": {\n      \"message\": \"Network fee\"\n    },\n    \"confirmation.feeError\": {\n      \"message\": \"Unable to estimate fee\"\n    },\n    \"confirmation.origin\": {\n      \"message\": \"Request from\"\n    },\n    \"confirmation.origin.tooltip\": {\n      \"message\": \"This is the site asking for your confirmation.\"\n    },\n    \"confirmation.simulationErrorTitle\": {\n      \"message\": \"This transaction was reverted during simulation.\"\n    },\n    \"confirmation.simulationErrorSubtitle\": {\n      \"message\": \"{reason}\"\n    },\n    \"confirmation.validationErrorTitle\": {\n      \"message\": \"This is a deceptive request\"\n    },\n    \"confirmation.validationErrorSubtitle\": {\n      \"message\": \"If you approve this request, a third party known for scams will take all your assets.\"\n    },\n    \"confirmation.validationErrorLearnMore\": {\n      \"message\": \"Learn more\"\n    },\n    \"confirmation.validationErrorSecurityAdviced\": {\n      \"message\": \"Security advice by\"\n    },\n    \"confirmation.signMessage.title\": {\n      \"message\": \"Sign message\"\n    },\n    \"confirmation.signMessage.message\": {\n      \"message\": \"Message\"\n    },\n    \"confirmation.signIn.title\": {\n      \"message\": \"Sign-in request\"\n    },\n    \"confirmation.signIn.description\": {\n      \"message\": \"A site wants you to sign in to prove you own this account.\"\n    },\n    \"confirmation.signIn.domain\": {\n      \"message\": \"Domain\"\n    },\n    \"confirmation.signIn.unknownDomain\": {\n      \"message\": \"Unknown domain\"\n    },\n    \"confirmation.signIn.signingInWith\": {\n      \"message\": \"Signing in with\"\n    },\n    \"confirmation.signIn.badAccount\": {\n      \"message\": \"This site is asking you to sign in using the wrong account.\"\n    },\n    \"confirmation.signIn.message\": {\n      \"message\": \"Message\"\n    },\n    \"confirmation.signIn.statement\": {\n      \"message\": \"Statement\"\n    },\n    \"confirmation.signIn.version\": {\n      \"message\": \"Version\"\n    },\n    \"confirmation.signIn.chainId\": {\n      \"message\": \"Chain ID\"\n    },\n    \"confirmation.signIn.nonce\": {\n      \"message\": \"Nonce\"\n    },\n    \"confirmation.signIn.issuedAt\": {\n      \"message\": \"Issued at\"\n    },\n    \"confirmation.signIn.expirationTime\": {\n      \"message\": \"Expiration time\"\n    },\n    \"confirmation.signIn.notBefore\": {\n      \"message\": \"Not before\"\n    },\n    \"confirmation.signIn.requestId\": {\n      \"message\": \"Request ID\"\n    },\n    \"confirmation.signIn.resources\": {\n      \"message\": \"Resources\"\n    },\n    \"confirmation.signIn.badDomain\": {\n      \"message\": \"This site is asking you to sign in using the wrong domain.\"\n    },\n    \"transactionScan.errors.accountAlreadyInUse\": {\n      \"message\": \"An account with the same address already exists.\"\n    },\n    \"transactionScan.errors.insufficientSol\": {\n      \"message\": \"Account does not have enough SOL to perform the operation.\"\n    },\n    \"transactionScan.errors.slippageToleranceExceeded\": {\n      \"message\": \"The transaction was reverted because the slippage tolerance was exceeded.\"\n    },\n    \"transactionScan.errors.unknownError\": {\n      \"message\": \"An unknown error occurred.\"\n    }\n  }\n}\n"}],"removable":false,"hideSnapBranding":true}