@hashgraph/hedera-wallet-connect 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. package/dist/browser-cjs-metafile.json +1 -1
  2. package/dist/browser-cjs.js +1 -1
  3. package/dist/browser-esm-metafile.json +1 -1
  4. package/dist/browser-esm.js +1 -1
  5. package/dist/node-cjs-metafile.json +1 -1
  6. package/dist/node-cjs.js +5 -4
  7. package/dist/node-esm-metafile.json +1 -1
  8. package/dist/node-esm.js +5 -4
  9. package/dist/types/src/index.d.ts +2 -0
  10. package/dist/types/src/index.d.ts.map +1 -0
  11. package/dist/types/src/lib/dapp/DAppSigner.d.ts +29 -0
  12. package/dist/types/src/lib/dapp/DAppSigner.d.ts.map +1 -0
  13. package/dist/types/src/lib/dapp/index.d.ts +177 -0
  14. package/dist/types/src/lib/dapp/index.d.ts.map +1 -0
  15. package/dist/types/src/lib/index.d.ts +4 -0
  16. package/dist/types/src/lib/index.d.ts.map +1 -0
  17. package/dist/types/src/lib/shared/chainIds.d.ts +12 -0
  18. package/dist/types/src/lib/shared/chainIds.d.ts.map +1 -0
  19. package/dist/types/src/lib/shared/errors.d.ts +49 -0
  20. package/dist/types/src/lib/shared/errors.d.ts.map +1 -0
  21. package/dist/types/src/lib/shared/events.d.ts +8 -0
  22. package/dist/types/src/lib/shared/events.d.ts.map +1 -0
  23. package/dist/types/src/lib/shared/index.d.ts +7 -0
  24. package/dist/types/src/lib/shared/index.d.ts.map +1 -0
  25. package/dist/types/src/lib/shared/methods.d.ts +13 -0
  26. package/dist/types/src/lib/shared/methods.d.ts.map +1 -0
  27. package/dist/types/src/lib/shared/payloads.d.ts +102 -0
  28. package/dist/types/src/lib/shared/payloads.d.ts.map +1 -0
  29. package/dist/types/src/lib/shared/utils.d.ts +269 -0
  30. package/dist/types/src/lib/shared/utils.d.ts.map +1 -0
  31. package/dist/types/src/lib/wallet/index.d.ts +40 -0
  32. package/dist/types/src/lib/wallet/index.d.ts.map +1 -0
  33. package/dist/types/src/lib/wallet/provider.d.ts +18 -0
  34. package/dist/types/src/lib/wallet/provider.d.ts.map +1 -0
  35. package/dist/types/src/lib/wallet/types.d.ts +32 -0
  36. package/dist/types/src/lib/wallet/types.d.ts.map +1 -0
  37. package/dist/types/test/_helpers.d.ts +35 -0
  38. package/dist/types/test/_helpers.d.ts.map +1 -0
  39. package/dist/types/test/dapp/DAppConnector.test.d.ts +2 -0
  40. package/dist/types/test/dapp/DAppConnector.test.d.ts.map +1 -0
  41. package/dist/types/test/utils.test.d.ts +2 -0
  42. package/dist/types/test/utils.test.d.ts.map +1 -0
  43. package/dist/types/test/wallet/methods/wallet-executeTransaction.test.d.ts +2 -0
  44. package/dist/types/test/wallet/methods/wallet-executeTransaction.test.d.ts.map +1 -0
  45. package/dist/types/test/wallet/methods/wallet-getNodeAddresses.test.d.ts +2 -0
  46. package/dist/types/test/wallet/methods/wallet-getNodeAddresses.test.d.ts.map +1 -0
  47. package/dist/types/test/wallet/methods/wallet-signAndExecuteQuery.test.d.ts +2 -0
  48. package/dist/types/test/wallet/methods/wallet-signAndExecuteQuery.test.d.ts.map +1 -0
  49. package/dist/types/test/wallet/methods/wallet-signAndExecuteTransaction.test.d.ts +2 -0
  50. package/dist/types/test/wallet/methods/wallet-signAndExecuteTransaction.test.d.ts.map +1 -0
  51. package/dist/types/test/wallet/methods/wallet-signMessage.test.d.ts +2 -0
  52. package/dist/types/test/wallet/methods/wallet-signMessage.test.d.ts.map +1 -0
  53. package/dist/types/test/wallet/methods/wallet-signTransaction.test.d.ts +2 -0
  54. package/dist/types/test/wallet/methods/wallet-signTransaction.test.d.ts.map +1 -0
  55. package/dist/types/test/wallet/wallet-init.test.d.ts +2 -0
  56. package/dist/types/test/wallet/wallet-init.test.d.ts.map +1 -0
  57. package/package.json +3 -3
  58. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -35
  59. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -17
  60. package/.github/ISSUE_TEMPLATE/hip_820.md +0 -16
  61. package/.github/dependabot.yml +0 -17
  62. package/.github/workflows/prettier.yml +0 -28
  63. package/.github/workflows/publish.yml +0 -35
  64. package/.github/workflows/test.yml +0 -32
  65. package/.husky/pre-commit +0 -4
  66. package/.lintstagedrc.json +0 -5
  67. package/.prettierignore +0 -3
  68. package/jest.config.ts +0 -33
  69. package/scripts/examples/build.mjs +0 -54
  70. package/scripts/examples/dev.mjs +0 -54
  71. package/scripts/lib/build.mjs +0 -40
  72. package/scripts/lib/context.mjs +0 -71
  73. package/scripts/lib/watch.mjs +0 -28
  74. package/typedoc.json +0 -10
package/dist/node-cjs.js CHANGED
@@ -10631,12 +10631,13 @@ Minimum version required to store current data is: `+a+`.
10631
10631
  `+o,d=o;for(let h=-1;h<n+1;h+=2){for(let g=-1;g<n;g++)d+=l[wRe(i,n,g,h)];d+=l[wRe(i,n,n,h)]+u}return d+=jh,typeof t=="function"&&t(null,d),d}});var ARe=C(xRe=>{var dMt=vRe(),fMt=ERe();xRe.render=function(r,e,t){return e&&e.small?fMt.render(r,e,t):dMt.render(r,e,t)}});var jY=C(SRe=>{var pMt=mw();function TRe(r,e){let t=r.a/255,n=e+'="'+r.hex+'"';return t<1?n+" "+e+'-opacity="'+t.toFixed(2).slice(1)+'"':n}function qY(r,e,t){let n=r+e;return typeof t<"u"&&(n+=" "+t),n}function hMt(r,e,t){let n="",i=0,a=!1,o=0;for(let s=0;s<r.length;s++){let c=Math.floor(s%e),l=Math.floor(s/e);!c&&!a&&(a=!0),r[s]?(o++,s>0&&c>0&&r[s-1]||(n+=a?qY("M",c+t,.5+l+t):qY("m",i,0),i=0,a=!1),c+1<e&&r[s+1]||(n+=qY("h",o),o=0)):i++}return n}SRe.render=function(e,t,n){let i=pMt.getOptions(t),a=e.modules.size,o=e.modules.data,s=a+i.margin*2,c=i.color.light.a?"<path "+TRe(i.color.light,"fill")+' d="M0 0h'+s+"v"+s+'H0z"/>':"",l="<path "+TRe(i.color.dark,"stroke")+' d="'+hMt(o,a,i.margin)+'"/>',u='viewBox="0 0 '+s+" "+s+'"',h='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+u+' shape-rendering="crispEdges">'+c+l+`</svg>
10632
10632
  `;return typeof n=="function"&&n(null,h),h}});var IRe=C(QN=>{var mMt=jY();QN.render=mMt.render;QN.renderToFile=function(e,t,n,i){typeof i>"u"&&(i=n,n=void 0);let a=require("fs"),s='<?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">'+QN.render(t,n);a.writeFile(e,s,i)}});var CRe=C($N=>{var VY=mw();function gMt(r,e,t){r.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=t,e.width=t,e.style.height=t+"px",e.style.width=t+"px"}function yMt(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}$N.render=function(e,t,n){let i=n,a=t;typeof i>"u"&&(!t||!t.getContext)&&(i=t,t=void 0),t||(a=yMt()),i=VY.getOptions(i);let o=VY.getImageWidth(e.modules.size,i),s=a.getContext("2d"),c=s.createImageData(o,o);return VY.qrToImageData(c.data,e,i),gMt(s,a,o),s.putImageData(c,0,0),a};$N.renderToDataURL=function(e,t,n){let i=n;typeof i>"u"&&(!t||!t.getContext)&&(i=t,t=void 0),i||(i={});let a=$N.render(e,t,i),o=i.type||"image/png",s=i.rendererOpts||{};return a.toDataURL(o,s.quality)}});var NRe=C(gw=>{var vMt=nY(),HY=_Y(),kRe=CRe(),bMt=jY();function KY(r,e,t,n,i){let a=[].slice.call(arguments,1),o=a.length,s=typeof a[o-1]=="function";if(!s&&!vMt())throw new Error("Callback required as last argument");if(s){if(o<2)throw new Error("Too few arguments provided");o===2?(i=t,t=e,e=n=void 0):o===3&&(e.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=t,t=e,e=void 0))}else{if(o<1)throw new Error("Too few arguments provided");return o===1?(t=e,e=n=void 0):o===2&&!e.getContext&&(n=t,t=e,e=void 0),new Promise(function(c,l){try{let u=HY.create(t,n);c(r(u,e,n))}catch(u){l(u)}})}try{let c=HY.create(t,n);i(null,r(c,e,n))}catch(c){i(c)}}gw.create=HY.create;gw.toCanvas=KY.bind(null,kRe.render);gw.toDataURL=KY.bind(null,kRe.renderToDataURL);gw.toString=KY.bind(null,function(r,e,t){return bMt.render(r,t)})});var PRe=C(s0=>{var RRe=nY(),zY=_Y(),wMt=mRe(),ORe=gRe(),_Mt=ARe(),DRe=IRe();function yw(r,e,t){if(typeof r>"u")throw new Error("String required as first argument");if(typeof t>"u"&&(t=e,e={}),typeof t!="function")if(RRe())e=t||{},t=null;else throw new Error("Callback required as last argument");return{opts:e,cb:t}}function EMt(r){return r.slice((r.lastIndexOf(".")-1>>>0)+2).toLowerCase()}function YN(r){switch(r){case"svg":return DRe;case"txt":case"utf8":return ORe;case"png":case"image/png":default:return wMt}}function xMt(r){switch(r){case"svg":return DRe;case"terminal":return _Mt;case"utf8":default:return ORe}}function vw(r,e,t){if(!t.cb)return new Promise(function(n,i){try{let a=zY.create(e,t.opts);return r(a,t.opts,function(o,s){return o?i(o):n(s)})}catch(a){i(a)}});try{let n=zY.create(e,t.opts);return r(n,t.opts,t.cb)}catch(n){t.cb(n)}}s0.create=zY.create;s0.toCanvas=NRe().toCanvas;s0.toString=function(e,t,n){let i=yw(e,t,n),a=i.opts?i.opts.type:void 0,o=xMt(a);return vw(o.render,e,i)};s0.toDataURL=function(e,t,n){let i=yw(e,t,n),a=YN(i.opts.type);return vw(a.renderToDataURL,e,i)};s0.toBuffer=function(e,t,n){let i=yw(e,t,n),a=YN(i.opts.type);return vw(a.renderToBuffer,e,i)};s0.toFile=function(e,t,n,i){if(typeof e!="string"||!(typeof t=="string"||typeof t=="object"))throw new Error("Invalid argument");if(arguments.length<3&&!RRe())throw new Error("Too few arguments provided");let a=yw(t,n,i),o=a.opts.type||EMt(e),c=YN(o).renderToFile.bind(null,e);return vw(c,t,a)};s0.toFileStream=function(e,t,n){if(arguments.length<2)throw new Error("Too few arguments provided");let i=yw(t,n,e.emit.bind(e,"error")),o=YN("png").renderToFileStream.bind(null,e);vw(o,t,i)}});var MRe=C((s5r,BRe)=>{BRe.exports=PRe()});var $Re={};qy($Re,{WcmModal:()=>Fy,WcmQrCode:()=>H6});function IMt(){var r;let e=(r=vd.state.themeMode)!=null?r:"dark",t={light:{foreground:{1:"rgb(20,20,20)",2:"rgb(121,134,134)",3:"rgb(158,169,169)"},background:{1:"rgb(255,255,255)",2:"rgb(241,243,243)",3:"rgb(228,231,231)"},overlay:"rgba(0,0,0,0.1)"},dark:{foreground:{1:"rgb(228,231,231)",2:"rgb(148,158,158)",3:"rgb(110,119,119)"},background:{1:"rgb(20,20,20)",2:"rgb(39,42,42)",3:"rgb(59,64,64)"},overlay:"rgba(255,255,255,0.1)"}}[e];return{"--wcm-color-fg-1":t.foreground[1],"--wcm-color-fg-2":t.foreground[2],"--wcm-color-fg-3":t.foreground[3],"--wcm-color-bg-1":t.background[1],"--wcm-color-bg-2":t.background[2],"--wcm-color-bg-3":t.background[3],"--wcm-color-overlay":t.overlay}}function URe(){return{"--wcm-accent-color":"#3396FF","--wcm-accent-fill-color":"#FFFFFF","--wcm-z-index":"89","--wcm-background-color":"#3396FF","--wcm-background-border-radius":"8px","--wcm-container-border-radius":"30px","--wcm-wallet-icon-border-radius":"15px","--wcm-wallet-icon-large-border-radius":"30px","--wcm-wallet-icon-small-border-radius":"7px","--wcm-input-border-radius":"28px","--wcm-button-border-radius":"10px","--wcm-notification-border-radius":"36px","--wcm-secondary-button-border-radius":"28px","--wcm-icon-button-border-radius":"50%","--wcm-button-hover-highlight-border-radius":"10px","--wcm-text-big-bold-size":"20px","--wcm-text-big-bold-weight":"600","--wcm-text-big-bold-line-height":"24px","--wcm-text-big-bold-letter-spacing":"-0.03em","--wcm-text-big-bold-text-transform":"none","--wcm-text-xsmall-bold-size":"10px","--wcm-text-xsmall-bold-weight":"700","--wcm-text-xsmall-bold-line-height":"12px","--wcm-text-xsmall-bold-letter-spacing":"0.02em","--wcm-text-xsmall-bold-text-transform":"uppercase","--wcm-text-xsmall-regular-size":"12px","--wcm-text-xsmall-regular-weight":"600","--wcm-text-xsmall-regular-line-height":"14px","--wcm-text-xsmall-regular-letter-spacing":"-0.03em","--wcm-text-xsmall-regular-text-transform":"none","--wcm-text-small-thin-size":"14px","--wcm-text-small-thin-weight":"500","--wcm-text-small-thin-line-height":"16px","--wcm-text-small-thin-letter-spacing":"-0.03em","--wcm-text-small-thin-text-transform":"none","--wcm-text-small-regular-size":"14px","--wcm-text-small-regular-weight":"600","--wcm-text-small-regular-line-height":"16px","--wcm-text-small-regular-letter-spacing":"-0.03em","--wcm-text-small-regular-text-transform":"none","--wcm-text-medium-regular-size":"16px","--wcm-text-medium-regular-weight":"600","--wcm-text-medium-regular-line-height":"20px","--wcm-text-medium-regular-letter-spacing":"-0.03em","--wcm-text-medium-regular-text-transform":"none","--wcm-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--wcm-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--wcm-success-color":"rgb(38,181,98)","--wcm-error-color":"rgb(242, 90, 103)","--wcm-overlay-background-color":"rgba(0, 0, 0, 0.3)","--wcm-overlay-backdrop-filter":"none"}}function XY(r,e,t){return r===e?!1:(r-e<0?e-r:r-e)<=t+aLt}function oLt(r,e){let t=Array.prototype.slice.call(QRe.default.create(r,{errorCorrectionLevel:e}).modules.data,0),n=Math.sqrt(t.length);return t.reduce((i,a,o)=>(o%n===0?i.push([a]):i[i.length-1].push(a))&&i,[])}var d0,QRe,AMt,LRe,TMt,SMt,FRe,GY,Zr,CMt,kMt,NMt,Dy,c0,RMt,OMt,DMt,WY,bw,PMt,BMt,MMt,LMt,QY,Tn,FMt,UMt,qMt,jMt,$Y,VMt,HMt,KMt,zMt,YY,GMt,WMt,QMt,$Mt,JY,YMt,JMt,ZMt,ww,Vh,wr,XMt,eLt,tLt,ZY,_w,rLt,nLt,iLt,qRe,JN,aLt,jRe,V6,sLt,cLt,lLt,uLt,Py,H6,dLt,fLt,pLt,VRe,ZN,hLt,mLt,gLt,yLt,eJ,vLt,bLt,wLt,tJ,Ew,_Lt,ELt,xLt,l0,Ed,ALt,TLt,SLt,XN,By,ILt,CLt,HRe,rJ,kLt,NLt,RLt,KRe,OLt,DLt,PLt,BLt,nJ,MLt,LLt,FLt,My,u0,Uy,f0,ULt,qLt,jLt,VLt,iJ,HLt,KLt,zLt,GLt,aJ,WLt,QLt,$Lt,YLt,oJ,JLt,ZLt,XLt,sJ,Fy,eFt,tFt,rFt,xw,Hh,nFt,iFt,aFt,oFt,cJ,sFt,cFt,lFt,eR,Ly,uFt,dFt,fFt,lJ,pFt,hFt,mFt,zRe,tR,gFt,yFt,vFt,bFt,uJ,wFt,_Ft,EFt,GRe,rR,xFt,AFt,TFt,SFt,dJ,IFt,CFt,kFt,fJ,NFt,RFt,OFt,Aw,pJ,Kh,DFt,PFt,BFt,WRe,nR,YRe=gn(()=>{VTe();YTe();tSe();kQ();Oh();d0=Ie(Ake(),1);Ske();QRe=Ie(MRe(),1),AMt=Object.defineProperty,LRe=Object.getOwnPropertySymbols,TMt=Object.prototype.hasOwnProperty,SMt=Object.prototype.propertyIsEnumerable,FRe=(r,e,t)=>e in r?AMt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,GY=(r,e)=>{for(var t in e||(e={}))TMt.call(e,t)&&FRe(r,t,e[t]);if(LRe)for(var t of LRe(e))SMt.call(e,t)&&FRe(r,t,e[t]);return r};Zr={getPreset(r){return URe()[r]},setTheme(){let r=document.querySelector(":root"),{themeVariables:e}=vd.state;if(r){let t=GY(GY(GY({},IMt()),URe()),e);Object.entries(t).forEach(([n,i])=>r.style.setProperty(n,i))}},globalCss:fn`*,::after,::before{margin:0;padding:0;box-sizing:border-box;font-style:normal;text-rendering:optimizeSpeed;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent;transition:all .2s ease}@media (hover:hover) and (pointer:fine){button:active{transition:all .1s ease;transform:scale(.93)}}button::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button wcm-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--wcm-accent-fill-color);background:var(--wcm-accent-color)}`},CMt=fn`button{border-radius:var(--wcm-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--wcm-accent-color)}button path{fill:var(--wcm-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--wcm-color-overlay)}button:disabled::after{background-color:transparent}.wcm-icon-left svg{margin-right:5px}.wcm-icon-right svg{margin-left:5px}button:active::after{background-color:var(--wcm-color-overlay)}.wcm-ghost,.wcm-ghost:active::after,.wcm-outline{background-color:transparent}.wcm-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}.wcm-ghost:hover::after{background-color:transparent}.wcm-ghost:hover{opacity:.5}}button:disabled{background-color:var(--wcm-color-bg-3);pointer-events:none}.wcm-ghost::after{border-color:transparent}.wcm-ghost path{fill:var(--wcm-color-fg-2)}.wcm-outline path{fill:var(--wcm-accent-color)}.wcm-outline:disabled{background-color:transparent;opacity:.5}`,kMt=Object.defineProperty,NMt=Object.getOwnPropertyDescriptor,Dy=(r,e,t,n)=>{for(var i=n>1?void 0:n?NMt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&kMt(e,t,i),i},c0=class extends Rr{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){let r={"wcm-icon-left":this.iconLeft!==void 0,"wcm-icon-right":this.iconRight!==void 0,"wcm-ghost":this.variant==="ghost","wcm-outline":this.variant==="outline"},e="inverse";return this.variant==="ghost"&&(e="secondary"),this.variant==="outline"&&(e="accent"),Xe`<button class="${bd(r)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<wcm-text variant="small-regular" color="${e}"><slot></slot></wcm-text>${this.iconRight}</button>`}};c0.styles=[Zr.globalCss,CMt],Dy([Tr({type:Boolean})],c0.prototype,"disabled",2),Dy([Tr()],c0.prototype,"iconLeft",2),Dy([Tr()],c0.prototype,"iconRight",2),Dy([Tr()],c0.prototype,"onClick",2),Dy([Tr()],c0.prototype,"variant",2),c0=Dy([Jr("wcm-button")],c0);RMt=fn`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--wcm-button-border-radius);color:var(--wcm-accent-fill-color);background-color:var(--wcm-accent-color)}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--wcm-color-overlay)}button:active::after{background-color:var(--wcm-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--wcm-color-bg-3);color:var(--wcm-color-fg-3)}.wcm-secondary{color:var(--wcm-accent-color);background-color:transparent}.wcm-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}}`,OMt=Object.defineProperty,DMt=Object.getOwnPropertyDescriptor,WY=(r,e,t,n)=>{for(var i=n>1?void 0:n?DMt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&OMt(e,t,i),i},bw=class extends Rr{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){let r={"wcm-secondary":this.variant==="secondary"};return Xe`<button ?disabled="${this.disabled}" class="${bd(r)}"><slot></slot></button>`}};bw.styles=[Zr.globalCss,RMt],WY([Tr({type:Boolean})],bw.prototype,"disabled",2),WY([Tr()],bw.prototype,"variant",2),bw=WY([Jr("wcm-button-big")],bw);PMt=fn`:host{background-color:var(--wcm-color-bg-2);border-top:1px solid var(--wcm-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`,BMt=Object.defineProperty,MMt=Object.getOwnPropertyDescriptor,LMt=(r,e,t,n)=>{for(var i=n>1?void 0:n?MMt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&BMt(e,t,i),i},QY=class extends Rr{render(){return Xe`<div><slot></slot></div>`}};QY.styles=[Zr.globalCss,PMt],QY=LMt([Jr("wcm-info-footer")],QY);Tn={CROSS_ICON:ki`<svg width="12" height="12" viewBox="0 0 12 12"><path d="M9.94 11A.75.75 0 1 0 11 9.94L7.414 6.353a.5.5 0 0 1 0-.708L11 2.061A.75.75 0 1 0 9.94 1L6.353 4.586a.5.5 0 0 1-.708 0L2.061 1A.75.75 0 0 0 1 2.06l3.586 3.586a.5.5 0 0 1 0 .708L1 9.939A.75.75 0 1 0 2.06 11l3.586-3.586a.5.5 0 0 1 .708 0L9.939 11Z" fill="#fff"/></svg>`,WALLET_CONNECT_LOGO:ki`<svg width="178" height="29" viewBox="0 0 178 29" id="wcm-wc-logo"><path d="M10.683 7.926c5.284-5.17 13.85-5.17 19.134 0l.636.623a.652.652 0 0 1 0 .936l-2.176 2.129a.343.343 0 0 1-.478 0l-.875-.857c-3.686-3.607-9.662-3.607-13.348 0l-.937.918a.343.343 0 0 1-.479 0l-2.175-2.13a.652.652 0 0 1 0-.936l.698-.683Zm23.633 4.403 1.935 1.895a.652.652 0 0 1 0 .936l-8.73 8.543a.687.687 0 0 1-.956 0L20.37 17.64a.172.172 0 0 0-.239 0l-6.195 6.063a.687.687 0 0 1-.957 0l-8.73-8.543a.652.652 0 0 1 0-.936l1.936-1.895a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .239 0l6.195-6.064a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .24 0l6.195-6.064a.687.687 0 0 1 .956 0ZM48.093 20.948l2.338-9.355c.139-.515.258-1.07.416-1.942.12.872.258 1.427.357 1.942l2.022 9.355h4.181l3.528-13.874h-3.21l-1.943 8.523a24.825 24.825 0 0 0-.456 2.457c-.158-.931-.317-1.625-.495-2.438l-1.883-8.542h-4.201l-2.042 8.542a41.204 41.204 0 0 0-.475 2.438 41.208 41.208 0 0 0-.476-2.438l-1.903-8.542h-3.349l3.508 13.874h4.083ZM63.33 21.304c1.585 0 2.596-.654 3.11-1.605-.059.297-.078.595-.078.892v.357h2.655V15.22c0-2.735-1.248-4.32-4.3-4.32-2.636 0-4.36 1.466-4.52 3.487h2.914c.1-.891.734-1.426 1.705-1.426.911 0 1.407.515 1.407 1.11 0 .435-.258.693-1.03.792l-1.388.159c-2.061.257-3.825 1.01-3.825 3.19 0 1.982 1.645 3.092 3.35 3.092Zm.891-2.041c-.773 0-1.348-.436-1.348-1.19 0-.733.655-1.09 1.645-1.268l.674-.119c.575-.118.892-.218 1.09-.396v.912c0 1.228-.892 2.06-2.06 2.06ZM70.398 7.074v13.874h2.874V7.074h-2.874ZM74.934 7.074v13.874h2.874V7.074h-2.874ZM84.08 21.304c2.735 0 4.5-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922H81.92ZM94.92 21.146c.633 0 1.248-.1 1.525-.179v-2.18c-.218.04-.475.06-.693.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.338v-2.24h-2.338V7.788H91.47v3.448H89.37v2.24h2.1v4.201c0 2.3 1.15 3.469 3.45 3.469ZM104.62 21.304c3.924 0 6.302-2.299 6.599-5.608h-3.111c-.238 1.803-1.506 3.032-3.369 3.032-2.2 0-3.746-1.784-3.746-4.796 0-2.953 1.605-4.638 3.805-4.638 1.883 0 2.953 1.15 3.171 2.834h3.191c-.317-3.448-2.854-5.41-6.342-5.41-3.984 0-7.036 2.695-7.036 7.214 0 4.677 2.676 7.372 6.838 7.372ZM117.449 21.304c2.993 0 5.114-1.882 5.114-5.172 0-3.23-2.121-5.233-5.114-5.233-2.972 0-5.093 2.002-5.093 5.233 0 3.29 2.101 5.172 5.093 5.172Zm0-2.22c-1.327 0-2.18-1.09-2.18-2.952 0-1.903.892-2.973 2.18-2.973 1.308 0 2.2 1.07 2.2 2.973 0 1.862-.872 2.953-2.2 2.953ZM126.569 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.229-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM137.464 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.228-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM149.949 21.304c2.735 0 4.499-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922h-3.984ZM160.876 21.304c3.013 0 4.658-1.645 4.975-4.201h-2.874c-.099 1.07-.713 1.982-2.001 1.982-1.309 0-2.2-1.21-2.2-2.993 0-1.942 1.03-2.933 2.259-2.933 1.209 0 1.803.872 1.883 1.882h2.873c-.218-2.358-1.823-4.142-4.776-4.142-2.874 0-5.153 1.903-5.153 5.193 0 3.25 1.923 5.212 5.014 5.212ZM172.067 21.146c.634 0 1.248-.1 1.526-.179v-2.18c-.218.04-.476.06-.694.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.339v-2.24h-2.339V7.788h-2.854v3.448h-2.1v2.24h2.1v4.201c0 2.3 1.15 3.469 3.449 3.469Z" fill="#fff"/></svg>`,WALLET_CONNECT_ICON:ki`<svg width="28" height="20" viewBox="0 0 28 20"><g clip-path="url(#a)"><path d="M7.386 6.482c3.653-3.576 9.575-3.576 13.228 0l.44.43a.451.451 0 0 1 0 .648L19.55 9.033a.237.237 0 0 1-.33 0l-.606-.592c-2.548-2.496-6.68-2.496-9.228 0l-.648.634a.237.237 0 0 1-.33 0L6.902 7.602a.451.451 0 0 1 0-.647l.483-.473Zm16.338 3.046 1.339 1.31a.451.451 0 0 1 0 .648l-6.035 5.909a.475.475 0 0 1-.662 0L14.083 13.2a.119.119 0 0 0-.166 0l-4.283 4.194a.475.475 0 0 1-.662 0l-6.035-5.91a.451.451 0 0 1 0-.647l1.338-1.31a.475.475 0 0 1 .662 0l4.283 4.194c.046.044.12.044.166 0l4.283-4.194a.475.475 0 0 1 .662 0l4.283 4.194c.046.044.12.044.166 0l4.283-4.194a.475.475 0 0 1 .662 0Z" fill="#000000"/></g><defs><clipPath id="a"><path fill="#ffffff" d="M0 0h28v20H0z"/></clipPath></defs></svg>`,WALLET_CONNECT_ICON_COLORED:ki`<svg width="96" height="96" fill="none"><path fill="#fff" d="M25.322 33.597c12.525-12.263 32.83-12.263 45.355 0l1.507 1.476a1.547 1.547 0 0 1 0 2.22l-5.156 5.048a.814.814 0 0 1-1.134 0l-2.074-2.03c-8.737-8.555-22.903-8.555-31.64 0l-2.222 2.175a.814.814 0 0 1-1.134 0l-5.156-5.049a1.547 1.547 0 0 1 0-2.22l1.654-1.62Zm56.019 10.44 4.589 4.494a1.547 1.547 0 0 1 0 2.22l-20.693 20.26a1.628 1.628 0 0 1-2.267 0L48.283 56.632a.407.407 0 0 0-.567 0L33.03 71.012a1.628 1.628 0 0 1-2.268 0L10.07 50.75a1.547 1.547 0 0 1 0-2.22l4.59-4.494a1.628 1.628 0 0 1 2.267 0l14.687 14.38c.156.153.41.153.567 0l14.685-14.38a1.628 1.628 0 0 1 2.268 0l14.687 14.38c.156.153.41.153.567 0l14.686-14.38a1.628 1.628 0 0 1 2.268 0Z"/><path stroke="#000" d="M25.672 33.954c12.33-12.072 32.325-12.072 44.655 0l1.508 1.476a1.047 1.047 0 0 1 0 1.506l-5.157 5.048a.314.314 0 0 1-.434 0l-2.074-2.03c-8.932-8.746-23.409-8.746-32.34 0l-2.222 2.174a.314.314 0 0 1-.434 0l-5.157-5.048a1.047 1.047 0 0 1 0-1.506l1.655-1.62Zm55.319 10.44 4.59 4.494a1.047 1.047 0 0 1 0 1.506l-20.694 20.26a1.128 1.128 0 0 1-1.568 0l-14.686-14.38a.907.907 0 0 0-1.267 0L32.68 70.655a1.128 1.128 0 0 1-1.568 0L10.42 50.394a1.047 1.047 0 0 1 0-1.506l4.59-4.493a1.128 1.128 0 0 1 1.567 0l14.687 14.379a.907.907 0 0 0 1.266 0l-.35-.357.35.357 14.686-14.38a1.128 1.128 0 0 1 1.568 0l14.687 14.38a.907.907 0 0 0 1.267 0l14.686-14.38a1.128 1.128 0 0 1 1.568 0Z"/></svg>`,BACK_ICON:ki`<svg width="10" height="18" viewBox="0 0 10 18"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.735.179a.75.75 0 0 1 .087 1.057L2.92 8.192a1.25 1.25 0 0 0 0 1.617l5.902 6.956a.75.75 0 1 1-1.144.97L1.776 10.78a2.75 2.75 0 0 1 0-3.559L7.678.265A.75.75 0 0 1 8.735.18Z" fill="#fff"/></svg>`,COPY_ICON:ki`<svg width="24" height="24" fill="none"><path fill="#fff" fill-rule="evenodd" d="M7.01 7.01c.03-1.545.138-2.5.535-3.28A5 5 0 0 1 9.73 1.545C10.8 1 12.2 1 15 1c2.8 0 4.2 0 5.27.545a5 5 0 0 1 2.185 2.185C23 4.8 23 6.2 23 9c0 2.8 0 4.2-.545 5.27a5 5 0 0 1-2.185 2.185c-.78.397-1.735.505-3.28.534l-.001.01c-.03 1.54-.138 2.493-.534 3.27a5 5 0 0 1-2.185 2.186C13.2 23 11.8 23 9 23c-2.8 0-4.2 0-5.27-.545a5 5 0 0 1-2.185-2.185C1 19.2 1 17.8 1 15c0-2.8 0-4.2.545-5.27A5 5 0 0 1 3.73 7.545C4.508 7.149 5.46 7.04 7 7.01h.01ZM15 15.5c-1.425 0-2.403-.001-3.162-.063-.74-.06-1.139-.172-1.427-.319a3.5 3.5 0 0 1-1.53-1.529c-.146-.288-.257-.686-.318-1.427C8.501 11.403 8.5 10.425 8.5 9c0-1.425.001-2.403.063-3.162.06-.74.172-1.139.318-1.427a3.5 3.5 0 0 1 1.53-1.53c.288-.146.686-.257 1.427-.318.759-.062 1.737-.063 3.162-.063 1.425 0 2.403.001 3.162.063.74.06 1.139.172 1.427.318a3.5 3.5 0 0 1 1.53 1.53c.146.288.257.686.318 1.427.062.759.063 1.737.063 3.162 0 1.425-.001 2.403-.063 3.162-.06.74-.172 1.139-.319 1.427a3.5 3.5 0 0 1-1.529 1.53c-.288.146-.686.257-1.427.318-.759.062-1.737.063-3.162.063ZM7 8.511c-.444.009-.825.025-1.162.052-.74.06-1.139.172-1.427.318a3.5 3.5 0 0 0-1.53 1.53c-.146.288-.257.686-.318 1.427-.062.759-.063 1.737-.063 3.162 0 1.425.001 2.403.063 3.162.06.74.172 1.139.318 1.427a3.5 3.5 0 0 0 1.53 1.53c.288.146.686.257 1.427.318.759.062 1.737.063 3.162.063 1.425 0 2.403-.001 3.162-.063.74-.06 1.139-.172 1.427-.319a3.5 3.5 0 0 0 1.53-1.53c.146-.287.257-.685.318-1.426.027-.337.043-.718.052-1.162H15c-2.8 0-4.2 0-5.27-.545a5 5 0 0 1-2.185-2.185C7 13.2 7 11.8 7 9v-.489Z" clip-rule="evenodd"/></svg>`,RETRY_ICON:ki`<svg width="15" height="16" viewBox="0 0 15 16"><path d="M6.464 2.03A.75.75 0 0 0 5.403.97L2.08 4.293a1 1 0 0 0 0 1.414L5.403 9.03a.75.75 0 0 0 1.06-1.06L4.672 6.177a.25.25 0 0 1 .177-.427h2.085a4 4 0 1 1-3.93 4.746c-.077-.407-.405-.746-.82-.746-.414 0-.755.338-.7.748a5.501 5.501 0 1 0 5.45-6.248H4.848a.25.25 0 0 1-.177-.427L6.464 2.03Z" fill="#fff"/></svg>`,DESKTOP_ICON:ki`<svg width="16" height="16" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 5.98c0-1.85 0-2.775.394-3.466a3 3 0 0 1 1.12-1.12C2.204 1 3.13 1 4.98 1h6.04c1.85 0 2.775 0 3.466.394a3 3 0 0 1 1.12 1.12C16 3.204 16 4.13 16 5.98v1.04c0 1.85 0 2.775-.394 3.466a3 3 0 0 1-1.12 1.12C13.796 12 12.87 12 11.02 12H4.98c-1.85 0-2.775 0-3.466-.394a3 3 0 0 1-1.12-1.12C0 9.796 0 8.87 0 7.02V5.98ZM4.98 2.5h6.04c.953 0 1.568.001 2.034.043.446.04.608.108.69.154a1.5 1.5 0 0 1 .559.56c.046.08.114.243.154.69.042.465.043 1.08.043 2.033v1.04c0 .952-.001 1.568-.043 2.034-.04.446-.108.608-.154.69a1.499 1.499 0 0 1-.56.559c-.08.046-.243.114-.69.154-.466.042-1.08.043-2.033.043H4.98c-.952 0-1.568-.001-2.034-.043-.446-.04-.608-.108-.69-.154a1.5 1.5 0 0 1-.559-.56c-.046-.08-.114-.243-.154-.69-.042-.465-.043-1.08-.043-2.033V5.98c0-.952.001-1.568.043-2.034.04-.446.108-.608.154-.69a1.5 1.5 0 0 1 .56-.559c.08-.046.243-.114.69-.154.465-.042 1.08-.043 2.033-.043Z" fill="#fff"/><path d="M4 14.25a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Z" fill="#fff"/></svg>`,MOBILE_ICON:ki`<svg width="16" height="16" viewBox="0 0 16 16"><path d="M6.75 5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3 4.98c0-1.85 0-2.775.394-3.466a3 3 0 0 1 1.12-1.12C5.204 0 6.136 0 8 0s2.795 0 3.486.394a3 3 0 0 1 1.12 1.12C13 2.204 13 3.13 13 4.98v6.04c0 1.85 0 2.775-.394 3.466a3 3 0 0 1-1.12 1.12C10.796 16 9.864 16 8 16s-2.795 0-3.486-.394a3 3 0 0 1-1.12-1.12C3 13.796 3 12.87 3 11.02V4.98Zm8.5 0v6.04c0 .953-.001 1.568-.043 2.034-.04.446-.108.608-.154.69a1.499 1.499 0 0 1-.56.559c-.08.045-.242.113-.693.154-.47.042-1.091.043-2.05.043-.959 0-1.58-.001-2.05-.043-.45-.04-.613-.109-.693-.154a1.5 1.5 0 0 1-.56-.56c-.046-.08-.114-.243-.154-.69-.042-.466-.043-1.08-.043-2.033V4.98c0-.952.001-1.568.043-2.034.04-.446.108-.608.154-.69a1.5 1.5 0 0 1 .56-.559c.08-.045.243-.113.693-.154C6.42 1.501 7.041 1.5 8 1.5c.959 0 1.58.001 2.05.043.45.04.613.109.693.154a1.5 1.5 0 0 1 .56.56c.046.08.114.243.154.69.042.465.043 1.08.043 2.033Z" fill="#fff"/></svg>`,ARROW_DOWN_ICON:ki`<svg width="14" height="14" viewBox="0 0 14 14"><path d="M2.28 7.47a.75.75 0 0 0-1.06 1.06l5.25 5.25a.75.75 0 0 0 1.06 0l5.25-5.25a.75.75 0 0 0-1.06-1.06l-3.544 3.543a.25.25 0 0 1-.426-.177V.75a.75.75 0 0 0-1.5 0v10.086a.25.25 0 0 1-.427.176L2.28 7.47Z" fill="#fff"/></svg>`,ARROW_UP_RIGHT_ICON:ki`<svg width="15" height="14" fill="none"><path d="M4.5 1.75A.75.75 0 0 1 5.25 1H12a1.5 1.5 0 0 1 1.5 1.5v6.75a.75.75 0 0 1-1.5 0V4.164a.25.25 0 0 0-.427-.176L4.061 11.5A.75.75 0 0 1 3 10.44l7.513-7.513a.25.25 0 0 0-.177-.427H5.25a.75.75 0 0 1-.75-.75Z" fill="#fff"/></svg>`,ARROW_RIGHT_ICON:ki`<svg width="6" height="14" viewBox="0 0 6 14"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.181 1.099a.75.75 0 0 1 1.024.279l2.433 4.258a2.75 2.75 0 0 1 0 2.729l-2.433 4.257a.75.75 0 1 1-1.303-.744L4.335 7.62a1.25 1.25 0 0 0 0-1.24L1.902 2.122a.75.75 0 0 1 .28-1.023Z" fill="#fff"/></svg>`,QRCODE_ICON:ki`<svg width="25" height="24" viewBox="0 0 25 24"><path d="M23.748 9a.748.748 0 0 0 .748-.752c-.018-2.596-.128-4.07-.784-5.22a6 6 0 0 0-2.24-2.24c-1.15-.656-2.624-.766-5.22-.784a.748.748 0 0 0-.752.748c0 .414.335.749.748.752 1.015.007 1.82.028 2.494.088.995.09 1.561.256 1.988.5.7.398 1.28.978 1.679 1.678.243.427.41.993.498 1.988.061.675.082 1.479.09 2.493a.753.753 0 0 0 .75.749ZM3.527.788C4.677.132 6.152.022 8.747.004A.748.748 0 0 1 9.5.752a.753.753 0 0 1-.749.752c-1.014.007-1.818.028-2.493.088-.995.09-1.561.256-1.988.5-.7.398-1.28.978-1.679 1.678-.243.427-.41.993-.499 1.988-.06.675-.081 1.479-.088 2.493A.753.753 0 0 1 1.252 9a.748.748 0 0 1-.748-.752c.018-2.596.128-4.07.784-5.22a6 6 0 0 1 2.24-2.24ZM1.252 15a.748.748 0 0 0-.748.752c.018 2.596.128 4.07.784 5.22a6 6 0 0 0 2.24 2.24c1.15.656 2.624.766 5.22.784a.748.748 0 0 0 .752-.748.753.753 0 0 0-.749-.752c-1.014-.007-1.818-.028-2.493-.089-.995-.089-1.561-.255-1.988-.498a4.5 4.5 0 0 1-1.679-1.68c-.243-.426-.41-.992-.499-1.987-.06-.675-.081-1.479-.088-2.493A.753.753 0 0 0 1.252 15ZM22.996 15.749a.753.753 0 0 1 .752-.749c.415 0 .751.338.748.752-.018 2.596-.128 4.07-.784 5.22a6 6 0 0 1-2.24 2.24c-1.15.656-2.624.766-5.22.784a.748.748 0 0 1-.752-.748c0-.414.335-.749.748-.752 1.015-.007 1.82-.028 2.494-.089.995-.089 1.561-.255 1.988-.498a4.5 4.5 0 0 0 1.679-1.68c.243-.426.41-.992.498-1.987.061-.675.082-1.479.09-2.493Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M7 4a2.5 2.5 0 0 0-2.5 2.5v2A2.5 2.5 0 0 0 7 11h2a2.5 2.5 0 0 0 2.5-2.5v-2A2.5 2.5 0 0 0 9 4H7Zm2 1.5H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1ZM13.5 6.5A2.5 2.5 0 0 1 16 4h2a2.5 2.5 0 0 1 2.5 2.5v2A2.5 2.5 0 0 1 18 11h-2a2.5 2.5 0 0 1-2.5-2.5v-2Zm2.5-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1ZM7 13a2.5 2.5 0 0 0-2.5 2.5v2A2.5 2.5 0 0 0 7 20h2a2.5 2.5 0 0 0 2.5-2.5v-2A2.5 2.5 0 0 0 9 13H7Zm2 1.5H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1Z" fill="#fff"/><path d="M13.5 15.5c0-.465 0-.697.038-.89a2 2 0 0 1 1.572-1.572C15.303 13 15.535 13 16 13v2.5h-2.5ZM18 13c.465 0 .697 0 .89.038a2 2 0 0 1 1.572 1.572c.038.193.038.425.038.89H18V13ZM18 17.5h2.5c0 .465 0 .697-.038.89a2 2 0 0 1-1.572 1.572C18.697 20 18.465 20 18 20v-2.5ZM13.5 17.5H16V20c-.465 0-.697 0-.89-.038a2 2 0 0 1-1.572-1.572c-.038-.193-.038-.425-.038-.89Z" fill="#fff"/></svg>`,SCAN_ICON:ki`<svg width="16" height="16" fill="none"><path fill="#fff" d="M10 15.216c0 .422.347.763.768.74 1.202-.064 2.025-.222 2.71-.613a5.001 5.001 0 0 0 1.865-1.866c.39-.684.549-1.507.613-2.709a.735.735 0 0 0-.74-.768.768.768 0 0 0-.76.732c-.009.157-.02.306-.032.447-.073.812-.206 1.244-.384 1.555-.31.545-.761.996-1.306 1.306-.311.178-.743.311-1.555.384-.141.013-.29.023-.447.032a.768.768 0 0 0-.732.76ZM10 .784c0 .407.325.737.732.76.157.009.306.02.447.032.812.073 1.244.206 1.555.384a3.5 3.5 0 0 1 1.306 1.306c.178.311.311.743.384 1.555.013.142.023.29.032.447a.768.768 0 0 0 .76.732.734.734 0 0 0 .74-.768c-.064-1.202-.222-2.025-.613-2.71A5 5 0 0 0 13.477.658c-.684-.39-1.507-.549-2.709-.613a.735.735 0 0 0-.768.74ZM5.232.044A.735.735 0 0 1 6 .784a.768.768 0 0 1-.732.76c-.157.009-.305.02-.447.032-.812.073-1.244.206-1.555.384A3.5 3.5 0 0 0 1.96 3.266c-.178.311-.311.743-.384 1.555-.013.142-.023.29-.032.447A.768.768 0 0 1 .784 6a.735.735 0 0 1-.74-.768c.064-1.202.222-2.025.613-2.71A5 5 0 0 1 2.523.658C3.207.267 4.03.108 5.233.044ZM5.268 14.456a.768.768 0 0 1 .732.76.734.734 0 0 1-.768.74c-1.202-.064-2.025-.222-2.71-.613a5 5 0 0 1-1.865-1.866c-.39-.684-.549-1.507-.613-2.709A.735.735 0 0 1 .784 10c.407 0 .737.325.76.732.009.157.02.306.032.447.073.812.206 1.244.384 1.555a3.5 3.5 0 0 0 1.306 1.306c.311.178.743.311 1.555.384.142.013.29.023.447.032Z"/></svg>`,CHECKMARK_ICON:ki`<svg width="13" height="12" viewBox="0 0 13 12"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.155.132a.75.75 0 0 1 .232 1.035L5.821 11.535a1 1 0 0 1-1.626.09L.665 7.21a.75.75 0 1 1 1.17-.937L4.71 9.867a.25.25 0 0 0 .406-.023L11.12.364a.75.75 0 0 1 1.035-.232Z" fill="#fff"/></svg>`,SEARCH_ICON:ki`<svg width="20" height="21"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.432 13.992c-.354-.353-.91-.382-1.35-.146a5.5 5.5 0 1 1 2.265-2.265c-.237.441-.208.997.145 1.35l3.296 3.296a.75.75 0 1 1-1.06 1.061l-3.296-3.296Zm.06-5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z" fill="#949E9E"/></svg>`,WALLET_PLACEHOLDER:ki`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#q)"><path id="wallet-placeholder-fill" fill="#fff" d="M0 24.9c0-9.251 0-13.877 1.97-17.332a15 15 0 0 1 5.598-5.597C11.023 0 15.648 0 24.9 0h10.2c9.252 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.023 60 15.648 60 24.9v10.2c0 9.252 0 13.877-1.97 17.332a15.001 15.001 0 0 1-5.598 5.597C48.977 60 44.352 60 35.1 60H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.352 0 35.1V24.9Z"/><path id="wallet-placeholder-dash" stroke="#000" stroke-dasharray="4 4" stroke-width="1.5" d="M.04 41.708a231.598 231.598 0 0 1-.039-4.403l.75-.001L.75 35.1v-2.55H0v-5.1h.75V24.9l.001-2.204h-.75c.003-1.617.011-3.077.039-4.404l.75.016c.034-1.65.099-3.08.218-4.343l-.746-.07c.158-1.678.412-3.083.82-4.316l.713.236c.224-.679.497-1.296.827-1.875a14.25 14.25 0 0 1 1.05-1.585L3.076 5.9A15 15 0 0 1 5.9 3.076l.455.596a14.25 14.25 0 0 1 1.585-1.05c.579-.33 1.196-.603 1.875-.827l-.236-.712C10.812.674 12.217.42 13.895.262l.07.746C15.23.89 16.66.824 18.308.79l-.016-.75C19.62.012 21.08.004 22.695.001l.001.75L24.9.75h2.55V0h5.1v.75h2.55l2.204.001v-.75c1.617.003 3.077.011 4.404.039l-.016.75c1.65.034 3.08.099 4.343.218l.07-.746c1.678.158 3.083.412 4.316.82l-.236.713c.679.224 1.296.497 1.875.827a14.24 14.24 0 0 1 1.585 1.05l.455-.596A14.999 14.999 0 0 1 56.924 5.9l-.596.455c.384.502.735 1.032 1.05 1.585.33.579.602 1.196.827 1.875l.712-.236c.409 1.233.663 2.638.822 4.316l-.747.07c.119 1.264.184 2.694.218 4.343l.75-.016c.028 1.327.036 2.787.039 4.403l-.75.001.001 2.204v2.55H60v5.1h-.75v2.55l-.001 2.204h.75a231.431 231.431 0 0 1-.039 4.404l-.75-.016c-.034 1.65-.099 3.08-.218 4.343l.747.07c-.159 1.678-.413 3.083-.822 4.316l-.712-.236a10.255 10.255 0 0 1-.827 1.875 14.242 14.242 0 0 1-1.05 1.585l.596.455a14.997 14.997 0 0 1-2.824 2.824l-.455-.596c-.502.384-1.032.735-1.585 1.05-.579.33-1.196.602-1.875.827l.236.712c-1.233.409-2.638.663-4.316.822l-.07-.747c-1.264.119-2.694.184-4.343.218l.016.75c-1.327.028-2.787.036-4.403.039l-.001-.75-2.204.001h-2.55V60h-5.1v-.75H24.9l-2.204-.001v.75a231.431 231.431 0 0 1-4.404-.039l.016-.75c-1.65-.034-3.08-.099-4.343-.218l-.07.747c-1.678-.159-3.083-.413-4.316-.822l.236-.712a10.258 10.258 0 0 1-1.875-.827 14.252 14.252 0 0 1-1.585-1.05l-.455.596A14.999 14.999 0 0 1 3.076 54.1l.596-.455a14.24 14.24 0 0 1-1.05-1.585 10.259 10.259 0 0 1-.827-1.875l-.712.236C.674 49.188.42 47.783.262 46.105l.746-.07C.89 44.77.824 43.34.79 41.692l-.75.016Z"/><path fill="#fff" fill-rule="evenodd" d="M35.643 32.145c-.297-.743-.445-1.114-.401-1.275a.42.42 0 0 1 .182-.27c.134-.1.463-.1 1.123-.1.742 0 1.499.046 2.236-.05a6 6 0 0 0 5.166-5.166c.051-.39.051-.855.051-1.784 0-.928 0-1.393-.051-1.783a6 6 0 0 0-5.166-5.165c-.39-.052-.854-.052-1.783-.052h-7.72c-4.934 0-7.401 0-9.244 1.051a8 8 0 0 0-2.985 2.986C16.057 22.28 16.003 24.58 16 29 15.998 31.075 16 33.15 16 35.224A7.778 7.778 0 0 0 23.778 43H28.5c1.394 0 2.09 0 2.67-.116a6 6 0 0 0 4.715-4.714c.115-.58.115-1.301.115-2.744 0-1.31 0-1.964-.114-2.49a4.998 4.998 0 0 0-.243-.792Z" clip-rule="evenodd"/><path fill="#9EA9A9" fill-rule="evenodd" d="M37 18h-7.72c-2.494 0-4.266.002-5.647.126-1.361.122-2.197.354-2.854.728a6.5 6.5 0 0 0-2.425 2.426c-.375.657-.607 1.492-.729 2.853-.11 1.233-.123 2.777-.125 4.867 0 .7 0 1.05.097 1.181.096.13.182.181.343.2.163.02.518-.18 1.229-.581a6.195 6.195 0 0 1 3.053-.8H37c.977 0 1.32-.003 1.587-.038a4.5 4.5 0 0 0 3.874-3.874c.036-.268.039-.611.039-1.588 0-.976-.003-1.319-.038-1.587a4.5 4.5 0 0 0-3.875-3.874C38.32 18.004 37.977 18 37 18Zm-7.364 12.5h-7.414a4.722 4.722 0 0 0-4.722 4.723 6.278 6.278 0 0 0 6.278 6.278H28.5c1.466 0 1.98-.008 2.378-.087a4.5 4.5 0 0 0 3.535-3.536c.08-.397.087-.933.087-2.451 0-1.391-.009-1.843-.08-2.17a3.5 3.5 0 0 0-2.676-2.676c-.328-.072-.762-.08-2.108-.08Z" clip-rule="evenodd"/></g><defs><clipPath id="q"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,GLOBE_ICON:ki`<svg width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="#fff" fill-rule="evenodd" d="M15.5 8a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Zm-2.113.75c.301 0 .535.264.47.558a6.01 6.01 0 0 1-2.867 3.896c-.203.116-.42-.103-.334-.32.409-1.018.691-2.274.797-3.657a.512.512 0 0 1 .507-.477h1.427Zm.47-2.058c.065.294-.169.558-.47.558H11.96a.512.512 0 0 1-.507-.477c-.106-1.383-.389-2.638-.797-3.656-.087-.217.13-.437.333-.32a6.01 6.01 0 0 1 2.868 3.895Zm-4.402.558c.286 0 .515-.24.49-.525-.121-1.361-.429-2.534-.83-3.393-.279-.6-.549-.93-.753-1.112a.535.535 0 0 0-.724 0c-.204.182-.474.513-.754 1.112-.4.859-.708 2.032-.828 3.393a.486.486 0 0 0 .49.525h2.909Zm-5.415 0c.267 0 .486-.21.507-.477.106-1.383.389-2.638.797-3.656.087-.217-.13-.437-.333-.32a6.01 6.01 0 0 0-2.868 3.895c-.065.294.169.558.47.558H4.04ZM2.143 9.308c-.065-.294.169-.558.47-.558H4.04c.267 0 .486.21.507.477.106 1.383.389 2.639.797 3.657.087.217-.13.436-.333.32a6.01 6.01 0 0 1-2.868-3.896Zm3.913-.033a.486.486 0 0 1 .49-.525h2.909c.286 0 .515.24.49.525-.121 1.361-.428 2.535-.83 3.394-.279.6-.549.93-.753 1.112a.535.535 0 0 1-.724 0c-.204-.182-.474-.513-.754-1.112-.4-.859-.708-2.033-.828-3.394Z" clip-rule="evenodd"/></svg>`},FMt=fn`.wcm-toolbar-placeholder{top:0;bottom:0;left:0;right:0;width:100%;position:absolute;display:block;pointer-events:none;height:100px;border-radius:calc(var(--wcm-background-border-radius) * .9);background-color:var(--wcm-background-color);background-position:center;background-size:cover}.wcm-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.wcm-toolbar img,.wcm-toolbar svg{height:28px;object-position:left center;object-fit:contain}#wcm-wc-logo path{fill:var(--wcm-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--wcm-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--wcm-color-bg-1);box-shadow:0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--wcm-color-fg-1)}.wcm-toolbar div{display:flex}@media(hover:hover){button:hover{background-color:var(--wcm-color-bg-2)}}`,UMt=Object.defineProperty,qMt=Object.getOwnPropertyDescriptor,jMt=(r,e,t,n)=>{for(var i=n>1?void 0:n?qMt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&UMt(e,t,i),i},$Y=class extends Rr{render(){return Xe`<div class="wcm-toolbar-placeholder"></div><div class="wcm-toolbar">${Tn.WALLET_CONNECT_LOGO} <button @click="${M6.close}">${Tn.CROSS_ICON}</button></div>`}};$Y.styles=[Zr.globalCss,FMt],$Y=jMt([Jr("wcm-modal-backcard")],$Y);VMt=fn`main{padding:20px;padding-top:0;width:100%}`,HMt=Object.defineProperty,KMt=Object.getOwnPropertyDescriptor,zMt=(r,e,t,n)=>{for(var i=n>1?void 0:n?KMt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&HMt(e,t,i),i},YY=class extends Rr{render(){return Xe`<main><slot></slot></main>`}};YY.styles=[Zr.globalCss,VMt],YY=zMt([Jr("wcm-modal-content")],YY);GMt=fn`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--wcm-color-bg-2)}`,WMt=Object.defineProperty,QMt=Object.getOwnPropertyDescriptor,$Mt=(r,e,t,n)=>{for(var i=n>1?void 0:n?QMt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&WMt(e,t,i),i},JY=class extends Rr{render(){return Xe`<footer><slot></slot></footer>`}};JY.styles=[Zr.globalCss,GMt],JY=$Mt([Jr("wcm-modal-footer")],JY);YMt=fn`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.wcm-border{border-bottom:1px solid var(--wcm-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.wcm-back-btn{position:absolute;left:0}.wcm-action-btn{position:absolute;right:0}path{fill:var(--wcm-accent-color)}`,JMt=Object.defineProperty,ZMt=Object.getOwnPropertyDescriptor,ww=(r,e,t,n)=>{for(var i=n>1?void 0:n?ZMt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&JMt(e,t,i),i},Vh=class extends Rr{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return Xe`<button class="wcm-back-btn" @click="${Ci.goBack}">${Tn.BACK_ICON}</button>`}actionBtnTemplate(){return Xe`<button class="wcm-action-btn" @click="${this.onAction}">${this.actionIcon}</button>`}render(){let r={"wcm-border":this.border},e=Ci.state.history.length>1,t=this.title?Xe`<wcm-text variant="big-bold">${this.title}</wcm-text>`:Xe`<slot></slot>`;return Xe`<header class="${bd(r)}">${e?this.backBtnTemplate():null} ${t} ${this.onAction?this.actionBtnTemplate():null}</header>`}};Vh.styles=[Zr.globalCss,YMt],ww([Tr()],Vh.prototype,"title",2),ww([Tr()],Vh.prototype,"onAction",2),ww([Tr()],Vh.prototype,"actionIcon",2),ww([Tr({type:Boolean})],Vh.prototype,"border",2),Vh=ww([Jr("wcm-modal-header")],Vh);wr={MOBILE_BREAKPOINT:600,WCM_RECENT_WALLET_DATA:"WCM_RECENT_WALLET_DATA",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",getShadowRootElement(r,e){let t=r.renderRoot.querySelector(e);if(!t)throw new Error(`${e} not found`);return t},getWalletIcon({id:r,image_id:e}){let{walletImages:t}=ys.state;return t!=null&&t[r]?t[r]:e?vs.getWalletImageUrl(e):""},getWalletName(r,e=!1){return e&&r.length>8?`${r.substring(0,8)}..`:r},isMobileAnimation(){return window.innerWidth<=wr.MOBILE_BREAKPOINT},async preloadImage(r){let e=new Promise((t,n)=>{let i=new Image;i.onload=t,i.onerror=n,i.crossOrigin="anonymous",i.src=r});return Promise.race([e,Mt.wait(3e3)])},getErrorMessage(r){return r instanceof Error?r.message:"Unknown Error"},debounce(r,e=500){let t;return(...n)=>{function i(){r(...n)}t&&clearTimeout(t),t=setTimeout(i,e)}},handleMobileLinking(r){let{walletConnectUri:e}=Mi.state,{mobile:t,name:n}=r,i=t?.native,a=t?.universal;wr.setRecentWallet(r);function o(s){let c="";i?c=Mt.formatUniversalUrl(i,s,n):a&&(c=Mt.formatNativeUrl(a,s,n)),Mt.openHref(c,"_self")}e&&o(e)},handleAndroidLinking(){let{walletConnectUri:r}=Mi.state;r&&(Mt.setWalletConnectAndroidDeepLink(r),Mt.openHref(r,"_self"))},async handleUriCopy(){let{walletConnectUri:r}=Mi.state;if(r)try{await navigator.clipboard.writeText(r),L6.openToast("Link copied","success")}catch{L6.openToast("Failed to copy","error")}},getCustomImageUrls(){let{walletImages:r}=ys.state,e=Object.values(r??{});return Object.values(e)},truncate(r,e=8){return r.length<=e?r:`${r.substring(0,4)}...${r.substring(r.length-4)}`},setRecentWallet(r){try{localStorage.setItem(wr.WCM_RECENT_WALLET_DATA,JSON.stringify(r))}catch{console.info("Unable to set recent wallet")}},getRecentWallet(){try{let r=localStorage.getItem(wr.WCM_RECENT_WALLET_DATA);return r?JSON.parse(r):void 0}catch{console.info("Unable to get recent wallet")}},caseSafeIncludes(r,e){return r.toUpperCase().includes(e.toUpperCase())},openWalletExplorerUrl(){Mt.openHref(wr.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){let{desktop:r,mobile:e}=Mt.getWalletRouterData(),t=!!r?.native,n=!!r?.universal,i=!!e?.native||!!e?.universal;return{isDesktop:t,isMobile:i,isWeb:n}},goToConnectingView(r){Ci.setData({Wallet:r});let e=Mt.isMobile(),{isDesktop:t,isWeb:n,isMobile:i}=wr.getCachedRouterWalletPlatforms();e?i?Ci.push("MobileConnecting"):n?Ci.push("WebConnecting"):Ci.push("InstallWallet"):t?Ci.push("DesktopConnecting"):n?Ci.push("WebConnecting"):i?Ci.push("MobileQrcodeConnecting"):Ci.push("InstallWallet")}},XMt=fn`.wcm-router{overflow:hidden;will-change:transform}.wcm-content{display:flex;flex-direction:column}`,eLt=Object.defineProperty,tLt=Object.getOwnPropertyDescriptor,ZY=(r,e,t,n)=>{for(var i=n>1?void 0:n?tLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&eLt(e,t,i),i},_w=class extends Rr{constructor(){super(),this.view=Ci.state.view,this.prevView=Ci.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=Ci.subscribe(r=>{this.view!==r.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([r])=>{let e=`${r.contentRect.height}px`;this.oldHeight!=="0px"&&(0,d0.animate)(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),this.oldHeight=e}),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var r,e;(r=this.unsubscribe)==null||r.call(this),(e=this.resizeObserver)==null||e.disconnect()}get routerEl(){return wr.getShadowRootElement(this,".wcm-router")}get contentEl(){return wr.getShadowRootElement(this,".wcm-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return Xe`<wcm-connect-wallet-view></wcm-connect-wallet-view>`;case"DesktopConnecting":return Xe`<wcm-desktop-connecting-view></wcm-desktop-connecting-view>`;case"MobileConnecting":return Xe`<wcm-mobile-connecting-view></wcm-mobile-connecting-view>`;case"WebConnecting":return Xe`<wcm-web-connecting-view></wcm-web-connecting-view>`;case"MobileQrcodeConnecting":return Xe`<wcm-mobile-qr-connecting-view></wcm-mobile-qr-connecting-view>`;case"WalletExplorer":return Xe`<wcm-wallet-explorer-view></wcm-wallet-explorer-view>`;case"Qrcode":return Xe`<wcm-qrcode-view></wcm-qrcode-view>`;case"InstallWallet":return Xe`<wcm-install-wallet-view></wcm-install-wallet-view>`;default:return Xe`<div>Not Found</div>`}}async onChangeRoute(){await(0,d0.animate)(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=Ci.state.view,(0,d0.animate)(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return Xe`<div class="wcm-router"><div class="wcm-content">${this.viewTemplate()}</div></div>`}};_w.styles=[Zr.globalCss,XMt],ZY([bs()],_w.prototype,"view",2),ZY([bs()],_w.prototype,"prevView",2),_w=ZY([Jr("wcm-modal-router")],_w);rLt=fn`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:9px 15px 11px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:var(--wcm-notification-border-radius);border:1px solid var(--wcm-color-overlay);background-color:var(--wcm-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--wcm-color-bg-3)}}.wcm-success path{fill:var(--wcm-accent-color)}.wcm-error path{fill:var(--wcm-error-color)}`,nLt=Object.defineProperty,iLt=Object.getOwnPropertyDescriptor,qRe=(r,e,t,n)=>{for(var i=n>1?void 0:n?iLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&nLt(e,t,i),i},JN=class extends Rr{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=L6.subscribe(r=>{r.open?(this.open=!0,this.timeout=setTimeout(()=>L6.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var r;(r=this.unsubscribe)==null||r.call(this),clearTimeout(this.timeout),L6.closeToast()}render(){let{message:r,variant:e}=L6.state,t={"wcm-success":e==="success","wcm-error":e==="error"};return this.open?Xe`<div class="${bd(t)}">${e==="success"?Tn.CHECKMARK_ICON:null} ${e==="error"?Tn.CROSS_ICON:null}<wcm-text variant="small-regular">${r}</wcm-text></div>`:null}};JN.styles=[Zr.globalCss,rLt],qRe([bs()],JN.prototype,"open",2),JN=qRe([Jr("wcm-modal-toast")],JN);aLt=.1,jRe=2.5,V6=7;sLt={generate(r,e,t){let n="#141414",i="#ffffff",a=[],o=oLt(r,"Q"),s=e/o.length,c=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];c.forEach(({x:m,y:b})=>{let E=(o.length-V6)*s*m,I=(o.length-V6)*s*b,R=.45;for(let L=0;L<c.length;L+=1){let U=s*(V6-L*2);a.push(ki`<rect fill="${L%2===0?n:i}" height="${U}" rx="${U*R}" ry="${U*R}" width="${U}" x="${E+s*L}" y="${I+s*L}">`)}});let l=Math.floor((t+25)/s),u=o.length/2-l/2,d=o.length/2+l/2-1,h=[];o.forEach((m,b)=>{m.forEach((E,I)=>{if(o[b][I]&&!(b<V6&&I<V6||b>o.length-(V6+1)&&I<V6||b<V6&&I>o.length-(V6+1))&&!(b>u&&b<d&&I>u&&I<d)){let R=b*s+s/2,L=I*s+s/2;h.push([R,L])}})});let g={};return h.forEach(([m,b])=>{g[m]?g[m].push(b):g[m]=[b]}),Object.entries(g).map(([m,b])=>{let E=b.filter(I=>b.every(R=>!XY(I,R,s)));return[Number(m),E]}).forEach(([m,b])=>{b.forEach(E=>{a.push(ki`<circle cx="${m}" cy="${E}" fill="${n}" r="${s/jRe}">`)})}),Object.entries(g).filter(([m,b])=>b.length>1).map(([m,b])=>{let E=b.filter(I=>b.some(R=>XY(I,R,s)));return[Number(m),E]}).map(([m,b])=>{b.sort((I,R)=>I<R?-1:1);let E=[];for(let I of b){let R=E.find(L=>L.some(U=>XY(I,U,s)));R?R.push(I):E.push([I])}return[m,E.map(I=>[I[0],I[I.length-1]])]}).forEach(([m,b])=>{b.forEach(([E,I])=>{a.push(ki`<line x1="${m}" x2="${m}" y1="${E}" y2="${I}" stroke="${n}" stroke-width="${s/(jRe/2)}" stroke-linecap="round">`)})}),a}},cLt=fn`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;aspect-ratio:1/1;animation:fadeIn ease .2s}.wcm-dark{background-color:#fff;border-radius:var(--wcm-container-border-radius);padding:18px;box-shadow:0 2px 5px #000}svg:first-child,wcm-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{width:25%;height:25%;border-radius:var(--wcm-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--wcm-accent-color)}svg:first-child path:last-child{stroke:var(--wcm-color-overlay)}`,lLt=Object.defineProperty,uLt=Object.getOwnPropertyDescriptor,Py=(r,e,t,n)=>{for(var i=n>1?void 0:n?uLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&lLt(e,t,i),i},H6=class extends Rr{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){let r=vd.state.themeMode==="light"?this.size:this.size-36;return ki`<svg height="${r}" width="${r}">${sLt.generate(this.uri,r,r/4)}</svg>`}render(){let r={"wcm-dark":vd.state.themeMode==="dark"};return Xe`<div style="${`width: ${this.size}px`}" class="${bd(r)}">${this.walletId||this.imageUrl?Xe`<wcm-wallet-image walletId="${$o(this.walletId)}" imageId="${$o(this.imageId)}" imageUrl="${$o(this.imageUrl)}"></wcm-wallet-image>`:Tn.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}</div>`}};H6.styles=[Zr.globalCss,cLt],Py([Tr()],H6.prototype,"uri",2),Py([Tr({type:Number})],H6.prototype,"size",2),Py([Tr()],H6.prototype,"imageId",2),Py([Tr()],H6.prototype,"walletId",2),Py([Tr()],H6.prototype,"imageUrl",2),H6=Py([Jr("wcm-qrcode")],H6);dLt=fn`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--wcm-input-border-radius);font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:var(--wcm-color-fg-1);background-color:var(--wcm-color-bg-3);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay);caret-color:var(--wcm-accent-color)}input::placeholder{color:var(--wcm-color-fg-2)}svg{left:10px;top:4px;pointer-events:none;position:absolute;width:20px;height:20px}input:focus-within{box-shadow:inset 0 0 0 1px var(--wcm-accent-color)}path{fill:var(--wcm-color-fg-2)}`,fLt=Object.defineProperty,pLt=Object.getOwnPropertyDescriptor,VRe=(r,e,t,n)=>{for(var i=n>1?void 0:n?pLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&fLt(e,t,i),i},ZN=class extends Rr{constructor(){super(...arguments),this.onChange=()=>null}render(){return Xe`<input type="text" @input="${this.onChange}" placeholder="Search wallets"> ${Tn.SEARCH_ICON}`}};ZN.styles=[Zr.globalCss,dLt],VRe([Tr()],ZN.prototype,"onChange",2),ZN=VRe([Jr("wcm-search-input")],ZN);hLt=fn`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--wcm-accent-color)}`,mLt=Object.defineProperty,gLt=Object.getOwnPropertyDescriptor,yLt=(r,e,t,n)=>{for(var i=n>1?void 0:n?gLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&mLt(e,t,i),i},eJ=class extends Rr{render(){return Xe`<svg viewBox="0 0 50 50" width="24" height="24"><circle cx="25" cy="25" r="20" fill="none" stroke-width="4" stroke="#fff"/></svg>`}};eJ.styles=[Zr.globalCss,hLt],eJ=yLt([Jr("wcm-spinner")],eJ);vLt=fn`span{font-style:normal;font-family:var(--wcm-font-family);font-feature-settings:var(--wcm-font-feature-settings)}.wcm-xsmall-bold{font-family:var(--wcm-text-xsmall-bold-font-family);font-weight:var(--wcm-text-xsmall-bold-weight);font-size:var(--wcm-text-xsmall-bold-size);line-height:var(--wcm-text-xsmall-bold-line-height);letter-spacing:var(--wcm-text-xsmall-bold-letter-spacing);text-transform:var(--wcm-text-xsmall-bold-text-transform)}.wcm-xsmall-regular{font-family:var(--wcm-text-xsmall-regular-font-family);font-weight:var(--wcm-text-xsmall-regular-weight);font-size:var(--wcm-text-xsmall-regular-size);line-height:var(--wcm-text-xsmall-regular-line-height);letter-spacing:var(--wcm-text-xsmall-regular-letter-spacing);text-transform:var(--wcm-text-xsmall-regular-text-transform)}.wcm-small-thin{font-family:var(--wcm-text-small-thin-font-family);font-weight:var(--wcm-text-small-thin-weight);font-size:var(--wcm-text-small-thin-size);line-height:var(--wcm-text-small-thin-line-height);letter-spacing:var(--wcm-text-small-thin-letter-spacing);text-transform:var(--wcm-text-small-thin-text-transform)}.wcm-small-regular{font-family:var(--wcm-text-small-regular-font-family);font-weight:var(--wcm-text-small-regular-weight);font-size:var(--wcm-text-small-regular-size);line-height:var(--wcm-text-small-regular-line-height);letter-spacing:var(--wcm-text-small-regular-letter-spacing);text-transform:var(--wcm-text-small-regular-text-transform)}.wcm-medium-regular{font-family:var(--wcm-text-medium-regular-font-family);font-weight:var(--wcm-text-medium-regular-weight);font-size:var(--wcm-text-medium-regular-size);line-height:var(--wcm-text-medium-regular-line-height);letter-spacing:var(--wcm-text-medium-regular-letter-spacing);text-transform:var(--wcm-text-medium-regular-text-transform)}.wcm-big-bold{font-family:var(--wcm-text-big-bold-font-family);font-weight:var(--wcm-text-big-bold-weight);font-size:var(--wcm-text-big-bold-size);line-height:var(--wcm-text-big-bold-line-height);letter-spacing:var(--wcm-text-big-bold-letter-spacing);text-transform:var(--wcm-text-big-bold-text-transform)}:host(*){color:var(--wcm-color-fg-1)}.wcm-color-primary{color:var(--wcm-color-fg-1)}.wcm-color-secondary{color:var(--wcm-color-fg-2)}.wcm-color-tertiary{color:var(--wcm-color-fg-3)}.wcm-color-inverse{color:var(--wcm-accent-fill-color)}.wcm-color-accnt{color:var(--wcm-accent-color)}.wcm-color-error{color:var(--wcm-error-color)}`,bLt=Object.defineProperty,wLt=Object.getOwnPropertyDescriptor,tJ=(r,e,t,n)=>{for(var i=n>1?void 0:n?wLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&bLt(e,t,i),i},Ew=class extends Rr{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){let r={"wcm-big-bold":this.variant==="big-bold","wcm-medium-regular":this.variant==="medium-regular","wcm-small-regular":this.variant==="small-regular","wcm-small-thin":this.variant==="small-thin","wcm-xsmall-regular":this.variant==="xsmall-regular","wcm-xsmall-bold":this.variant==="xsmall-bold","wcm-color-primary":this.color==="primary","wcm-color-secondary":this.color==="secondary","wcm-color-tertiary":this.color==="tertiary","wcm-color-inverse":this.color==="inverse","wcm-color-accnt":this.color==="accent","wcm-color-error":this.color==="error"};return Xe`<span><slot class="${bd(r)}"></slot></span>`}};Ew.styles=[Zr.globalCss,vLt],tJ([Tr()],Ew.prototype,"variant",2),tJ([Tr()],Ew.prototype,"color",2),Ew=tJ([Jr("wcm-text")],Ew);_Lt=fn`button{width:100%;height:100%;border-radius:var(--wcm-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}wcm-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}wcm-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--wcm-wallet-icon-border-radius);margin-bottom:5px}.wcm-sublabel{margin-top:2px}`,ELt=Object.defineProperty,xLt=Object.getOwnPropertyDescriptor,l0=(r,e,t,n)=>{for(var i=n>1?void 0:n?xLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&ELt(e,t,i),i},Ed=class extends Rr{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.imageId=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?Xe`<wcm-text class="wcm-sublabel" variant="xsmall-bold" color="tertiary">RECENT</wcm-text>`:this.installed?Xe`<wcm-text class="wcm-sublabel" variant="xsmall-bold" color="tertiary">INSTALLED</wcm-text>`:null}handleClick(){CQ.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var r;return Xe`<button @click="${this.handleClick.bind(this)}"><div><wcm-wallet-image walletId="${this.walletId}" imageId="${$o(this.imageId)}"></wcm-wallet-image><wcm-text variant="xsmall-regular">${(r=this.label)!=null?r:wr.getWalletName(this.name,!0)}</wcm-text>${this.sublabelTemplate()}</div></button>`}};Ed.styles=[Zr.globalCss,_Lt],l0([Tr()],Ed.prototype,"onClick",2),l0([Tr()],Ed.prototype,"name",2),l0([Tr()],Ed.prototype,"walletId",2),l0([Tr()],Ed.prototype,"label",2),l0([Tr()],Ed.prototype,"imageId",2),l0([Tr({type:Boolean})],Ed.prototype,"installed",2),l0([Tr({type:Boolean})],Ed.prototype,"recent",2),Ed=l0([Jr("wcm-wallet-button")],Ed);ALt=fn`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--wcm-color-overlay)}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid var(--wcm-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`,TLt=Object.defineProperty,SLt=Object.getOwnPropertyDescriptor,XN=(r,e,t,n)=>{for(var i=n>1?void 0:n?SLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&TLt(e,t,i),i},By=class extends Rr{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var r;let e=(r=this.imageUrl)!=null&&r.length?this.imageUrl:wr.getWalletIcon({id:this.walletId,image_id:this.imageId});return Xe`${e.length?Xe`<div><img crossorigin="anonymous" src="${e}" alt="${this.id}"></div>`:Tn.WALLET_PLACEHOLDER}`}};By.styles=[Zr.globalCss,ALt],XN([Tr()],By.prototype,"walletId",2),XN([Tr()],By.prototype,"imageId",2),XN([Tr()],By.prototype,"imageUrl",2),By=XN([Jr("wcm-wallet-image")],By);ILt=Object.defineProperty,CLt=Object.getOwnPropertyDescriptor,HRe=(r,e,t,n)=>{for(var i=n>1?void 0:n?CLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&ILt(e,t,i),i},rJ=class extends Rr{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(r){try{r!=null&&r.length&&await Promise.all(r.map(async e=>wr.preloadImage(e)))}catch{console.info("Unsuccessful attempt at preloading some images",r)}}async preloadListings(){if(ys.state.enableExplorer){await vs.getRecomendedWallets(),Mi.setIsDataLoaded(!0);let{recomendedWallets:r}=vs.state,e=r.map(t=>wr.getWalletIcon(t));await this.loadImages(e)}else Mi.setIsDataLoaded(!0)}async preloadCustomImages(){let r=wr.getCustomImageUrls();await this.loadImages(r)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(r){console.error(r),L6.openToast("Failed preloading","error")}}};HRe([bs()],rJ.prototype,"preload",2),rJ=HRe([Jr("wcm-explorer-context")],rJ);kLt=Object.defineProperty,NLt=Object.getOwnPropertyDescriptor,RLt=(r,e,t,n)=>{for(var i=n>1?void 0:n?NLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&kLt(e,t,i),i},KRe=class extends Rr{constructor(){super(),this.unsubscribeTheme=void 0,Zr.setTheme(),this.unsubscribeTheme=vd.subscribe(Zr.setTheme)}disconnectedCallback(){var r;(r=this.unsubscribeTheme)==null||r.call(this)}};KRe=RLt([Jr("wcm-theme-context")],KRe);OLt=fn`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.wcm-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.wcm-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.wcm-track svg{margin:0 5px}wcm-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--wcm-wallet-icon-border-radius)}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-title{display:flex;align-items:center;margin-bottom:10px}.wcm-title svg{margin-right:6px}.wcm-title path{fill:var(--wcm-accent-color)}wcm-modal-footer .wcm-title{padding:0 10px}wcm-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--wcm-color-bg-1))}wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-info-footer wcm-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`,DLt=Object.defineProperty,PLt=Object.getOwnPropertyDescriptor,BLt=(r,e,t,n)=>{for(var i=n>1?void 0:n?PLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&DLt(e,t,i),i},nJ=class extends Rr{onGoToQrcode(){Ci.push("Qrcode")}render(){let{recomendedWallets:r}=vs.state,e=[...r,...r],t=Mt.RECOMMENDED_WALLET_AMOUNT*2;return Xe`<wcm-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${Tn.QRCODE_ICON}"></wcm-modal-header><wcm-modal-content><div class="wcm-title">${Tn.MOBILE_ICON}<wcm-text variant="small-regular" color="accent">WalletConnect</wcm-text></div><div class="wcm-slider"><div class="wcm-track">${[...Array(t)].map((n,i)=>{let a=e[i%e.length];return a?Xe`<wcm-wallet-image walletId="${a.id}" imageId="${a.image_id}"></wcm-wallet-image>`:Tn.WALLET_PLACEHOLDER})}</div><wcm-button-big @click="${wr.handleAndroidLinking}"><wcm-text variant="medium-regular" color="inverse">Select Wallet</wcm-text></wcm-button-big></div></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">Choose WalletConnect to see supported apps on your device</wcm-text></wcm-info-footer>`}};nJ.styles=[Zr.globalCss,OLt],nJ=BLt([Jr("wcm-android-wallet-selection")],nJ);MLt=fn`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:2px;top:0;left:0}use{stroke:var(--wcm-accent-color);animation:loading 1s linear infinite}wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:90px;height:90px}wcm-text{margin-bottom:40px}.wcm-error svg{stroke:var(--wcm-error-color)}.wcm-error use{display:none}.wcm-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.wcm-stale svg,.wcm-stale use{display:none}`,LLt=Object.defineProperty,FLt=Object.getOwnPropertyDescriptor,My=(r,e,t,n)=>{for(var i=n>1?void 0:n?FLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&LLt(e,t,i),i},u0=class extends Rr{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var r,e;let t=(e=(r=vd.state.themeVariables)==null?void 0:r["--wcm-wallet-icon-large-border-radius"])!=null?e:Zr.getPreset("--wcm-wallet-icon-large-border-radius"),n=0;t.includes("%")?n=88/100*parseInt(t,10):n=parseInt(t,10),n*=1.17;let i=317-n*1.57,a=425-n*1.8;return Xe`<svg viewBox="0 0 110 110" width="110" height="110"><rect id="wcm-loader" x="2" y="2" width="106" height="106" rx="${n}"/><use xlink:href="#wcm-loader" stroke-dasharray="106 ${i}" stroke-dashoffset="${a}"></use></svg>`}render(){let r={"wcm-error":this.isError,"wcm-stale":this.isStale};return Xe`<div class="${bd(r)}">${this.svgLoaderTemplate()}<wcm-wallet-image walletId="${$o(this.walletId)}" imageId="${$o(this.imageId)}"></wcm-wallet-image></div><wcm-text variant="medium-regular" color="${this.isError?"error":"primary"}">${this.isError?"Connection declined":this.label}</wcm-text>`}};u0.styles=[Zr.globalCss,MLt],My([Tr()],u0.prototype,"walletId",2),My([Tr()],u0.prototype,"imageId",2),My([Tr({type:Boolean})],u0.prototype,"isError",2),My([Tr({type:Boolean})],u0.prototype,"isStale",2),My([Tr()],u0.prototype,"label",2),u0=My([Jr("wcm-connector-waiting")],u0);Uy={manualWallets(){var r,e;let{mobileWallets:t,desktopWallets:n}=ys.state,i=(r=Uy.recentWallet())==null?void 0:r.id,a=Mt.isMobile()?t:n,o=a?.filter(s=>i!==s.id);return(e=Mt.isMobile()?o?.map(({id:s,name:c,links:l})=>({id:s,name:c,mobile:l,links:l})):o?.map(({id:s,name:c,links:l})=>({id:s,name:c,desktop:l,links:l})))!=null?e:[]},recentWallet(){return wr.getRecentWallet()},recomendedWallets(r=!1){var e;let t=r||(e=Uy.recentWallet())==null?void 0:e.id,{recomendedWallets:n}=vs.state;return n.filter(i=>t!==i.id)}},f0={onConnecting(r){wr.goToConnectingView(r)},manualWalletsTemplate(){return Uy.manualWallets().map(r=>Xe`<wcm-wallet-button walletId="${r.id}" name="${r.name}" .onClick="${()=>this.onConnecting(r)}"></wcm-wallet-button>`)},recomendedWalletsTemplate(r=!1){return Uy.recomendedWallets(r).map(e=>Xe`<wcm-wallet-button name="${e.name}" walletId="${e.id}" imageId="${e.image_id}" .onClick="${()=>this.onConnecting(e)}"></wcm-wallet-button>`)},recentWalletTemplate(){let r=Uy.recentWallet();if(r)return Xe`<wcm-wallet-button name="${r.name}" walletId="${r.id}" imageId="${$o(r.image_id)}" .recent="${!0}" .onClick="${()=>this.onConnecting(r)}"></wcm-wallet-button>`}},ULt=fn`.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-desktop-title,.wcm-mobile-title{display:flex;align-items:center}.wcm-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.wcm-desktop-title{margin-bottom:10px;padding:0 10px}.wcm-subtitle{display:flex;align-items:center}.wcm-subtitle:last-child path{fill:var(--wcm-color-fg-3)}.wcm-desktop-title svg,.wcm-mobile-title svg{margin-right:6px}.wcm-desktop-title path,.wcm-mobile-title path{fill:var(--wcm-accent-color)}`,qLt=Object.defineProperty,jLt=Object.getOwnPropertyDescriptor,VLt=(r,e,t,n)=>{for(var i=n>1?void 0:n?jLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&qLt(e,t,i),i},iJ=class extends Rr{render(){let{explorerExcludedWalletIds:r,enableExplorer:e}=ys.state,t=r!=="ALL"&&e,n=f0.manualWalletsTemplate(),i=f0.recomendedWalletsTemplate(),a=[f0.recentWalletTemplate(),...n,...i];a=a.filter(Boolean);let o=a.length>4||t,s=[];o?s=a.slice(0,3):s=a;let c=!!s.length;return Xe`<wcm-modal-header .border="${!0}" title="Connect your wallet" .onAction="${wr.handleUriCopy}" .actionIcon="${Tn.COPY_ICON}"></wcm-modal-header><wcm-modal-content><div class="wcm-mobile-title"><div class="wcm-subtitle">${Tn.MOBILE_ICON}<wcm-text variant="small-regular" color="accent">Mobile</wcm-text></div><div class="wcm-subtitle">${Tn.SCAN_ICON}<wcm-text variant="small-regular" color="secondary">Scan with your wallet</wcm-text></div></div><wcm-walletconnect-qr></wcm-walletconnect-qr></wcm-modal-content>${c?Xe`<wcm-modal-footer><div class="wcm-desktop-title">${Tn.DESKTOP_ICON}<wcm-text variant="small-regular" color="accent">Desktop</wcm-text></div><div class="wcm-grid">${s} ${o?Xe`<wcm-view-all-wallets-button></wcm-view-all-wallets-button>`:null}</div></wcm-modal-footer>`:null}`}};iJ.styles=[Zr.globalCss,ULt],iJ=VLt([Jr("wcm-desktop-wallet-selection")],iJ);HLt=fn`div{background-color:var(--wcm-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--wcm-color-bg-3);text-align:center}a{color:var(--wcm-accent-color);text-decoration:none;transition:opacity .2s ease-in-out;display:inline}a:active{opacity:.8}@media(hover:hover){a:hover{opacity:.8}}`,KLt=Object.defineProperty,zLt=Object.getOwnPropertyDescriptor,GLt=(r,e,t,n)=>{for(var i=n>1?void 0:n?zLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&KLt(e,t,i),i},aJ=class extends Rr{render(){let{termsOfServiceUrl:r,privacyPolicyUrl:e}=ys.state;return r??e?Xe`<div><wcm-text variant="small-regular" color="secondary">By connecting your wallet to this app, you agree to the app's ${r?Xe`<a href="${r}" target="_blank" rel="noopener noreferrer">Terms of Service</a>`:null} ${r&&e?"and":null} ${e?Xe`<a href="${e}" target="_blank" rel="noopener noreferrer">Privacy Policy</a>`:null}</wcm-text></div>`:null}};aJ.styles=[Zr.globalCss,HLt],aJ=GLt([Jr("wcm-legal-notice")],aJ);WLt=fn`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`,QLt=Object.defineProperty,$Lt=Object.getOwnPropertyDescriptor,YLt=(r,e,t,n)=>{for(var i=n>1?void 0:n?$Lt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&QLt(e,t,i),i},oJ=class extends Rr{onQrcode(){Ci.push("Qrcode")}render(){let{explorerExcludedWalletIds:r,enableExplorer:e}=ys.state,t=r!=="ALL"&&e,n=f0.manualWalletsTemplate(),i=f0.recomendedWalletsTemplate(),a=[f0.recentWalletTemplate(),...n,...i];a=a.filter(Boolean);let o=a.length>8||t,s=[];o?s=a.slice(0,7):s=a;let c=!!s.length;return Xe`<wcm-modal-header title="Connect your wallet" .onAction="${this.onQrcode}" .actionIcon="${Tn.QRCODE_ICON}"></wcm-modal-header>${c?Xe`<wcm-modal-content><div>${s} ${o?Xe`<wcm-view-all-wallets-button></wcm-view-all-wallets-button>`:null}</div></wcm-modal-content>`:null}`}};oJ.styles=[Zr.globalCss,WLt],oJ=YLt([Jr("wcm-mobile-wallet-selection")],oJ);JLt=fn`:host{all:initial}.wcm-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--wcm-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none;background-color:var(--wcm-overlay-background-color);backdrop-filter:var(--wcm-overlay-backdrop-filter)}@media(max-height:720px) and (orientation:landscape){.wcm-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.wcm-active{pointer-events:auto}.wcm-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) var(--wcm-container-border-radius) var(--wcm-container-border-radius);border:1px solid var(--wcm-color-overlay);overflow:hidden}.wcm-card{width:100%;position:relative;border-radius:var(--wcm-container-border-radius);overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--wcm-color-overlay);background-color:var(--wcm-color-bg-1);color:var(--wcm-color-fg-1)}@media(max-width:600px){.wcm-container{max-width:440px;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) 0 0}.wcm-card{border-radius:var(--wcm-container-border-radius) var(--wcm-container-border-radius) 0 0}.wcm-overlay{align-items:flex-end}}@media(max-width:440px){.wcm-container{border:0}}`,ZLt=Object.defineProperty,XLt=Object.getOwnPropertyDescriptor,sJ=(r,e,t,n)=>{for(var i=n>1?void 0:n?XLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&ZLt(e,t,i),i},Fy=class extends Rr{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=M6.subscribe(r=>{r.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var r;(r=this.unsubscribeModal)==null||r.call(this)}get overlayEl(){return wr.getShadowRootElement(this,".wcm-overlay")}get containerEl(){return wr.getShadowRootElement(this,".wcm-container")}toggleBodyScroll(r){document.querySelector("body")&&(r?document.getElementById("wcm-styles")?.remove():document.head.insertAdjacentHTML("beforeend",'<style id="wcm-styles">html,body{touch-action:none;overflow:hidden;overscroll-behavior:contain;}</style>'))}onCloseModal(r){r.target===r.currentTarget&&M6.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout(async()=>{let r=wr.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]},e=.1,t=.2;await Promise.all([(0,d0.animate)(this.overlayEl,{opacity:[0,1]},{delay:e,duration:t}).finished,(0,d0.animate)(this.containerEl,r,{delay:e,duration:t}).finished]),this.active=!0},0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();let r=wr.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]},e=.2;await Promise.all([(0,d0.animate)(this.overlayEl,{opacity:[1,0]},{duration:e}).finished,(0,d0.animate)(this.containerEl,r,{duration:e}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",r=>{var e;r.key==="Escape"?M6.close():r.key==="Tab"&&((e=r.target)!=null&&e.tagName.includes("wcm-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var r;(r=this.abortController)==null||r.abort(),this.abortController=void 0}render(){let r={"wcm-overlay":!0,"wcm-active":this.active};return Xe`<wcm-explorer-context></wcm-explorer-context><wcm-theme-context></wcm-theme-context><div id="wcm-modal" class="${bd(r)}" @click="${this.onCloseModal}" role="alertdialog" aria-modal="true"><div class="wcm-container" tabindex="0">${this.open?Xe`<wcm-modal-backcard></wcm-modal-backcard><div class="wcm-card"><wcm-modal-router></wcm-modal-router><wcm-modal-toast></wcm-modal-toast></div>`:null}</div></div>`}};Fy.styles=[Zr.globalCss,JLt],sJ([bs()],Fy.prototype,"open",2),sJ([bs()],Fy.prototype,"active",2),Fy=sJ([Jr("wcm-modal")],Fy);eFt=fn`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}wcm-button{margin:0 5px}`,tFt=Object.defineProperty,rFt=Object.getOwnPropertyDescriptor,xw=(r,e,t,n)=>{for(var i=n>1?void 0:n?rFt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&tFt(e,t,i),i},Hh=class extends Rr{constructor(){super(...arguments),this.isMobile=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){Mt.isMobile()?Ci.replace("MobileConnecting"):Ci.replace("MobileQrcodeConnecting")}onDesktop(){Ci.replace("DesktopConnecting")}onWeb(){Ci.replace("WebConnecting")}render(){return Xe`<div>${this.isRetry?Xe`<slot></slot>`:null} ${this.isMobile?Xe`<wcm-button .onClick="${this.onMobile}" .iconLeft="${Tn.MOBILE_ICON}" variant="outline">Mobile</wcm-button>`:null} ${this.isDesktop?Xe`<wcm-button .onClick="${this.onDesktop}" .iconLeft="${Tn.DESKTOP_ICON}" variant="outline">Desktop</wcm-button>`:null} ${this.isWeb?Xe`<wcm-button .onClick="${this.onWeb}" .iconLeft="${Tn.GLOBE_ICON}" variant="outline">Web</wcm-button>`:null}</div>`}};Hh.styles=[Zr.globalCss,eFt],xw([Tr({type:Boolean})],Hh.prototype,"isMobile",2),xw([Tr({type:Boolean})],Hh.prototype,"isDesktop",2),xw([Tr({type:Boolean})],Hh.prototype,"isWeb",2),xw([Tr({type:Boolean})],Hh.prototype,"isRetry",2),Hh=xw([Jr("wcm-platform-selection")],Hh);nFt=fn`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--wcm-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.wcm-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--wcm-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--wcm-color-bg-2);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}.wcm-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--wcm-wallet-icon-border-radius)/ 2);border:1px solid var(--wcm-color-overlay)}.wcm-icons svg{width:21px;height:21px}.wcm-icons img:nth-child(1),.wcm-icons img:nth-child(2),.wcm-icons svg:nth-child(1),.wcm-icons svg:nth-child(2){margin-bottom:4px}wcm-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`,iFt=Object.defineProperty,aFt=Object.getOwnPropertyDescriptor,oFt=(r,e,t,n)=>{for(var i=n>1?void 0:n?aFt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&iFt(e,t,i),i},cJ=class extends Rr{onClick(){Ci.push("WalletExplorer")}render(){let{recomendedWallets:r}=vs.state,e=Uy.manualWallets(),t=[...r,...e].reverse().slice(0,4);return Xe`<button @click="${this.onClick}"><div class="wcm-icons">${t.map(n=>{let i=wr.getWalletIcon(n);if(i)return Xe`<img crossorigin="anonymous" src="${i}">`;let a=wr.getWalletIcon({id:n.id});return a?Xe`<img crossorigin="anonymous" src="${a}">`:Tn.WALLET_PLACEHOLDER})} ${[...Array(4-t.length)].map(()=>Tn.WALLET_PLACEHOLDER)}</div><wcm-text variant="xsmall-regular">View All</wcm-text></button>`}};cJ.styles=[Zr.globalCss,nFt],cJ=oFt([Jr("wcm-view-all-wallets-button")],cJ);sFt=fn`.wcm-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`,cFt=Object.defineProperty,lFt=Object.getOwnPropertyDescriptor,eR=(r,e,t,n)=>{for(var i=n>1?void 0:n?lFt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&cFt(e,t,i),i},Ly=class extends Rr{constructor(){super(),this.walletId="",this.imageId="",this.uri="",setTimeout(()=>{let{walletConnectUri:r}=Mi.state;this.uri=r},0)}get overlayEl(){return wr.getShadowRootElement(this,".wcm-qr-container")}render(){return Xe`<div class="wcm-qr-container">${this.uri?Xe`<wcm-qrcode size="${this.overlayEl.offsetWidth}" uri="${this.uri}" walletId="${$o(this.walletId)}" imageId="${$o(this.imageId)}"></wcm-qrcode>`:Xe`<wcm-spinner></wcm-spinner>`}</div>`}};Ly.styles=[Zr.globalCss,sFt],eR([Tr()],Ly.prototype,"walletId",2),eR([Tr()],Ly.prototype,"imageId",2),eR([bs()],Ly.prototype,"uri",2),Ly=eR([Jr("wcm-walletconnect-qr")],Ly);uFt=Object.defineProperty,dFt=Object.getOwnPropertyDescriptor,fFt=(r,e,t,n)=>{for(var i=n>1?void 0:n?dFt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&uFt(e,t,i),i},lJ=class extends Rr{viewTemplate(){return Mt.isAndroid()?Xe`<wcm-android-wallet-selection></wcm-android-wallet-selection>`:Mt.isMobile()?Xe`<wcm-mobile-wallet-selection></wcm-mobile-wallet-selection>`:Xe`<wcm-desktop-wallet-selection></wcm-desktop-wallet-selection>`}render(){return Xe`${this.viewTemplate()}<wcm-legal-notice></wcm-legal-notice>`}};lJ.styles=[Zr.globalCss],lJ=fFt([Jr("wcm-connect-wallet-view")],lJ);pFt=fn`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`,hFt=Object.defineProperty,mFt=Object.getOwnPropertyDescriptor,zRe=(r,e,t,n)=>{for(var i=n>1?void 0:n?mFt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&hFt(e,t,i),i},tR=class extends Rr{constructor(){super(),this.isError=!1,this.openDesktopApp()}onFormatAndRedirect(r){let{desktop:e,name:t}=Mt.getWalletRouterData(),n=e?.native;if(n){let i=Mt.formatNativeUrl(n,r,t);Mt.openHref(i,"_self")}}openDesktopApp(){let{walletConnectUri:r}=Mi.state,e=Mt.getWalletRouterData();wr.setRecentWallet(e),r&&this.onFormatAndRedirect(r)}render(){let{name:r,id:e,image_id:t}=Mt.getWalletRouterData(),{isMobile:n,isWeb:i}=wr.getCachedRouterWalletPlatforms();return Xe`<wcm-modal-header title="${r}" .onAction="${wr.handleUriCopy}" .actionIcon="${Tn.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${$o(t)}" label="${`Continue in ${r}...`}" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Connection can continue loading if ${r} is not installed on your device`}</wcm-text><wcm-platform-selection .isMobile="${n}" .isWeb="${i}" .isRetry="${!0}"><wcm-button .onClick="${this.openDesktopApp.bind(this)}" .iconRight="${Tn.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection></wcm-info-footer>`}};tR.styles=[Zr.globalCss,pFt],zRe([bs()],tR.prototype,"isError",2),tR=zRe([Jr("wcm-desktop-connecting-view")],tR);gFt=fn`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}wcm-button{margin-top:15px}`,yFt=Object.defineProperty,vFt=Object.getOwnPropertyDescriptor,bFt=(r,e,t,n)=>{for(var i=n>1?void 0:n?vFt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&yFt(e,t,i),i},uJ=class extends Rr{onInstall(r){r&&Mt.openHref(r,"_blank")}render(){let{name:r,id:e,image_id:t,homepage:n}=Mt.getWalletRouterData();return Xe`<wcm-modal-header title="${r}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${$o(t)}" label="Not Detected" .isStale="${!0}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Download ${r} to continue. If multiple browser extensions are installed, disable non ${r} ones and try again`}</wcm-text><wcm-button .onClick="${()=>this.onInstall(n)}" .iconLeft="${Tn.ARROW_DOWN_ICON}">Download</wcm-button></wcm-info-footer>`}};uJ.styles=[Zr.globalCss,gFt],uJ=bFt([Jr("wcm-install-wallet-view")],uJ);wFt=fn`wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}wcm-info-footer{display:flex;width:100%}.wcm-app-store{justify-content:space-between}.wcm-app-store wcm-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--wcm-wallet-icon-small-border-radius)}.wcm-app-store div{display:flex;align-items:center}.wcm-app-store wcm-button{margin-right:-10px}.wcm-note{flex-direction:column;align-items:center;padding:5px 0}.wcm-note wcm-text{text-align:center}wcm-platform-selection{margin-top:-15px}.wcm-note wcm-text{margin-top:15px}.wcm-note wcm-text span{color:var(--wcm-accent-color)}`,_Ft=Object.defineProperty,EFt=Object.getOwnPropertyDescriptor,GRe=(r,e,t,n)=>{for(var i=n>1?void 0:n?EFt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&_Ft(e,t,i),i},rR=class extends Rr{constructor(){super(),this.isError=!1,this.openMobileApp()}onFormatAndRedirect(r,e=!1){let{mobile:t,name:n}=Mt.getWalletRouterData(),i=t?.native,a=t?.universal;if(i&&!e){let o=Mt.formatNativeUrl(i,r,n);Mt.openHref(o,"_self")}else if(a){let o=Mt.formatUniversalUrl(a,r,n);Mt.openHref(o,"_self")}}openMobileApp(r=!1){let{walletConnectUri:e}=Mi.state,t=Mt.getWalletRouterData();wr.setRecentWallet(t),e&&this.onFormatAndRedirect(e,r)}onGoToAppStore(r){r&&Mt.openHref(r,"_blank")}render(){let{name:r,id:e,image_id:t,app:n,mobile:i}=Mt.getWalletRouterData(),{isWeb:a}=wr.getCachedRouterWalletPlatforms(),o=n?.ios,s=i?.universal;return Xe`<wcm-modal-header title="${r}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${$o(t)}" label="Tap 'Open' to continue…" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer class="wcm-note"><wcm-platform-selection .isWeb="${a}" .isRetry="${!0}"><wcm-button .onClick="${()=>this.openMobileApp(!1)}" .iconRight="${Tn.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection>${s?Xe`<wcm-text color="secondary" variant="small-thin">Still doesn't work? <span tabindex="0" @click="${()=>this.openMobileApp(!0)}">Try this alternate link</span></wcm-text>`:null}</wcm-info-footer><wcm-info-footer class="wcm-app-store"><div><wcm-wallet-image walletId="${e}" imageId="${$o(t)}"></wcm-wallet-image><wcm-text>${`Get ${r}`}</wcm-text></div><wcm-button .iconRight="${Tn.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGoToAppStore(o)}" variant="ghost">App Store</wcm-button></wcm-info-footer>`}};rR.styles=[Zr.globalCss,wFt],GRe([bs()],rR.prototype,"isError",2),rR=GRe([Jr("wcm-mobile-connecting-view")],rR);xFt=fn`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`,AFt=Object.defineProperty,TFt=Object.getOwnPropertyDescriptor,SFt=(r,e,t,n)=>{for(var i=n>1?void 0:n?TFt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&AFt(e,t,i),i},dJ=class extends Rr{render(){let{name:r,id:e,image_id:t}=Mt.getWalletRouterData(),{isDesktop:n,isWeb:i}=wr.getCachedRouterWalletPlatforms();return Xe`<wcm-modal-header title="${r}" .onAction="${wr.handleUriCopy}" .actionIcon="${Tn.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-walletconnect-qr walletId="${e}" imageId="${$o(t)}"></wcm-walletconnect-qr></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Scan this QR Code with your phone's camera or inside ${r} app`}</wcm-text><wcm-platform-selection .isDesktop="${n}" .isWeb="${i}"></wcm-platform-selection></wcm-info-footer>`}};dJ.styles=[Zr.globalCss,xFt],dJ=SFt([Jr("wcm-mobile-qr-connecting-view")],dJ);IFt=Object.defineProperty,CFt=Object.getOwnPropertyDescriptor,kFt=(r,e,t,n)=>{for(var i=n>1?void 0:n?CFt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&IFt(e,t,i),i},fJ=class extends Rr{render(){return Xe`<wcm-modal-header title="Scan the code" .onAction="${wr.handleUriCopy}" .actionIcon="${Tn.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-walletconnect-qr></wcm-walletconnect-qr></wcm-modal-content>`}};fJ.styles=[Zr.globalCss],fJ=kFt([Jr("wcm-qrcode-view")],fJ);NFt=fn`wcm-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}wcm-modal-content::after,wcm-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}wcm-modal-content::before{box-shadow:0 -1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(var(--wcm-color-bg-1),rgba(255,255,255,0))}wcm-modal-content::after{box-shadow:0 1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--wcm-color-bg-1));top:calc(100% - 20px)}wcm-modal-content::-webkit-scrollbar{display:none}.wcm-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.wcm-empty,.wcm-loading{display:flex}.wcm-loading .wcm-placeholder-block{height:100%}.wcm-end-reached .wcm-placeholder-block{height:0;opacity:0}.wcm-empty .wcm-placeholder-block{opacity:1;height:100%}wcm-wallet-button{margin:calc((100% - 60px)/ 3) 0}`,RFt=Object.defineProperty,OFt=Object.getOwnPropertyDescriptor,Aw=(r,e,t,n)=>{for(var i=n>1?void 0:n?OFt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&RFt(e,t,i),i},pJ=40,Kh=class extends Rr{constructor(){super(...arguments),this.loading=!vs.state.wallets.listings.length,this.firstFetch=!vs.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=wr.debounce(r=>{r.length>=1?(this.firstFetch=!0,this.endReached=!1,this.search=r,vs.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),vs.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var r;(r=this.intersectionObserver)==null||r.disconnect()}get placeholderEl(){return wr.getShadowRootElement(this,".wcm-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([r])=>{r.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){let{wallets:r,search:e}=vs.state,{listings:t,total:n}=this.search?e:r;return n<=pJ||t.length>=n}async fetchWallets(){var r;let{wallets:e,search:t}=vs.state,{listings:n,total:i,page:a}=this.search?t:e;if(!this.endReached&&(this.firstFetch||i>pJ&&n.length<i))try{this.loading=!0;let o=(r=Mi.state.chains)==null?void 0:r.join(","),{listings:s}=await vs.getWallets({page:this.firstFetch?1:a+1,entries:pJ,search:this.search,version:2,chains:o}),c=s.map(l=>wr.getWalletIcon(l));await Promise.all([...c.map(async l=>wr.preloadImage(l)),Mt.wait(300)]),this.endReached=this.isLastPage()}catch(o){console.error(o),L6.openToast(wr.getErrorMessage(o),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(r){Mt.isAndroid()?wr.handleMobileLinking(r):wr.goToConnectingView(r)}onSearchChange(r){let{value:e}=r.target;this.searchDebounce(e)}render(){let{wallets:r,search:e}=vs.state,{listings:t}=this.search?e:r,n=this.loading&&!t.length,i=this.search.length>=3,a=f0.manualWalletsTemplate(),o=f0.recomendedWalletsTemplate(!0);i&&(a=a.filter(({values:l})=>wr.caseSafeIncludes(l[0],this.search)),o=o.filter(({values:l})=>wr.caseSafeIncludes(l[0],this.search)));let s=!this.loading&&!t.length&&!o.length,c={"wcm-loading":n,"wcm-end-reached":this.endReached||!this.loading,"wcm-empty":s};return Xe`<wcm-modal-header><wcm-search-input .onChange="${this.onSearchChange.bind(this)}"></wcm-search-input></wcm-modal-header><wcm-modal-content class="${bd(c)}"><div class="wcm-grid">${n?null:a} ${n?null:o} ${n?null:t.map(l=>Xe`${l?Xe`<wcm-wallet-button imageId="${l.image_id}" name="${l.name}" walletId="${l.id}" .onClick="${()=>this.onConnect(l)}"></wcm-wallet-button>`:null}`)}</div><div class="wcm-placeholder-block">${s?Xe`<wcm-text variant="big-bold" color="secondary">No results found</wcm-text>`:null} ${!s&&this.loading?Xe`<wcm-spinner></wcm-spinner>`:null}</div></wcm-modal-content>`}};Kh.styles=[Zr.globalCss,NFt],Aw([bs()],Kh.prototype,"loading",2),Aw([bs()],Kh.prototype,"firstFetch",2),Aw([bs()],Kh.prototype,"search",2),Aw([bs()],Kh.prototype,"endReached",2),Kh=Aw([Jr("wcm-wallet-explorer-view")],Kh);DFt=fn`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`,PFt=Object.defineProperty,BFt=Object.getOwnPropertyDescriptor,WRe=(r,e,t,n)=>{for(var i=n>1?void 0:n?BFt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&PFt(e,t,i),i},nR=class extends Rr{constructor(){super(),this.isError=!1,this.openWebWallet()}onFormatAndRedirect(r){let{desktop:e,name:t}=Mt.getWalletRouterData(),n=e?.universal;if(n){let i=Mt.formatUniversalUrl(n,r,t);Mt.openHref(i,"_blank")}}openWebWallet(){let{walletConnectUri:r}=Mi.state,e=Mt.getWalletRouterData();wr.setRecentWallet(e),r&&this.onFormatAndRedirect(r)}render(){let{name:r,id:e,image_id:t}=Mt.getWalletRouterData(),{isMobile:n,isDesktop:i}=wr.getCachedRouterWalletPlatforms(),a=Mt.isMobile();return Xe`<wcm-modal-header title="${r}" .onAction="${wr.handleUriCopy}" .actionIcon="${Tn.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${$o(t)}" label="${`Continue in ${r}...`}" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`${r} web app has opened in a new tab. Go there, accept the connection, and come back`}</wcm-text><wcm-platform-selection .isMobile="${n}" .isDesktop="${a?!1:i}" .isRetry="${!0}"><wcm-button .onClick="${this.openWebWallet.bind(this)}" .iconRight="${Tn.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection></wcm-info-footer>`}};nR.styles=[Zr.globalCss,DFt],WRe([bs()],nR.prototype,"isError",2),nR=WRe([Jr("wcm-web-connecting-view")],nR)});var MFt={};qy(MFt,{CAIPChainIdToLedgerId:()=>qfe,DAppConnector:()=>mJ,DAppSigner:()=>Tw,EIPChainIdToLedgerId:()=>fat,HEDERA_ERRORS:()=>yJ,HederaChainId:()=>Iw,HederaJsonRpcMethod:()=>zh,HederaSessionEvent:()=>kw,LEDGER_ID_MAPPINGS:()=>bl,Uint8ArrayToBase64String:()=>C4,Wallet:()=>c_e,accountAndLedgerFromSession:()=>JU,base64StringToQuery:()=>WU,base64StringToSignatureMap:()=>Lfe,base64StringToTransaction:()=>rS,base64StringToTransactionBody:()=>oat,base64StringToUint8Array:()=>sat,freezeTransaction:()=>Bfe,getHederaError:()=>Cw,ledgerIdToCAIPChainId:()=>$b,ledgerIdToEIPChainId:()=>Ufe,networkNameToCAIPChainId:()=>hat,networkNameToEIPChainId:()=>pat,networkNamespaces:()=>YU,prefixMessageToSign:()=>QU,queryToBase64String:()=>cat,setDefaultNodeAccountIds:()=>Mfe,signatureMapToBase64String:()=>nS,signerSignaturesToSignatureMap:()=>iS,stringToSignerMessage:()=>$U,transactionBodyToBase64String:()=>iat,transactionListToBase64String:()=>aat,transactionToBase64String:()=>rat,transactionToTransactionBody:()=>nat,verifyMessageSignature:()=>lat});module.exports=Dn(MFt);var Iw=(i=>(i.Mainnet="hedera:mainnet",i.Testnet="hedera:testnet",i.Previewnet="hedera:previewnet",i.Devnet="hedera:devnet",i))(Iw||{});var yJ={INVALID_PARAMS:{code:9e3,message:"INVALID_PARAMS"}};function Cw(r,e,t){let{code:n,message:i}=yJ[r];return{code:n,message:e?`${i} ${e}`:i,data:t}}var kw=(t=>(t.AccountsChanged="accountsChanged",t.ChainChanged="chainChanged",t))(kw||{});var zh=(o=>(o.GetNodeAddresses="hedera_getNodeAddresses",o.ExecuteTransaction="hedera_executeTransaction",o.SignMessage="hedera_signMessage",o.SignAndExecuteQuery="hedera_signAndExecuteQuery",o.SignAndExecuteTransaction="hedera_signAndExecuteTransaction",o.SignTransaction="hedera_signTransaction",o))(zh||{});var wl=require("buffer");var na=Ie(Yt(),1);function He(r){return Buffer.from(r).toString("hex")}function et(r){let e=r.startsWith("0x")?r.substring(2):r;return Buffer.from(e,"hex")}var jy=class extends Error{constructor(e,t,n,i,a){super(`Entity ID ${e.toString()}.${t.toString()}.${n.toString()}-${i} was incorrect.`),this.name="BadEntityIdException",this.shard=e,this.realm=t,this.num=n,this.presentChecksum=i,this.expectedChecksum=a}};var iOe=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,cR=Math.ceil,A3=Math.floor,Ts="[BigNumber Error] ",CJ=Ts+"Number primitive has more than 15 significant digits: ",Dc=1e14,_r=14,lR=9007199254740991,uR=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],K6=1e7,Ua=1e9;function kJ(r){var e,t,n,i=R.prototype={constructor:R,toString:null,valueOf:null},a=new R(1),o=20,s=4,c=-7,l=21,u=-1e7,d=1e7,h=!1,g=1,m=0,b={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},E="0123456789abcdefghijklmnopqrstuvwxyz",I=!0;function R(N,F){var O,y,x,w,p,v,A,T,S=this;if(!(S instanceof R))return new R(N,F);if(F==null){if(N&&N._isBigNumber===!0){S.s=N.s,!N.c||N.e>d?S.c=S.e=null:N.e<u?S.c=[S.e=0]:(S.e=N.e,S.c=N.c.slice());return}if((v=typeof N=="number")&&N*0==0){if(S.s=1/N<0?(N=-N,-1):1,N===~~N){for(w=0,p=N;p>=10;p/=10,w++);w>d?S.c=S.e=null:(S.e=w,S.c=[N]);return}T=String(N)}else{if(!iOe.test(T=String(N)))return n(S,T,v);S.s=T.charCodeAt(0)==45?(T=T.slice(1),-1):1}(w=T.indexOf("."))>-1&&(T=T.replace(".","")),(p=T.search(/e/i))>0?(w<0&&(w=p),w+=+T.slice(p+1),T=T.substring(0,p)):w<0&&(w=T.length)}else{if(Ni(F,2,E.length,"Base"),F==10&&I)return S=new R(N),G(S,o+S.e+1,s);if(T=String(N),v=typeof N=="number"){if(N*0!=0)return n(S,T,v,F);if(S.s=1/N<0?(T=T.slice(1),-1):1,R.DEBUG&&T.replace(/^0\.0*|\./,"").length>15)throw Error(CJ+N)}else S.s=T.charCodeAt(0)===45?(T=T.slice(1),-1):1;for(O=E.slice(0,F),w=p=0,A=T.length;p<A;p++)if(O.indexOf(y=T.charAt(p))<0){if(y=="."){if(p>w){w=A;continue}}else if(!x&&(T==T.toUpperCase()&&(T=T.toLowerCase())||T==T.toLowerCase()&&(T=T.toUpperCase()))){x=!0,p=-1,w=0;continue}return n(S,String(N),v,F)}v=!1,T=t(T,F,10,S.s),(w=T.indexOf("."))>-1?T=T.replace(".",""):w=T.length}for(p=0;T.charCodeAt(p)===48;p++);for(A=T.length;T.charCodeAt(--A)===48;);if(T=T.slice(p,++A)){if(A-=p,v&&R.DEBUG&&A>15&&(N>lR||N!==A3(N)))throw Error(CJ+S.s*N);if((w=w-p-1)>d)S.c=S.e=null;else if(w<u)S.c=[S.e=0];else{if(S.e=w,S.c=[],p=(w+1)%_r,w<0&&(p+=_r),p<A){for(p&&S.c.push(+T.slice(0,p)),A-=_r;p<A;)S.c.push(+T.slice(p,p+=_r));p=_r-(T=T.slice(p)).length}else p-=A;for(;p--;T+="0");S.c.push(+T)}}else S.c=[S.e=0]}R.clone=kJ,R.ROUND_UP=0,R.ROUND_DOWN=1,R.ROUND_CEIL=2,R.ROUND_FLOOR=3,R.ROUND_HALF_UP=4,R.ROUND_HALF_DOWN=5,R.ROUND_HALF_EVEN=6,R.ROUND_HALF_CEIL=7,R.ROUND_HALF_FLOOR=8,R.EUCLID=9,R.config=R.set=function(N){var F,O;if(N!=null)if(typeof N=="object"){if(N.hasOwnProperty(F="DECIMAL_PLACES")&&(O=N[F],Ni(O,0,Ua,F),o=O),N.hasOwnProperty(F="ROUNDING_MODE")&&(O=N[F],Ni(O,0,8,F),s=O),N.hasOwnProperty(F="EXPONENTIAL_AT")&&(O=N[F],O&&O.pop?(Ni(O[0],-Ua,0,F),Ni(O[1],0,Ua,F),c=O[0],l=O[1]):(Ni(O,-Ua,Ua,F),c=-(l=O<0?-O:O))),N.hasOwnProperty(F="RANGE"))if(O=N[F],O&&O.pop)Ni(O[0],-Ua,-1,F),Ni(O[1],1,Ua,F),u=O[0],d=O[1];else if(Ni(O,-Ua,Ua,F),O)u=-(d=O<0?-O:O);else throw Error(Ts+F+" cannot be zero: "+O);if(N.hasOwnProperty(F="CRYPTO"))if(O=N[F],O===!!O)if(O)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))h=O;else throw h=!O,Error(Ts+"crypto unavailable");else h=O;else throw Error(Ts+F+" not true or false: "+O);if(N.hasOwnProperty(F="MODULO_MODE")&&(O=N[F],Ni(O,0,9,F),g=O),N.hasOwnProperty(F="POW_PRECISION")&&(O=N[F],Ni(O,0,Ua,F),m=O),N.hasOwnProperty(F="FORMAT"))if(O=N[F],typeof O=="object")b=O;else throw Error(Ts+F+" not an object: "+O);if(N.hasOwnProperty(F="ALPHABET"))if(O=N[F],typeof O=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(O))I=O.slice(0,10)=="0123456789",E=O;else throw Error(Ts+F+" invalid: "+O)}else throw Error(Ts+"Object expected: "+N);return{DECIMAL_PLACES:o,ROUNDING_MODE:s,EXPONENTIAL_AT:[c,l],RANGE:[u,d],CRYPTO:h,MODULO_MODE:g,POW_PRECISION:m,FORMAT:b,ALPHABET:E}},R.isBigNumber=function(N){if(!N||N._isBigNumber!==!0)return!1;if(!R.DEBUG)return!0;var F,O,y=N.c,x=N.e,w=N.s;e:if({}.toString.call(y)=="[object Array]"){if((w===1||w===-1)&&x>=-Ua&&x<=Ua&&x===A3(x)){if(y[0]===0){if(x===0&&y.length===1)return!0;break e}if(F=(x+1)%_r,F<1&&(F+=_r),String(y[0]).length==F){for(F=0;F<y.length;F++)if(O=y[F],O<0||O>=Dc||O!==A3(O))break e;if(O!==0)return!0}}}else if(y===null&&x===null&&(w===null||w===1||w===-1))return!0;throw Error(Ts+"Invalid BigNumber: "+N)},R.maximum=R.max=function(){return U(arguments,-1)},R.minimum=R.min=function(){return U(arguments,1)},R.random=function(){var N=9007199254740992,F=Math.random()*N&2097151?function(){return A3(Math.random()*N)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(O){var y,x,w,p,v,A=0,T=[],S=new R(a);if(O==null?O=o:Ni(O,0,Ua),p=cR(O/_r),h)if(crypto.getRandomValues){for(y=crypto.getRandomValues(new Uint32Array(p*=2));A<p;)v=y[A]*131072+(y[A+1]>>>11),v>=9e15?(x=crypto.getRandomValues(new Uint32Array(2)),y[A]=x[0],y[A+1]=x[1]):(T.push(v%1e14),A+=2);A=p/2}else if(crypto.randomBytes){for(y=crypto.randomBytes(p*=7);A<p;)v=(y[A]&31)*281474976710656+y[A+1]*1099511627776+y[A+2]*4294967296+y[A+3]*16777216+(y[A+4]<<16)+(y[A+5]<<8)+y[A+6],v>=9e15?crypto.randomBytes(7).copy(y,A):(T.push(v%1e14),A+=7);A=p/7}else throw h=!1,Error(Ts+"crypto unavailable");if(!h)for(;A<p;)v=F(),v<9e15&&(T[A++]=v%1e14);for(p=T[--A],O%=_r,p&&O&&(v=uR[_r-O],T[A]=A3(p/v)*v);T[A]===0;T.pop(),A--);if(A<0)T=[w=0];else{for(w=-1;T[0]===0;T.splice(0,1),w-=_r);for(A=1,v=T[0];v>=10;v/=10,A++);A<_r&&(w-=_r-A)}return S.e=w,S.c=T,S}}(),R.sum=function(){for(var N=1,F=arguments,O=new R(F[0]);N<F.length;)O=O.plus(F[N++]);return O},t=function(){var N="0123456789";function F(O,y,x,w){for(var p,v=[0],A,T=0,S=O.length;T<S;){for(A=v.length;A--;v[A]*=y);for(v[0]+=w.indexOf(O.charAt(T++)),p=0;p<v.length;p++)v[p]>x-1&&(v[p+1]==null&&(v[p+1]=0),v[p+1]+=v[p]/x|0,v[p]%=x)}return v.reverse()}return function(O,y,x,w,p){var v,A,T,S,_,B,q,k,z=O.indexOf("."),ie=o,M=s;for(z>=0&&(S=m,m=0,O=O.replace(".",""),k=new R(y),B=k.pow(O.length-z),m=S,k.c=F(xd(x3(B.c),B.e,"0"),10,x,N),k.e=k.c.length),q=F(O,y,x,p?(v=E,N):(v=N,E)),T=S=q.length;q[--S]==0;q.pop());if(!q[0])return v.charAt(0);if(z<0?--T:(B.c=q,B.e=T,B.s=w,B=e(B,k,ie,M,x),q=B.c,_=B.r,T=B.e),A=T+ie+1,z=q[A],S=x/2,_=_||A<0||q[A+1]!=null,_=M<4?(z!=null||_)&&(M==0||M==(B.s<0?3:2)):z>S||z==S&&(M==4||_||M==6&&q[A-1]&1||M==(B.s<0?8:7)),A<1||!q[0])O=_?xd(v.charAt(1),-ie,v.charAt(0)):v.charAt(0);else{if(q.length=A,_)for(--x;++q[--A]>x;)q[A]=0,A||(++T,q=[1].concat(q));for(S=q.length;!q[--S];);for(z=0,O="";z<=S;O+=v.charAt(q[z++]));O=xd(O,T,v.charAt(0))}return O}}(),e=function(){function N(y,x,w){var p,v,A,T,S=0,_=y.length,B=x%K6,q=x/K6|0;for(y=y.slice();_--;)A=y[_]%K6,T=y[_]/K6|0,p=q*A+T*B,v=B*A+p%K6*K6+S,S=(v/w|0)+(p/K6|0)+q*T,y[_]=v%w;return S&&(y=[S].concat(y)),y}function F(y,x,w,p){var v,A;if(w!=p)A=w>p?1:-1;else for(v=A=0;v<w;v++)if(y[v]!=x[v]){A=y[v]>x[v]?1:-1;break}return A}function O(y,x,w,p){for(var v=0;w--;)y[w]-=v,v=y[w]<x[w]?1:0,y[w]=v*p+y[w]-x[w];for(;!y[0]&&y.length>1;y.splice(0,1));}return function(y,x,w,p,v){var A,T,S,_,B,q,k,z,ie,M,te,oe,se,re,le,ae,ue,_e=y.s==x.s?1:-1,he=y.c,be=x.c;if(!he||!he[0]||!be||!be[0])return new R(!y.s||!x.s||(he?be&&he[0]==be[0]:!be)?NaN:he&&he[0]==0||!be?_e*0:_e/0);for(z=new R(_e),ie=z.c=[],T=y.e-x.e,_e=w+T+1,v||(v=Dc,T=T3(y.e/_r)-T3(x.e/_r),_e=_e/_r|0),S=0;be[S]==(he[S]||0);S++);if(be[S]>(he[S]||0)&&T--,_e<0)ie.push(1),_=!0;else{for(re=he.length,ae=be.length,S=0,_e+=2,B=A3(v/(be[0]+1)),B>1&&(be=N(be,B,v),he=N(he,B,v),ae=be.length,re=he.length),se=ae,M=he.slice(0,ae),te=M.length;te<ae;M[te++]=0);ue=be.slice(),ue=[0].concat(ue),le=be[0],be[1]>=v/2&&le++;do{if(B=0,A=F(be,M,ae,te),A<0){if(oe=M[0],ae!=te&&(oe=oe*v+(M[1]||0)),B=A3(oe/le),B>1)for(B>=v&&(B=v-1),q=N(be,B,v),k=q.length,te=M.length;F(q,M,k,te)==1;)B--,O(q,ae<k?ue:be,k,v),k=q.length,A=1;else B==0&&(A=B=1),q=be.slice(),k=q.length;if(k<te&&(q=[0].concat(q)),O(M,q,te,v),te=M.length,A==-1)for(;F(be,M,ae,te)<1;)B++,O(M,ae<te?ue:be,te,v),te=M.length}else A===0&&(B++,M=[0]);ie[S++]=B,M[0]?M[te++]=he[se]||0:(M=[he[se]],te=1)}while((se++<re||M[0]!=null)&&_e--);_=M[0]!=null,ie[0]||ie.splice(0,1)}if(v==Dc){for(S=1,_e=ie[0];_e>=10;_e/=10,S++);G(z,w+(z.e=S+T*_r-1)+1,p,_)}else z.e=T,z.r=+_;return z}}();function L(N,F,O,y){var x,w,p,v,A;if(O==null?O=s:Ni(O,0,8),!N.c)return N.toString();if(x=N.c[0],p=N.e,F==null)A=x3(N.c),A=y==1||y==2&&(p<=c||p>=l)?Ow(A,p):xd(A,p,"0");else if(N=G(new R(N),F,O),w=N.e,A=x3(N.c),v=A.length,y==1||y==2&&(F<=w||w<=c)){for(;v<F;A+="0",v++);A=Ow(A,w)}else if(F-=p,A=xd(A,w,"0"),w+1>v){if(--F>0)for(A+=".";F--;A+="0");}else if(F+=w-v,F>0)for(w+1==v&&(A+=".");F--;A+="0");return N.s<0&&x?"-"+A:A}function U(N,F){for(var O,y,x=1,w=new R(N[0]);x<N.length;x++)y=new R(N[x]),(!y.s||(O=m0(w,y))===F||O===0&&w.s===F)&&(w=y);return w}function V(N,F,O){for(var y=1,x=F.length;!F[--x];F.pop());for(x=F[0];x>=10;x/=10,y++);return(O=y+O*_r-1)>d?N.c=N.e=null:O<u?N.c=[N.e=0]:(N.e=O,N.c=F),N}n=function(){var N=/^(-?)0([xbo])(?=\w[\w.]*$)/i,F=/^([^.]+)\.$/,O=/^\.([^.]+)$/,y=/^-?(Infinity|NaN)$/,x=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(w,p,v,A){var T,S=v?p:p.replace(x,"");if(y.test(S))w.s=isNaN(S)?null:S<0?-1:1;else{if(!v&&(S=S.replace(N,function(_,B,q){return T=(q=q.toLowerCase())=="x"?16:q=="b"?2:8,!A||A==T?B:_}),A&&(T=A,S=S.replace(F,"$1").replace(O,"0.$1")),p!=S))return new R(S,T);if(R.DEBUG)throw Error(Ts+"Not a"+(A?" base "+A:"")+" number: "+p);w.s=null}w.c=w.e=null}}();function G(N,F,O,y){var x,w,p,v,A,T,S,_=N.c,B=uR;if(_){e:{for(x=1,v=_[0];v>=10;v/=10,x++);if(w=F-x,w<0)w+=_r,p=F,A=_[T=0],S=A3(A/B[x-p-1]%10);else if(T=cR((w+1)/_r),T>=_.length)if(y){for(;_.length<=T;_.push(0));A=S=0,x=1,w%=_r,p=w-_r+1}else break e;else{for(A=v=_[T],x=1;v>=10;v/=10,x++);w%=_r,p=w-_r+x,S=p<0?0:A3(A/B[x-p-1]%10)}if(y=y||F<0||_[T+1]!=null||(p<0?A:A%B[x-p-1]),y=O<4?(S||y)&&(O==0||O==(N.s<0?3:2)):S>5||S==5&&(O==4||y||O==6&&(w>0?p>0?A/B[x-p]:0:_[T-1])%10&1||O==(N.s<0?8:7)),F<1||!_[0])return _.length=0,y?(F-=N.e+1,_[0]=B[(_r-F%_r)%_r],N.e=-F||0):_[0]=N.e=0,N;if(w==0?(_.length=T,v=1,T--):(_.length=T+1,v=B[_r-w],_[T]=p>0?A3(A/B[x-p]%B[p])*v:0),y)for(;;)if(T==0){for(w=1,p=_[0];p>=10;p/=10,w++);for(p=_[0]+=v,v=1;p>=10;p/=10,v++);w!=v&&(N.e++,_[0]==Dc&&(_[0]=1));break}else{if(_[T]+=v,_[T]!=Dc)break;_[T--]=0,v=1}for(w=_.length;_[--w]===0;_.pop());}N.e>d?N.c=N.e=null:N.e<u&&(N.c=[N.e=0])}return N}function H(N){var F,O=N.e;return O===null?N.toString():(F=x3(N.c),F=O<=c||O>=l?Ow(F,O):xd(F,O,"0"),N.s<0?"-"+F:F)}return i.absoluteValue=i.abs=function(){var N=new R(this);return N.s<0&&(N.s=1),N},i.comparedTo=function(N,F){return m0(this,new R(N,F))},i.decimalPlaces=i.dp=function(N,F){var O,y,x,w=this;if(N!=null)return Ni(N,0,Ua),F==null?F=s:Ni(F,0,8),G(new R(w),N+w.e+1,F);if(!(O=w.c))return null;if(y=((x=O.length-1)-T3(this.e/_r))*_r,x=O[x])for(;x%10==0;x/=10,y--);return y<0&&(y=0),y},i.dividedBy=i.div=function(N,F){return e(this,new R(N,F),o,s)},i.dividedToIntegerBy=i.idiv=function(N,F){return e(this,new R(N,F),0,1)},i.exponentiatedBy=i.pow=function(N,F){var O,y,x,w,p,v,A,T,S,_=this;if(N=new R(N),N.c&&!N.isInteger())throw Error(Ts+"Exponent not an integer: "+H(N));if(F!=null&&(F=new R(F)),v=N.e>14,!_.c||!_.c[0]||_.c[0]==1&&!_.e&&_.c.length==1||!N.c||!N.c[0])return S=new R(Math.pow(+H(_),v?N.s*(2-Rw(N)):+H(N))),F?S.mod(F):S;if(A=N.s<0,F){if(F.c?!F.c[0]:!F.s)return new R(NaN);y=!A&&_.isInteger()&&F.isInteger(),y&&(_=_.mod(F))}else{if(N.e>9&&(_.e>0||_.e<-1||(_.e==0?_.c[0]>1||v&&_.c[1]>=24e7:_.c[0]<8e13||v&&_.c[0]<=9999975e7)))return w=_.s<0&&Rw(N)?-0:0,_.e>-1&&(w=1/w),new R(A?1/w:w);m&&(w=cR(m/_r+2))}for(v?(O=new R(.5),A&&(N.s=1),T=Rw(N)):(x=Math.abs(+H(N)),T=x%2),S=new R(a);;){if(T){if(S=S.times(_),!S.c)break;w?S.c.length>w&&(S.c.length=w):y&&(S=S.mod(F))}if(x){if(x=A3(x/2),x===0)break;T=x%2}else if(N=N.times(O),G(N,N.e+1,1),N.e>14)T=Rw(N);else{if(x=+H(N),x===0)break;T=x%2}_=_.times(_),w?_.c&&_.c.length>w&&(_.c.length=w):y&&(_=_.mod(F))}return y?S:(A&&(S=a.div(S)),F?S.mod(F):w?G(S,m,s,p):S)},i.integerValue=function(N){var F=new R(this);return N==null?N=s:Ni(N,0,8),G(F,F.e+1,N)},i.isEqualTo=i.eq=function(N,F){return m0(this,new R(N,F))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(N,F){return m0(this,new R(N,F))>0},i.isGreaterThanOrEqualTo=i.gte=function(N,F){return(F=m0(this,new R(N,F)))===1||F===0},i.isInteger=function(){return!!this.c&&T3(this.e/_r)>this.c.length-2},i.isLessThan=i.lt=function(N,F){return m0(this,new R(N,F))<0},i.isLessThanOrEqualTo=i.lte=function(N,F){return(F=m0(this,new R(N,F)))===-1||F===0},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&this.c[0]==0},i.minus=function(N,F){var O,y,x,w,p=this,v=p.s;if(N=new R(N,F),F=N.s,!v||!F)return new R(NaN);if(v!=F)return N.s=-F,p.plus(N);var A=p.e/_r,T=N.e/_r,S=p.c,_=N.c;if(!A||!T){if(!S||!_)return S?(N.s=-F,N):new R(_?p:NaN);if(!S[0]||!_[0])return _[0]?(N.s=-F,N):new R(S[0]?p:s==3?-0:0)}if(A=T3(A),T=T3(T),S=S.slice(),v=A-T){for((w=v<0)?(v=-v,x=S):(T=A,x=_),x.reverse(),F=v;F--;x.push(0));x.reverse()}else for(y=(w=(v=S.length)<(F=_.length))?v:F,v=F=0;F<y;F++)if(S[F]!=_[F]){w=S[F]<_[F];break}if(w&&(x=S,S=_,_=x,N.s=-N.s),F=(y=_.length)-(O=S.length),F>0)for(;F--;S[O++]=0);for(F=Dc-1;y>v;){if(S[--y]<_[y]){for(O=y;O&&!S[--O];S[O]=F);--S[O],S[y]+=Dc}S[y]-=_[y]}for(;S[0]==0;S.splice(0,1),--T);return S[0]?V(N,S,T):(N.s=s==3?-1:1,N.c=[N.e=0],N)},i.modulo=i.mod=function(N,F){var O,y,x=this;return N=new R(N,F),!x.c||!N.s||N.c&&!N.c[0]?new R(NaN):!N.c||x.c&&!x.c[0]?new R(x):(g==9?(y=N.s,N.s=1,O=e(x,N,0,3),N.s=y,O.s*=y):O=e(x,N,0,g),N=x.minus(O.times(N)),!N.c[0]&&g==1&&(N.s=x.s),N)},i.multipliedBy=i.times=function(N,F){var O,y,x,w,p,v,A,T,S,_,B,q,k,z,ie,M=this,te=M.c,oe=(N=new R(N,F)).c;if(!te||!oe||!te[0]||!oe[0])return!M.s||!N.s||te&&!te[0]&&!oe||oe&&!oe[0]&&!te?N.c=N.e=N.s=null:(N.s*=M.s,!te||!oe?N.c=N.e=null:(N.c=[0],N.e=0)),N;for(y=T3(M.e/_r)+T3(N.e/_r),N.s*=M.s,A=te.length,_=oe.length,A<_&&(k=te,te=oe,oe=k,x=A,A=_,_=x),x=A+_,k=[];x--;k.push(0));for(z=Dc,ie=K6,x=_;--x>=0;){for(O=0,B=oe[x]%ie,q=oe[x]/ie|0,p=A,w=x+p;w>x;)T=te[--p]%ie,S=te[p]/ie|0,v=q*T+S*B,T=B*T+v%ie*ie+k[w]+O,O=(T/z|0)+(v/ie|0)+q*S,k[w--]=T%z;k[w]=O}return O?++y:k.splice(0,1),V(N,k,y)},i.negated=function(){var N=new R(this);return N.s=-N.s||null,N},i.plus=function(N,F){var O,y=this,x=y.s;if(N=new R(N,F),F=N.s,!x||!F)return new R(NaN);if(x!=F)return N.s=-F,y.minus(N);var w=y.e/_r,p=N.e/_r,v=y.c,A=N.c;if(!w||!p){if(!v||!A)return new R(x/0);if(!v[0]||!A[0])return A[0]?N:new R(v[0]?y:x*0)}if(w=T3(w),p=T3(p),v=v.slice(),x=w-p){for(x>0?(p=w,O=A):(x=-x,O=v),O.reverse();x--;O.push(0));O.reverse()}for(x=v.length,F=A.length,x-F<0&&(O=A,A=v,v=O,F=x),x=0;F;)x=(v[--F]=v[F]+A[F]+x)/Dc|0,v[F]=Dc===v[F]?0:v[F]%Dc;return x&&(v=[x].concat(v),++p),V(N,v,p)},i.precision=i.sd=function(N,F){var O,y,x,w=this;if(N!=null&&N!==!!N)return Ni(N,1,Ua),F==null?F=s:Ni(F,0,8),G(new R(w),N,F);if(!(O=w.c))return null;if(x=O.length-1,y=x*_r+1,x=O[x]){for(;x%10==0;x/=10,y--);for(x=O[0];x>=10;x/=10,y++);}return N&&w.e+1>y&&(y=w.e+1),y},i.shiftedBy=function(N){return Ni(N,-lR,lR),this.times("1e"+N)},i.squareRoot=i.sqrt=function(){var N,F,O,y,x,w=this,p=w.c,v=w.s,A=w.e,T=o+4,S=new R("0.5");if(v!==1||!p||!p[0])return new R(!v||v<0&&(!p||p[0])?NaN:p?w:1/0);if(v=Math.sqrt(+H(w)),v==0||v==1/0?(F=x3(p),(F.length+A)%2==0&&(F+="0"),v=Math.sqrt(+F),A=T3((A+1)/2)-(A<0||A%2),v==1/0?F="5e"+A:(F=v.toExponential(),F=F.slice(0,F.indexOf("e")+1)+A),O=new R(F)):O=new R(v+""),O.c[0]){for(A=O.e,v=A+T,v<3&&(v=0);;)if(x=O,O=S.times(x.plus(e(w,x,T,1))),x3(x.c).slice(0,v)===(F=x3(O.c)).slice(0,v))if(O.e<A&&--v,F=F.slice(v-3,v+1),F=="9999"||!y&&F=="4999"){if(!y&&(G(x,x.e+o+2,0),x.times(x).eq(w))){O=x;break}T+=4,v+=4,y=1}else{(!+F||!+F.slice(1)&&F.charAt(0)=="5")&&(G(O,O.e+o+2,1),N=!O.times(O).eq(w));break}}return G(O,O.e+o+1,s,N)},i.toExponential=function(N,F){return N!=null&&(Ni(N,0,Ua),N++),L(this,N,F,1)},i.toFixed=function(N,F){return N!=null&&(Ni(N,0,Ua),N=N+this.e+1),L(this,N,F)},i.toFormat=function(N,F,O){var y,x=this;if(O==null)N!=null&&F&&typeof F=="object"?(O=F,F=null):N&&typeof N=="object"?(O=N,N=F=null):O=b;else if(typeof O!="object")throw Error(Ts+"Argument not an object: "+O);if(y=x.toFixed(N,F),x.c){var w,p=y.split("."),v=+O.groupSize,A=+O.secondaryGroupSize,T=O.groupSeparator||"",S=p[0],_=p[1],B=x.s<0,q=B?S.slice(1):S,k=q.length;if(A&&(w=v,v=A,A=w,k-=w),v>0&&k>0){for(w=k%v||v,S=q.substr(0,w);w<k;w+=v)S+=T+q.substr(w,v);A>0&&(S+=T+q.slice(w)),B&&(S="-"+S)}y=_?S+(O.decimalSeparator||"")+((A=+O.fractionGroupSize)?_.replace(new RegExp("\\d{"+A+"}\\B","g"),"$&"+(O.fractionGroupSeparator||"")):_):S}return(O.prefix||"")+y+(O.suffix||"")},i.toFraction=function(N){var F,O,y,x,w,p,v,A,T,S,_,B,q=this,k=q.c;if(N!=null&&(v=new R(N),!v.isInteger()&&(v.c||v.s!==1)||v.lt(a)))throw Error(Ts+"Argument "+(v.isInteger()?"out of range: ":"not an integer: ")+H(v));if(!k)return new R(q);for(F=new R(a),T=O=new R(a),y=A=new R(a),B=x3(k),w=F.e=B.length-q.e-1,F.c[0]=uR[(p=w%_r)<0?_r+p:p],N=!N||v.comparedTo(F)>0?w>0?F:T:v,p=d,d=1/0,v=new R(B),A.c[0]=0;S=e(v,F,0,1),x=O.plus(S.times(y)),x.comparedTo(N)!=1;)O=y,y=x,T=A.plus(S.times(x=T)),A=x,F=v.minus(S.times(x=F)),v=x;return x=e(N.minus(O),y,0,1),A=A.plus(x.times(T)),O=O.plus(x.times(y)),A.s=T.s=q.s,w=w*2,_=e(T,y,w,s).minus(q).abs().comparedTo(e(A,O,w,s).minus(q).abs())<1?[T,y]:[A,O],d=p,_},i.toNumber=function(){return+H(this)},i.toPrecision=function(N,F){return N!=null&&Ni(N,1,Ua),L(this,N,F,2)},i.toString=function(N){var F,O=this,y=O.s,x=O.e;return x===null?y?(F="Infinity",y<0&&(F="-"+F)):F="NaN":(N==null?F=x<=c||x>=l?Ow(x3(O.c),x):xd(x3(O.c),x,"0"):N===10&&I?(O=G(new R(O),o+x+1,s),F=xd(x3(O.c),O.e,"0")):(Ni(N,2,E.length,"Base"),F=t(xd(x3(O.c),x,"0"),10,N,y,!0)),y<0&&O.c[0]&&(F="-"+F)),F},i.valueOf=i.toJSON=function(){return H(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,r!=null&&R.set(r),R}function T3(r){var e=r|0;return r>0||r===e?e:e-1}function x3(r){for(var e,t,n=1,i=r.length,a=r[0]+"";n<i;){for(e=r[n++]+"",t=_r-e.length;t--;e="0"+e);a+=e}for(i=a.length;a.charCodeAt(--i)===48;);return a.slice(0,i+1||1)}function m0(r,e){var t,n,i=r.c,a=e.c,o=r.s,s=e.s,c=r.e,l=e.e;if(!o||!s)return null;if(t=i&&!i[0],n=a&&!a[0],t||n)return t?n?0:-s:o;if(o!=s)return o;if(t=o<0,n=c==l,!i||!a)return n?0:!i^t?1:-1;if(!n)return c>l^t?1:-1;for(s=(c=i.length)<(l=a.length)?c:l,o=0;o<s;o++)if(i[o]!=a[o])return i[o]>a[o]^t?1:-1;return c==l?0:c>l^t?1:-1}function Ni(r,e,t,n){if(r<e||r>t||r!==A3(r))throw Error(Ts+(n||"Argument")+(typeof r=="number"?r<e||r>t?" out of range: ":" not an integer: ":" not a primitive number: ")+String(r))}function Rw(r){var e=r.c.length-1;return T3(r.e/_r)==e&&r.c[e]%2!=0}function Ow(r,e){return(r.length>1?r.charAt(0)+"."+r.slice(1):r)+(e<0?"e":"e+")+e}function xd(r,e,t){var n,i;if(e<0){for(i=t+".";++e;i+=t);r=i+r}else if(n=r.length,++e>n){for(i=t,e-=n;--e;i+=t);r+=i}else e<n&&(r=r.slice(0,e)+"."+r.slice(e));return r}var aOe=kJ(),Qe=aOe;var NJ=Ie(Yt(),1),oOe="This value cannot be null | undefined.";var sOe="This value must be a string or Uint8Array.";var cOe="The provided variable must be an Array.";var lOe="This value must be a String, Number, or BigNumber to be converted.",uOe="This value must be a String, Number, or BigNumber to be converted.",dOe="Unable to parse given variable. Returns NaN.";function g0(r){return r!=null}function fOe(r){return g0(r)&&r instanceof Uint8Array}function Dw(r){return g0(r)&&(typeof r=="number"||r instanceof Number)}function RJ(r){return g0(r)&&r instanceof Qe}function OJ(r){return g0(r)&&r instanceof NJ.default}function dR(r){return g0(r)&&typeof r=="string"}function pOe(r){return g0(r)&&(dR(r)||fOe(r))}function Qh(r){for(let e=0;e<12;e++)if(r[e]!=0)return!1;return!0}function fR(r){if(g0(r))return r;throw new Error(oOe)}function DJ(r){if(pOe(fR(r)))return r;throw new Error(sOe)}function yt(r){if(fR(r),RJ(r)||dR(r)||Dw(r)||OJ(r))return new Qe(r);throw new Error(lOe)}function bt(r){if(r instanceof Array)return r.map(yt);throw new Error(cOe)}function Pw(r){if(fR(r),RJ(r)||dR(r)||Dw(r)||OJ(r)){let e=parseInt(r);if(isNaN(e))throw new Error(dOe);return e}else throw new Error(uOe)}function lo(r,e=0,t=r.byteLength){if(!(Number.isInteger(e)&&e>=0))throw new Error("Invalid offset!");if(!(Number.isInteger(t)&&t>=0))throw new Error("Invalid length!");return new DataView(r.buffer,r.byteOffset+e,Math.min(t,r.byteLength-e))}function pR(r,e,t=new Set){if(typeof r=="object"&&typeof e=="object"){let n=Object.keys(r),i=Object.keys(e);if(n.length!==i.length)return!1;for(let a=0;a<n.length;a++){if(n[a]!==i[a])return!1;if(!t.has(n[a])&&!pR(r[n[a]],e[i[a]],t))return!1}return!0}else return typeof r=="number"&&typeof e=="number"||typeof r=="string"&&typeof e=="string"||typeof r=="boolean"&&typeof e=="boolean"?r===e:!1}function Bw(r){for(var e=r.length,t,n;e!==0;)n=Math.floor(Math.random()*e),e-=1,t=r[e],r[e]=r[n],r[n]=t}function PJ(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;let t=new DataView(r.buffer,r.byteOffset,r.byteLength),n=new DataView(e.buffer,e.byteOffset,e.byteLength),i=r.byteLength;for(;i--;)if(t.getUint8(i)!==n.getUint8(i))return!1;return!0}var UUe=Ie(vr(),1);var Ys=class{};var In=class extends Error{constructor(e){super(e instanceof Error?e.message:e),this.name="BadKeyError",e instanceof Error&&(this.cause=e,this.stack=e.stack)}};var Wee=Ie(zy(),1);function Jh(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;let t=new DataView(r.buffer,r.byteOffset,r.byteLength),n=new DataView(e.buffer,e.byteOffset,e.byteLength),i=r.byteLength;for(;i--;)if(t.getUint8(i)!==n.getUint8(i))return!1;return!0}function NZ(r,e){if(r.byteLength<e.byteLength)return!1;let t=e.byteLength;for(;t--;)if(r[t]!==e[t])return!1;return!0}function Ia(r){return Buffer.from(r).toString("hex")}function ur(r){let e=r.startsWith("0x")?r.substring(2):r;return Buffer.from(e,"hex")}function RZ(r,e){let t="0123456789abcdef",n="0x";for(let i=0;i<r.length;i++){let a=r[i];n+=t[(a&240)>>4]+t[a&15]}for(n.length>2*e+2&&console.log("result out of range","result");n.length<2*e+2;)n="0x0"+n.substring(2);return n.substring(2)}var E_=Ie(__(),1),gMe="302a300506032b6570032100",BO=ur(gMe),jc=class r extends Ys{constructor(e){super(),this._keyData=e}get _type(){return"ED25519"}static fromBytes(e){switch(e.length){case 32:return r.fromBytesRaw(e);case 44:return r.fromBytesDer(e);default:throw new In(`invalid public key length: ${e.length} bytes`)}}static fromBytesDer(e){let t=E_.default.asn1.fromDer(new E_.default.util.ByteStringBuffer(e)),n;try{n=E_.default.pki.ed25519.publicKeyFromAsn1(t)}catch(i){let a=i!=null&&i.message!=null?i.message:"";throw new In(`cannot decode ED25519 public key data from DER format: ${a}`)}return new r(n)}static fromBytesRaw(e){if(e.length!=32)throw new In(`invalid public key length: ${e.length} bytes`);return new r(e)}static fromString(e){return r.fromBytes(ur(e))}verify(e,t){return Wee.default.sign.detached.verify(e,t,this._keyData)}toBytesDer(){let e=new Uint8Array(BO.length+32);return e.set(BO,0),e.set(this._keyData.subarray(0,32),BO.length),e}toBytesRaw(){return this._keyData.slice()}equals(e){return Jh(this._keyData,e._keyData)}};var hf=Ie(zy(),1);var MO=Ie(zy(),1);function Qee(r){return MO.default.randomBytes(r)}function C0(r){return Promise.resolve(MO.default.randomBytes(r))}var x_=Ie(require("crypto"),1);function $ee(r){return Buffer.from(r).toString("utf8")}function of(r){return Buffer.from(r,"utf8")}var Jn={Sha256:"SHA-256",Sha384:"SHA-384",Sha512:"SHA-512"};function Vc(r,e,t){let n=typeof e=="string"?of(e):e,i=typeof t=="string"?of(t):t;switch(r){case Jn.Sha256:return Promise.resolve(x_.default.createHmac("SHA256",n).update(i).digest());case Jn.Sha384:return Promise.resolve(x_.default.createHmac("SHA384",n).update(i).digest());case Jn.Sha512:return Promise.resolve(x_.default.createHmac("SHA512",n).update(i).digest());default:throw new Error("(BUG) Non-Exhaustive switch statement for algorithms")}}var Are=Ie(p5(),1),Tre=Ie(hD(),1),mD=new Are.default.ec("secp256k1"),hFe=new Tre.default("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),Sre=2147483648;async function A2(r,e,t){let n=gD(t),i=new Uint8Array(37),a=ur(mD.keyFromPrivate(r).getPublic(!0,"hex"));n?(i[0]=0,i.set(r,1)):i.set(a,0),new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(33,t,!1);let o=await Vc(Jn.Sha512,e,i),s=o.subarray(0,32),c=o.subarray(32);try{let l=mD.keyFromPrivate(r).getPrivate().add(mD.keyFromPrivate(s).getPrivate()).mod(hFe),u=RZ(l.toBuffer(),32);return l.eqn(0)?A2(r,e,t+1):{keyData:ur(u),chainCode:c}}catch{return A2(r,e,t+1)}}async function Ire(r){if(r.length<16)throw new TypeError("Seed should be at least 128 bits");if(r.length>64)throw new TypeError("Seed should be at most 512 bits");let e=await Vc(Jn.Sha512,"Bitcoin seed",r),t=e.subarray(0,32),n=e.subarray(32);return{keyData:t,chainCode:n}}function q_(r){return r|Sre}function gD(r){return(r&Sre)!==0}async function V_(r,e,t){if(gD(t))throw new Error("the index should not be pre-hardened");let n=new Uint8Array(37);n[0]=0,n.set(r,1),new DataView(n.buffer,n.byteOffset,n.byteLength).setUint32(33,t,!1),n[33]|=128;let i=await Vc(Jn.Sha512,e,n);return{keyData:i.subarray(0,32),chainCode:i.subarray(32)}}async function Cre(r){let e=await Vc(Jn.Sha512,"ed25519 seed",r);return{keyData:e.subarray(0,32),chainCode:e.subarray(32)}}var H_=Ie(__(),1),mFe="302e020100300506032b657004220420",vD=ur(mFe),Qa=class r{constructor(e,t){this._keyPair=e instanceof Uint8Array?hf.default.sign.keyPair.fromSeed(e):e,this._chainCode=t??null}get _type(){return"ED25519"}static generate(){let e=Qee(64);return new r(hf.default.sign.keyPair.fromSeed(e.subarray(0,32)),e.subarray(32))}static async generateAsync(){let e=await C0(64);return new r(hf.default.sign.keyPair.fromSeed(e.subarray(0,32)),e.subarray(32))}static fromBytes(e){switch(e.length){case 48:return r.fromBytesDer(e);case 32:case 64:return r.fromBytesRaw(e);default:throw new In(`invalid private key length: ${e.length} bytes`)}}static fromBytesDer(e){let t=H_.default.asn1.fromDer(new H_.default.util.ByteStringBuffer(e)),n;try{n=H_.default.pki.ed25519.privateKeyFromAsn1(t).privateKeyBytes}catch(a){let o=a!=null&&a.message!=null?a.message:"";throw new In(`cannot decode ED25519 private key data from DER format: ${o}`)}let i=hf.default.sign.keyPair.fromSeed(n);return new r(i)}static fromBytesRaw(e){switch(e.length){case 32:return new r(hf.default.sign.keyPair.fromSeed(e));case 64:return new r(hf.default.sign.keyPair.fromSecretKey(e));default:}throw new In(`invalid private key length: ${e.length} bytes`)}static fromString(e){return r.fromBytes(ur(e))}static fromStringDer(e){return r.fromBytesDer(ur(e))}static fromStringRaw(e){return r.fromBytesRaw(ur(e))}static async fromSeed(e){let{keyData:t,chainCode:n}=await Cre(e);return new r(t,n)}get publicKey(){return new jc(this._keyPair.publicKey)}sign(e){return hf.default.sign.detached(e,this._keyPair.secretKey)}toBytesDer(){let e=new Uint8Array(vD.length+32);return e.set(vD,0),e.set(this._keyPair.secretKey.subarray(0,32),vD.length),e}toBytesRaw(){return this._keyPair.secretKey.slice(0,32)}};var mf="0123456789abcdef".split(""),gFe=[1,256,65536,16777216],Wc=[0,8,16,24],kre=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],yFe=r=>({blocks:[],reset:!0,block:0,start:0,blockCount:1600-(r<<1)>>5,outputBlocks:r>>5,s:(e=>[].concat(e,e,e,e,e))([0,0,0,0,0,0,0,0,0,0])}),vFe=(r,e)=>{for(var t=e.length,n=r.blocks,i=r.blockCount<<2,a=r.blockCount,o=r.outputBlocks,s=r.s,c=0,l,u;c<t;){if(r.reset)for(r.reset=!1,n[0]=r.block,l=1;l<a+1;++l)n[l]=0;if(typeof e!="string")for(l=r.start;c<t&&l<i;++c)n[l>>2]|=e[c]<<Wc[l++&3];else for(l=r.start;c<t&&l<i;++c)u=e.charCodeAt(c),u<128?n[l>>2]|=u<<Wc[l++&3]:u<2048?(n[l>>2]|=(192|u>>6)<<Wc[l++&3],n[l>>2]|=(128|u&63)<<Wc[l++&3]):u<55296||u>=57344?(n[l>>2]|=(224|u>>12)<<Wc[l++&3],n[l>>2]|=(128|u>>6&63)<<Wc[l++&3],n[l>>2]|=(128|u&63)<<Wc[l++&3]):(u=65536+((u&1023)<<10|e.charCodeAt(++c)&1023),n[l>>2]|=(240|u>>18)<<Wc[l++&3],n[l>>2]|=(128|u>>12&63)<<Wc[l++&3],n[l>>2]|=(128|u>>6&63)<<Wc[l++&3],n[l>>2]|=(128|u&63)<<Wc[l++&3]);if(r.lastByteIndex=l,l>=i){for(r.start=l-i,r.block=n[a],l=0;l<a;++l)s[l]^=n[l];bD(s),r.reset=!0}else r.start=l}if(l=r.lastByteIndex,n[l>>2]|=gFe[l&3],r.lastByteIndex===i)for(n[0]=n[a],l=1;l<a+1;++l)n[l]=0;for(n[a-1]|=2147483648,l=0;l<a;++l)s[l]^=n[l];bD(s);var d="",h,g=0;for(l=0;g<o;){for(l=0;l<a&&g<o;++l,++g)h=s[l],d+=mf[h>>4&15]+mf[h&15]+mf[h>>12&15]+mf[h>>8&15]+mf[h>>20&15]+mf[h>>16&15]+mf[h>>28&15]+mf[h>>24&15];g%a===0&&(bD(s),l=0)}return"0x"+d},bD=r=>{var e,t,n,i,a,o,s,c,l,u,d,h,g,m,b,E,I,R,L,U,V,G,H,N,F,O,y,x,w,p,v,A,T,S,_,B,q,k,z,ie,M,te,oe,se,re,le,ae,ue,_e,he,be,pn,it,ht,Gn,Et,Tt,yi,At,St,ci,It,Ct;for(n=0;n<48;n+=2)i=r[0]^r[10]^r[20]^r[30]^r[40],a=r[1]^r[11]^r[21]^r[31]^r[41],o=r[2]^r[12]^r[22]^r[32]^r[42],s=r[3]^r[13]^r[23]^r[33]^r[43],c=r[4]^r[14]^r[24]^r[34]^r[44],l=r[5]^r[15]^r[25]^r[35]^r[45],u=r[6]^r[16]^r[26]^r[36]^r[46],d=r[7]^r[17]^r[27]^r[37]^r[47],h=r[8]^r[18]^r[28]^r[38]^r[48],g=r[9]^r[19]^r[29]^r[39]^r[49],e=h^(o<<1|s>>>31),t=g^(s<<1|o>>>31),r[0]^=e,r[1]^=t,r[10]^=e,r[11]^=t,r[20]^=e,r[21]^=t,r[30]^=e,r[31]^=t,r[40]^=e,r[41]^=t,e=i^(c<<1|l>>>31),t=a^(l<<1|c>>>31),r[2]^=e,r[3]^=t,r[12]^=e,r[13]^=t,r[22]^=e,r[23]^=t,r[32]^=e,r[33]^=t,r[42]^=e,r[43]^=t,e=o^(u<<1|d>>>31),t=s^(d<<1|u>>>31),r[4]^=e,r[5]^=t,r[14]^=e,r[15]^=t,r[24]^=e,r[25]^=t,r[34]^=e,r[35]^=t,r[44]^=e,r[45]^=t,e=c^(h<<1|g>>>31),t=l^(g<<1|h>>>31),r[6]^=e,r[7]^=t,r[16]^=e,r[17]^=t,r[26]^=e,r[27]^=t,r[36]^=e,r[37]^=t,r[46]^=e,r[47]^=t,e=u^(i<<1|a>>>31),t=d^(a<<1|i>>>31),r[8]^=e,r[9]^=t,r[18]^=e,r[19]^=t,r[28]^=e,r[29]^=t,r[38]^=e,r[39]^=t,r[48]^=e,r[49]^=t,m=r[0],b=r[1],le=r[11]<<4|r[10]>>>28,ae=r[10]<<4|r[11]>>>28,x=r[20]<<3|r[21]>>>29,w=r[21]<<3|r[20]>>>29,St=r[31]<<9|r[30]>>>23,ci=r[30]<<9|r[31]>>>23,te=r[40]<<18|r[41]>>>14,oe=r[41]<<18|r[40]>>>14,S=r[2]<<1|r[3]>>>31,_=r[3]<<1|r[2]>>>31,E=r[13]<<12|r[12]>>>20,I=r[12]<<12|r[13]>>>20,ue=r[22]<<10|r[23]>>>22,_e=r[23]<<10|r[22]>>>22,p=r[33]<<13|r[32]>>>19,v=r[32]<<13|r[33]>>>19,It=r[42]<<2|r[43]>>>30,Ct=r[43]<<2|r[42]>>>30,ht=r[5]<<30|r[4]>>>2,Gn=r[4]<<30|r[5]>>>2,B=r[14]<<6|r[15]>>>26,q=r[15]<<6|r[14]>>>26,R=r[25]<<11|r[24]>>>21,L=r[24]<<11|r[25]>>>21,he=r[34]<<15|r[35]>>>17,be=r[35]<<15|r[34]>>>17,A=r[45]<<29|r[44]>>>3,T=r[44]<<29|r[45]>>>3,N=r[6]<<28|r[7]>>>4,F=r[7]<<28|r[6]>>>4,Et=r[17]<<23|r[16]>>>9,Tt=r[16]<<23|r[17]>>>9,k=r[26]<<25|r[27]>>>7,z=r[27]<<25|r[26]>>>7,U=r[36]<<21|r[37]>>>11,V=r[37]<<21|r[36]>>>11,pn=r[47]<<24|r[46]>>>8,it=r[46]<<24|r[47]>>>8,se=r[8]<<27|r[9]>>>5,re=r[9]<<27|r[8]>>>5,O=r[18]<<20|r[19]>>>12,y=r[19]<<20|r[18]>>>12,yi=r[29]<<7|r[28]>>>25,At=r[28]<<7|r[29]>>>25,ie=r[38]<<8|r[39]>>>24,M=r[39]<<8|r[38]>>>24,G=r[48]<<14|r[49]>>>18,H=r[49]<<14|r[48]>>>18,r[0]=m^~E&R,r[1]=b^~I&L,r[10]=N^~O&x,r[11]=F^~y&w,r[20]=S^~B&k,r[21]=_^~q&z,r[30]=se^~le&ue,r[31]=re^~ae&_e,r[40]=ht^~Et&yi,r[41]=Gn^~Tt&At,r[2]=E^~R&U,r[3]=I^~L&V,r[12]=O^~x&p,r[13]=y^~w&v,r[22]=B^~k&ie,r[23]=q^~z&M,r[32]=le^~ue&he,r[33]=ae^~_e&be,r[42]=Et^~yi&St,r[43]=Tt^~At&ci,r[4]=R^~U&G,r[5]=L^~V&H,r[14]=x^~p&A,r[15]=w^~v&T,r[24]=k^~ie&te,r[25]=z^~M&oe,r[34]=ue^~he&pn,r[35]=_e^~be&it,r[44]=yi^~St&It,r[45]=At^~ci&Ct,r[6]=U^~G&m,r[7]=V^~H&b,r[16]=p^~A&N,r[17]=v^~T&F,r[26]=ie^~te&S,r[27]=M^~oe&_,r[36]=he^~pn&se,r[37]=be^~it&re,r[46]=St^~It&ht,r[47]=ci^~Ct&Gn,r[8]=G^~m&E,r[9]=H^~b&I,r[18]=A^~N&O,r[19]=T^~F&y,r[28]=te^~S&B,r[29]=oe^~_&q,r[38]=pn^~se&le,r[39]=it^~re&ae,r[48]=It^~ht&Et,r[49]=Ct^~Gn&Tt,r[0]^=kre[n],r[1]^=kre[n+1]},bFe=r=>e=>{var t;if(e.slice(0,2)==="0x"){t=[];for(var n=2,i=e.length;n<i;n+=2)t.push(parseInt(e.slice(n,n+2),16))}else t=e;return vFe(yFe(r),t)},h5=bFe(256);var Nre=Ie(p5(),1),m5=new Nre.default.ec("secp256k1");function wD(){let r=m5.genKeyPair();return{privateKey:ur(r.getPrivate("hex")),publicKey:ur(r.getPublic(!0,"hex"))}}async function Rre(){return Promise.resolve(wD())}function gf(r){let e=m5.keyFromPrivate(r);return{privateKey:ur(e.getPrivate("hex")),publicKey:ur(e.getPublic(!0,"hex"))}}function Ore(r){let e=m5.keyFromPublic(r);return ur(e.getPublic(!1,"hex"))}function Dre(r,e){let t=Ia(e),n=ur(h5(`0x${t}`)),a=m5.keyFromPrivate(r).sign(n),o=a.r.toArray("be",32),s=a.s.toArray("be",32),c=new Uint8Array(64);return c.set(o,0),c.set(s,32),c}function Pre(r,e,t){let n=Ia(e),i=ur(h5(`0x${n}`));return m5.keyFromPublic(r).verify(i,{r:t.subarray(0,32),s:t.subarray(32,64)})}var Bre=Ie(p5(),1),wFe=new Bre.default.ec("secp256k1"),_Fe="302d300706052b8104000a032200",z_=ur(_Fe),EFe="3036301006072a8648ce3d020106052b8104000a032200",_D=ur(EFe),Qc=class r extends Ys{constructor(e){super(),this._keyData=e}get _type(){return"secp256k1"}static fromBytes(e){switch(e.length){case 33:return r.fromBytesRaw(e);default:return r.fromBytesDer(e)}}static fromBytesDer(e){let t=new Uint8Array;switch(e.length){case 47:t=e.subarray(z_.length);break;case 56:t=e.subarray(_D.length,_D.length+33);break;default:let a=wFe.keyFromPublic(e.subarray(_D.length),"der").getPublic().encodeCompressed("hex");t=ur(a);break}if(t.length==0)throw new In("cannot decode ECDSA private key data from DER format");return new r(t)}static fromBytesRaw(e){if(e.length!=33)throw new In(`invalid public key length: ${e.length} bytes`);return new r(e)}static fromString(e){return r.fromBytes(ur(e))}verify(e,t){return Pre(this._keyData,e,t)}toBytesDer(){let e=new Uint8Array(z_.length+this._keyData.length);return e.set(z_,0),e.set(this._keyData,z_.length),e}toBytesRaw(){return new Uint8Array(this._keyData.subarray())}toEthereumAddress(){let e=ur(h5(`0x${Ia(Ore(this.toBytesRaw()).subarray(1))}`));return Ia(e.subarray(12))}equals(e){return Jh(this._keyData,e._keyData)}};var xFe="3030020100300706052b8104000a04220420",g5=ur(xFe),AFe="30540201010420",Mre=ur(AFe),Oo=class r{constructor(e,t){this._keyPair=e,this._chainCode=t??null}get _type(){return"secp256k1"}static generate(){return new r(wD())}static async generateAsync(){return new r(await Rre())}static fromBytes(e){switch(e.length){case 32:return r.fromBytesRaw(e);default:return r.fromBytesDer(e)}}static fromBytesDer(e){let t=new Uint8Array;return NZ(e,g5)?t=e.subarray(g5.length):t=e.subarray(Mre.length,Mre.length+32),new r(gf(t))}static fromBytesRaw(e){return new r(gf(e))}static fromString(e){return r.fromBytes(ur(e))}static fromStringDer(e){return r.fromBytesDer(ur(e))}static fromStringRaw(e){return r.fromBytesRaw(ur(e))}static async fromSeed(e){let{keyData:t,chainCode:n}=await Ire(e);return new r(gf(t),n)}get publicKey(){return new Qc(this._keyPair.publicKey)}sign(e){return Dre(this._keyPair.privateKey,e)}toBytesDer(){let e=new Uint8Array(g5.length+32);return e.set(g5,0),e.set(this._keyPair.privateKey.subarray(0,32),g5.length),e}toBytesRaw(){let e=new Uint8Array(32);return e.set(this._keyPair.privateKey.slice(0,32),0),e}};var e3=class r extends Ys{constructor(e){super(),this._key=e}get _type(){return this._key._type}static fromBytes(e){let t;try{return new r(jc.fromBytes(e))}catch(n){t=n!=null&&n.message!=null?n.message:""}try{return new r(Qc.fromBytes(e))}catch(n){t=n!=null&&n.message!=null?n.message:""}throw new In(`public key cannot be decoded from bytes: ${t}`)}static fromBytesED25519(e){return new r(jc.fromBytes(e))}static fromBytesECDSA(e){return new r(Qc.fromBytes(e))}static fromString(e){return r.fromBytes(ur(e))}static fromStringED25519(e){return r.fromBytesED25519(ur(e))}static fromStringECDSA(e){return r.fromBytesECDSA(ur(e))}verify(e,t){return this._key.verify(e,t)}verifyTransaction(e){console.log("Deprecated: use `@hashgraph/sdk`.PublicKey instead"),e._requireFrozen(),e.isFrozen()||e.freeze();for(let t of e._signedTransactions)if(t.sigMap!=null&&t.sigMap.sigPair!=null){let n=!1;for(let i of t.sigMap.sigPair){let a=i.pubKeyPrefix;if(Jh(a,this.toBytesRaw())){n=!0;let o=t.bodyBytes,s=i.ed25519!=null?i.ed25519:i.ECDSASecp256k1;if(!this.verify(o,s))return!1}}if(!n)return!1}return!0}toBytes(){return this._key instanceof jc?this.toBytesRaw():this.toBytesDer()}toBytesDer(){return this._key.toBytesDer()}toBytesRaw(){return this._key.toBytesRaw()}toString(){return this.toStringDer()}toStringDer(){return Ia(this.toBytesDer())}toStringRaw(){return Ia(this.toBytesRaw())}toEthereumAddress(){if(this._key instanceof Qc)return this._key.toEthereumAddress();throw new Error("unsupported operation on Ed25519PublicKey")}equals(e){return this._key instanceof jc&&e._key instanceof jc?this._key.equals(e._key):this._key instanceof Qc&&e._key instanceof Qc?this._key.equals(e._key):!1}};var G_=Ie(require("crypto"),1);var M0={Aes128Ctr:"AES-128-CTR",Aes128Cbc:"AES-128-CBC"};function Lre(r,e,t,n){let i=G_.default.createCipheriv(r,e.slice(0,16),t);return Promise.resolve(Buffer.concat([i.update(n),i.final()]))}function T2(r,e,t,n){let i=G_.default.createDecipheriv(r,e.slice(0,16),t);return Promise.resolve(Buffer.concat([i.update(n),i.final()]))}function Fre(r,e){return Promise.resolve(G_.default.createHash("md5").update(r).update(ur(e).slice(0,8)).digest())}var Ure=Ie(require("util"),1),qre=Ie(require("crypto"),1);async function Od(r,e,t,n,i){let a=typeof e=="string"?of(e):e,o=typeof t=="string"?of(t):t,s=Ure.default.promisify(qre.default.pbkdf2);switch(r){case Jn.Sha256:return s(a,o,n,i,"sha256");case Jn.Sha384:return s(a,o,n,i,"sha384");case Jn.Sha512:return s(a,o,n,i,"sha512");default:throw new Error("(BUG) Non-Exhaustive switch statement for algorithms")}}var jre="hmac-sha256";async function Vre(r,e){let a=await C0(32),o=await Od(Jn.Sha256,e,a,262144,32),s=await C0(16),c=await Lre(M0.Aes128Ctr,o.slice(0,16),s,r),l=await Vc(Jn.Sha384,o.slice(16),c),u={version:1,crypto:{ciphertext:Ia(c),cipherparams:{iv:Ia(s)},cipher:M0.Aes128Ctr,kdf:"pbkdf2",kdfparams:{dkLen:32,salt:Ia(a),c:262144,prf:jre},mac:Ia(l)}};return of(JSON.stringify(u))}async function Hre(r,e){let t=JSON.parse($ee(r));if(t.version!==1)throw new In(`unsupported keystore version: ${t.version}`);let{ciphertext:n,cipherparams:{iv:i},cipher:a,kdf:o,kdfparams:{dkLen:s,salt:c,c:l,prf:u},mac:d}=t.crypto;if(o!=="pbkdf2")throw new In(`unsupported key derivation function:" + ${o}`);if(u!==jre)throw new In(`unsupported key derivation hash function: ${u}`);let h=ur(c),g=ur(i),m=ur(n),b=await Od(Jn.Sha256,e,h,l,s),E=ur(d),I=await Vc(Jn.Sha384,b.slice(16),m);if(!E.every((R,L)=>R===I[L]))throw new In("HMAC mismatch; passphrase is incorrect");return T2(a,b.slice(0,16),g,m)}function y5(r){return Kre(r)[0]}function Kre(r){let[e,t]=IFe(r.subarray(1)),n=t.subarray(0,e),i=t.subarray(e);switch(r[0]){case 2:return[{int:zre(n)},i];case 4:return[{bytes:n},i];case 5:return[{},i];case 6:return[{ident:SFe(n)},i];case 48:return[{seq:TFe(n)},i];default:throw new Error(`unsupported DER type tag: ${r[0]}`)}}function TFe(r){let e=r,t=[];for(;e.length!==0;){let[n,i]=Kre(e);t.push(n),e=i}return t}function SFe(r){let e=[Math.floor(r[0]/40),r[0]%40],t=0;for(let n of r.subarray(1))t*=128,n<128?(t+=n,e.push(t),t=0):t+=n&127;return e.join(".")}function IFe(r){if(r[0]<128)return[r[0],r.subarray(1)];let e=r[0]-128,t=r.subarray(1,e+1),n=r.subarray(e+1);return[zre(t),n]}function zre(r){let e=r.length;if(e===1)return r[0];let t=new DataView(r.buffer,r.byteOffset,r.byteLength);if(e===2)return t.getUint16(0,!1);if(e===3){let n=Uint8Array.of(0,...r);t=new DataView(n.buffer,n.byteOffset,n.byteLength)}if(e>4)throw new Error(`unsupported DER integer length of ${e} bytes`);return t.getUint32(0,!1)}var yf=class{constructor(e){if("seq"in e&&e.seq.length>=1&&"ident"in e.seq[0])this.algIdent=e.seq[0].ident,this.parameters=e.seq[1];else throw new Error(`error parsing AlgorithmIdentifier from ${JSON.stringify(e)}`)}toString(){return JSON.stringify(this)}},xD=class{constructor(e){if("seq"in e&&e.seq.length===2)this.kdf=new yf(e.seq[0]),this.encScheme=new yf(e.seq[1]);else throw new Error(`error parsing PBES2Params from ${JSON.stringify(e)}`)}},AD=class{constructor(e){if("seq"in e&&e.seq.length>=2&&"bytes"in e.seq[0]&&"int"in e.seq[1]&&(this.salt=e.seq[0].bytes,this.iterCount=e.seq[1].int,e.seq.length>2)){if("seq"in e.seq[2]){this.prf=new yf(e.seq[2]);return}else"int"in e.seq[2]&&(this.keyLength=e.seq[2].int);e.seq.length===4&&(this.prf=new yf(e.seq[3]));return}throw new Error(`error parsing PBKDF2Params from ${JSON.stringify(e)}`)}},TD=class r{constructor(e){if("seq"in e&&e.seq.length===3){if("int"in e.seq[0]&&e.seq[0].int===0)this.version=0;else throw new Error(`expected version = 0, got ${JSON.stringify(e.seq[0])}`);if(this.algId=new yf(e.seq[1]),"bytes"in e.seq[2])this.privateKey=e.seq[2].bytes;else throw new Error(`expected octet string as 3rd element, got ${JSON.stringify(e.seq[2])}`);return}throw new Error(`error parsing PrivateKeyInfo from ${JSON.stringify(e)}`)}static parse(e){return new r(y5(e))}},Q_=class r{constructor(e){if("seq"in e&&e.seq.length===2&&"bytes"in e.seq[1]){this.algId=new yf(e.seq[0]),this.data=e.seq[1].bytes;return}throw new Error(`error parsing EncryptedPrivateKeyInfo from ${JSON.stringify(e)}`)}static parse(e){return new r(y5(e))}async decrypt(e){if(this.algId.algIdent!=="1.2.840.113549.1.5.13"||!this.algId.parameters)throw new Error(`unsupported key encryption algorithm: ${this.algId.toString()}`);let t=new xD(this.algId.parameters);if(t.kdf.algIdent!=="1.2.840.113549.1.5.12"||!t.kdf.parameters)throw new Error(`unsupported key derivation function: ${t.kdf.toString()}`);let n=new AD(t.kdf.parameters);if(n.prf){if(n.prf.algIdent!=="1.2.840.113549.2.9")throw new Error(`unsupported PRF ${n.prf.toString()}`)}else throw new Error("unsupported PRF HMAC-SHA-1");if(t.encScheme.algIdent!=="2.16.840.1.101.3.4.1.2")throw new Error(`unsupported encryption scheme: ${t.encScheme.toString()}`);if(!t.encScheme.parameters||!("bytes"in t.encScheme.parameters))throw new Error(`expected IV as bytes for AES-128-CBC, got: ${JSON.stringify(t.encScheme.parameters)}`);let i=n.keyLength||16,a=t.encScheme.parameters.bytes,o=await Od(Jn.Sha256,e,n.salt,n.iterCount,i),s=await T2(M0.Aes128Cbc,o,a,this.data);return TD.parse(s)}};function SD(r){return Buffer.from(r,"base64")}var Fne=Ie(Lne(),1),Une=Ie(__(),1);var qne=require("buffer"),mUe="1.3.101.112";async function gUe(r,e){let t=r.replace(/-----BEGIN (.*)-----|-----END (.*)-----|\n|\r/g,""),n=SD(t);if(e){let i;try{i=Q_.parse(n)}catch(c){let l=c!=null&&c.message!=null?c.message:"";throw new In(`failed to parse encrypted private key: ${l}`)}let a=await i.decrypt(e),o=null;if(a.algId.algIdent===mUe)o=Qa;else throw new In(`unknown private key algorithm ${a.algId.toString()}`);let s=y5(a.privateKey);if(!("bytes"in s))throw new In(`expected ASN bytes, got ${JSON.stringify(s)}`);return o.fromBytes(s.bytes)}return n.subarray(16)}async function yUe(r,e){let t=r.replace(/-----BEGIN (.*)-----|-----END (.*)-----|\n|\r/g,""),n=SD(t);if(e){let a=Une.default.pem.decode(r)[0].dekInfo.parameters,o=ur(a),s=r.split(`
10633
10633
  `),c=await Fre(e,a),l=qne.Buffer.from(s.slice(4,s.length-1).join(""),"base64"),u=await T2(M0.Aes128Cbc,c,o,l);return Oo.fromBytesDer(u)}else return Fne.fromBER(n).result.valueBlock.value[1].valueBlock.valueHexView}async function jne(r,e){return r.includes("BEGIN EC PRIVATE KEY")?yUe(r,e):gUe(r,e)}function Vne(r,e){let t=new Uint8Array(r.length+8);t.set(r,0);let n=new DataView(t.buffer,t.byteOffset,t.byteLength);e===0xffffffffff?(n.setInt32(r.length+0,255),n.setInt32(r.length+4,-1)):(n.setInt32(r.length+0,e<0?-1:0),n.setInt32(r.length+4,e));let i=Uint8Array.from([255]);return Od(Jn.Sha512,t,i,2048,32)}var bUe={privateKeyConstructor:null,privateKeyFromBytes:null,mnemonicFromString:null},F3=bUe;var Pn=class r extends Ys{constructor(e){super(),this._key=e}get _type(){return this._key._type}get _chainCode(){return this._key._chainCode}static generateED25519(){return new r(Qa.generate())}static generateECDSA(){return new r(Oo.generate())}static generate(){return r.generateED25519()}static async generateAsync(){return r.generateED25519Async()}static async generateED25519Async(){return new r(await Qa.generateAsync())}static async generateECDSAAsync(){return new r(await Oo.generateAsync())}static fromBytes(e){let t;e.length==32&&console.warn("WARNING: Consider using fromStringECDSA() or fromStringED2551() on a HEX-encoded string and fromStringDer() on a HEX-encoded string with DER prefix instead.");try{return new r(Qa.fromBytes(e))}catch(n){t=n!=null&&n.message!=null?n.message:""}try{return new r(Oo.fromBytes(e))}catch(n){t=n!=null&&n.message!=null?n.message:""}throw new In(`private key cannot be decoded from bytes: ${t}`)}static fromBytesECDSA(e){return new r(Oo.fromBytes(e))}static fromBytesED25519(e){return new r(Qa.fromBytes(e))}static fromString(e){return r.fromBytes(ur(e))}static fromStringECDSA(e){return r.fromBytesECDSA(ur(e))}static fromStringED25519(e){return r.fromBytesED25519(ur(e))}static async fromSeedED25519(e){let t=await Qa.fromSeed(e);return new r(t)}static async fromSeedECDSAsecp256k1(e){let t=await Oo.fromSeed(e);return new r(t)}static async fromMnemonic(e,t=""){if(F3.mnemonicFromString==null)throw new Error("Mnemonic not found in cache");return(typeof e=="string"?F3.mnemonicFromString(e):e).toEd25519PrivateKey(t)}static async fromKeystore(e,t=""){return r.fromBytes(await Hre(e,t))}static async fromPem(e,t=""){let n=await jne(e,t);return n instanceof Qa||n instanceof Oo?new r(n):e.includes("BEGIN EC PRIVATE KEY")?new r(Oo.fromBytes(n)):new r(Qa.fromBytes(n))}async derive(e){if(this._key._chainCode==null)throw new Error("this private key does not support key derivation");if(this._key instanceof Qa){let{keyData:t,chainCode:n}=await V_(this.toBytesRaw(),this._key._chainCode,e);return new r(new Qa(t,n))}else{let{keyData:t,chainCode:n}=await A2(this.toBytesRaw(),this._key._chainCode,e);return new r(new Oo(gf(t),n))}}async legacyDerive(e){let t=await Vne(this.toBytesRaw().subarray(0,32),e),n=this._key.constructor;return new r(new n(t))}get publicKey(){return new e3(this._key.publicKey)}sign(e){return this._key.sign(e)}signTransaction(e){if(e.isFrozen()||e.freeze(),e._signedTransactions.length!=1)throw new Error("`PrivateKey.signTransaction()` requires `Transaction` to have a single node `AccountId` set");let t=e._signedTransactions[0],n=Ia(this.publicKey.toBytesRaw());t.sigMap==null&&(t.sigMap={}),t.sigMap.sigPair==null&&(t.sigMap.sigPair=[]);for(let o of t.sigMap.sigPair)if(o.pubKeyPrefix!=null&&Ia(o.pubKeyPrefix)===n)switch(this._type){case"ED25519":return o.ed25519;case"secp256k1":return o.ECDSASecp256k1}let i=this.sign(t.bodyBytes!=null?t.bodyBytes:new Uint8Array),a={pubKeyPrefix:this.publicKey.toBytesRaw()};switch(this._type){case"ED25519":a.ed25519=i;break;case"secp256k1":a.ECDSASecp256k1=i;break}return t.sigMap.sigPair.push(a),e._signerPublicKeys.add(n),i}isDerivable(){return this._key._chainCode!=null}toBytes(){return this._key instanceof Qa?this.toBytesRaw():this.toBytesDer()}toBytesDer(){return this._key.toBytesDer()}toBytesRaw(){return this._key.toBytesRaw()}toString(){return this.toStringDer()}toStringDer(){return Ia(this.toBytesDer())}toStringRaw(){return Ia(this.toBytesRaw())}toKeystore(e=""){return Vre(this.toBytesRaw(),e)}};F3.privateKeyConstructor=r=>new Pn(r);F3.privateKeyFromBytes=r=>Pn.fromBytes(r);var wUe=Object.freeze({BadLength:"BadLength",UnknownWords:"UnknownWords",ChecksumMismatch:"ChecksumMismatch"}),U3=wUe;var Yc=class r extends Error{constructor(e,t,n){let i;switch(t){case U3.BadLength:i="mnemonic is of an unexpected number of words";break;case U3.ChecksumMismatch:i="checksum byte in mnemonic did not match the rest of the mnemonic";break;case U3.UnknownWords:i="mnemonic contained words that are not in the standard word list";break;default:throw new Error(`unexpected value ${t.toString()} for 'reason'`)}super(`invalid mnemonic: ${i}`),typeof Error.captureStackTrace<"u"&&Error.captureStackTrace(this,r),this.name="BadMnemonicError",this.reason=t,this.mnemonic=e,this.unknownWordIndices=n}};var hE=["aback","abbey","abbot","abide","ablaze","able","aboard","abode","abort","abound","about","above","abroad","abrupt","absent","absorb","absurd","abuse","accent","accept","access","accord","accuse","ace","ache","aching","acid","acidic","acorn","acre","across","act","action","active","actor","actual","acute","adam","adapt","add","added","addict","adept","adhere","adjust","admire","admit","adobe","adopt","adrift","adult","adverb","advice","aerial","afar","affair","affect","afford","afghan","afield","afloat","afraid","afresh","after","again","age","agency","agenda","agent","aghast","agile","ago","agony","agree","agreed","ahead","aid","aide","aim","air","airman","airy","akin","alarm","alaska","albeit","album","ale","alert","alibi","alice","alien","alight","align","alike","alive","alkali","all","alley","allied","allow","alloy","ally","almond","almost","aloft","alone","along","aloof","aloud","alpha","alpine","also","altar","alter","always","amaze","amazon","amber","ambush","amen","amend","amid","amidst","amiss","among","amount","ample","amuse","anchor","and","andrew","anew","angel","anger","angle","angry","animal","ankle","annoy","annual","answer","anthem","any","anyhow","anyway","apart","apathy","apex","apiece","appeal","appear","apple","apply","april","apron","arab","arcade","arcane","arch","arctic","ardent","are","area","argue","arid","arise","ark","arm","armful","army","aroma","around","arouse","array","arrest","arrive","arrow","arson","art","artery","artful","artist","ascent","ash","ashen","ashore","aside","ask","asleep","aspect","assay","assent","assert","assess","asset","assign","assist","assume","assure","asthma","astute","asylum","ate","athens","atlas","atom","atomic","attach","attack","attain","attend","attic","auburn","audio","audit","august","aunt","auntie","aura","austin","author","auto","autumn","avail","avenge","avenue","avert","avid","avoid","await","awake","awaken","award","aware","awash","away","awful","awhile","axe","axes","axiom","axis","axle","aye","babe","baby","bach","back","backup","bacon","bad","badge","badly","bag","baggy","bail","bait","bake","baker","bakery","bald","ball","ballad","ballet","ballot","baltic","bamboo","ban","banal","banana","band","bang","bank","bar","barber","bare","barely","barge","bark","barley","barn","baron","barrel","barren","basalt","base","basic","basil","basin","basis","basket","bass","bat","batch","bath","baton","battle","bay","beach","beacon","beak","beam","bean","bear","beard","beast","beat","beauty","become","bed","beech","beef","beefy","beep","beer","beet","beetle","before","beg","beggar","begin","behalf","behave","behind","beige","being","belief","bell","belly","belong","below","belt","bench","bend","benign","bent","berlin","berry","berth","beset","beside","best","bestow","bet","beta","betray","better","beware","beyond","bias","biceps","bicker","bid","big","bigger","bike","bile","bill","bin","binary","bind","biopsy","birch","bird","birdie","birth","bishop","bit","bitch","bite","bitter","black","blade","blame","bland","blast","blaze","bleak","blend","bless","blew","blind","blink","blip","bliss","blitz","block","blond","blood","bloody","bloom","blot","blouse","blow","blue","bluff","blunt","blur","blush","boar","board","boast","boat","bob","bodily","body","bogus","boil","bold","bolt","bomb","bombay","bond","bone","bonn","bonnet","bonus","bony","book","boom","boost","boot","booth","booze","border","bore","borrow","bosom","boss","boston","both","bother","bottle","bottom","bought","bounce","bound","bounty","bout","bovine","bow","bowel","bowl","box","boy","boyish","brace","brain","brainy","brake","bran","branch","brand","brandy","brass","brave","bravo","brazil","breach","bread","break","breast","breath","bred","breed","breeze","brew","bribe","brick","bride","bridge","brief","bright","brim","brine","bring","brink","brisk","broad","broke","broken","bronze","brook","broom","brown","bruise","brush","brutal","brute","bubble","buck","bucket","buckle","budget","buffet","buggy","build","bulb","bulge","bulk","bulky","bull","bullet","bully","bump","bumpy","bunch","bundle","bunk","bunny","burden","bureau","burial","buried","burly","burn","burnt","burrow","burst","bury","bus","bush","bust","bustle","busy","but","butler","butt","butter","button","buy","buyer","buzz","bye","byte","cab","cabin","cable","cache","cactus","caesar","cage","cairo","cajun","cajole","cake","calf","call","caller","calm","calmly","came","camel","camera","camp","campus","can","canada","canal","canary","cancel","cancer","candid","candle","candy","cane","canine","canoe","canopy","canvas","canyon","cap","cape","car","carbon","card","care","career","caress","cargo","carl","carnal","carol","carp","carpet","carrot","carry","cart","cartel","case","cash","cask","cast","castle","casual","cat","catch","cater","cattle","caught","causal","cause","cave","cease","celery","cell","cellar","celtic","cement","censor","census","cent","cereal","chain","chair","chalk","chalky","champ","chance","change","chant","chaos","chap","chapel","charge","charm","chart","chase","chat","cheap","cheat","check","cheek","cheeky","cheer","cheery","cheese","chef","cheque","cherry","chess","chest","chew","chic","chick","chief","child","chile","chill","chilly","chin","china","chip","choice","choir","choose","chop","choppy","chord","chorus","chose","chosen","chris","chrome","chunk","chunky","church","cider","cigar","cinema","circa","circle","circus","cite","city","civic","civil","clad","claim","clammy","clan","clap","clash","clasp","class","clause","claw","clay","clean","clear","clergy","clerk","clever","click","client","cliff","climax","climb","clinch","cling","clinic","clip","cloak","clock","clone","close","closer","closet","cloth","cloud","cloudy","clout","clown","club","clue","clumsy","clung","clutch","coach","coal","coarse","coast","coat","coax","cobalt","cobra","coca","cock","cocoa","code","coffee","coffin","cohort","coil","coin","coke","cold","collar","colon","colony","colt","column","comb","combat","come","comedy","comic","commit","common","compel","comply","concur","cone","confer","congo","consul","convex","convey","convoy","cook","cool","cope","copper","copy","coral","cord","core","cork","corn","corner","corps","corpse","corpus","cortex","cosmic","cosmos","cost","costly","cotton","couch","cough","could","count","county","coup","couple","coupon","course","court","cousin","cove","cover","covert","cow","coward","cowboy","cozy","crab","crack","cradle","craft","crafty","crag","crane","crash","crate","crater","crawl","crazy","creak","cream","creamy","create","credit","creed","creek","creep","creepy","crept","crest","crew","cried","crime","crisis","crisp","critic","crook","crop","cross","crow","crowd","crown","crude","cruel","cruise","crunch","crush","crust","crux","cry","crypt","cuba","cube","cubic","cuckoo","cuff","cult","cup","curb","cure","curfew","curl","curry","curse","cursor","curve","cuss","custom","cut","cute","cycle","cyclic","cynic","czech","dad","daddy","dagger","daily","dairy","daisy","dale","dam","damage","damp","dampen","dance","danger","danish","dare","dark","darken","darn","dart","dash","data","date","david","dawn","day","dead","deadly","deaf","deal","dealer","dean","dear","death","debate","debit","debris","debt","debtor","decade","decay","decent","decide","deck","decor","decree","deduce","deed","deep","deeply","deer","defeat","defect","defend","defer","define","defy","degree","deity","delay","delete","delhi","delta","demand","demise","demo","demure","denial","denote","dense","dental","deny","depart","depend","depict","deploy","depot","depth","deputy","derive","desert","design","desire","desist","desk","detail","detect","deter","detest","detour","device","devise","devoid","devote","devour","dial","diana","diary","dice","dictum","did","die","diesel","diet","differ","dig","digest","digit","dine","dinghy","dinner","diode","dip","dire","direct","dirt","dirty","disc","disco","dish","disk","dismal","dispel","ditch","dive","divert","divide","divine","dizzy","docile","dock","doctor","dog","dogma","dole","doll","dollar","dolly","domain","dome","domino","donate","done","donkey","donor","doom","door","dorsal","dose","dot","double","doubt","dough","dour","dove","down","dozen","draft","drag","dragon","drain","drama","drank","draw","drawer","dread","dream","dreary","dress","drew","dried","drift","drill","drink","drip","drive","driver","drop","drove","drown","drug","drum","drunk","dry","dual","duck","duct","due","duel","duet","duke","dull","duly","dumb","dummy","dump","dune","dung","duress","during","dusk","dust","dusty","dutch","duty","dwarf","dwell","dyer","dying","dynamo","each","eager","eagle","ear","earl","early","earn","earth","ease","easel","easily","east","easter","easy","eat","eaten","eater","echo","eddy","eden","edge","edible","edict","edit","editor","eel","eerie","eerily","effect","effort","egg","ego","eight","eighth","eighty","either","elbow","elder","eldest","elect","eleven","elicit","elite","else","elude","elves","embark","emblem","embryo","emerge","emit","empire","employ","empty","enable","enamel","end","endure","enemy","energy","engage","engine","enjoy","enlist","enough","ensure","entail","enter","entire","entry","envoy","envy","enzyme","epic","epoch","equal","equate","equip","equity","era","erect","eric","erode","erotic","errant","error","escape","escort","essay","essex","estate","esteem","ethic","ethnic","europe","evade","eve","even","event","ever","every","evict","evil","evoke","evolve","exact","exam","exceed","excel","except","excess","excise","excite","excuse","exempt","exert","exile","exist","exit","exodus","exotic","expand","expect","expert","expire","export","expose","extend","extra","eye","eyed","fabric","face","facial","fact","factor","fade","fail","faint","fair","fairly","fairy","faith","fake","falcon","fall","false","falter","fame","family","famine","famous","fan","fancy","far","farce","fare","farm","farmer","fast","fasten","faster","fat","fatal","fate","father","fatty","fault","faulty","fauna","fear","feast","feat","fed","fee","feeble","feed","feel","feet","fell","fellow","felt","female","fence","fend","ferry","fetal","fetch","feudal","fever","few","fewer","fiasco","fiddle","field","fiend","fierce","fiery","fifth","fifty","fig","fight","figure","file","fill","filled","filler","film","filter","filth","filthy","final","finale","find","fine","finery","finger","finish","finite","fire","firm","firmly","first","fiscal","fish","fisher","fist","fit","fitful","five","fix","flag","flair","flak","flame","flank","flap","flare","flash","flask","flat","flavor","flaw","fled","flee","fleece","fleet","flesh","fleshy","flew","flick","flight","flimsy","flint","flirt","float","flock","flood","floor","floppy","flora","floral","flour","flow","flower","fluent","fluffy","fluid","flung","flurry","flush","flute","flux","fly","flyer","foal","foam","focal","focus","fog","foil","fold","folk","follow","folly","fond","fondly","font","food","fool","foot","for","forbid","force","ford","forest","forge","forget","fork","form","formal","format","former","fort","forth","forty","forum","fossil","foster","foul","found","four","fourth","fox","foyer","frail","frame","franc","france","frank","fraud","fred","free","freed","freely","freeze","french","frenzy","fresh","friar","friday","fridge","fried","friend","fright","fringe","frock","frog","from","front","frost","frosty","frown","frozen","frugal","fruit","fry","fudge","fuel","full","fully","fumes","fun","fund","funny","fur","furry","fury","fuse","fusion","fuss","fussy","futile","future","fuzzy","gadget","gain","gala","galaxy","gale","gall","galley","gallon","gallop","gamble","game","gamma","gandhi","gang","gap","garage","garden","garlic","gas","gasp","gate","gather","gauge","gaunt","gave","gaze","gear","geese","gem","gemini","gender","gene","geneva","genial","genius","genre","gentle","gently","gentry","genus","george","germ","get","ghetto","ghost","giant","gift","giggle","gill","gilt","ginger","girl","give","given","glad","glade","glance","gland","glare","glass","glassy","gleam","glee","glide","global","globe","gloom","gloomy","gloria","glory","gloss","glossy","glove","glow","glue","gnat","gnu","goal","goat","gold","golden","golf","gone","gong","goo","good","goose","gore","gorge","gory","gosh","gospel","gossip","got","gothic","govern","gown","grab","grace","grade","grail","grain","grand","grant","grape","graph","grasp","grass","grassy","grate","grave","gravel","gravy","grease","greasy","great","greece","greed","greedy","greek","green","greet","grew","grey","grid","grief","grill","grim","grin","grind","grip","grit","gritty","groan","groin","groom","groove","gross","ground","group","grove","grow","grown","growth","grudge","grunt","guard","guess","guest","guide","guild","guilt","guilty","guise","guitar","gulf","gully","gun","gunman","guru","gut","guy","gypsy","habit","hack","had","hail","hair","hairy","haiti","hale","half","hall","halt","hamlet","hammer","hand","handle","handy","hang","hangar","hanoi","happen","happy","harass","harbor","hard","harder","hardly","hare","harem","harm","harp","harry","harsh","has","hash","hassle","haste","hasten","hasty","hat","hatch","hate","haul","haunt","havana","have","haven","havoc","hawaii","hawk","hay","hazard","haze","hazel","hazy","head","heal","health","heap","hear","heard","heart","hearth","hearty","heat","heater","heaven","heavy","hebrew","heck","hectic","hedge","heel","hefty","height","heir","held","helium","helix","hell","hello","helm","helmet","help","hemp","hence","henry","her","herald","herb","herd","here","hereby","hermes","hernia","hero","heroic","heroin","hey","heyday","hick","hidden","hide","high","higher","highly","hill","him","hind","hinder","hint","hippie","hire","his","hiss","hit","hive","hoard","hoarse","hobby","hockey","hold","holder","hole","hollow","holly","holy","home","honest","honey","hood","hook","hope","horn","horrid","horror","horse","hose","host","hot","hotel","hound","hour","house","hover","how","huge","hull","human","humane","humble","humid","hung","hunger","hungry","hunt","hurdle","hurl","hurry","hurt","hush","hut","hybrid","hymn","hyphen","ice","icing","icon","idaho","idea","ideal","idiom","idiot","idle","idly","idol","ignite","ignore","ill","image","immune","impact","imply","import","impose","inca","incest","inch","income","incur","indeed","index","india","indian","indoor","induce","inept","inert","infant","infect","infer","influx","inform","inject","injure","injury","ink","inlaid","inland","inlet","inmate","inn","innate","inner","input","insane","insect","insert","inset","inside","insist","insult","insure","intact","intake","intend","inter","into","invade","invent","invest","invite","invoke","inward","iowa","iran","iraq","irish","iron","ironic","irony","isaac","isabel","island","isle","israel","issue","italy","itch","item","itself","ivan","ivory","jack","jacket","jacob","jade","jaguar","jail","james","jane","japan","jargon","java","jaw","jazz","jeep","jelly","jerky","jest","jet","jewel","jewish","jim","job","jock","jockey","joe","john","join","joint","joke","jolly","jolt","jordan","joseph","joy","joyful","joyous","judge","judy","juice","juicy","july","jumble","jumbo","jump","june","jungle","junior","junk","junta","jury","just","kansas","karate","karl","keel","keen","keep","keeper","kenya","kept","kernel","kettle","key","khaki","kick","kid","kidnap","kidney","kill","killer","kin","kind","kindly","king","kiss","kite","kitten","knack","knee","kneel","knew","knife","knight","knit","knob","knock","knot","know","known","koran","korea","kuwait","label","lace","lack","lad","ladder","laden","lady","lagoon","laity","lake","lamb","lame","lamp","lance","land","lane","lap","lapse","large","larval","laser","last","latch","late","lately","latent","later","latest","latin","latter","laugh","launch","lava","lavish","law","lawful","lawn","lawyer","lay","layer","layman","lazy","lead","leader","leaf","leafy","league","leak","leaky","lean","leap","learn","lease","leash","least","leave","led","ledge","left","leg","legacy","legal","legend","legion","lemon","lend","length","lens","lent","leo","leper","lesion","less","lessen","lesser","lesson","lest","let","lethal","letter","level","lever","levy","lewis","liable","liar","libel","libya","lice","lick","lid","lie","lied","lier","life","lift","light","like","likely","limb","lime","limit","limp","line","linear","linen","linger","link","lint","lion","lip","liquid","liquor","list","listen","lit","live","lively","liver","liz","lizard","load","loaf","loan","lobby","lobe","local","locate","lock","locus","lodge","loft","lofty","log","logic","logo","london","lone","lonely","long","longer","look","loop","loose","loosen","loot","lord","lorry","lose","loss","lost","lot","lotion","lotus","loud","loudly","lounge","lousy","love","lovely","lover","low","lower","lowest","loyal","lucid","luck","lucky","lucy","lull","lump","lumpy","lunacy","lunar","lunch","lung","lure","lurid","lush","lust","lute","luther","luxury","lying","lymph","lynch","lyric","macho","macro","mad","madam","made","mafia","magic","magma","magnet","magnum","magpie","maid","maiden","mail","main","mainly","major","make","maker","male","malice","mall","malt","mammal","manage","mane","mania","manic","manner","manor","mantle","manual","manure","many","map","maple","marble","march","mare","margin","maria","marina","mark","market","marry","mars","marsh","martin","martyr","mary","mask","mason","mass","mast","master","mat","match","mate","matrix","matter","mature","maxim","may","maybe","mayor","maze","mead","meadow","meal","mean","meant","meat","medal","media","median","medic","medium","meet","mellow","melody","melon","melt","member","memo","memory","menace","mend","mental","mentor","menu","mercy","mere","merely","merge","merger","merit","merry","mesh","mess","messy","met","metal","meter","method","methyl","metric","metro","mexico","miami","mickey","mid","midday","middle","midst","midway","might","mighty","mild","mildew","mile","milk","milky","mill","mimic","mince","mind","mine","mini","mink","minor","mint","minus","minute","mire","mirror","mirth","misery","miss","mist","misty","mite","mix","moan","moat","mob","mobile","mock","mode","model","modem","modern","modest","modify","module","moist","molar","mold","mole","molten","moment","monday","money","monk","monkey","month","mood","moody","moon","moor","moral","morale","morbid","more","morgue","mortal","mortar","mosaic","moscow","moses","mosque","moss","most","mostly","moth","mother","motion","motive","motor","mount","mourn","mouse","mouth","move","movie","mrs","much","muck","mucus","mud","muddle","muddy","mule","mummy","munich","murder","murky","murmur","muscle","museum","music","mussel","must","mutant","mute","mutiny","mutter","mutton","mutual","muzzle","myopic","myriad","myself","mystic","myth","nadir","nail","naked","name","namely","nape","napkin","naples","narrow","nasal","nasty","nathan","nation","native","nature","nausea","naval","nave","navy","near","nearer","nearly","neat","neatly","neck","need","needle","needy","negate","neon","nepal","nephew","nerve","nest","net","neural","never","newly","next","nice","nicely","niche","nickel","niece","night","nile","nimble","nine","ninety","ninth","nobel","noble","nobody","node","noise","noisy","none","noon","nor","norm","normal","north","norway","nose","nosy","not","note","notice","notify","notion","noun","novel","novice","now","nozzle","null","numb","number","nurse","nut","nylon","nymph","oak","oar","oasis","oath","obese","obey","object","oblige","oboe","obtain","obtuse","occult","occupy","occur","ocean","octave","odd","off","offend","offer","office","offset","often","ohio","oil","oily","okay","old","older","oldest","olive","omega","omen","omit","once","one","onion","only","onset","onto","onus","onward","opaque","open","openly","opera","opium","oppose","optic","option","oracle","oral","orange","orbit","orchid","ordeal","order","organ","orgasm","orient","origin","ornate","orphan","oscar","other","otter","ought","ounce","our","out","outer","output","outset","oval","oven","over","overt","owe","owing","owl","own","owner","oxford","oxide","oxygen","oyster","ozone","pace","pack","packet","pact","pad","paddle","paddy","pagan","page","paid","pain","paint","pair","palace","pale","palm","pan","panama","panel","panic","papa","papal","paper","parade","parcel","pardon","parent","paris","parish","park","parody","parrot","part","partly","party","pascal","pass","past","paste","pastel","pastor","pastry","pat","patch","patent","path","patio","patrol","patron","paul","pause","pave","paw","pawn","pay","peace","peach","peak","pear","pearl","pedal","peel","peer","peking","pelvic","pelvis","pen","penal","pence","pencil","penny","people","pepper","per","perch","peril","period","perish","permit","person","peru","pest","pet","peter","petite","petrol","petty","phase","philip","phone","photo","phrase","piano","pick","picket","picnic","pie","piece","pier","pierce","piety","pig","pigeon","piggy","pike","pile","pill","pillar","pillow","pilot","pin","pinch","pine","pink","pint","pious","pipe","pirate","piss","pistol","piston","pit","pitch","pity","pivot","pixel","pizza","place","placid","plague","plain","plan","plane","planet","plank","plant","plasma","plate","play","player","plea","plead","please","pledge","plenty","plight","plot","plough","ploy","plug","plum","plump","plunge","plural","plus","plush","pocket","poem","poet","poetic","poetry","point","poison","poland","polar","pole","police","policy","polish","polite","poll","pollen","polo","pond","ponder","pony","pool","poor","poorly","pop","poppy","pore","pork","port","portal","pose","posh","post","postal","pot","potato","potent","pouch","pound","pour","powder","power","praise","pray","prayer","preach","prefer","prefix","press","pretty","price","pride","priest","primal","prime","prince","print","prior","prism","prison","privy","prize","probe","profit","prompt","prone","proof","propel","proper","prose","proton","proud","prove","proven","proxy","prune","pry","psalm","pseudo","psyche","pub","public","puff","pull","pulp","pulpit","pulsar","pulse","pump","punch","punish","punk","pupil","puppet","puppy","pure","purely","purge","purify","purple","purse","pursue","push","pushy","put","putt","puzzle","quaint","quake","quarry","quart","quartz","quebec","queen","queer","query","quest","queue","quick","quid","quiet","quilt","quirk","quit","quite","quiver","quiz","quota","quote","rabbit","race","racial","racism","rack","racket","radar","radio","radish","radius","raffle","raft","rage","raid","rail","rain","rainy","raise","rake","rally","ramp","random","range","rank","ransom","rape","rapid","rare","rarely","rarity","rash","rat","rate","rather","ratify","ratio","rattle","rave","raven","raw","ray","razor","reach","react","read","reader","ready","real","really","realm","reap","rear","reason","rebel","recall","recent","recess","recipe","reckon","record","recoup","rector","red","redeem","redo","reduce","reed","reef","reek","refer","reform","refuge","refuse","regal","regard","regent","regime","region","regret","reign","reject","relate","relax","relay","relic","relief","relish","rely","remain","remark","remedy","remind","remit","remote","remove","renal","render","rent","rental","repair","repeal","repeat","repent","reply","report","rescue","resent","reside","resign","resin","resist","resort","rest","result","resume","retail","retain","retina","retire","return","reveal","review","revise","revive","revolt","reward","rex","rhine","rhino","rhyme","rhythm","ribbon","rice","rich","rick","rid","ride","rider","ridge","rife","rifle","rift","right","rigid","rile","rim","ring","rinse","riot","ripe","ripen","ripple","rise","risk","risky","rite","ritual","ritz","rival","river","road","roar","roast","rob","robe","robert","robin","robot","robust","rock","rocket","rocky","rod","rode","rodent","rogue","role","roll","roman","rome","roof","room","root","rope","rose","rosy","rot","rotate","rotor","rotten","rouge","rough","round","route","rover","row","royal","rub","rubber","rubble","ruby","rudder","rude","rug","rugby","ruin","rule","ruler","rumble","rump","run","rune","rung","runway","rural","rush","russia","rust","rustic","rusty","sack","sacred","sad","saddle","sadism","sadly","safari","safe","safely","safer","safety","saga","sage","sahara","said","sail","sailor","saint","sake","salad","salary","sale","saline","saliva","salmon","saloon","salt","salty","salute","sam","same","sample","sand","sandy","sane","sash","satin","satire","saturn","sauce","saucer","saudi","sauna","savage","save","saw","say","scale","scalp","scan","scant","scar","scarce","scare","scarf","scary","scene","scenic","scent","school","scold","scope","score","scorn","scotch","scott","scout","scrap","scrape","scream","screen","screw","script","scroll","scrub","scum","sea","seal","seam","seaman","search","season","seat","second","secret","sect","sector","secure","see","seed","seeing","seek","seem","seize","seldom","select","self","sell","seller","semi","senate","send","senile","senior","sense","sensor","sent","sentry","seoul","sequel","serene","serial","series","sermon","serum","serve","server","set","settle","seven","severe","sew","sewage","shabby","shade","shadow","shady","shaft","shaggy","shah","shake","shaky","shall","sham","shame","shape","share","shark","sharp","shawl","she","shear","sheen","sheep","sheer","sheet","shelf","shell","sherry","shield","shift","shine","shiny","ship","shire","shirk","shirt","shiver","shock","shoe","shook","shoot","shop","shore","short","shot","should","shout","show","shower","shrank","shrewd","shrill","shrimp","shrine","shrink","shrub","shrug","shut","shy","shyly","sick","side","siege","sigh","sight","sigma","sign","signal","silent","silk","silken","silky","sill","silly","silo","silver","simple","simply","since","sinful","sing","singer","single","sink","sir","sire","siren","sister","sit","site","sitter","six","sixth","sixty","size","sketch","skill","skin","skinny","skip","skirt","skull","sky","slab","slack","slain","slam","slang","slap","slat","slate","slave","sleek","sleep","sleepy","sleeve","slice","slick","slid","slide","slight","slim","slimy","sling","slip","slit","slogan","slope","sloppy","slot","slow","slowly","slug","slum","slump","smack","small","smart","smash","smear","smell","smelly","smelt","smile","smite","smoke","smoky","smooth","smug","snack","snail","snake","snap","snatch","sneak","snow","snowy","snug","soak","soap","sober","soccer","social","sock","socket","socks","soda","sodden","sodium","sofa","soft","soften","softly","soggy","soil","solar","sold","sole","solely","solemn","solid","solo","solve","some","son","sonar","sonata","song","sonic","sony","soon","sooner","soot","soothe","sordid","sore","sorrow","sorry","sort","soul","sound","soup","sour","source","soviet","sow","space","spade","spain","span","spare","spark","sparse","spasm","spat","spate","speak","spear","speech","speed","speedy","spell","spend","sphere","spice","spicy","spider","spiky","spill","spin","spinal","spine","spiral","spirit","spit","spite","splash","split","spoil","spoke","sponge","spoon","sport","spot","spouse","spray","spread","spree","spring","sprint","spur","squad","square","squash","squat","squid","stab","stable","stack","staff","stage","stain","stair","stairs","stake","stale","stall","stamp","stance","stand","staple","star","starch","stare","stark","start","starve","state","static","statue","status","stay","stead","steady","steak","steal","steam","steel","steep","steer","stem","stench","step","stereo","stern","stew","stick","sticky","stiff","stifle","stigma","still","sting","stint","stir","stitch","stock","stocky","stone","stony","stool","stop","store","storm","stormy","story","stout","stove","stow","strain","strait","strand","strap","strata","straw","stray","streak","stream","street","stress","strict","stride","strife","strike","string","strip","stripe","strive","stroke","stroll","strong","stud","studio","study","stuff","stuffy","stunt","stupid","sturdy","style","submit","subtle","subtly","suburb","such","sudden","sue","suez","suffer","sugar","suit","suite","suitor","sullen","sultan","sum","summer","summit","summon","sun","sunday","sunny","sunset","super","superb","supper","supple","supply","sure","surely","surf","surge","survey","suture","swamp","swan","swap","swarm","sway","swear","sweat","sweaty","sweden","sweep","sweet","swell","swift","swim","swine","swing","swirl","swiss","switch","sword","swore","sydney","symbol","synod","syntax","syria","syrup","system","table","tablet","taboo","tacit","tackle","tact","tactic","tail","tailor","taiwan","take","tale","talent","talk","tall","tally","tame","tampa","tan","tandem","tangle","tank","tap","tape","target","tariff","tarp","tart","tarzan","task","taste","tasty","tattoo","taurus","taut","tavern","tax","taxi","tea","teach","teak","team","tear","tease","tech","teeth","tell","temper","temple","tempo","tempt","ten","tenant","tend","tender","tendon","tennis","tenor","tense","tent","tenth","tenure","teresa","term","terror","terse","test","texas","text","thank","thaw","them","theme","thence","theory","there","these","thesis","they","thick","thief","thigh","thin","thing","think","third","thirst","thirty","this","thomas","thorn","those","though","thread","threat","three","thrill","thrive","throat","throne","throng","throw","thrust","thud","thug","thumb","thus","thyme","tibet","tick","ticket","tidal","tide","tidy","tie","tier","tiger","tight","tile","till","tilt","timber","time","timid","tin","tiny","tip","tire","tissue","title","toad","toast","today","toe","toilet","token","tokyo","told","toll","tom","tomato","tomb","tonal","tone","tongue","tonic","too","took","tool","tooth","top","topaz","topic","torch","torque","torso","tort","toss","total","touch","tough","tour","toward","towel","tower","town","toxic","toxin","toy","trace","track","tract","trade","tragic","trail","train","trait","tram","trance","trap","trauma","travel","tray","tread","treat","treaty","treble","tree","trek","tremor","trench","trend","trendy","trial","tribal","tribe","trick","tricky","tried","trifle","trim","trio","trip","triple","troop","trophy","trot","trough","trout","truce","truck","true","truly","trunk","trust","truth","try","tube","tumble","tuna","tundra","tune","tunic","tunnel","turban","turf","turk","turkey","turn","turtle","tutor","tweed","twelve","twenty","twice","twin","twist","two","tycoon","tying","type","tyrant","ugly","ulcer","ultra","umpire","unable","uncle","under","uneasy","unfair","unify","union","unique","unit","unite","unity","unlike","unrest","unruly","until","update","upheld","uphill","uphold","upon","upper","uproar","upset","upshot","uptake","upturn","upward","urban","urge","urgent","urging","urine","usable","usage","use","useful","user","usual","utmost","utter","vacant","vacuum","vague","vain","valet","valid","valley","value","valve","van","vanish","vanity","vary","vase","vast","vat","vault","vector","veil","vein","velvet","vendor","veneer","venice","venom","vent","venue","venus","verb","verbal","verge","verify","verity","verse","versus","very","vessel","vest","vet","veto","via","viable","vicar","vice","victim","victor","video","vienna","view","vigil","viking","vile","villa","vine","vinyl","viola","violet","violin","viral","virgo","virtue","virus","visa","vision","visit","visual","vital","vivid","vocal","vodka","vogue","voice","void","volley","volume","vote","vowel","voyage","vulgar","wade","wage","waist","wait","waiter","wake","walk","walker","wall","wallet","walnut","wander","want","war","warden","warm","warmth","warn","warp","warsaw","wary","was","wash","wasp","waste","watch","water","watery","wave","wax","way","weak","weaken","wealth","weapon","wear","weary","weave","wedge","wee","weed","week","weekly","weep","weigh","weight","weird","well","were","west","wet","whale","wharf","what","wheat","wheel","when","whence","where","which","whiff","while","whim","whip","whisky","white","who","whole","wholly","whom","whose","why","wicked","wide","widely","widen","wider","widow","width","wife","wig","wild","wildly","will","willow","wily","win","wind","window","windy","wine","wing","wink","winner","winter","wipe","wire","wisdom","wise","wish","wit","witch","with","within","witty","wizard","woke","wolf","wolves","woman","womb","won","wonder","wood","wooden","woods","woody","wool","word","work","worker","world","worm","worry","worse","worst","worth","worthy","would","wound","wrap","wrath","wreath","wreck","wring","wrist","writ","write","writer","wrong","xerox","yacht","yale","yard","yarn","yeah","year","yeard","yeast","yellow","yet","yield","yogurt","yolk","you","young","your","youth","zaire","zeal","zebra","zenith","zero","zeus","zigzag","zinc","zombie","zone"];var Z5=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"];var $ne=Ie(zy(),1);var Hne=Ie(require("crypto"),1);async function mE(r){return Hne.default.createHash("sha256").update(r).digest()}async function DD(r,e){let t=r.join(" "),n=`mnemonic${e}`.normalize("NFKD");return Od(Jn.Sha512,t,n,2048,64)}function PD(r,e){let t=r.map(o=>e.indexOf(o.toLowerCase())),n=EUe(t,e.length,256,33),i=n[n.length-1],a=new Uint8Array(n.length-1);for(let o=0;o<n.length-1;o+=1)a[o]=n[o]^i;return[a,i]}async function zne(r,e){let t=r.length*11,n=[];n.fill(!1,0,t);for(let[l,u]of r.entries()){let d=e.indexOf(u.toLowerCase());if(d<0)throw new Error(`Word not found in wordlist: ${u}`);for(let h=0;h<11;h+=1)n[l*11+h]=(d&1<<10-h)!==0}let i=t/33,a=t-i,o=new Uint8Array(a/8);for(let l=0;l<o.length;l+=1)for(let u=0;u<8;u+=1)n[l*8+u]&&(o[l]|=1<<7-u);let s=await mE(o),c=xUe(s);for(let l=0;l<i;l+=1)if(n[a+l]!==c[l])throw new Error("Checksum mismatch");return o}function Gne(r){let e=255;for(let t=0;t<r.length-1;t+=1){e^=r[t];for(let n=0;n<8;n+=1)e=e>>>1^(e&1?178:0)}return e^255}function EUe(r,e,t,n){let i=new Qe(0);for(let o of r)i=i.times(e),i=i.plus(o);let a=new Uint8Array(n);for(let o=n-1;o>=0;o-=1){let s=i.dividedToIntegerBy(t),c=i.modulo(t);i=s,a[o]=c.toNumber()}return a}function xUe(r){let e=[];e.fill(!1,0,r.length*8);for(let t=0;t<r.length;t+=1)for(let n=0;n<8;n+=1)e[t*8+n]=(r[t]&1<<7-n)!==0;return e}var TUe="ed25519 seed",SUe="Bitcoin seed",D2=2147483648,gE=[44,3030,0,0],Yne=[44|D2,3030|D2,0|D2,0],Jne=[44|D2,60|D2,0|D2,0,0],nu=class r{constructor({words:e}){this.words=e}static generate(){return r._generate(24)}static generate12(){return r._generate(12)}static async _generate(e){let t;if(e===12)t=16;else if(e===24)t=32;else throw new Error(`unsupported phrase length ${e}, only 12 or 24 are supported`);let n=await C0(t),i=Zne(Array.from(n)),a=await Qne(n),s=(i+a).match(/(.{1,11})/g),c=(s??[]).map(l=>Z5[Wne(l)]);return new r({words:c})}static fromWords(e){return new r({words:e})._validate()}toPrivateKey(e=""){return this.toEd25519PrivateKey(e)}async toEd25519PrivateKey(e="",t=gE){let{keyData:n,chainCode:i}=await this._toKeyData(e,TUe);for(let o of t)({keyData:n,chainCode:i}=await V_(n,i,o));let a=$ne.default.sign.keyPair.fromSeed(n);if(F3.privateKeyConstructor==null)throw new Error("PrivateKey not found in cache");return F3.privateKeyConstructor(new Qa(a,i))}async toStandardEd25519PrivateKey(e="",t){let n=await r.toSeed(this.words,e),i=await Pn.fromSeedED25519(n);t=t??0;for(let a of[44,3030,0,0,t])i=await i.derive(a);return i}async toEcdsaPrivateKey(e="",t=gE){let{keyData:n,chainCode:i}=await this._toKeyData(e,SUe);for(let a of t)({keyData:n,chainCode:i}=await A2(n,i,a));if(F3.privateKeyConstructor==null)throw new Error("PrivateKey not found in cache");return F3.privateKeyConstructor(new Oo(gf(n),i))}async toStandardECDSAsecp256k1PrivateKey(e="",t){let n=await r.toSeed(this.words,e),i=await Pn.fromSeedECDSAsecp256k1(n);t=t??0;for(let a of[q_(44),q_(3030),q_(0),0,t])i=await i.derive(a);return i}static async toSeed(e,t){return await DD(e,t)}async _toKeyData(e,t){let n=await DD(this.words,e),i=await Vc(Jn.Sha512,t,n);return{keyData:i.subarray(0,32),chainCode:i.subarray(32)}}static async fromString(e){return r.fromWords(e.split(/\s|,/))}async _validate(){if(this.words.length===22){let e=this.words.reduce((a,o,s)=>hE.includes(o.toLowerCase())?a:[...a,s],[]);if(e.length>0)throw new Yc(this,U3.UnknownWords,e);let[t,n]=PD(this.words,hE),i=Gne(t);if(n!==i)throw new Yc(this,U3.ChecksumMismatch,[])}else{if(!(this.words.length===12||this.words.length===24))throw new Yc(this,U3.BadLength,[]);let e=this.words.reduce((l,u,d)=>Z5.includes(u)?l:[...l,d],[]);if(e.length>0)throw new Yc(this,U3.UnknownWords,e);let t=this.words.map(l=>Z5.indexOf(l).toString(2).padStart(11,"0")).join(""),n=Math.floor(t.length/33)*32,i=t.slice(0,n),a=t.slice(n),s=i.match(/(.{1,8})/g).map(Wne);if(await Qne(Uint8Array.from(s))!==a)throw new Yc(this,U3.ChecksumMismatch,[])}return this}async toLegacyPrivateKey(){let e;if(this.words.length===22?[e]=PD(this.words,hE):e=await zne(this.words,Z5),F3.privateKeyFromBytes==null)throw new Error("PrivateKey not found in cache");return F3.privateKeyFromBytes(e)}toString(){return this.words.join(" ")}};function Wne(r){return parseInt(r,2)}function Zne(r){return r.map(e=>e.toString(2).padStart(8,"0")).join("")}async function Qne(r){let t=r.length*8/32,n=await mE(r);return Zne(Array.from(n)).slice(0,t)}function yE(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;let t=new DataView(r.buffer,r.byteOffset,r.byteLength),n=new DataView(e.buffer,e.byteOffset,e.byteLength),i=r.byteLength;for(;i--;)if(t.getUint8(i)!==n.getUint8(i))return!1;return!0}var MD=class{constructor(){this._timeDrift=0,this._contractId=null,this._keyList=null,this._thresholdKey=null,this._publicKeyED25519=null,this._publicKeyECDSA=null,this._privateKeyConstructor=null,this._mnemonicFromString=null,this._accountIdConstructor=null,this._delegateContractId=null,this._evmAddress=null,this._ethereumTransactionDataLegacyFromBytes=null,this._ethereumTransactionDataEip1559FromBytes=null,this._ethereumTransactionDataEip2930FromBytes=null,this._transactionReceiptQueryConstructor=null,this._transactionRecordQueryConstructor=null}setTimeDrift(e){this._timeDrift=e}get timeDrift(){if(this._timeDrift==null)throw new Error("Cache.timeDrift was used before it was set");return this._timeDrift}setContractId(e){this._contractId=e}get contractId(){if(this._contractId==null)throw new Error("Cache.contractId was used before it was set");return this._contractId}setKeyList(e){this._keyList=e}get keyList(){if(this._keyList==null)throw new Error("Cache.keyList was used before it was set");return this._keyList}setThresholdKey(e){this._thresholdKey=e}get thresholdKey(){if(this._thresholdKey==null)throw new Error("Cache.thresholdKey was used before it was set");return this._thresholdKey}setPublicKeyED25519(e){this._publicKeyED25519=e}get publicKeyED25519(){if(this._publicKeyED25519==null)throw new Error("Cache.publicKeyED25519 was used before it was set");return this._publicKeyED25519}setPublicKeyECDSA(e){this._publicKeyECDSA=e}get publicKeyECDSA(){if(this._publicKeyECDSA==null)throw new Error("Cache.publicKeyECDSA was used before it was set");return this._publicKeyECDSA}setPrivateKeyConstructor(e){this._privateKeyConstructor=e}get privateKeyConstructor(){if(this._privateKeyConstructor==null)throw new Error("Cache.privateKeyConstructor was used before it was set");return this._privateKeyConstructor}setMnemonicFromString(e){this._mnemonicFromString=e}get mnemonicFromString(){if(this._mnemonicFromString==null)throw new Error("Cache.mnemonicFromString was used before it was set");return this.mnemonicFromString}setAccountIdConstructor(e){this._accountIdConstructor=e}get accountIdConstructor(){if(this._accountIdConstructor==null)throw new Error("Cache.accountIdConstructor was used before it was set");return this._accountIdConstructor}setDelegateContractId(e){this._delegateContractId=e}get delegateContractId(){if(this._delegateContractId==null)throw new Error("Cache.delegateContractId was used before it was set");return this._delegateContractId}setEvmAddress(e){this._evmAddress=e}get evmAddress(){if(this._evmAddress==null)throw new Error("Cache.evmAddress was used before it was set");return this._evmAddress}setEthereumTransactionDataLegacyFromBytes(e){this._ethereumTransactionDataLegacyFromBytes=e}get ethereumTransactionDataLegacyFromBytes(){if(this._ethereumTransactionDataLegacyFromBytes==null)throw new Error("Cache.ethereumTransactionDataLegacyFromBytes was used before it was set");return this._ethereumTransactionDataLegacyFromBytes}setEthereumTransactionDataEip1559FromBytes(e){this._ethereumTransactionDataEip1559FromBytes=e}get ethereumTransactionDataEip1559FromBytes(){if(this._ethereumTransactionDataEip1559FromBytes==null)throw new Error("Cache.ethereumTransactionDataEip1559FromBytes was used before it was set");return this._ethereumTransactionDataEip1559FromBytes}setEthereumTransactionDataEip2930FromBytes(e){this._ethereumTransactionDataEip2930FromBytes=e}get ethereumTransactionDataEip2930FromBytes(){if(this._ethereumTransactionDataEip2930FromBytes==null)throw new Error("Cache.ethereumTransactionDataEip2930FromBytes was used before it was set");return this._ethereumTransactionDataEip2930FromBytes}setTransactionReceiptQueryConstructor(e){this._transactionReceiptQueryConstructor=e}get transactionReceiptQueryConstructor(){if(this._transactionReceiptQueryConstructor==null)throw new Error("Cache.transactionReceiptQueryConstructor was used before it was set");return this._transactionReceiptQueryConstructor}setTransactionRecordQueryConstructor(e){this._transactionRecordQueryConstructor=e}get transactionRecordQueryConstructor(){if(this._transactionRecordQueryConstructor==null)throw new Error("Cache.transactionRecordQueryConstructor was used before it was set");return this._transactionRecordQueryConstructor}setAddressBookQueryConstructor(e){this._addressBookQueryConstructor=e}get addressBookQueryConstructor(){if(this._addressBookQueryConstructor==null)throw new Error("Cache.addressBookQueryConstructor was used before it was set");return this._addressBookQueryConstructor}},IUe=new MD,ir=IUe;var rt=class{_toProtobufKey(){throw new Error("not implemented")}static _fromProtobufKey(e){return e.contractID!=null?ir.contractId(e.contractID):e.delegatableContractId!=null?ir.delegateContractId(e.delegatableContractId):e.ed25519!=null&&e.ed25519.byteLength>0?ir.publicKeyED25519(e.ed25519):e.ECDSASecp256k1!=null&&e.ECDSASecp256k1.byteLength>0?ir.publicKeyECDSA(e.ECDSASecp256k1):e.thresholdKey!=null&&e.thresholdKey.threshold!=null?ir.thresholdKey(e.thresholdKey):e.keyList!=null?ir.keyList(e.keyList):null}};var Xn=class r extends rt{constructor(e){super(),this._key=e}static fromBytes(e){return new r(e3.fromBytes(e))}static fromBytesED25519(e){return new r(e3.fromBytesED25519(e))}static fromBytesECDSA(e){return new r(e3.fromBytesECDSA(e))}static fromString(e){return new r(e3.fromString(e))}static fromStringECDSA(e){return new r(e3.fromStringECDSA(e))}static fromStringED25519(e){return new r(e3.fromStringED25519(e))}verify(e,t){return this._key.verify(e,t)}verifyTransaction(e){e._requireFrozen(),e.isFrozen()||e.freeze();for(let t of e._signedTransactions.list)if(t.sigMap!=null&&t.sigMap.sigPair!=null){let n=!1;for(let i of t.sigMap.sigPair){let a=i.pubKeyPrefix;if(yE(a,this.toBytesRaw())){n=!0;let o=t.bodyBytes,s=null;if(i.ed25519!=null?s=i.ed25519:i.ECDSASecp256k1!=null&&(s=i.ECDSASecp256k1),s==null)continue;if(!this.verify(o,s))return!1}}if(!n)return!1}return!0}toBytes(){return this._key.toBytes()}toBytesDer(){return this._key.toBytesDer()}toBytesRaw(){return this._key.toBytesRaw()}toEthereumAddress(){return this._key.toEthereumAddress()}toEvmAddress(){return this._key.toEthereumAddress()}toString(){return this._key.toString()}toStringDer(){return this._key.toStringDer()}toStringRaw(){return this._key.toStringRaw()}equals(e){return this._key.equals(e._key)}_toProtobufKey(){switch(this._key._type){case"ED25519":return{ed25519:this._key.toBytesRaw()};case"secp256k1":return{ECDSASecp256k1:this._key.toBytesRaw()};default:throw new Error(`unrecognized key type ${this._key._type}`)}}_toProtobufSignature(e){switch(this._key._type){case"ED25519":return{pubKeyPrefix:this._key.toBytesRaw(),ed25519:e};case"secp256k1":return{pubKeyPrefix:this._key.toBytesRaw(),ECDSASecp256k1:e};default:throw new Error(`unrecognized key type ${this._key._type}`)}}toAccountId(e,t){return ir.accountIdConstructor(e,t,this)}};ir.setPublicKeyED25519(r=>Xn.fromBytesED25519(r));ir.setPublicKeyECDSA(r=>Xn.fromBytesECDSA(r));var qUe=/^(\d+)(?:\.(\d+)\.([a-fA-F0-9]+))?(?:-([a-z]{5}))?$/;function q3(r,e,t){if(e==null&&t!=null||e!=null&&t==null)throw new Error("invalid entity ID");let[n,i,a]=typeof r=="number"||na.default.isLong(r)?[t!=null?na.default.fromValue(r):na.default.ZERO,e!=null?na.default.fromValue(e):na.default.ZERO,t!=null?na.default.fromValue(t):na.default.fromValue(r)]:[r.shard!=null?na.default.fromValue(r.shard):na.default.ZERO,r.realm!=null?na.default.fromValue(r.realm):na.default.ZERO,na.default.fromValue(r.num)];if(n.isNegative()||i.isNegative()||a.isNegative())throw new Error("negative numbers are not allowed in IDs");return{shard:n,realm:i,num:a}}function ou(r,e){let t=r[0].compare(e[0]);return t!=0||(t=r[1].compare(e[1]),t!=0)?t:r[2].compare(e[2])}function X5(r){let e=qUe.exec(r);if(e==null)throw new Error(`failed to parse entity id: ${r}`);return e[2]==null&&e[3]==null?{shard:"0",realm:"0",numOrHex:e[1],checksum:e[4]}:{shard:e[1],realm:e[2],numOrHex:e[3],checksum:e[4]}}function vf(r){let e=X5(r);if(Number.isNaN(e.shard)||Number.isNaN(e.realm)||Number.isNaN(e.numOrHex))throw new Error("invalid format for entity ID");return{shard:e.shard!=null?na.default.fromString(e.shard):na.default.ZERO,realm:e.realm!=null?na.default.fromString(e.realm):na.default.ZERO,num:na.default.fromString(e.numOrHex),checksum:e.checksum}}function t3(r){let e=r.startsWith("0x")?et(r.slice(2)):et(r);if(e.length!==20)throw new Error(`Invalid hex encoded solidity address length:
10634
- expected length 40, got length ${r.length}`);let t=na.default.fromBytesBE([0,0,0,0,...e.slice(0,4)]),n=na.default.fromBytesBE(Array.from(e.slice(4,12))),i=na.default.fromBytesBE(Array.from(e.slice(12,20)));return[t,n,i]}function j3(r){let e=new Uint8Array(20),t=lo(e),[n,i,a]=r;return t.setUint32(0,Pw(n)),t.setUint32(8,Pw(i)),t.setUint32(16,Pw(a)),He(e)}function hie(r,e){let t="",n=[],i=0,a=0,o=0,s=0,c=0,l=26*26*26,u=26*26*26*26*26,d=97,h=1000003,g=31,m=new Uint8Array(r.length+6);m.set(r,0),m.set([0,0,0,0,0,0],r.length);for(let b=0;b<e.length;b++)n.push(e[b]==="."?10:parseInt(e[b],10));for(let b=0;b<n.length;b++)o=(g*o+n[b])%l,b%2===0?i=(i+n[b])%11:a=(a+n[b])%11;for(let b=0;b<m.length;b++)s=(g*s+m[b])%u;c=(((e.length%5*11+i)*11+a)*l+o+s)%u,c=c*h%u;for(let b=0;b<5;b++)t=String.fromCharCode(d+c%26)+t,c/=26;return t}function V3(r,e,t,n,i){if(i._network._ledgerId==null||n==null)return;let a=hie(i._network._ledgerId._ledgerId,`${r.toString()}.${e.toString()}.${t.toString()}`);if(n!=a)throw new jy(r,e,t,n,a)}function H3(r,e){if(e==null)throw new Error("client cannot be null");if(e._network._ledgerId==null)throw new Error("cannot calculate checksum with a client that does not contain a recognzied ledger ID");let t=hie(e._network._ledgerId._ledgerId,r);return`${r}-${t}`}var B2=class r{constructor(e){this._mnemonic=e}static async generate(){return new r(await nu._generate(24))}static async generate12(){return new r(await nu._generate(12))}static async fromWords(e){return new r(await nu.fromWords(e))}async toPrivateKey(e=""){return ir.privateKeyConstructor(await this._mnemonic.toPrivateKey(e))}async toEd25519PrivateKey(e="",t){return ir.privateKeyConstructor(await this._mnemonic.toEd25519PrivateKey(e,t))}async toStandardEd25519PrivateKey(e="",t){return ir.privateKeyConstructor(await this._mnemonic.toStandardEd25519PrivateKey(e,t))}async toEcdsaPrivateKey(e="",t){return ir.privateKeyConstructor(await this._mnemonic.toEcdsaPrivateKey(e,t))}async toStandardECDSAsecp256k1PrivateKey(e="",t){return ir.privateKeyConstructor(await this._mnemonic.toStandardECDSAsecp256k1PrivateKey(e,t))}static async fromString(e){return new r(await nu.fromString(e))}async toLegacyPrivateKey(){return ir.privateKeyConstructor(await this._mnemonic.toLegacyPrivateKey())}async toSeed(e){return await nu.toSeed(this._mnemonic.words,e)}toString(){return this._mnemonic.toString()}};var Zc=class r extends rt{constructor(e){super(),this._key=e}static generateED25519(){return new r(Pn.generateED25519())}static generateECDSA(){return new r(Pn.generateECDSA())}static generate(){return r.generateED25519()}static async generateAsync(){return new r(await Pn.generateAsync())}static async generateED25519Async(){return new r(await Pn.generateED25519Async())}static async generateECDSAAsync(){return new r(await Pn.generateECDSAAsync())}static fromBytes(e){return new r(Pn.fromBytes(e))}static fromBytesECDSA(e){return new r(Pn.fromBytesECDSA(e))}static fromBytesED25519(e){return new r(Pn.fromBytesED25519(e))}static fromString(e){return new r(Pn.fromString(e))}static fromStringDer(e){return new r(Pn.fromString(e))}static fromStringECDSA(e){return new r(Pn.fromStringECDSA(e))}static fromStringED25519(e){return new r(Pn.fromStringED25519(e))}static async fromSeedED25519(e){return new r(await Pn.fromSeedED25519(e))}static async fromSeedECDSAsecp256k1(e){return new r(await Pn.fromSeedECDSAsecp256k1(e))}static async fromMnemonic(e,t=""){return e instanceof B2?new r(await Pn.fromMnemonic(e._mnemonic,t)):new r(await Pn.fromMnemonic(e,t))}static async fromKeystore(e,t=""){return new r(await Pn.fromKeystore(e,t))}static async fromPem(e,t=""){return new r(await Pn.fromPem(e,t))}async derive(e){return new r(await this._key.derive(e))}async legacyDerive(e){return new r(await this._key.legacyDerive(e))}get publicKey(){return new Xn(this._key.publicKey)}get chainCode(){return this._key._chainCode}sign(e){return this._key.sign(e)}signTransaction(e){let t=e._signedTransactions.get(0),n=t.bodyBytes!=null?this.sign(t.bodyBytes):new Uint8Array;return e.addSignature(this.publicKey,n),n}isDerivable(){return this._key.isDerivable()}toBytes(){return this._key.toBytes()}toBytesDer(){return this._key.toBytesDer()}toBytesRaw(){return this._key.toBytesRaw()}toString(){return this._key.toStringDer()}toStringDer(){return this._key.toStringDer()}toStringRaw(){return this._key.toStringRaw()}toKeystore(e=""){return this._key.toKeystore(e)}_toProtobufKey(){return this.publicKey._toProtobufKey()}toAccountId(e,t){return this.publicKey.toAccountId(e,t)}get type(){return this._key._type}};ir.setPrivateKeyConstructor(r=>new Zc(r));var Ri=class r extends rt{constructor(e,t){super(),e==null?this._keys=[]:e instanceof rt?this._keys=[e]:this._keys=e,this._threshold=t??null}static of(...e){return new r(e,null)}static from(e,t,n){return t==null?new r(Array.from(e)):new r(Array.from(e,t,n))}get threshold(){return this._threshold}setThreshold(e){return this._threshold=e,this}push(...e){return this._keys.push(...e)}splice(e,t,...n){return new r(this._keys.splice(e,t,...n),this.threshold)}slice(e,t){return new r(this._keys.slice(e,t),this.threshold)}[Symbol.iterator](){return this._keys[Symbol.iterator]()}toArray(){return this._keys.slice()}toString(){return JSON.stringify({threshold:this._threshold,keys:this._keys.toString()})}_toProtobufKey(){let e=this._keys.map(t=>t._toProtobufKey());return this.threshold==null?{keyList:{keys:e}}:{thresholdKey:{threshold:this.threshold,keys:{keys:e}}}}static __fromProtobufKeyList(e){let t=(e.keys!=null?e.keys:[]).map(n=>rt._fromProtobufKey(n));return new r(t)}static __fromProtobufThresoldKey(e){let t=r.__fromProtobufKeyList(e.keys!=null?e.keys:{});return t.setThreshold(e.threshold!=null?e.threshold:0),t}};ir.setKeyList(r=>Ri.__fromProtobufKeyList(r));ir.setThresholdKey(r=>Ri.__fromProtobufThresoldKey(r));function mie(r){return Qe.isBigNumber(r)?r:new Qe(r.toString())}var kn=class r{constructor(e,t,n){this._name=e,this._symbol=t,this._tinybar=n,Object.freeze(this)}static fromString(e){switch(e){case r.Hbar._symbol:return r.Hbar;case r.Tinybar._symbol:return r.Tinybar;case r.Microbar._symbol:return r.Microbar;case r.Millibar._symbol:return r.Millibar;case r.Kilobar._symbol:return r.Kilobar;case r.Megabar._symbol:return r.Megabar;case r.Gigabar._symbol:return r.Gigabar;default:throw new Error("Unknown unit.")}}};kn.Tinybar=new kn("tinybar","t\u210F",new Qe(1));kn.Microbar=new kn("microbar","\u03BC\u210F",new Qe(100));kn.Millibar=new kn("millibar","m\u210F",new Qe(1e5));kn.Hbar=new kn("hbar","\u210F",new Qe("100000000"));kn.Kilobar=new kn("kilobar","k\u210F",new Qe(1e3).multipliedBy(new Qe("100000000")));kn.Megabar=new kn("megabar","M\u210F",new Qe(1e6).multipliedBy(new Qe("100000000")));kn.Gigabar=new kn("gigabar","G\u210F",new Qe("1000000000").multipliedBy(new Qe("100000000")));var UD=Ie(Yt(),1),ze=class r{constructor(e,t=kn.Hbar){if(t===kn.Tinybar)this._valueInTinybar=mie(e);else{let n;UD.default.isLong(e)?n=new Qe(e.toString(10)):Qe.isBigNumber(e)||typeof e=="string"||typeof e=="number"?n=new Qe(e):n=new Qe(0),this._valueInTinybar=n.multipliedBy(t._tinybar)}if(!this._valueInTinybar.isInteger())throw new Error("Hbar in tinybars contains decimals")}static from(e,t){return new r(e,t)}static fromTinybars(e){return typeof e=="string"?this.fromString(e,kn.Tinybar):new r(e,kn.Tinybar)}static fromString(e,t=kn.Hbar){if(/^((?:\+|-)?\d+(?:\.\d+)?)(?: (tℏ|μℏ|mℏ|ℏ|kℏ|Mℏ|Gℏ))?$/.test(e)){let[i,a]=e.split(" ");return a!=null&&(t=kn.fromString(a)),new r(new Qe(i),t)}else throw new Error("invalid argument provided")}to(e){return this._valueInTinybar.dividedBy(e._tinybar)}toBigNumber(){return this.to(kn.Hbar)}toTinybars(){return UD.default.fromValue(this._valueInTinybar.toFixed())}negated(){return r.fromTinybars(this._valueInTinybar.negated())}isNegative(){return this._valueInTinybar.isNegative()}toString(e){return e!=null?`${this._valueInTinybar.dividedBy(e._tinybar).toString()} ${e._symbol}`:this._valueInTinybar.isLessThan(1e4)&&this._valueInTinybar.isGreaterThan(-1e4)?`${this._valueInTinybar.toFixed()} ${kn.Tinybar._symbol}`:`${this.to(kn.Hbar).toString()} ${kn.Hbar._symbol}`}};var su=class r extends Error{constructor(e,t){super(t),this.name="StatusError",this.status=e.status,this.transactionId=e.transactionId,this.message=t,typeof Error.captureStackTrace<"u"&&Error.captureStackTrace(this,r)}toJSON(){return{name:this.name,status:this.status.toString(),transactionId:this.transactionId.toString(),message:this.message}}toString(){return JSON.stringify(this.toJSON())}valueOf(){return this.toJSON()}};var Xc=class extends su{constructor(e){super(e,`receipt for transaction ${e.transactionId.toString()} contained error status ${e.status.toString()}`),this.transactionReceipt=e.transactionReceipt}};var P=class r{constructor(e){this._code=e,Object.freeze(this)}toString(){switch(this){case r.Ok:return"OK";case r.InvalidTransaction:return"INVALID_TRANSACTION";case r.PayerAccountNotFound:return"PAYER_ACCOUNT_NOT_FOUND";case r.InvalidNodeAccount:return"INVALID_NODE_ACCOUNT";case r.TransactionExpired:return"TRANSACTION_EXPIRED";case r.InvalidTransactionStart:return"INVALID_TRANSACTION_START";case r.InvalidTransactionDuration:return"INVALID_TRANSACTION_DURATION";case r.InvalidSignature:return"INVALID_SIGNATURE";case r.MemoTooLong:return"MEMO_TOO_LONG";case r.InsufficientTxFee:return"INSUFFICIENT_TX_FEE";case r.InsufficientPayerBalance:return"INSUFFICIENT_PAYER_BALANCE";case r.DuplicateTransaction:return"DUPLICATE_TRANSACTION";case r.Busy:return"BUSY";case r.NotSupported:return"NOT_SUPPORTED";case r.InvalidFileId:return"INVALID_FILE_ID";case r.InvalidAccountId:return"INVALID_ACCOUNT_ID";case r.InvalidContractId:return"INVALID_CONTRACT_ID";case r.InvalidTransactionId:return"INVALID_TRANSACTION_ID";case r.ReceiptNotFound:return"RECEIPT_NOT_FOUND";case r.RecordNotFound:return"RECORD_NOT_FOUND";case r.InvalidSolidityId:return"INVALID_SOLIDITY_ID";case r.Unknown:return"UNKNOWN";case r.Success:return"SUCCESS";case r.FailInvalid:return"FAIL_INVALID";case r.FailFee:return"FAIL_FEE";case r.FailBalance:return"FAIL_BALANCE";case r.KeyRequired:return"KEY_REQUIRED";case r.BadEncoding:return"BAD_ENCODING";case r.InsufficientAccountBalance:return"INSUFFICIENT_ACCOUNT_BALANCE";case r.InvalidSolidityAddress:return"INVALID_SOLIDITY_ADDRESS";case r.InsufficientGas:return"INSUFFICIENT_GAS";case r.ContractSizeLimitExceeded:return"CONTRACT_SIZE_LIMIT_EXCEEDED";case r.LocalCallModificationException:return"LOCAL_CALL_MODIFICATION_EXCEPTION";case r.ContractRevertExecuted:return"CONTRACT_REVERT_EXECUTED";case r.ContractExecutionException:return"CONTRACT_EXECUTION_EXCEPTION";case r.InvalidReceivingNodeAccount:return"INVALID_RECEIVING_NODE_ACCOUNT";case r.MissingQueryHeader:return"MISSING_QUERY_HEADER";case r.AccountUpdateFailed:return"ACCOUNT_UPDATE_FAILED";case r.InvalidKeyEncoding:return"INVALID_KEY_ENCODING";case r.NullSolidityAddress:return"NULL_SOLIDITY_ADDRESS";case r.ContractUpdateFailed:return"CONTRACT_UPDATE_FAILED";case r.InvalidQueryHeader:return"INVALID_QUERY_HEADER";case r.InvalidFeeSubmitted:return"INVALID_FEE_SUBMITTED";case r.InvalidPayerSignature:return"INVALID_PAYER_SIGNATURE";case r.KeyNotProvided:return"KEY_NOT_PROVIDED";case r.InvalidExpirationTime:return"INVALID_EXPIRATION_TIME";case r.NoWaclKey:return"NO_WACL_KEY";case r.FileContentEmpty:return"FILE_CONTENT_EMPTY";case r.InvalidAccountAmounts:return"INVALID_ACCOUNT_AMOUNTS";case r.EmptyTransactionBody:return"EMPTY_TRANSACTION_BODY";case r.InvalidTransactionBody:return"INVALID_TRANSACTION_BODY";case r.InvalidSignatureTypeMismatchingKey:return"INVALID_SIGNATURE_TYPE_MISMATCHING_KEY";case r.InvalidSignatureCountMismatchingKey:return"INVALID_SIGNATURE_COUNT_MISMATCHING_KEY";case r.EmptyLiveHashBody:return"EMPTY_LIVE_HASH_BODY";case r.EmptyLiveHash:return"EMPTY_LIVE_HASH";case r.EmptyLiveHashKeys:return"EMPTY_LIVE_HASH_KEYS";case r.InvalidLiveHashSize:return"INVALID_LIVE_HASH_SIZE";case r.EmptyQueryBody:return"EMPTY_QUERY_BODY";case r.EmptyLiveHashQuery:return"EMPTY_LIVE_HASH_QUERY";case r.LiveHashNotFound:return"LIVE_HASH_NOT_FOUND";case r.AccountIdDoesNotExist:return"ACCOUNT_ID_DOES_NOT_EXIST";case r.LiveHashAlreadyExists:return"LIVE_HASH_ALREADY_EXISTS";case r.InvalidFileWacl:return"INVALID_FILE_WACL";case r.SerializationFailed:return"SERIALIZATION_FAILED";case r.TransactionOversize:return"TRANSACTION_OVERSIZE";case r.TransactionTooManyLayers:return"TRANSACTION_TOO_MANY_LAYERS";case r.ContractDeleted:return"CONTRACT_DELETED";case r.PlatformNotActive:return"PLATFORM_NOT_ACTIVE";case r.KeyPrefixMismatch:return"KEY_PREFIX_MISMATCH";case r.PlatformTransactionNotCreated:return"PLATFORM_TRANSACTION_NOT_CREATED";case r.InvalidRenewalPeriod:return"INVALID_RENEWAL_PERIOD";case r.InvalidPayerAccountId:return"INVALID_PAYER_ACCOUNT_ID";case r.AccountDeleted:return"ACCOUNT_DELETED";case r.FileDeleted:return"FILE_DELETED";case r.AccountRepeatedInAccountAmounts:return"ACCOUNT_REPEATED_IN_ACCOUNT_AMOUNTS";case r.SettingNegativeAccountBalance:return"SETTING_NEGATIVE_ACCOUNT_BALANCE";case r.ObtainerRequired:return"OBTAINER_REQUIRED";case r.ObtainerSameContractId:return"OBTAINER_SAME_CONTRACT_ID";case r.ObtainerDoesNotExist:return"OBTAINER_DOES_NOT_EXIST";case r.ModifyingImmutableContract:return"MODIFYING_IMMUTABLE_CONTRACT";case r.FileSystemException:return"FILE_SYSTEM_EXCEPTION";case r.AutorenewDurationNotInRange:return"AUTORENEW_DURATION_NOT_IN_RANGE";case r.ErrorDecodingBytestring:return"ERROR_DECODING_BYTESTRING";case r.ContractFileEmpty:return"CONTRACT_FILE_EMPTY";case r.ContractBytecodeEmpty:return"CONTRACT_BYTECODE_EMPTY";case r.InvalidInitialBalance:return"INVALID_INITIAL_BALANCE";case r.InvalidReceiveRecordThreshold:return"INVALID_RECEIVE_RECORD_THRESHOLD";case r.InvalidSendRecordThreshold:return"INVALID_SEND_RECORD_THRESHOLD";case r.AccountIsNotGenesisAccount:return"ACCOUNT_IS_NOT_GENESIS_ACCOUNT";case r.PayerAccountUnauthorized:return"PAYER_ACCOUNT_UNAUTHORIZED";case r.InvalidFreezeTransactionBody:return"INVALID_FREEZE_TRANSACTION_BODY";case r.FreezeTransactionBodyNotFound:return"FREEZE_TRANSACTION_BODY_NOT_FOUND";case r.TransferListSizeLimitExceeded:return"TRANSFER_LIST_SIZE_LIMIT_EXCEEDED";case r.ResultSizeLimitExceeded:return"RESULT_SIZE_LIMIT_EXCEEDED";case r.NotSpecialAccount:return"NOT_SPECIAL_ACCOUNT";case r.ContractNegativeGas:return"CONTRACT_NEGATIVE_GAS";case r.ContractNegativeValue:return"CONTRACT_NEGATIVE_VALUE";case r.InvalidFeeFile:return"INVALID_FEE_FILE";case r.InvalidExchangeRateFile:return"INVALID_EXCHANGE_RATE_FILE";case r.InsufficientLocalCallGas:return"INSUFFICIENT_LOCAL_CALL_GAS";case r.EntityNotAllowedToDelete:return"ENTITY_NOT_ALLOWED_TO_DELETE";case r.AuthorizationFailed:return"AUTHORIZATION_FAILED";case r.FileUploadedProtoInvalid:return"FILE_UPLOADED_PROTO_INVALID";case r.FileUploadedProtoNotSavedToDisk:return"FILE_UPLOADED_PROTO_NOT_SAVED_TO_DISK";case r.FeeScheduleFilePartUploaded:return"FEE_SCHEDULE_FILE_PART_UPLOADED";case r.ExchangeRateChangeLimitExceeded:return"EXCHANGE_RATE_CHANGE_LIMIT_EXCEEDED";case r.MaxContractStorageExceeded:return"MAX_CONTRACT_STORAGE_EXCEEDED";case r.TransferAccountSameAsDeleteAccount:return"TRANSFER_ACCOUNT_SAME_AS_DELETE_ACCOUNT";case r.TotalLedgerBalanceInvalid:return"TOTAL_LEDGER_BALANCE_INVALID";case r.ExpirationReductionNotAllowed:return"EXPIRATION_REDUCTION_NOT_ALLOWED";case r.MaxGasLimitExceeded:return"MAX_GAS_LIMIT_EXCEEDED";case r.MaxFileSizeExceeded:return"MAX_FILE_SIZE_EXCEEDED";case r.ReceiverSigRequired:return"RECEIVER_SIG_REQUIRED";case r.InvalidTopicId:return"INVALID_TOPIC_ID";case r.InvalidAdminKey:return"INVALID_ADMIN_KEY";case r.InvalidSubmitKey:return"INVALID_SUBMIT_KEY";case r.Unauthorized:return"UNAUTHORIZED";case r.InvalidTopicMessage:return"INVALID_TOPIC_MESSAGE";case r.InvalidAutorenewAccount:return"INVALID_AUTORENEW_ACCOUNT";case r.AutorenewAccountNotAllowed:return"AUTORENEW_ACCOUNT_NOT_ALLOWED";case r.TopicExpired:return"TOPIC_EXPIRED";case r.InvalidChunkNumber:return"INVALID_CHUNK_NUMBER";case r.InvalidChunkTransactionId:return"INVALID_CHUNK_TRANSACTION_ID";case r.AccountFrozenForToken:return"ACCOUNT_FROZEN_FOR_TOKEN";case r.TokensPerAccountLimitExceeded:return"TOKENS_PER_ACCOUNT_LIMIT_EXCEEDED";case r.InvalidTokenId:return"INVALID_TOKEN_ID";case r.InvalidTokenDecimals:return"INVALID_TOKEN_DECIMALS";case r.InvalidTokenInitialSupply:return"INVALID_TOKEN_INITIAL_SUPPLY";case r.InvalidTreasuryAccountForToken:return"INVALID_TREASURY_ACCOUNT_FOR_TOKEN";case r.InvalidTokenSymbol:return"INVALID_TOKEN_SYMBOL";case r.TokenHasNoFreezeKey:return"TOKEN_HAS_NO_FREEZE_KEY";case r.TransfersNotZeroSumForToken:return"TRANSFERS_NOT_ZERO_SUM_FOR_TOKEN";case r.MissingTokenSymbol:return"MISSING_TOKEN_SYMBOL";case r.TokenSymbolTooLong:return"TOKEN_SYMBOL_TOO_LONG";case r.AccountKycNotGrantedForToken:return"ACCOUNT_KYC_NOT_GRANTED_FOR_TOKEN";case r.TokenHasNoKycKey:return"TOKEN_HAS_NO_KYC_KEY";case r.InsufficientTokenBalance:return"INSUFFICIENT_TOKEN_BALANCE";case r.TokenWasDeleted:return"TOKEN_WAS_DELETED";case r.TokenHasNoSupplyKey:return"TOKEN_HAS_NO_SUPPLY_KEY";case r.TokenHasNoWipeKey:return"TOKEN_HAS_NO_WIPE_KEY";case r.InvalidTokenMintAmount:return"INVALID_TOKEN_MINT_AMOUNT";case r.InvalidTokenBurnAmount:return"INVALID_TOKEN_BURN_AMOUNT";case r.TokenNotAssociatedToAccount:return"TOKEN_NOT_ASSOCIATED_TO_ACCOUNT";case r.CannotWipeTokenTreasuryAccount:return"CANNOT_WIPE_TOKEN_TREASURY_ACCOUNT";case r.InvalidKycKey:return"INVALID_KYC_KEY";case r.InvalidWipeKey:return"INVALID_WIPE_KEY";case r.InvalidFreezeKey:return"INVALID_FREEZE_KEY";case r.InvalidSupplyKey:return"INVALID_SUPPLY_KEY";case r.MissingTokenName:return"MISSING_TOKEN_NAME";case r.TokenNameTooLong:return"TOKEN_NAME_TOO_LONG";case r.InvalidWipingAmount:return"INVALID_WIPING_AMOUNT";case r.TokenIsImmutable:return"TOKEN_IS_IMMUTABLE";case r.TokenAlreadyAssociatedToAccount:return"TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT";case r.TransactionRequiresZeroTokenBalances:return"TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES";case r.AccountIsTreasury:return"ACCOUNT_IS_TREASURY";case r.TokenIdRepeatedInTokenList:return"TOKEN_ID_REPEATED_IN_TOKEN_LIST";case r.TokenTransferListSizeLimitExceeded:return"TOKEN_TRANSFER_LIST_SIZE_LIMIT_EXCEEDED";case r.EmptyTokenTransferBody:return"EMPTY_TOKEN_TRANSFER_BODY";case r.EmptyTokenTransferAccountAmounts:return"EMPTY_TOKEN_TRANSFER_ACCOUNT_AMOUNTS";case r.InvalidScheduleId:return"INVALID_SCHEDULE_ID";case r.ScheduleIsImmutable:return"SCHEDULE_IS_IMMUTABLE";case r.InvalidSchedulePayerId:return"INVALID_SCHEDULE_PAYER_ID";case r.InvalidScheduleAccountId:return"INVALID_SCHEDULE_ACCOUNT_ID";case r.NoNewValidSignatures:return"NO_NEW_VALID_SIGNATURES";case r.UnresolvableRequiredSigners:return"UNRESOLVABLE_REQUIRED_SIGNERS";case r.ScheduledTransactionNotInWhitelist:return"SCHEDULED_TRANSACTION_NOT_IN_WHITELIST";case r.SomeSignaturesWereInvalid:return"SOME_SIGNATURES_WERE_INVALID";case r.TransactionIdFieldNotAllowed:return"TRANSACTION_ID_FIELD_NOT_ALLOWED";case r.IdenticalScheduleAlreadyCreated:return"IDENTICAL_SCHEDULE_ALREADY_CREATED";case r.InvalidZeroByteInString:return"INVALID_ZERO_BYTE_IN_STRING";case r.ScheduleAlreadyDeleted:return"SCHEDULE_ALREADY_DELETED";case r.ScheduleAlreadyExecuted:return"SCHEDULE_ALREADY_EXECUTED";case r.MessageSizeTooLarge:return"MESSAGE_SIZE_TOO_LARGE";case r.OperationRepeatedInBucketGroups:return"OPERATION_REPEATED_IN_BUCKET_GROUPS";case r.BucketCapacityOverflow:return"BUCKET_CAPACITY_OVERFLOW";case r.NodeCapacityNotSufficientForOperation:return"NODE_CAPACITY_NOT_SUFFICIENT_FOR_OPERATION";case r.BucketHasNoThrottleGroups:return"BUCKET_HAS_NO_THROTTLE_GROUPS";case r.ThrottleGroupHasZeroOpsPerSec:return"THROTTLE_GROUP_HAS_ZERO_OPS_PER_SEC";case r.SuccessButMissingExpectedOperation:return"SUCCESS_BUT_MISSING_EXPECTED_OPERATION";case r.UnparseableThrottleDefinitions:return"UNPARSEABLE_THROTTLE_DEFINITIONS";case r.InvalidThrottleDefinitions:return"INVALID_THROTTLE_DEFINITIONS";case r.AccountExpiredAndPendingRemoval:return"ACCOUNT_EXPIRED_AND_PENDING_REMOVAL";case r.InvalidTokenMaxSupply:return"INVALID_TOKEN_MAX_SUPPLY";case r.InvalidTokenNftSerialNumber:return"INVALID_TOKEN_NFT_SERIAL_NUMBER";case r.InvalidNftId:return"INVALID_NFT_ID";case r.MetadataTooLong:return"METADATA_TOO_LONG";case r.BatchSizeLimitExceeded:return"BATCH_SIZE_LIMIT_EXCEEDED";case r.InvalidQueryRange:return"INVALID_QUERY_RANGE";case r.FractionDividesByZero:return"FRACTION_DIVIDES_BY_ZERO";case r.InsufficientPayerBalanceForCustomFee:return"INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE";case r.CustomFeesListTooLong:return"CUSTOM_FEES_LIST_TOO_LONG";case r.InvalidCustomFeeCollector:return"INVALID_CUSTOM_FEE_COLLECTOR";case r.InvalidTokenIdInCustomFees:return"INVALID_TOKEN_ID_IN_CUSTOM_FEES";case r.TokenNotAssociatedToFeeCollector:return"TOKEN_NOT_ASSOCIATED_TO_FEE_COLLECTOR";case r.TokenMaxSupplyReached:return"TOKEN_MAX_SUPPLY_REACHED";case r.SenderDoesNotOwnNftSerialNo:return"SENDER_DOES_NOT_OWN_NFT_SERIAL_NO";case r.CustomFeeNotFullySpecified:return"CUSTOM_FEE_NOT_FULLY_SPECIFIED";case r.CustomFeeMustBePositive:return"CUSTOM_FEE_MUST_BE_POSITIVE";case r.TokenHasNoFeeScheduleKey:return"TOKEN_HAS_NO_FEE_SCHEDULE_KEY";case r.CustomFeeOutsideNumericRange:return"CUSTOM_FEE_OUTSIDE_NUMERIC_RANGE";case r.RoyaltyFractionCannotExceedOne:return"ROYALTY_FRACTION_CANNOT_EXCEED_ONE";case r.FractionalFeeMaxAmountLessThanMinAmount:return"FRACTIONAL_FEE_MAX_AMOUNT_LESS_THAN_MIN_AMOUNT";case r.CustomScheduleAlreadyHasNoFees:return"CUSTOM_SCHEDULE_ALREADY_HAS_NO_FEES";case r.CustomFeeDenominationMustBeFungibleCommon:return"CUSTOM_FEE_DENOMINATION_MUST_BE_FUNGIBLE_COMMON";case r.CustomFractionalFeeOnlyAllowedForFungibleCommon:return"CUSTOM_FRACTIONAL_FEE_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON";case r.InvalidCustomFeeScheduleKey:return"INVALID_CUSTOM_FEE_SCHEDULE_KEY";case r.InvalidTokenMintMetadata:return"INVALID_TOKEN_MINT_METADATA";case r.InvalidTokenBurnMetadata:return"INVALID_TOKEN_BURN_METADATA";case r.CurrentTreasuryStillOwnsNfts:return"CURRENT_TREASURY_STILL_OWNS_NFTS";case r.AccountStillOwnsNfts:return"ACCOUNT_STILL_OWNS_NFTS";case r.TreasuryMustOwnBurnedNft:return"TREASURY_MUST_OWN_BURNED_NFT";case r.AccountDoesNotOwnWipedNft:return"ACCOUNT_DOES_NOT_OWN_WIPED_NFT";case r.AccountAmountTransfersOnlyAllowedForFungibleCommon:return"ACCOUNT_AMOUNT_TRANSFERS_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON";case r.MaxNftsInPriceRegimeHaveBeenMinted:return"MAX_NFTS_IN_PRICE_REGIME_HAVE_BEEN_MINTED";case r.PayerAccountDeleted:return"PAYER_ACCOUNT_DELETED";case r.CustomFeeChargingExceededMaxRecursionDepth:return"CUSTOM_FEE_CHARGING_EXCEEDED_MAX_RECURSION_DEPTH";case r.CustomFeeChargingExceededMaxAccountAmounts:return"CUSTOM_FEE_CHARGING_EXCEEDED_MAX_ACCOUNT_AMOUNTS";case r.InsufficientSenderAccountBalanceForCustomFee:return"INSUFFICIENT_SENDER_ACCOUNT_BALANCE_FOR_CUSTOM_FEE";case r.SerialNumberLimitReached:return"SERIAL_NUMBER_LIMIT_REACHED";case r.CustomRoyaltyFeeOnlyAllowedForNonFungibleUnique:return"CUSTOM_ROYALTY_FEE_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE";case r.NoRemainingAutomaticAssociations:return"NO_REMAINING_AUTOMATIC_ASSOCIATIONS";case r.ExistingAutomaticAssociationsExceedGivenLimit:return"EXISTING_AUTOMATIC_ASSOCIATIONS_EXCEED_GIVEN_LIMIT";case r.RequestedNumAutomaticAssociationsExceedsAssociationLimit:return"REQUESTED_NUM_AUTOMATIC_ASSOCIATIONS_EXCEEDS_ASSOCIATION_LIMIT";case r.TokenIsPaused:return"TOKEN_IS_PAUSED";case r.TokenHasNoPauseKey:return"TOKEN_HAS_NO_PAUSE_KEY";case r.InvalidPauseKey:return"INVALID_PAUSE_KEY";case r.FreezeUpdateFileDoesNotExist:return"FREEZE_UPDATE_FILE_DOES_NOT_EXIST";case r.FreezeUpdateFileHashDoesNotMatch:return"FREEZE_UPDATE_FILE_HASH_DOES_NOT_MATCH";case r.NoUpgradeHasBeenPrepared:return"NO_UPGRADE_HAS_BEEN_PREPARED";case r.NoFreezeIsScheduled:return"NO_FREEZE_IS_SCHEDULED";case r.UpdateFileHashChangedSincePrepareUpgrade:return"UPDATE_FILE_HASH_CHANGED_SINCE_PREPARE_UPGRADE";case r.FreezeStartTimeMustBeFuture:return"FREEZE_START_TIME_MUST_BE_FUTURE";case r.PreparedUpdateFileIsImmutable:return"PREPARED_UPDATE_FILE_IS_IMMUTABLE";case r.FreezeAlreadyScheduled:return"FREEZE_ALREADY_SCHEDULED";case r.FreezeUpgradeInProgress:return"FREEZE_UPGRADE_IN_PROGRESS";case r.UpdateFileIdDoesNotMatchPrepared:return"UPDATE_FILE_ID_DOES_NOT_MATCH_PREPARED";case r.UpdateFileHashDoesNotMatchPrepared:return"UPDATE_FILE_HASH_DOES_NOT_MATCH_PREPARED";case r.ConsensusGasExhausted:return"CONSENSUS_GAS_EXHAUSTED";case r.RevertedSuccess:return"REVERTED_SUCCESS";case r.MaxStorageInPriceRegimeHasBeenUsed:return"MAX_STORAGE_IN_PRICE_REGIME_HAS_BEEN_USED";case r.InvalidAliasKey:return"INVALID_ALIAS_KEY";case r.UnexpectedTokenDecimals:return"UNEXPECTED_TOKEN_DECIMALS";case r.InvalidProxyAccountId:return"INVALID_PROXY_ACCOUNT_ID";case r.InvalidTransferAccountId:return"INVALID_TRANSFER_ACCOUNT_ID";case r.InvalidFeeCollectorAccountId:return"INVALID_FEE_COLLECTOR_ACCOUNT_ID";case r.AliasIsImmutable:return"ALIAS_IS_IMMUTABLE";case r.SpenderAccountSameAsOwner:return"SPENDER_ACCOUNT_SAME_AS_OWNER";case r.AmountExceedsTokenMaxSupply:return"AMOUNT_EXCEEDS_TOKEN_MAX_SUPPLY";case r.NegativeAllowanceAmount:return"NEGATIVE_ALLOWANCE_AMOUNT";case r.CannotApproveForAllFungibleCommon:return"CANNOT_APPROVE_FOR_ALL_FUNGIBLE_COMMON";case r.SpenderDoesNotHaveAllowance:return"SPENDER_DOES_NOT_HAVE_ALLOWANCE";case r.AmountExceedsAllowance:return"AMOUNT_EXCEEDS_ALLOWANCE";case r.MaxAllowancesExceeded:return"MAX_ALLOWANCES_EXCEEDED";case r.EmptyAllowances:return"EMPTY_ALLOWANCES";case r.SpenderAccountRepeatedInAllowances:return"SPENDER_ACCOUNT_REPEATED_IN_ALLOWANCES";case r.RepeatedSerialNumsInNftAllowances:return"REPEATED_SERIAL_NUMS_IN_NFT_ALLOWANCES";case r.FungibleTokenInNftAllowances:return"FUNGIBLE_TOKEN_IN_NFT_ALLOWANCES";case r.NftInFungibleTokenAllowances:return"NFT_IN_FUNGIBLE_TOKEN_ALLOWANCES";case r.InvalidAllowanceOwnerId:return"INVALID_ALLOWANCE_OWNER_ID";case r.InvalidAllowanceSpenderId:return"INVALID_ALLOWANCE_SPENDER_ID";case r.RepeatedAllowancesToDelete:return"REPEATED_ALLOWANCES_TO_DELETE";case r.InvalidDelegatingSpender:return"INVALID_DELEGATING_SPENDER";case r.DelegatingSpenderCannotGrantApproveForAll:return"DELEGATING_SPENDER_CANNOT_GRANT_APPROVE_FOR_ALL";case r.DelegatingSpenderDoesNotHaveApproveForAll:return"DELEGATING_SPENDER_DOES_NOT_HAVE_APPROVE_FOR_ALL";case r.ScheduleExpirationTimeTooFarInFuture:return"SCHEDULE_EXPIRATION_TIME_TOO_FAR_IN_FUTURE";case r.ScheduleExpirationTimeMustBeHigherThanConsensusTime:return"SCHEDULE_EXPIRATION_TIME_MUST_BE_HIGHER_THAN_CONSENSUS_TIME";case r.ScheduleFutureThrottleExceeded:return"SCHEDULE_FUTURE_THROTTLE_EXCEEDED";case r.ScheduleFutureGasLimitExceeded:return"SCHEDULE_FUTURE_GAS_LIMIT_EXCEEDED";case r.InvalidEthereumTransaction:return"INVALID_ETHEREUM_TRANSACTION";case r.WrongChainId:return"WRONG_CHAIN_ID";case r.WrongNonce:return"WRONG_NONCE";case r.AccessListUnsupported:return"ACCESS_LIST_UNSUPPORTED";case r.SchedulePendingExpiration:return"SCHEDULE_PENDING_EXPIRATION";case r.ContractIsTokenTreasury:return"CONTRACT_IS_TOKEN_TREASURY";case r.ContractHasNonZeroTokenBalances:return"CONTRACT_HAS_NON_ZERO_TOKEN_BALANCES";case r.ContractExpiredAndPendingRemoval:return"CONTRACT_EXPIRED_AND_PENDING_REMOVAL";case r.ContractHasNoAutoRenewAccount:return"CONTRACT_HAS_NO_AUTO_RENEW_ACCOUNT";case r.PermanentRemovalRequiresSystemInitiation:return"PERMANENT_REMOVAL_REQUIRES_SYSTEM_INITIATION";case r.ProxyAccountIdFieldIsDeprecated:return"PROXY_ACCOUNT_ID_FIELD_IS_DEPRECATED";case r.SelfStakingIsNotAllowed:return"SELF_STAKING_IS_NOT_ALLOWED";case r.InvalidStakingId:return"INVALID_STAKING_ID";case r.StakingNotEnabled:return"STAKING_NOT_ENABLED";case r.InvalidPrngRange:return"INVALID_PRNG_RANGE";case r.MaxEntitiesInPriceRegimeHaveBeenCreated:return"MAX_ENTITIES_IN_PRICE_REGIME_HAVE_BEEN_CREATED";case r.InvalidFullPrefixSignatureForPrecompile:return"INVALID_FULL_PREFIX_SIGNATURE_FOR_PRECOMPILE";case r.InsufficientBalancesForStorageRent:return"INSUFFICIENT_BALANCES_FOR_STORAGE_RENT";case r.MaxChildRecordsExceeded:return"MAX_CHILD_RECORDS_EXCEEDED";case r.InsufficientBalancesForRenewalFees:return"INSUFFICIENT_BALANCES_FOR_RENEWAL_FEES";case r.TransactionHasUnknownFields:return"TRANSACTION_HAS_UNKNOWN_FIELDS";case r.AccountIsImmutable:return"ACCOUNT_IS_IMMUTABLE";case r.AliasAlreadyAssigned:return"ALIAS_ALREADY_ASSIGNED";default:return`UNKNOWN (${this._code})`}}static _fromCode(e){switch(e){case 0:return r.Ok;case 1:return r.InvalidTransaction;case 2:return r.PayerAccountNotFound;case 3:return r.InvalidNodeAccount;case 4:return r.TransactionExpired;case 5:return r.InvalidTransactionStart;case 6:return r.InvalidTransactionDuration;case 7:return r.InvalidSignature;case 8:return r.MemoTooLong;case 9:return r.InsufficientTxFee;case 10:return r.InsufficientPayerBalance;case 11:return r.DuplicateTransaction;case 12:return r.Busy;case 13:return r.NotSupported;case 14:return r.InvalidFileId;case 15:return r.InvalidAccountId;case 16:return r.InvalidContractId;case 17:return r.InvalidTransactionId;case 18:return r.ReceiptNotFound;case 19:return r.RecordNotFound;case 20:return r.InvalidSolidityId;case 21:return r.Unknown;case 22:return r.Success;case 23:return r.FailInvalid;case 24:return r.FailFee;case 25:return r.FailBalance;case 26:return r.KeyRequired;case 27:return r.BadEncoding;case 28:return r.InsufficientAccountBalance;case 29:return r.InvalidSolidityAddress;case 30:return r.InsufficientGas;case 31:return r.ContractSizeLimitExceeded;case 32:return r.LocalCallModificationException;case 33:return r.ContractRevertExecuted;case 34:return r.ContractExecutionException;case 35:return r.InvalidReceivingNodeAccount;case 36:return r.MissingQueryHeader;case 37:return r.AccountUpdateFailed;case 38:return r.InvalidKeyEncoding;case 39:return r.NullSolidityAddress;case 40:return r.ContractUpdateFailed;case 41:return r.InvalidQueryHeader;case 42:return r.InvalidFeeSubmitted;case 43:return r.InvalidPayerSignature;case 44:return r.KeyNotProvided;case 45:return r.InvalidExpirationTime;case 46:return r.NoWaclKey;case 47:return r.FileContentEmpty;case 48:return r.InvalidAccountAmounts;case 49:return r.EmptyTransactionBody;case 50:return r.InvalidTransactionBody;case 51:return r.InvalidSignatureTypeMismatchingKey;case 52:return r.InvalidSignatureCountMismatchingKey;case 53:return r.EmptyLiveHashBody;case 54:return r.EmptyLiveHash;case 55:return r.EmptyLiveHashKeys;case 56:return r.InvalidLiveHashSize;case 57:return r.EmptyQueryBody;case 58:return r.EmptyLiveHashQuery;case 59:return r.LiveHashNotFound;case 60:return r.AccountIdDoesNotExist;case 61:return r.LiveHashAlreadyExists;case 62:return r.InvalidFileWacl;case 63:return r.SerializationFailed;case 64:return r.TransactionOversize;case 65:return r.TransactionTooManyLayers;case 66:return r.ContractDeleted;case 67:return r.PlatformNotActive;case 68:return r.KeyPrefixMismatch;case 69:return r.PlatformTransactionNotCreated;case 70:return r.InvalidRenewalPeriod;case 71:return r.InvalidPayerAccountId;case 72:return r.AccountDeleted;case 73:return r.FileDeleted;case 74:return r.AccountRepeatedInAccountAmounts;case 75:return r.SettingNegativeAccountBalance;case 76:return r.ObtainerRequired;case 77:return r.ObtainerSameContractId;case 78:return r.ObtainerDoesNotExist;case 79:return r.ModifyingImmutableContract;case 80:return r.FileSystemException;case 81:return r.AutorenewDurationNotInRange;case 82:return r.ErrorDecodingBytestring;case 83:return r.ContractFileEmpty;case 84:return r.ContractBytecodeEmpty;case 85:return r.InvalidInitialBalance;case 86:return r.InvalidReceiveRecordThreshold;case 87:return r.InvalidSendRecordThreshold;case 88:return r.AccountIsNotGenesisAccount;case 89:return r.PayerAccountUnauthorized;case 90:return r.InvalidFreezeTransactionBody;case 91:return r.FreezeTransactionBodyNotFound;case 92:return r.TransferListSizeLimitExceeded;case 93:return r.ResultSizeLimitExceeded;case 94:return r.NotSpecialAccount;case 95:return r.ContractNegativeGas;case 96:return r.ContractNegativeValue;case 97:return r.InvalidFeeFile;case 98:return r.InvalidExchangeRateFile;case 99:return r.InsufficientLocalCallGas;case 100:return r.EntityNotAllowedToDelete;case 101:return r.AuthorizationFailed;case 102:return r.FileUploadedProtoInvalid;case 103:return r.FileUploadedProtoNotSavedToDisk;case 104:return r.FeeScheduleFilePartUploaded;case 105:return r.ExchangeRateChangeLimitExceeded;case 106:return r.MaxContractStorageExceeded;case 107:return r.TransferAccountSameAsDeleteAccount;case 108:return r.TotalLedgerBalanceInvalid;case 110:return r.ExpirationReductionNotAllowed;case 111:return r.MaxGasLimitExceeded;case 112:return r.MaxFileSizeExceeded;case 113:return r.ReceiverSigRequired;case 150:return r.InvalidTopicId;case 155:return r.InvalidAdminKey;case 156:return r.InvalidSubmitKey;case 157:return r.Unauthorized;case 158:return r.InvalidTopicMessage;case 159:return r.InvalidAutorenewAccount;case 160:return r.AutorenewAccountNotAllowed;case 162:return r.TopicExpired;case 163:return r.InvalidChunkNumber;case 164:return r.InvalidChunkTransactionId;case 165:return r.AccountFrozenForToken;case 166:return r.TokensPerAccountLimitExceeded;case 167:return r.InvalidTokenId;case 168:return r.InvalidTokenDecimals;case 169:return r.InvalidTokenInitialSupply;case 170:return r.InvalidTreasuryAccountForToken;case 171:return r.InvalidTokenSymbol;case 172:return r.TokenHasNoFreezeKey;case 173:return r.TransfersNotZeroSumForToken;case 174:return r.MissingTokenSymbol;case 175:return r.TokenSymbolTooLong;case 176:return r.AccountKycNotGrantedForToken;case 177:return r.TokenHasNoKycKey;case 178:return r.InsufficientTokenBalance;case 179:return r.TokenWasDeleted;case 180:return r.TokenHasNoSupplyKey;case 181:return r.TokenHasNoWipeKey;case 182:return r.InvalidTokenMintAmount;case 183:return r.InvalidTokenBurnAmount;case 184:return r.TokenNotAssociatedToAccount;case 185:return r.CannotWipeTokenTreasuryAccount;case 186:return r.InvalidKycKey;case 187:return r.InvalidWipeKey;case 188:return r.InvalidFreezeKey;case 189:return r.InvalidSupplyKey;case 190:return r.MissingTokenName;case 191:return r.TokenNameTooLong;case 192:return r.InvalidWipingAmount;case 193:return r.TokenIsImmutable;case 194:return r.TokenAlreadyAssociatedToAccount;case 195:return r.TransactionRequiresZeroTokenBalances;case 196:return r.AccountIsTreasury;case 197:return r.TokenIdRepeatedInTokenList;case 198:return r.TokenTransferListSizeLimitExceeded;case 199:return r.EmptyTokenTransferBody;case 200:return r.EmptyTokenTransferAccountAmounts;case 201:return r.InvalidScheduleId;case 202:return r.ScheduleIsImmutable;case 203:return r.InvalidSchedulePayerId;case 204:return r.InvalidScheduleAccountId;case 205:return r.NoNewValidSignatures;case 206:return r.UnresolvableRequiredSigners;case 207:return r.ScheduledTransactionNotInWhitelist;case 208:return r.SomeSignaturesWereInvalid;case 209:return r.TransactionIdFieldNotAllowed;case 210:return r.IdenticalScheduleAlreadyCreated;case 211:return r.InvalidZeroByteInString;case 212:return r.ScheduleAlreadyDeleted;case 213:return r.ScheduleAlreadyExecuted;case 214:return r.MessageSizeTooLarge;case 215:return r.OperationRepeatedInBucketGroups;case 216:return r.BucketCapacityOverflow;case 217:return r.NodeCapacityNotSufficientForOperation;case 218:return r.BucketHasNoThrottleGroups;case 219:return r.ThrottleGroupHasZeroOpsPerSec;case 220:return r.SuccessButMissingExpectedOperation;case 221:return r.UnparseableThrottleDefinitions;case 222:return r.InvalidThrottleDefinitions;case 223:return r.AccountExpiredAndPendingRemoval;case 224:return r.InvalidTokenMaxSupply;case 225:return r.InvalidTokenNftSerialNumber;case 226:return r.InvalidNftId;case 227:return r.MetadataTooLong;case 228:return r.BatchSizeLimitExceeded;case 229:return r.InvalidQueryRange;case 230:return r.FractionDividesByZero;case 231:return r.InsufficientPayerBalanceForCustomFee;case 232:return r.CustomFeesListTooLong;case 233:return r.InvalidCustomFeeCollector;case 234:return r.InvalidTokenIdInCustomFees;case 235:return r.TokenNotAssociatedToFeeCollector;case 236:return r.TokenMaxSupplyReached;case 237:return r.SenderDoesNotOwnNftSerialNo;case 238:return r.CustomFeeNotFullySpecified;case 239:return r.CustomFeeMustBePositive;case 240:return r.TokenHasNoFeeScheduleKey;case 241:return r.CustomFeeOutsideNumericRange;case 242:return r.RoyaltyFractionCannotExceedOne;case 243:return r.FractionalFeeMaxAmountLessThanMinAmount;case 244:return r.CustomScheduleAlreadyHasNoFees;case 245:return r.CustomFeeDenominationMustBeFungibleCommon;case 246:return r.CustomFractionalFeeOnlyAllowedForFungibleCommon;case 247:return r.InvalidCustomFeeScheduleKey;case 248:return r.InvalidTokenMintMetadata;case 249:return r.InvalidTokenBurnMetadata;case 250:return r.CurrentTreasuryStillOwnsNfts;case 251:return r.AccountStillOwnsNfts;case 252:return r.TreasuryMustOwnBurnedNft;case 253:return r.AccountDoesNotOwnWipedNft;case 254:return r.AccountAmountTransfersOnlyAllowedForFungibleCommon;case 255:return r.MaxNftsInPriceRegimeHaveBeenMinted;case 256:return r.PayerAccountDeleted;case 257:return r.CustomFeeChargingExceededMaxRecursionDepth;case 258:return r.CustomFeeChargingExceededMaxAccountAmounts;case 259:return r.InsufficientSenderAccountBalanceForCustomFee;case 260:return r.SerialNumberLimitReached;case 261:return r.CustomRoyaltyFeeOnlyAllowedForNonFungibleUnique;case 262:return r.NoRemainingAutomaticAssociations;case 263:return r.ExistingAutomaticAssociationsExceedGivenLimit;case 264:return r.RequestedNumAutomaticAssociationsExceedsAssociationLimit;case 265:return r.TokenIsPaused;case 266:return r.TokenHasNoPauseKey;case 267:return r.InvalidPauseKey;case 268:return r.FreezeUpdateFileDoesNotExist;case 269:return r.FreezeUpdateFileHashDoesNotMatch;case 270:return r.NoUpgradeHasBeenPrepared;case 271:return r.NoFreezeIsScheduled;case 272:return r.UpdateFileHashChangedSincePrepareUpgrade;case 273:return r.FreezeStartTimeMustBeFuture;case 274:return r.PreparedUpdateFileIsImmutable;case 275:return r.FreezeAlreadyScheduled;case 276:return r.FreezeUpgradeInProgress;case 277:return r.UpdateFileIdDoesNotMatchPrepared;case 278:return r.UpdateFileHashDoesNotMatchPrepared;case 279:return r.ConsensusGasExhausted;case 280:return r.RevertedSuccess;case 281:return r.MaxStorageInPriceRegimeHasBeenUsed;case 282:return r.InvalidAliasKey;case 283:return r.UnexpectedTokenDecimals;case 284:return r.InvalidProxyAccountId;case 285:return r.InvalidTransferAccountId;case 286:return r.InvalidFeeCollectorAccountId;case 287:return r.AliasIsImmutable;case 288:return r.SpenderAccountSameAsOwner;case 289:return r.AmountExceedsTokenMaxSupply;case 290:return r.NegativeAllowanceAmount;case 291:return r.CannotApproveForAllFungibleCommon;case 292:return r.SpenderDoesNotHaveAllowance;case 293:return r.AmountExceedsAllowance;case 294:return r.MaxAllowancesExceeded;case 295:return r.EmptyAllowances;case 296:return r.SpenderAccountRepeatedInAllowances;case 297:return r.RepeatedSerialNumsInNftAllowances;case 298:return r.FungibleTokenInNftAllowances;case 299:return r.NftInFungibleTokenAllowances;case 300:return r.InvalidAllowanceOwnerId;case 301:return r.InvalidAllowanceSpenderId;case 302:return r.RepeatedAllowancesToDelete;case 303:return r.InvalidDelegatingSpender;case 304:return r.DelegatingSpenderCannotGrantApproveForAll;case 305:return r.DelegatingSpenderDoesNotHaveApproveForAll;case 306:return r.ScheduleExpirationTimeTooFarInFuture;case 307:return r.ScheduleExpirationTimeMustBeHigherThanConsensusTime;case 308:return r.ScheduleFutureThrottleExceeded;case 309:return r.ScheduleFutureGasLimitExceeded;case 310:return r.InvalidEthereumTransaction;case 311:return r.WrongChainId;case 312:return r.WrongNonce;case 313:return r.AccessListUnsupported;case 314:return r.SchedulePendingExpiration;case 315:return r.ContractIsTokenTreasury;case 316:return r.ContractHasNonZeroTokenBalances;case 317:return r.ContractExpiredAndPendingRemoval;case 318:return r.ContractHasNoAutoRenewAccount;case 319:return r.PermanentRemovalRequiresSystemInitiation;case 320:return r.ProxyAccountIdFieldIsDeprecated;case 321:return r.SelfStakingIsNotAllowed;case 322:return r.InvalidStakingId;case 323:return r.StakingNotEnabled;case 324:return r.InvalidPrngRange;case 325:return r.MaxEntitiesInPriceRegimeHaveBeenCreated;case 326:return r.InvalidFullPrefixSignatureForPrecompile;case 327:return r.InsufficientBalancesForStorageRent;case 328:return r.MaxChildRecordsExceeded;case 329:return r.InsufficientBalancesForRenewalFees;case 330:return r.TransactionHasUnknownFields;case 331:return r.AccountIsImmutable;case 332:return r.AliasAlreadyAssigned;default:throw new Error(`(BUG) Status.fromCode() does not handle code: ${e}`)}}valueOf(){return this._code}};P.Ok=new P(0);P.InvalidTransaction=new P(1);P.PayerAccountNotFound=new P(2);P.InvalidNodeAccount=new P(3);P.TransactionExpired=new P(4);P.InvalidTransactionStart=new P(5);P.InvalidTransactionDuration=new P(6);P.InvalidSignature=new P(7);P.MemoTooLong=new P(8);P.InsufficientTxFee=new P(9);P.InsufficientPayerBalance=new P(10);P.DuplicateTransaction=new P(11);P.Busy=new P(12);P.NotSupported=new P(13);P.InvalidFileId=new P(14);P.InvalidAccountId=new P(15);P.InvalidContractId=new P(16);P.InvalidTransactionId=new P(17);P.ReceiptNotFound=new P(18);P.RecordNotFound=new P(19);P.InvalidSolidityId=new P(20);P.Unknown=new P(21);P.Success=new P(22);P.FailInvalid=new P(23);P.FailFee=new P(24);P.FailBalance=new P(25);P.KeyRequired=new P(26);P.BadEncoding=new P(27);P.InsufficientAccountBalance=new P(28);P.InvalidSolidityAddress=new P(29);P.InsufficientGas=new P(30);P.ContractSizeLimitExceeded=new P(31);P.LocalCallModificationException=new P(32);P.ContractRevertExecuted=new P(33);P.ContractExecutionException=new P(34);P.InvalidReceivingNodeAccount=new P(35);P.MissingQueryHeader=new P(36);P.AccountUpdateFailed=new P(37);P.InvalidKeyEncoding=new P(38);P.NullSolidityAddress=new P(39);P.ContractUpdateFailed=new P(40);P.InvalidQueryHeader=new P(41);P.InvalidFeeSubmitted=new P(42);P.InvalidPayerSignature=new P(43);P.KeyNotProvided=new P(44);P.InvalidExpirationTime=new P(45);P.NoWaclKey=new P(46);P.FileContentEmpty=new P(47);P.InvalidAccountAmounts=new P(48);P.EmptyTransactionBody=new P(49);P.InvalidTransactionBody=new P(50);P.InvalidSignatureTypeMismatchingKey=new P(51);P.InvalidSignatureCountMismatchingKey=new P(52);P.EmptyLiveHashBody=new P(53);P.EmptyLiveHash=new P(54);P.EmptyLiveHashKeys=new P(55);P.InvalidLiveHashSize=new P(56);P.EmptyQueryBody=new P(57);P.EmptyLiveHashQuery=new P(58);P.LiveHashNotFound=new P(59);P.AccountIdDoesNotExist=new P(60);P.LiveHashAlreadyExists=new P(61);P.InvalidFileWacl=new P(62);P.SerializationFailed=new P(63);P.TransactionOversize=new P(64);P.TransactionTooManyLayers=new P(65);P.ContractDeleted=new P(66);P.PlatformNotActive=new P(67);P.KeyPrefixMismatch=new P(68);P.PlatformTransactionNotCreated=new P(69);P.InvalidRenewalPeriod=new P(70);P.InvalidPayerAccountId=new P(71);P.AccountDeleted=new P(72);P.FileDeleted=new P(73);P.AccountRepeatedInAccountAmounts=new P(74);P.SettingNegativeAccountBalance=new P(75);P.ObtainerRequired=new P(76);P.ObtainerSameContractId=new P(77);P.ObtainerDoesNotExist=new P(78);P.ModifyingImmutableContract=new P(79);P.FileSystemException=new P(80);P.AutorenewDurationNotInRange=new P(81);P.ErrorDecodingBytestring=new P(82);P.ContractFileEmpty=new P(83);P.ContractBytecodeEmpty=new P(84);P.InvalidInitialBalance=new P(85);P.InvalidReceiveRecordThreshold=new P(86);P.InvalidSendRecordThreshold=new P(87);P.AccountIsNotGenesisAccount=new P(88);P.PayerAccountUnauthorized=new P(89);P.InvalidFreezeTransactionBody=new P(90);P.FreezeTransactionBodyNotFound=new P(91);P.TransferListSizeLimitExceeded=new P(92);P.ResultSizeLimitExceeded=new P(93);P.NotSpecialAccount=new P(94);P.ContractNegativeGas=new P(95);P.ContractNegativeValue=new P(96);P.InvalidFeeFile=new P(97);P.InvalidExchangeRateFile=new P(98);P.InsufficientLocalCallGas=new P(99);P.EntityNotAllowedToDelete=new P(100);P.AuthorizationFailed=new P(101);P.FileUploadedProtoInvalid=new P(102);P.FileUploadedProtoNotSavedToDisk=new P(103);P.FeeScheduleFilePartUploaded=new P(104);P.ExchangeRateChangeLimitExceeded=new P(105);P.MaxContractStorageExceeded=new P(106);P.TransferAccountSameAsDeleteAccount=new P(107);P.TotalLedgerBalanceInvalid=new P(108);P.ExpirationReductionNotAllowed=new P(110);P.MaxGasLimitExceeded=new P(111);P.MaxFileSizeExceeded=new P(112);P.ReceiverSigRequired=new P(113);P.InvalidTopicId=new P(150);P.InvalidAdminKey=new P(155);P.InvalidSubmitKey=new P(156);P.Unauthorized=new P(157);P.InvalidTopicMessage=new P(158);P.InvalidAutorenewAccount=new P(159);P.AutorenewAccountNotAllowed=new P(160);P.TopicExpired=new P(162);P.InvalidChunkNumber=new P(163);P.InvalidChunkTransactionId=new P(164);P.AccountFrozenForToken=new P(165);P.TokensPerAccountLimitExceeded=new P(166);P.InvalidTokenId=new P(167);P.InvalidTokenDecimals=new P(168);P.InvalidTokenInitialSupply=new P(169);P.InvalidTreasuryAccountForToken=new P(170);P.InvalidTokenSymbol=new P(171);P.TokenHasNoFreezeKey=new P(172);P.TransfersNotZeroSumForToken=new P(173);P.MissingTokenSymbol=new P(174);P.TokenSymbolTooLong=new P(175);P.AccountKycNotGrantedForToken=new P(176);P.TokenHasNoKycKey=new P(177);P.InsufficientTokenBalance=new P(178);P.TokenWasDeleted=new P(179);P.TokenHasNoSupplyKey=new P(180);P.TokenHasNoWipeKey=new P(181);P.InvalidTokenMintAmount=new P(182);P.InvalidTokenBurnAmount=new P(183);P.TokenNotAssociatedToAccount=new P(184);P.CannotWipeTokenTreasuryAccount=new P(185);P.InvalidKycKey=new P(186);P.InvalidWipeKey=new P(187);P.InvalidFreezeKey=new P(188);P.InvalidSupplyKey=new P(189);P.MissingTokenName=new P(190);P.TokenNameTooLong=new P(191);P.InvalidWipingAmount=new P(192);P.TokenIsImmutable=new P(193);P.TokenAlreadyAssociatedToAccount=new P(194);P.TransactionRequiresZeroTokenBalances=new P(195);P.AccountIsTreasury=new P(196);P.TokenIdRepeatedInTokenList=new P(197);P.TokenTransferListSizeLimitExceeded=new P(198);P.EmptyTokenTransferBody=new P(199);P.EmptyTokenTransferAccountAmounts=new P(200);P.InvalidScheduleId=new P(201);P.ScheduleIsImmutable=new P(202);P.InvalidSchedulePayerId=new P(203);P.InvalidScheduleAccountId=new P(204);P.NoNewValidSignatures=new P(205);P.UnresolvableRequiredSigners=new P(206);P.ScheduledTransactionNotInWhitelist=new P(207);P.SomeSignaturesWereInvalid=new P(208);P.TransactionIdFieldNotAllowed=new P(209);P.IdenticalScheduleAlreadyCreated=new P(210);P.InvalidZeroByteInString=new P(211);P.ScheduleAlreadyDeleted=new P(212);P.ScheduleAlreadyExecuted=new P(213);P.MessageSizeTooLarge=new P(214);P.OperationRepeatedInBucketGroups=new P(215);P.BucketCapacityOverflow=new P(216);P.NodeCapacityNotSufficientForOperation=new P(217);P.BucketHasNoThrottleGroups=new P(218);P.ThrottleGroupHasZeroOpsPerSec=new P(219);P.SuccessButMissingExpectedOperation=new P(220);P.UnparseableThrottleDefinitions=new P(221);P.InvalidThrottleDefinitions=new P(222);P.AccountExpiredAndPendingRemoval=new P(223);P.InvalidTokenMaxSupply=new P(224);P.InvalidTokenNftSerialNumber=new P(225);P.InvalidNftId=new P(226);P.MetadataTooLong=new P(227);P.BatchSizeLimitExceeded=new P(228);P.InvalidQueryRange=new P(229);P.FractionDividesByZero=new P(230);P.InsufficientPayerBalanceForCustomFee=new P(231);P.CustomFeesListTooLong=new P(232);P.InvalidCustomFeeCollector=new P(233);P.InvalidTokenIdInCustomFees=new P(234);P.TokenNotAssociatedToFeeCollector=new P(235);P.TokenMaxSupplyReached=new P(236);P.SenderDoesNotOwnNftSerialNo=new P(237);P.CustomFeeNotFullySpecified=new P(238);P.CustomFeeMustBePositive=new P(239);P.TokenHasNoFeeScheduleKey=new P(240);P.CustomFeeOutsideNumericRange=new P(241);P.RoyaltyFractionCannotExceedOne=new P(242);P.FractionalFeeMaxAmountLessThanMinAmount=new P(243);P.CustomScheduleAlreadyHasNoFees=new P(244);P.CustomFeeDenominationMustBeFungibleCommon=new P(245);P.CustomFractionalFeeOnlyAllowedForFungibleCommon=new P(246);P.InvalidCustomFeeScheduleKey=new P(247);P.InvalidTokenMintMetadata=new P(248);P.InvalidTokenBurnMetadata=new P(249);P.CurrentTreasuryStillOwnsNfts=new P(250);P.AccountStillOwnsNfts=new P(251);P.TreasuryMustOwnBurnedNft=new P(252);P.AccountDoesNotOwnWipedNft=new P(253);P.AccountAmountTransfersOnlyAllowedForFungibleCommon=new P(254);P.MaxNftsInPriceRegimeHaveBeenMinted=new P(255);P.PayerAccountDeleted=new P(256);P.CustomFeeChargingExceededMaxRecursionDepth=new P(257);P.CustomFeeChargingExceededMaxAccountAmounts=new P(258);P.InsufficientSenderAccountBalanceForCustomFee=new P(259);P.SerialNumberLimitReached=new P(260);P.CustomRoyaltyFeeOnlyAllowedForNonFungibleUnique=new P(261);P.NoRemainingAutomaticAssociations=new P(262);P.ExistingAutomaticAssociationsExceedGivenLimit=new P(263);P.RequestedNumAutomaticAssociationsExceedsAssociationLimit=new P(264);P.TokenIsPaused=new P(265);P.TokenHasNoPauseKey=new P(266);P.InvalidPauseKey=new P(267);P.FreezeUpdateFileDoesNotExist=new P(268);P.FreezeUpdateFileHashDoesNotMatch=new P(269);P.NoUpgradeHasBeenPrepared=new P(270);P.NoFreezeIsScheduled=new P(271);P.UpdateFileHashChangedSincePrepareUpgrade=new P(272);P.FreezeStartTimeMustBeFuture=new P(273);P.PreparedUpdateFileIsImmutable=new P(274);P.FreezeAlreadyScheduled=new P(275);P.FreezeUpgradeInProgress=new P(276);P.UpdateFileIdDoesNotMatchPrepared=new P(277);P.UpdateFileHashDoesNotMatchPrepared=new P(278);P.ConsensusGasExhausted=new P(279);P.RevertedSuccess=new P(280);P.MaxStorageInPriceRegimeHasBeenUsed=new P(281);P.InvalidAliasKey=new P(282);P.UnexpectedTokenDecimals=new P(283);P.InvalidProxyAccountId=new P(284);P.InvalidTransferAccountId=new P(285);P.InvalidFeeCollectorAccountId=new P(286);P.AliasIsImmutable=new P(287);P.SpenderAccountSameAsOwner=new P(288);P.AmountExceedsTokenMaxSupply=new P(289);P.NegativeAllowanceAmount=new P(290);P.CannotApproveForAllFungibleCommon=new P(291);P.SpenderDoesNotHaveAllowance=new P(292);P.AmountExceedsAllowance=new P(293);P.MaxAllowancesExceeded=new P(294);P.EmptyAllowances=new P(295);P.SpenderAccountRepeatedInAllowances=new P(296);P.RepeatedSerialNumsInNftAllowances=new P(297);P.FungibleTokenInNftAllowances=new P(298);P.NftInFungibleTokenAllowances=new P(299);P.InvalidAllowanceOwnerId=new P(300);P.InvalidAllowanceSpenderId=new P(301);P.RepeatedAllowancesToDelete=new P(302);P.InvalidDelegatingSpender=new P(303);P.DelegatingSpenderCannotGrantApproveForAll=new P(304);P.DelegatingSpenderDoesNotHaveApproveForAll=new P(305);P.ScheduleExpirationTimeTooFarInFuture=new P(306);P.ScheduleExpirationTimeMustBeHigherThanConsensusTime=new P(307);P.ScheduleFutureThrottleExceeded=new P(308);P.ScheduleFutureGasLimitExceeded=new P(309);P.InvalidEthereumTransaction=new P(310);P.WrongChainId=new P(311);P.WrongNonce=new P(312);P.AccessListUnsupported=new P(313);P.SchedulePendingExpiration=new P(314);P.ContractIsTokenTreasury=new P(315);P.ContractHasNonZeroTokenBalances=new P(316);P.ContractExpiredAndPendingRemoval=new P(317);P.ContractHasNoAutoRenewAccount=new P(318);P.PermanentRemovalRequiresSystemInitiation=new P(319);P.ProxyAccountIdFieldIsDeprecated=new P(320);P.SelfStakingIsNotAllowed=new P(321);P.InvalidStakingId=new P(322);P.StakingNotEnabled=new P(323);P.InvalidPrngRange=new P(324);P.MaxEntitiesInPriceRegimeHaveBeenCreated=new P(325);P.InvalidFullPrefixSignatureForPrecompile=new P(326);P.InsufficientBalancesForStorageRent=new P(327);P.MaxChildRecordsExceeded=new P(328);P.InsufficientBalancesForRenewalFees=new P(329);P.TransactionHasUnknownFields=new P(330);P.AccountIsImmutable=new P(331);P.AliasAlreadyAssigned=new P(332);var Ud=Ie(Yt(),1);var h8=Ie(vr(),1);var rs=class r extends rt{constructor(e){super(),this._bytes=e}static fromString(e){return new r(et(e))}static fromBytes(e){return new r(e)}toBytes(){return this._bytes}toString(){return He(this._bytes)}equals(e){return PJ(this._bytes,e._bytes)}};function e8(r,e){return function(){return r.apply(e,arguments)}}var{toString:jUe}=Object.prototype,{getPrototypeOf:VD}=Object,AE=(r=>e=>{let t=jUe.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),cu=r=>(r=r.toLowerCase(),e=>AE(e)===r),TE=r=>e=>typeof e===r,{isArray:M2}=Array,t8=TE("undefined");function VUe(r){return r!==null&&!t8(r)&&r.constructor!==null&&!t8(r.constructor)&&K3(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}var vie=cu("ArrayBuffer");function HUe(r){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&vie(r.buffer),e}var KUe=TE("string"),K3=TE("function"),bie=TE("number"),SE=r=>r!==null&&typeof r=="object",zUe=r=>r===!0||r===!1,xE=r=>{if(AE(r)!=="object")return!1;let e=VD(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)},GUe=cu("Date"),WUe=cu("File"),QUe=cu("Blob"),$Ue=cu("FileList"),YUe=r=>SE(r)&&K3(r.pipe),JUe=r=>{let e;return r&&(typeof FormData=="function"&&r instanceof FormData||K3(r.append)&&((e=AE(r))==="formdata"||e==="object"&&K3(r.toString)&&r.toString()==="[object FormData]"))},ZUe=cu("URLSearchParams"),XUe=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function r8(r,e,{allOwnKeys:t=!1}={}){if(r===null||typeof r>"u")return;let n,i;if(typeof r!="object"&&(r=[r]),M2(r))for(n=0,i=r.length;n<i;n++)e.call(null,r[n],n,r);else{let a=t?Object.getOwnPropertyNames(r):Object.keys(r),o=a.length,s;for(n=0;n<o;n++)s=a[n],e.call(null,r[s],s,r)}}function wie(r,e){e=e.toLowerCase();let t=Object.keys(r),n=t.length,i;for(;n-- >0;)if(i=t[n],e===i.toLowerCase())return i;return null}var _ie=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Eie=r=>!t8(r)&&r!==_ie;function jD(){let{caseless:r}=Eie(this)&&this||{},e={},t=(n,i)=>{let a=r&&wie(e,i)||i;xE(e[a])&&xE(n)?e[a]=jD(e[a],n):xE(n)?e[a]=jD({},n):M2(n)?e[a]=n.slice():e[a]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&r8(arguments[n],t);return e}var eqe=(r,e,t,{allOwnKeys:n}={})=>(r8(e,(i,a)=>{t&&K3(i)?r[a]=e8(i,t):r[a]=i},{allOwnKeys:n}),r),tqe=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),rqe=(r,e,t,n)=>{r.prototype=Object.create(e.prototype,n),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:e.prototype}),t&&Object.assign(r.prototype,t)},nqe=(r,e,t,n)=>{let i,a,o,s={};if(e=e||{},r==null)return e;do{for(i=Object.getOwnPropertyNames(r),a=i.length;a-- >0;)o=i[a],(!n||n(o,r,e))&&!s[o]&&(e[o]=r[o],s[o]=!0);r=t!==!1&&VD(r)}while(r&&(!t||t(r,e))&&r!==Object.prototype);return e},iqe=(r,e,t)=>{r=String(r),(t===void 0||t>r.length)&&(t=r.length),t-=e.length;let n=r.indexOf(e,t);return n!==-1&&n===t},aqe=r=>{if(!r)return null;if(M2(r))return r;let e=r.length;if(!bie(e))return null;let t=new Array(e);for(;e-- >0;)t[e]=r[e];return t},oqe=(r=>e=>r&&e instanceof r)(typeof Uint8Array<"u"&&VD(Uint8Array)),sqe=(r,e)=>{let n=(r&&r[Symbol.iterator]).call(r),i;for(;(i=n.next())&&!i.done;){let a=i.value;e.call(r,a[0],a[1])}},cqe=(r,e)=>{let t,n=[];for(;(t=r.exec(e))!==null;)n.push(t);return n},lqe=cu("HTMLFormElement"),uqe=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,n,i){return n.toUpperCase()+i}),gie=(({hasOwnProperty:r})=>(e,t)=>r.call(e,t))(Object.prototype),dqe=cu("RegExp"),xie=(r,e)=>{let t=Object.getOwnPropertyDescriptors(r),n={};r8(t,(i,a)=>{let o;(o=e(i,a,r))!==!1&&(n[a]=o||i)}),Object.defineProperties(r,n)},fqe=r=>{xie(r,(e,t)=>{if(K3(r)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;let n=r[t];if(K3(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},pqe=(r,e)=>{let t={},n=i=>{i.forEach(a=>{t[a]=!0})};return M2(r)?n(r):n(String(r).split(e)),t},hqe=()=>{},mqe=(r,e)=>(r=+r,Number.isFinite(r)?r:e),qD="abcdefghijklmnopqrstuvwxyz",yie="0123456789",Aie={DIGIT:yie,ALPHA:qD,ALPHA_DIGIT:qD+qD.toUpperCase()+yie},gqe=(r=16,e=Aie.ALPHA_DIGIT)=>{let t="",{length:n}=e;for(;r--;)t+=e[Math.random()*n|0];return t};function yqe(r){return!!(r&&K3(r.append)&&r[Symbol.toStringTag]==="FormData"&&r[Symbol.iterator])}var vqe=r=>{let e=new Array(10),t=(n,i)=>{if(SE(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[i]=n;let a=M2(n)?[]:{};return r8(n,(o,s)=>{let c=t(o,i+1);!t8(c)&&(a[s]=c)}),e[i]=void 0,a}}return n};return t(r,0)},bqe=cu("AsyncFunction"),wqe=r=>r&&(SE(r)||K3(r))&&K3(r.then)&&K3(r.catch),ve={isArray:M2,isArrayBuffer:vie,isBuffer:VUe,isFormData:JUe,isArrayBufferView:HUe,isString:KUe,isNumber:bie,isBoolean:zUe,isObject:SE,isPlainObject:xE,isUndefined:t8,isDate:GUe,isFile:WUe,isBlob:QUe,isRegExp:dqe,isFunction:K3,isStream:YUe,isURLSearchParams:ZUe,isTypedArray:oqe,isFileList:$Ue,forEach:r8,merge:jD,extend:eqe,trim:XUe,stripBOM:tqe,inherits:rqe,toFlatObject:nqe,kindOf:AE,kindOfTest:cu,endsWith:iqe,toArray:aqe,forEachEntry:sqe,matchAll:cqe,isHTMLForm:lqe,hasOwnProperty:gie,hasOwnProp:gie,reduceDescriptors:xie,freezeMethods:fqe,toObjectSet:pqe,toCamelCase:uqe,noop:hqe,toFiniteNumber:mqe,findKey:wie,global:_ie,isContextDefined:Eie,ALPHABET:Aie,generateString:gqe,isSpecCompliantForm:yqe,toJSONObject:vqe,isAsyncFn:bqe,isThenable:wqe};function L2(r,e,t,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),n&&(this.request=n),i&&(this.response=i)}ve.inherits(L2,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ve.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var Tie=L2.prototype,Sie={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{Sie[r]={value:r}});Object.defineProperties(L2,Sie);Object.defineProperty(Tie,"isAxiosError",{value:!0});L2.from=(r,e,t,n,i,a)=>{let o=Object.create(Tie);return ve.toFlatObject(r,o,function(c){return c!==Error.prototype},s=>s!=="isAxiosError"),L2.call(o,r.message,e,t,n,i),o.cause=r,o.name=r.name,a&&Object.assign(o,a),o};var wt=L2;var cae=Ie(sae(),1),kE=cae.default;function XD(r){return ve.isPlainObject(r)||ve.isArray(r)}function uae(r){return ve.endsWith(r,"[]")?r.slice(0,-2):r}function lae(r,e,t){return r?r.concat(e).map(function(i,a){return i=uae(i),!t&&a?"["+i+"]":i}).join(t?".":""):e}function nje(r){return ve.isArray(r)&&!r.some(XD)}var ije=ve.toFlatObject(ve,{},null,function(e){return/^is[A-Z]/.test(e)});function aje(r,e,t){if(!ve.isObject(r))throw new TypeError("target must be an object");e=e||new(kE||FormData),t=ve.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,E){return!ve.isUndefined(E[b])});let n=t.metaTokens,i=t.visitor||u,a=t.dots,o=t.indexes,c=(t.Blob||typeof Blob<"u"&&Blob)&&ve.isSpecCompliantForm(e);if(!ve.isFunction(i))throw new TypeError("visitor must be a function");function l(m){if(m===null)return"";if(ve.isDate(m))return m.toISOString();if(!c&&ve.isBlob(m))throw new wt("Blob is not supported. Use a Buffer instead.");return ve.isArrayBuffer(m)||ve.isTypedArray(m)?c&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function u(m,b,E){let I=m;if(m&&!E&&typeof m=="object"){if(ve.endsWith(b,"{}"))b=n?b:b.slice(0,-2),m=JSON.stringify(m);else if(ve.isArray(m)&&nje(m)||(ve.isFileList(m)||ve.endsWith(b,"[]"))&&(I=ve.toArray(m)))return b=uae(b),I.forEach(function(L,U){!(ve.isUndefined(L)||L===null)&&e.append(o===!0?lae([b],U,a):o===null?b:b+"[]",l(L))}),!1}return XD(m)?!0:(e.append(lae(E,b,a),l(m)),!1)}let d=[],h=Object.assign(ije,{defaultVisitor:u,convertValue:l,isVisitable:XD});function g(m,b){if(!ve.isUndefined(m)){if(d.indexOf(m)!==-1)throw Error("Circular reference detected in "+b.join("."));d.push(m),ve.forEach(m,function(I,R){(!(ve.isUndefined(I)||I===null)&&i.call(e,I,ve.isString(R)?R.trim():R,b,h))===!0&&g(I,b?b.concat(R):[R])}),d.pop()}}if(!ve.isObject(r))throw new TypeError("data must be an object");return g(r),e}var bf=aje;function dae(r){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function fae(r,e){this._pairs=[],r&&bf(r,this,e)}var pae=fae.prototype;pae.append=function(e,t){this._pairs.push([e,t])};pae.toString=function(e){let t=e?function(n){return e.call(this,n,dae)}:dae;return this._pairs.map(function(i){return t(i[0])+"="+t(i[1])},"").join("&")};var hae=fae;function oje(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function q0(r,e,t){if(!e)return r;let n=t&&t.encode||oje,i=t&&t.serialize,a;if(i?a=i(e,t):a=ve.isURLSearchParams(e)?e.toString():new hae(e,t).toString(n),a){let o=r.indexOf("#");o!==-1&&(r=r.slice(0,o)),r+=(r.indexOf("?")===-1?"?":"&")+a}return r}var eP=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ve.forEach(this.handlers,function(n){n!==null&&e(n)})}},tP=eP;var F2={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var mae=Ie(require("url"),1),gae=mae.default.URLSearchParams;var yae={isNode:!0,classes:{URLSearchParams:gae,FormData:kE,Blob:typeof Blob<"u"&&Blob||null},protocols:["http","https","file","data"]};var rP={};qy(rP,{hasBrowserEnv:()=>vae,hasStandardBrowserEnv:()=>sje,hasStandardBrowserWebWorkerEnv:()=>cje});var vae=typeof window<"u"&&typeof document<"u",sje=(r=>vae&&["ReactNative","NativeScript","NS"].indexOf(r)<0)(typeof navigator<"u"&&navigator.product),cje=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function";var Ca={...rP,...yae};function nP(r,e){return bf(r,new Ca.classes.URLSearchParams,Object.assign({visitor:function(t,n,i,a){return Ca.isNode&&ve.isBuffer(t)?(this.append(n,t.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},e))}function lje(r){return ve.matchAll(/\w+|\[(\w*)]/g,r).map(e=>e[0]==="[]"?"":e[1]||e[0])}function uje(r){let e={},t=Object.keys(r),n,i=t.length,a;for(n=0;n<i;n++)a=t[n],e[a]=r[a];return e}function dje(r){function e(t,n,i,a){let o=t[a++];if(o==="__proto__")return!0;let s=Number.isFinite(+o),c=a>=t.length;return o=!o&&ve.isArray(i)?i.length:o,c?(ve.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!s):((!i[o]||!ve.isObject(i[o]))&&(i[o]=[]),e(t,n,i[o],a)&&ve.isArray(i[o])&&(i[o]=uje(i[o])),!s)}if(ve.isFormData(r)&&ve.isFunction(r.entries)){let t={};return ve.forEachEntry(r,(n,i)=>{e(lje(n),i,t,0)}),t}return null}var NE=dje;function fje(r,e,t){if(ve.isString(r))try{return(e||JSON.parse)(r),ve.trim(r)}catch(n){if(n.name!=="SyntaxError")throw n}return(t||JSON.stringify)(r)}var iP={transitional:F2,adapter:["xhr","http"],transformRequest:[function(e,t){let n=t.getContentType()||"",i=n.indexOf("application/json")>-1,a=ve.isObject(e);if(a&&ve.isHTMLForm(e)&&(e=new FormData(e)),ve.isFormData(e))return i&&i?JSON.stringify(NE(e)):e;if(ve.isArrayBuffer(e)||ve.isBuffer(e)||ve.isStream(e)||ve.isFile(e)||ve.isBlob(e))return e;if(ve.isArrayBufferView(e))return e.buffer;if(ve.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return nP(e,this.formSerializer).toString();if((s=ve.isFileList(e))||n.indexOf("multipart/form-data")>-1){let c=this.env&&this.env.FormData;return bf(s?{"files[]":e}:e,c&&new c,this.formSerializer)}}return a||i?(t.setContentType("application/json",!1),fje(e)):e}],transformResponse:[function(e){let t=this.transitional||iP.transitional,n=t&&t.forcedJSONParsing,i=this.responseType==="json";if(e&&ve.isString(e)&&(n&&!this.responseType||i)){let o=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(s){if(o)throw s.name==="SyntaxError"?wt.from(s,wt.ERR_BAD_RESPONSE,this,null,this.response):s}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ca.classes.FormData,Blob:Ca.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ve.forEach(["delete","get","head","post","put","patch"],r=>{iP.headers[r]={}});var U2=iP;var pje=ve.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),bae=r=>{let e={},t,n,i;return r&&r.split(`
10634
+ expected length 40, got length ${r.length}`);let t=na.default.fromBytesBE([0,0,0,0,...e.slice(0,4)]),n=na.default.fromBytesBE(Array.from(e.slice(4,12))),i=na.default.fromBytesBE(Array.from(e.slice(12,20)));return[t,n,i]}function j3(r){let e=new Uint8Array(20),t=lo(e),[n,i,a]=r;return t.setUint32(0,Pw(n)),t.setUint32(8,Pw(i)),t.setUint32(16,Pw(a)),He(e)}function hie(r,e){let t="",n=[],i=0,a=0,o=0,s=0,c=0,l=26*26*26,u=26*26*26*26*26,d=97,h=1000003,g=31,m=new Uint8Array(r.length+6);m.set(r,0),m.set([0,0,0,0,0,0],r.length);for(let b=0;b<e.length;b++)n.push(e[b]==="."?10:parseInt(e[b],10));for(let b=0;b<n.length;b++)o=(g*o+n[b])%l,b%2===0?i=(i+n[b])%11:a=(a+n[b])%11;for(let b=0;b<m.length;b++)s=(g*s+m[b])%u;c=(((e.length%5*11+i)*11+a)*l+o+s)%u,c=c*h%u;for(let b=0;b<5;b++)t=String.fromCharCode(d+c%26)+t,c/=26;return t}function V3(r,e,t,n,i){if(i._network._ledgerId==null||n==null)return;let a=hie(i._network._ledgerId._ledgerId,`${r.toString()}.${e.toString()}.${t.toString()}`);if(n!=a)throw new jy(r,e,t,n,a)}function H3(r,e){if(e==null)throw new Error("client cannot be null");if(e._network._ledgerId==null)throw new Error("cannot calculate checksum with a client that does not contain a recognzied ledger ID");let t=hie(e._network._ledgerId._ledgerId,r);return`${r}-${t}`}var B2=class r{constructor(e){this._mnemonic=e}static async generate(){return new r(await nu._generate(24))}static async generate12(){return new r(await nu._generate(12))}static async fromWords(e){return new r(await nu.fromWords(e))}async toPrivateKey(e=""){return ir.privateKeyConstructor(await this._mnemonic.toPrivateKey(e))}async toEd25519PrivateKey(e="",t){return ir.privateKeyConstructor(await this._mnemonic.toEd25519PrivateKey(e,t))}async toStandardEd25519PrivateKey(e="",t){return ir.privateKeyConstructor(await this._mnemonic.toStandardEd25519PrivateKey(e,t))}async toEcdsaPrivateKey(e="",t){return ir.privateKeyConstructor(await this._mnemonic.toEcdsaPrivateKey(e,t))}async toStandardECDSAsecp256k1PrivateKey(e="",t){return ir.privateKeyConstructor(await this._mnemonic.toStandardECDSAsecp256k1PrivateKey(e,t))}static async fromString(e){return new r(await nu.fromString(e))}async toLegacyPrivateKey(){return ir.privateKeyConstructor(await this._mnemonic.toLegacyPrivateKey())}async toSeed(e){return await nu.toSeed(this._mnemonic.words,e)}toString(){return this._mnemonic.toString()}};var Zc=class r extends rt{constructor(e){super(),this._key=e}static generateED25519(){return new r(Pn.generateED25519())}static generateECDSA(){return new r(Pn.generateECDSA())}static generate(){return r.generateED25519()}static async generateAsync(){return new r(await Pn.generateAsync())}static async generateED25519Async(){return new r(await Pn.generateED25519Async())}static async generateECDSAAsync(){return new r(await Pn.generateECDSAAsync())}static fromBytes(e){return new r(Pn.fromBytes(e))}static fromBytesECDSA(e){return new r(Pn.fromBytesECDSA(e))}static fromBytesED25519(e){return new r(Pn.fromBytesED25519(e))}static fromString(e){return new r(Pn.fromString(e))}static fromStringDer(e){return new r(Pn.fromString(e))}static fromStringECDSA(e){return new r(Pn.fromStringECDSA(e))}static fromStringED25519(e){return new r(Pn.fromStringED25519(e))}static async fromSeedED25519(e){return new r(await Pn.fromSeedED25519(e))}static async fromSeedECDSAsecp256k1(e){return new r(await Pn.fromSeedECDSAsecp256k1(e))}static async fromMnemonic(e,t=""){return e instanceof B2?new r(await Pn.fromMnemonic(e._mnemonic,t)):new r(await Pn.fromMnemonic(e,t))}static async fromKeystore(e,t=""){return new r(await Pn.fromKeystore(e,t))}static async fromPem(e,t=""){return new r(await Pn.fromPem(e,t))}async derive(e){return new r(await this._key.derive(e))}async legacyDerive(e){return new r(await this._key.legacyDerive(e))}get publicKey(){return new Xn(this._key.publicKey)}get chainCode(){return this._key._chainCode}sign(e){return this._key.sign(e)}signTransaction(e){let t=e._signedTransactions.get(0),n=t.bodyBytes!=null?this.sign(t.bodyBytes):new Uint8Array;return e.addSignature(this.publicKey,n),n}isDerivable(){return this._key.isDerivable()}toBytes(){return this._key.toBytes()}toBytesDer(){return this._key.toBytesDer()}toBytesRaw(){return this._key.toBytesRaw()}toString(){return this._key.toStringDer()}toStringDer(){return this._key.toStringDer()}toStringRaw(){return this._key.toStringRaw()}toKeystore(e=""){return this._key.toKeystore(e)}_toProtobufKey(){return this.publicKey._toProtobufKey()}toAccountId(e,t){return this.publicKey.toAccountId(e,t)}get type(){return this._key._type}};ir.setPrivateKeyConstructor(r=>new Zc(r));var Ri=class r extends rt{constructor(e,t){super(),e==null?this._keys=[]:e instanceof rt?this._keys=[e]:this._keys=e,this._threshold=t??null}static of(...e){return new r(e,null)}static from(e,t,n){return t==null?new r(Array.from(e)):new r(Array.from(e,t,n))}get threshold(){return this._threshold}setThreshold(e){return this._threshold=e,this}push(...e){return this._keys.push(...e)}splice(e,t,...n){return new r(this._keys.splice(e,t,...n),this.threshold)}slice(e,t){return new r(this._keys.slice(e,t),this.threshold)}[Symbol.iterator](){return this._keys[Symbol.iterator]()}toArray(){return this._keys.slice()}toString(){return JSON.stringify({threshold:this._threshold,keys:this._keys.toString()})}_toProtobufKey(){let e=this._keys.map(t=>t._toProtobufKey());return this.threshold==null?{keyList:{keys:e}}:{thresholdKey:{threshold:this.threshold,keys:{keys:e}}}}static __fromProtobufKeyList(e){let t=(e.keys!=null?e.keys:[]).map(n=>rt._fromProtobufKey(n));return new r(t)}static __fromProtobufThresoldKey(e){let t=r.__fromProtobufKeyList(e.keys!=null?e.keys:{});return t.setThreshold(e.threshold!=null?e.threshold:0),t}};ir.setKeyList(r=>Ri.__fromProtobufKeyList(r));ir.setThresholdKey(r=>Ri.__fromProtobufThresoldKey(r));function mie(r){return Qe.isBigNumber(r)?r:new Qe(r.toString())}var kn=class r{constructor(e,t,n){this._name=e,this._symbol=t,this._tinybar=n,Object.freeze(this)}static fromString(e){switch(e){case r.Hbar._symbol:return r.Hbar;case r.Tinybar._symbol:return r.Tinybar;case r.Microbar._symbol:return r.Microbar;case r.Millibar._symbol:return r.Millibar;case r.Kilobar._symbol:return r.Kilobar;case r.Megabar._symbol:return r.Megabar;case r.Gigabar._symbol:return r.Gigabar;default:throw new Error("Unknown unit.")}}};kn.Tinybar=new kn("tinybar","t\u210F",new Qe(1));kn.Microbar=new kn("microbar","\u03BC\u210F",new Qe(100));kn.Millibar=new kn("millibar","m\u210F",new Qe(1e5));kn.Hbar=new kn("hbar","\u210F",new Qe("100000000"));kn.Kilobar=new kn("kilobar","k\u210F",new Qe(1e3).multipliedBy(new Qe("100000000")));kn.Megabar=new kn("megabar","M\u210F",new Qe(1e6).multipliedBy(new Qe("100000000")));kn.Gigabar=new kn("gigabar","G\u210F",new Qe("1000000000").multipliedBy(new Qe("100000000")));var UD=Ie(Yt(),1),ze=class r{constructor(e,t=kn.Hbar){if(t===kn.Tinybar)this._valueInTinybar=mie(e);else{let n;UD.default.isLong(e)?n=new Qe(e.toString(10)):Qe.isBigNumber(e)||typeof e=="string"||typeof e=="number"?n=new Qe(e):n=new Qe(0),this._valueInTinybar=n.multipliedBy(t._tinybar)}if(!this._valueInTinybar.isInteger())throw new Error("Hbar in tinybars contains decimals")}static from(e,t){return new r(e,t)}static fromTinybars(e){return typeof e=="string"?this.fromString(e,kn.Tinybar):new r(e,kn.Tinybar)}static fromString(e,t=kn.Hbar){if(/^((?:\+|-)?\d+(?:\.\d+)?)(?: (tℏ|μℏ|mℏ|ℏ|kℏ|Mℏ|Gℏ))?$/.test(e)){let[i,a]=e.split(" ");return a!=null&&(t=kn.fromString(a)),new r(new Qe(i),t)}else throw new Error("invalid argument provided")}to(e){return this._valueInTinybar.dividedBy(e._tinybar)}toBigNumber(){return this.to(kn.Hbar)}toTinybars(){return UD.default.fromValue(this._valueInTinybar.toFixed())}negated(){return r.fromTinybars(this._valueInTinybar.negated())}isNegative(){return this._valueInTinybar.isNegative()}toString(e){return e!=null?`${this._valueInTinybar.dividedBy(e._tinybar).toString()} ${e._symbol}`:this._valueInTinybar.isLessThan(1e4)&&this._valueInTinybar.isGreaterThan(-1e4)?`${this._valueInTinybar.toFixed()} ${kn.Tinybar._symbol}`:`${this.to(kn.Hbar).toString()} ${kn.Hbar._symbol}`}};var su=class r extends Error{constructor(e,t){super(t),this.name="StatusError",this.status=e.status,this.transactionId=e.transactionId,this.message=t,typeof Error.captureStackTrace<"u"&&Error.captureStackTrace(this,r)}toJSON(){return{name:this.name,status:this.status.toString(),transactionId:this.transactionId.toString(),message:this.message}}toString(){return JSON.stringify(this.toJSON())}valueOf(){return this.toJSON()}};var Xc=class extends su{constructor(e){super(e,`receipt for transaction ${e.transactionId.toString()} contained error status ${e.status.toString()}`),this.transactionReceipt=e.transactionReceipt}};var P=class r{constructor(e){this._code=e,Object.freeze(this)}toString(){switch(this){case r.Ok:return"OK";case r.InvalidTransaction:return"INVALID_TRANSACTION";case r.PayerAccountNotFound:return"PAYER_ACCOUNT_NOT_FOUND";case r.InvalidNodeAccount:return"INVALID_NODE_ACCOUNT";case r.TransactionExpired:return"TRANSACTION_EXPIRED";case r.InvalidTransactionStart:return"INVALID_TRANSACTION_START";case r.InvalidTransactionDuration:return"INVALID_TRANSACTION_DURATION";case r.InvalidSignature:return"INVALID_SIGNATURE";case r.MemoTooLong:return"MEMO_TOO_LONG";case r.InsufficientTxFee:return"INSUFFICIENT_TX_FEE";case r.InsufficientPayerBalance:return"INSUFFICIENT_PAYER_BALANCE";case r.DuplicateTransaction:return"DUPLICATE_TRANSACTION";case r.Busy:return"BUSY";case r.NotSupported:return"NOT_SUPPORTED";case r.InvalidFileId:return"INVALID_FILE_ID";case r.InvalidAccountId:return"INVALID_ACCOUNT_ID";case r.InvalidContractId:return"INVALID_CONTRACT_ID";case r.InvalidTransactionId:return"INVALID_TRANSACTION_ID";case r.ReceiptNotFound:return"RECEIPT_NOT_FOUND";case r.RecordNotFound:return"RECORD_NOT_FOUND";case r.InvalidSolidityId:return"INVALID_SOLIDITY_ID";case r.Unknown:return"UNKNOWN";case r.Success:return"SUCCESS";case r.FailInvalid:return"FAIL_INVALID";case r.FailFee:return"FAIL_FEE";case r.FailBalance:return"FAIL_BALANCE";case r.KeyRequired:return"KEY_REQUIRED";case r.BadEncoding:return"BAD_ENCODING";case r.InsufficientAccountBalance:return"INSUFFICIENT_ACCOUNT_BALANCE";case r.InvalidSolidityAddress:return"INVALID_SOLIDITY_ADDRESS";case r.InsufficientGas:return"INSUFFICIENT_GAS";case r.ContractSizeLimitExceeded:return"CONTRACT_SIZE_LIMIT_EXCEEDED";case r.LocalCallModificationException:return"LOCAL_CALL_MODIFICATION_EXCEPTION";case r.ContractRevertExecuted:return"CONTRACT_REVERT_EXECUTED";case r.ContractExecutionException:return"CONTRACT_EXECUTION_EXCEPTION";case r.InvalidReceivingNodeAccount:return"INVALID_RECEIVING_NODE_ACCOUNT";case r.MissingQueryHeader:return"MISSING_QUERY_HEADER";case r.AccountUpdateFailed:return"ACCOUNT_UPDATE_FAILED";case r.InvalidKeyEncoding:return"INVALID_KEY_ENCODING";case r.NullSolidityAddress:return"NULL_SOLIDITY_ADDRESS";case r.ContractUpdateFailed:return"CONTRACT_UPDATE_FAILED";case r.InvalidQueryHeader:return"INVALID_QUERY_HEADER";case r.InvalidFeeSubmitted:return"INVALID_FEE_SUBMITTED";case r.InvalidPayerSignature:return"INVALID_PAYER_SIGNATURE";case r.KeyNotProvided:return"KEY_NOT_PROVIDED";case r.InvalidExpirationTime:return"INVALID_EXPIRATION_TIME";case r.NoWaclKey:return"NO_WACL_KEY";case r.FileContentEmpty:return"FILE_CONTENT_EMPTY";case r.InvalidAccountAmounts:return"INVALID_ACCOUNT_AMOUNTS";case r.EmptyTransactionBody:return"EMPTY_TRANSACTION_BODY";case r.InvalidTransactionBody:return"INVALID_TRANSACTION_BODY";case r.InvalidSignatureTypeMismatchingKey:return"INVALID_SIGNATURE_TYPE_MISMATCHING_KEY";case r.InvalidSignatureCountMismatchingKey:return"INVALID_SIGNATURE_COUNT_MISMATCHING_KEY";case r.EmptyLiveHashBody:return"EMPTY_LIVE_HASH_BODY";case r.EmptyLiveHash:return"EMPTY_LIVE_HASH";case r.EmptyLiveHashKeys:return"EMPTY_LIVE_HASH_KEYS";case r.InvalidLiveHashSize:return"INVALID_LIVE_HASH_SIZE";case r.EmptyQueryBody:return"EMPTY_QUERY_BODY";case r.EmptyLiveHashQuery:return"EMPTY_LIVE_HASH_QUERY";case r.LiveHashNotFound:return"LIVE_HASH_NOT_FOUND";case r.AccountIdDoesNotExist:return"ACCOUNT_ID_DOES_NOT_EXIST";case r.LiveHashAlreadyExists:return"LIVE_HASH_ALREADY_EXISTS";case r.InvalidFileWacl:return"INVALID_FILE_WACL";case r.SerializationFailed:return"SERIALIZATION_FAILED";case r.TransactionOversize:return"TRANSACTION_OVERSIZE";case r.TransactionTooManyLayers:return"TRANSACTION_TOO_MANY_LAYERS";case r.ContractDeleted:return"CONTRACT_DELETED";case r.PlatformNotActive:return"PLATFORM_NOT_ACTIVE";case r.KeyPrefixMismatch:return"KEY_PREFIX_MISMATCH";case r.PlatformTransactionNotCreated:return"PLATFORM_TRANSACTION_NOT_CREATED";case r.InvalidRenewalPeriod:return"INVALID_RENEWAL_PERIOD";case r.InvalidPayerAccountId:return"INVALID_PAYER_ACCOUNT_ID";case r.AccountDeleted:return"ACCOUNT_DELETED";case r.FileDeleted:return"FILE_DELETED";case r.AccountRepeatedInAccountAmounts:return"ACCOUNT_REPEATED_IN_ACCOUNT_AMOUNTS";case r.SettingNegativeAccountBalance:return"SETTING_NEGATIVE_ACCOUNT_BALANCE";case r.ObtainerRequired:return"OBTAINER_REQUIRED";case r.ObtainerSameContractId:return"OBTAINER_SAME_CONTRACT_ID";case r.ObtainerDoesNotExist:return"OBTAINER_DOES_NOT_EXIST";case r.ModifyingImmutableContract:return"MODIFYING_IMMUTABLE_CONTRACT";case r.FileSystemException:return"FILE_SYSTEM_EXCEPTION";case r.AutorenewDurationNotInRange:return"AUTORENEW_DURATION_NOT_IN_RANGE";case r.ErrorDecodingBytestring:return"ERROR_DECODING_BYTESTRING";case r.ContractFileEmpty:return"CONTRACT_FILE_EMPTY";case r.ContractBytecodeEmpty:return"CONTRACT_BYTECODE_EMPTY";case r.InvalidInitialBalance:return"INVALID_INITIAL_BALANCE";case r.InvalidReceiveRecordThreshold:return"INVALID_RECEIVE_RECORD_THRESHOLD";case r.InvalidSendRecordThreshold:return"INVALID_SEND_RECORD_THRESHOLD";case r.AccountIsNotGenesisAccount:return"ACCOUNT_IS_NOT_GENESIS_ACCOUNT";case r.PayerAccountUnauthorized:return"PAYER_ACCOUNT_UNAUTHORIZED";case r.InvalidFreezeTransactionBody:return"INVALID_FREEZE_TRANSACTION_BODY";case r.FreezeTransactionBodyNotFound:return"FREEZE_TRANSACTION_BODY_NOT_FOUND";case r.TransferListSizeLimitExceeded:return"TRANSFER_LIST_SIZE_LIMIT_EXCEEDED";case r.ResultSizeLimitExceeded:return"RESULT_SIZE_LIMIT_EXCEEDED";case r.NotSpecialAccount:return"NOT_SPECIAL_ACCOUNT";case r.ContractNegativeGas:return"CONTRACT_NEGATIVE_GAS";case r.ContractNegativeValue:return"CONTRACT_NEGATIVE_VALUE";case r.InvalidFeeFile:return"INVALID_FEE_FILE";case r.InvalidExchangeRateFile:return"INVALID_EXCHANGE_RATE_FILE";case r.InsufficientLocalCallGas:return"INSUFFICIENT_LOCAL_CALL_GAS";case r.EntityNotAllowedToDelete:return"ENTITY_NOT_ALLOWED_TO_DELETE";case r.AuthorizationFailed:return"AUTHORIZATION_FAILED";case r.FileUploadedProtoInvalid:return"FILE_UPLOADED_PROTO_INVALID";case r.FileUploadedProtoNotSavedToDisk:return"FILE_UPLOADED_PROTO_NOT_SAVED_TO_DISK";case r.FeeScheduleFilePartUploaded:return"FEE_SCHEDULE_FILE_PART_UPLOADED";case r.ExchangeRateChangeLimitExceeded:return"EXCHANGE_RATE_CHANGE_LIMIT_EXCEEDED";case r.MaxContractStorageExceeded:return"MAX_CONTRACT_STORAGE_EXCEEDED";case r.TransferAccountSameAsDeleteAccount:return"TRANSFER_ACCOUNT_SAME_AS_DELETE_ACCOUNT";case r.TotalLedgerBalanceInvalid:return"TOTAL_LEDGER_BALANCE_INVALID";case r.ExpirationReductionNotAllowed:return"EXPIRATION_REDUCTION_NOT_ALLOWED";case r.MaxGasLimitExceeded:return"MAX_GAS_LIMIT_EXCEEDED";case r.MaxFileSizeExceeded:return"MAX_FILE_SIZE_EXCEEDED";case r.ReceiverSigRequired:return"RECEIVER_SIG_REQUIRED";case r.InvalidTopicId:return"INVALID_TOPIC_ID";case r.InvalidAdminKey:return"INVALID_ADMIN_KEY";case r.InvalidSubmitKey:return"INVALID_SUBMIT_KEY";case r.Unauthorized:return"UNAUTHORIZED";case r.InvalidTopicMessage:return"INVALID_TOPIC_MESSAGE";case r.InvalidAutorenewAccount:return"INVALID_AUTORENEW_ACCOUNT";case r.AutorenewAccountNotAllowed:return"AUTORENEW_ACCOUNT_NOT_ALLOWED";case r.TopicExpired:return"TOPIC_EXPIRED";case r.InvalidChunkNumber:return"INVALID_CHUNK_NUMBER";case r.InvalidChunkTransactionId:return"INVALID_CHUNK_TRANSACTION_ID";case r.AccountFrozenForToken:return"ACCOUNT_FROZEN_FOR_TOKEN";case r.TokensPerAccountLimitExceeded:return"TOKENS_PER_ACCOUNT_LIMIT_EXCEEDED";case r.InvalidTokenId:return"INVALID_TOKEN_ID";case r.InvalidTokenDecimals:return"INVALID_TOKEN_DECIMALS";case r.InvalidTokenInitialSupply:return"INVALID_TOKEN_INITIAL_SUPPLY";case r.InvalidTreasuryAccountForToken:return"INVALID_TREASURY_ACCOUNT_FOR_TOKEN";case r.InvalidTokenSymbol:return"INVALID_TOKEN_SYMBOL";case r.TokenHasNoFreezeKey:return"TOKEN_HAS_NO_FREEZE_KEY";case r.TransfersNotZeroSumForToken:return"TRANSFERS_NOT_ZERO_SUM_FOR_TOKEN";case r.MissingTokenSymbol:return"MISSING_TOKEN_SYMBOL";case r.TokenSymbolTooLong:return"TOKEN_SYMBOL_TOO_LONG";case r.AccountKycNotGrantedForToken:return"ACCOUNT_KYC_NOT_GRANTED_FOR_TOKEN";case r.TokenHasNoKycKey:return"TOKEN_HAS_NO_KYC_KEY";case r.InsufficientTokenBalance:return"INSUFFICIENT_TOKEN_BALANCE";case r.TokenWasDeleted:return"TOKEN_WAS_DELETED";case r.TokenHasNoSupplyKey:return"TOKEN_HAS_NO_SUPPLY_KEY";case r.TokenHasNoWipeKey:return"TOKEN_HAS_NO_WIPE_KEY";case r.InvalidTokenMintAmount:return"INVALID_TOKEN_MINT_AMOUNT";case r.InvalidTokenBurnAmount:return"INVALID_TOKEN_BURN_AMOUNT";case r.TokenNotAssociatedToAccount:return"TOKEN_NOT_ASSOCIATED_TO_ACCOUNT";case r.CannotWipeTokenTreasuryAccount:return"CANNOT_WIPE_TOKEN_TREASURY_ACCOUNT";case r.InvalidKycKey:return"INVALID_KYC_KEY";case r.InvalidWipeKey:return"INVALID_WIPE_KEY";case r.InvalidFreezeKey:return"INVALID_FREEZE_KEY";case r.InvalidSupplyKey:return"INVALID_SUPPLY_KEY";case r.MissingTokenName:return"MISSING_TOKEN_NAME";case r.TokenNameTooLong:return"TOKEN_NAME_TOO_LONG";case r.InvalidWipingAmount:return"INVALID_WIPING_AMOUNT";case r.TokenIsImmutable:return"TOKEN_IS_IMMUTABLE";case r.TokenAlreadyAssociatedToAccount:return"TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT";case r.TransactionRequiresZeroTokenBalances:return"TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES";case r.AccountIsTreasury:return"ACCOUNT_IS_TREASURY";case r.TokenIdRepeatedInTokenList:return"TOKEN_ID_REPEATED_IN_TOKEN_LIST";case r.TokenTransferListSizeLimitExceeded:return"TOKEN_TRANSFER_LIST_SIZE_LIMIT_EXCEEDED";case r.EmptyTokenTransferBody:return"EMPTY_TOKEN_TRANSFER_BODY";case r.EmptyTokenTransferAccountAmounts:return"EMPTY_TOKEN_TRANSFER_ACCOUNT_AMOUNTS";case r.InvalidScheduleId:return"INVALID_SCHEDULE_ID";case r.ScheduleIsImmutable:return"SCHEDULE_IS_IMMUTABLE";case r.InvalidSchedulePayerId:return"INVALID_SCHEDULE_PAYER_ID";case r.InvalidScheduleAccountId:return"INVALID_SCHEDULE_ACCOUNT_ID";case r.NoNewValidSignatures:return"NO_NEW_VALID_SIGNATURES";case r.UnresolvableRequiredSigners:return"UNRESOLVABLE_REQUIRED_SIGNERS";case r.ScheduledTransactionNotInWhitelist:return"SCHEDULED_TRANSACTION_NOT_IN_WHITELIST";case r.SomeSignaturesWereInvalid:return"SOME_SIGNATURES_WERE_INVALID";case r.TransactionIdFieldNotAllowed:return"TRANSACTION_ID_FIELD_NOT_ALLOWED";case r.IdenticalScheduleAlreadyCreated:return"IDENTICAL_SCHEDULE_ALREADY_CREATED";case r.InvalidZeroByteInString:return"INVALID_ZERO_BYTE_IN_STRING";case r.ScheduleAlreadyDeleted:return"SCHEDULE_ALREADY_DELETED";case r.ScheduleAlreadyExecuted:return"SCHEDULE_ALREADY_EXECUTED";case r.MessageSizeTooLarge:return"MESSAGE_SIZE_TOO_LARGE";case r.OperationRepeatedInBucketGroups:return"OPERATION_REPEATED_IN_BUCKET_GROUPS";case r.BucketCapacityOverflow:return"BUCKET_CAPACITY_OVERFLOW";case r.NodeCapacityNotSufficientForOperation:return"NODE_CAPACITY_NOT_SUFFICIENT_FOR_OPERATION";case r.BucketHasNoThrottleGroups:return"BUCKET_HAS_NO_THROTTLE_GROUPS";case r.ThrottleGroupHasZeroOpsPerSec:return"THROTTLE_GROUP_HAS_ZERO_OPS_PER_SEC";case r.SuccessButMissingExpectedOperation:return"SUCCESS_BUT_MISSING_EXPECTED_OPERATION";case r.UnparseableThrottleDefinitions:return"UNPARSEABLE_THROTTLE_DEFINITIONS";case r.InvalidThrottleDefinitions:return"INVALID_THROTTLE_DEFINITIONS";case r.AccountExpiredAndPendingRemoval:return"ACCOUNT_EXPIRED_AND_PENDING_REMOVAL";case r.InvalidTokenMaxSupply:return"INVALID_TOKEN_MAX_SUPPLY";case r.InvalidTokenNftSerialNumber:return"INVALID_TOKEN_NFT_SERIAL_NUMBER";case r.InvalidNftId:return"INVALID_NFT_ID";case r.MetadataTooLong:return"METADATA_TOO_LONG";case r.BatchSizeLimitExceeded:return"BATCH_SIZE_LIMIT_EXCEEDED";case r.InvalidQueryRange:return"INVALID_QUERY_RANGE";case r.FractionDividesByZero:return"FRACTION_DIVIDES_BY_ZERO";case r.InsufficientPayerBalanceForCustomFee:return"INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE";case r.CustomFeesListTooLong:return"CUSTOM_FEES_LIST_TOO_LONG";case r.InvalidCustomFeeCollector:return"INVALID_CUSTOM_FEE_COLLECTOR";case r.InvalidTokenIdInCustomFees:return"INVALID_TOKEN_ID_IN_CUSTOM_FEES";case r.TokenNotAssociatedToFeeCollector:return"TOKEN_NOT_ASSOCIATED_TO_FEE_COLLECTOR";case r.TokenMaxSupplyReached:return"TOKEN_MAX_SUPPLY_REACHED";case r.SenderDoesNotOwnNftSerialNo:return"SENDER_DOES_NOT_OWN_NFT_SERIAL_NO";case r.CustomFeeNotFullySpecified:return"CUSTOM_FEE_NOT_FULLY_SPECIFIED";case r.CustomFeeMustBePositive:return"CUSTOM_FEE_MUST_BE_POSITIVE";case r.TokenHasNoFeeScheduleKey:return"TOKEN_HAS_NO_FEE_SCHEDULE_KEY";case r.CustomFeeOutsideNumericRange:return"CUSTOM_FEE_OUTSIDE_NUMERIC_RANGE";case r.RoyaltyFractionCannotExceedOne:return"ROYALTY_FRACTION_CANNOT_EXCEED_ONE";case r.FractionalFeeMaxAmountLessThanMinAmount:return"FRACTIONAL_FEE_MAX_AMOUNT_LESS_THAN_MIN_AMOUNT";case r.CustomScheduleAlreadyHasNoFees:return"CUSTOM_SCHEDULE_ALREADY_HAS_NO_FEES";case r.CustomFeeDenominationMustBeFungibleCommon:return"CUSTOM_FEE_DENOMINATION_MUST_BE_FUNGIBLE_COMMON";case r.CustomFractionalFeeOnlyAllowedForFungibleCommon:return"CUSTOM_FRACTIONAL_FEE_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON";case r.InvalidCustomFeeScheduleKey:return"INVALID_CUSTOM_FEE_SCHEDULE_KEY";case r.InvalidTokenMintMetadata:return"INVALID_TOKEN_MINT_METADATA";case r.InvalidTokenBurnMetadata:return"INVALID_TOKEN_BURN_METADATA";case r.CurrentTreasuryStillOwnsNfts:return"CURRENT_TREASURY_STILL_OWNS_NFTS";case r.AccountStillOwnsNfts:return"ACCOUNT_STILL_OWNS_NFTS";case r.TreasuryMustOwnBurnedNft:return"TREASURY_MUST_OWN_BURNED_NFT";case r.AccountDoesNotOwnWipedNft:return"ACCOUNT_DOES_NOT_OWN_WIPED_NFT";case r.AccountAmountTransfersOnlyAllowedForFungibleCommon:return"ACCOUNT_AMOUNT_TRANSFERS_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON";case r.MaxNftsInPriceRegimeHaveBeenMinted:return"MAX_NFTS_IN_PRICE_REGIME_HAVE_BEEN_MINTED";case r.PayerAccountDeleted:return"PAYER_ACCOUNT_DELETED";case r.CustomFeeChargingExceededMaxRecursionDepth:return"CUSTOM_FEE_CHARGING_EXCEEDED_MAX_RECURSION_DEPTH";case r.CustomFeeChargingExceededMaxAccountAmounts:return"CUSTOM_FEE_CHARGING_EXCEEDED_MAX_ACCOUNT_AMOUNTS";case r.InsufficientSenderAccountBalanceForCustomFee:return"INSUFFICIENT_SENDER_ACCOUNT_BALANCE_FOR_CUSTOM_FEE";case r.SerialNumberLimitReached:return"SERIAL_NUMBER_LIMIT_REACHED";case r.CustomRoyaltyFeeOnlyAllowedForNonFungibleUnique:return"CUSTOM_ROYALTY_FEE_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE";case r.NoRemainingAutomaticAssociations:return"NO_REMAINING_AUTOMATIC_ASSOCIATIONS";case r.ExistingAutomaticAssociationsExceedGivenLimit:return"EXISTING_AUTOMATIC_ASSOCIATIONS_EXCEED_GIVEN_LIMIT";case r.RequestedNumAutomaticAssociationsExceedsAssociationLimit:return"REQUESTED_NUM_AUTOMATIC_ASSOCIATIONS_EXCEEDS_ASSOCIATION_LIMIT";case r.TokenIsPaused:return"TOKEN_IS_PAUSED";case r.TokenHasNoPauseKey:return"TOKEN_HAS_NO_PAUSE_KEY";case r.InvalidPauseKey:return"INVALID_PAUSE_KEY";case r.FreezeUpdateFileDoesNotExist:return"FREEZE_UPDATE_FILE_DOES_NOT_EXIST";case r.FreezeUpdateFileHashDoesNotMatch:return"FREEZE_UPDATE_FILE_HASH_DOES_NOT_MATCH";case r.NoUpgradeHasBeenPrepared:return"NO_UPGRADE_HAS_BEEN_PREPARED";case r.NoFreezeIsScheduled:return"NO_FREEZE_IS_SCHEDULED";case r.UpdateFileHashChangedSincePrepareUpgrade:return"UPDATE_FILE_HASH_CHANGED_SINCE_PREPARE_UPGRADE";case r.FreezeStartTimeMustBeFuture:return"FREEZE_START_TIME_MUST_BE_FUTURE";case r.PreparedUpdateFileIsImmutable:return"PREPARED_UPDATE_FILE_IS_IMMUTABLE";case r.FreezeAlreadyScheduled:return"FREEZE_ALREADY_SCHEDULED";case r.FreezeUpgradeInProgress:return"FREEZE_UPGRADE_IN_PROGRESS";case r.UpdateFileIdDoesNotMatchPrepared:return"UPDATE_FILE_ID_DOES_NOT_MATCH_PREPARED";case r.UpdateFileHashDoesNotMatchPrepared:return"UPDATE_FILE_HASH_DOES_NOT_MATCH_PREPARED";case r.ConsensusGasExhausted:return"CONSENSUS_GAS_EXHAUSTED";case r.RevertedSuccess:return"REVERTED_SUCCESS";case r.MaxStorageInPriceRegimeHasBeenUsed:return"MAX_STORAGE_IN_PRICE_REGIME_HAS_BEEN_USED";case r.InvalidAliasKey:return"INVALID_ALIAS_KEY";case r.UnexpectedTokenDecimals:return"UNEXPECTED_TOKEN_DECIMALS";case r.InvalidProxyAccountId:return"INVALID_PROXY_ACCOUNT_ID";case r.InvalidTransferAccountId:return"INVALID_TRANSFER_ACCOUNT_ID";case r.InvalidFeeCollectorAccountId:return"INVALID_FEE_COLLECTOR_ACCOUNT_ID";case r.AliasIsImmutable:return"ALIAS_IS_IMMUTABLE";case r.SpenderAccountSameAsOwner:return"SPENDER_ACCOUNT_SAME_AS_OWNER";case r.AmountExceedsTokenMaxSupply:return"AMOUNT_EXCEEDS_TOKEN_MAX_SUPPLY";case r.NegativeAllowanceAmount:return"NEGATIVE_ALLOWANCE_AMOUNT";case r.CannotApproveForAllFungibleCommon:return"CANNOT_APPROVE_FOR_ALL_FUNGIBLE_COMMON";case r.SpenderDoesNotHaveAllowance:return"SPENDER_DOES_NOT_HAVE_ALLOWANCE";case r.AmountExceedsAllowance:return"AMOUNT_EXCEEDS_ALLOWANCE";case r.MaxAllowancesExceeded:return"MAX_ALLOWANCES_EXCEEDED";case r.EmptyAllowances:return"EMPTY_ALLOWANCES";case r.SpenderAccountRepeatedInAllowances:return"SPENDER_ACCOUNT_REPEATED_IN_ALLOWANCES";case r.RepeatedSerialNumsInNftAllowances:return"REPEATED_SERIAL_NUMS_IN_NFT_ALLOWANCES";case r.FungibleTokenInNftAllowances:return"FUNGIBLE_TOKEN_IN_NFT_ALLOWANCES";case r.NftInFungibleTokenAllowances:return"NFT_IN_FUNGIBLE_TOKEN_ALLOWANCES";case r.InvalidAllowanceOwnerId:return"INVALID_ALLOWANCE_OWNER_ID";case r.InvalidAllowanceSpenderId:return"INVALID_ALLOWANCE_SPENDER_ID";case r.RepeatedAllowancesToDelete:return"REPEATED_ALLOWANCES_TO_DELETE";case r.InvalidDelegatingSpender:return"INVALID_DELEGATING_SPENDER";case r.DelegatingSpenderCannotGrantApproveForAll:return"DELEGATING_SPENDER_CANNOT_GRANT_APPROVE_FOR_ALL";case r.DelegatingSpenderDoesNotHaveApproveForAll:return"DELEGATING_SPENDER_DOES_NOT_HAVE_APPROVE_FOR_ALL";case r.ScheduleExpirationTimeTooFarInFuture:return"SCHEDULE_EXPIRATION_TIME_TOO_FAR_IN_FUTURE";case r.ScheduleExpirationTimeMustBeHigherThanConsensusTime:return"SCHEDULE_EXPIRATION_TIME_MUST_BE_HIGHER_THAN_CONSENSUS_TIME";case r.ScheduleFutureThrottleExceeded:return"SCHEDULE_FUTURE_THROTTLE_EXCEEDED";case r.ScheduleFutureGasLimitExceeded:return"SCHEDULE_FUTURE_GAS_LIMIT_EXCEEDED";case r.InvalidEthereumTransaction:return"INVALID_ETHEREUM_TRANSACTION";case r.WrongChainId:return"WRONG_CHAIN_ID";case r.WrongNonce:return"WRONG_NONCE";case r.AccessListUnsupported:return"ACCESS_LIST_UNSUPPORTED";case r.SchedulePendingExpiration:return"SCHEDULE_PENDING_EXPIRATION";case r.ContractIsTokenTreasury:return"CONTRACT_IS_TOKEN_TREASURY";case r.ContractHasNonZeroTokenBalances:return"CONTRACT_HAS_NON_ZERO_TOKEN_BALANCES";case r.ContractExpiredAndPendingRemoval:return"CONTRACT_EXPIRED_AND_PENDING_REMOVAL";case r.ContractHasNoAutoRenewAccount:return"CONTRACT_HAS_NO_AUTO_RENEW_ACCOUNT";case r.PermanentRemovalRequiresSystemInitiation:return"PERMANENT_REMOVAL_REQUIRES_SYSTEM_INITIATION";case r.ProxyAccountIdFieldIsDeprecated:return"PROXY_ACCOUNT_ID_FIELD_IS_DEPRECATED";case r.SelfStakingIsNotAllowed:return"SELF_STAKING_IS_NOT_ALLOWED";case r.InvalidStakingId:return"INVALID_STAKING_ID";case r.StakingNotEnabled:return"STAKING_NOT_ENABLED";case r.InvalidPrngRange:return"INVALID_PRNG_RANGE";case r.MaxEntitiesInPriceRegimeHaveBeenCreated:return"MAX_ENTITIES_IN_PRICE_REGIME_HAVE_BEEN_CREATED";case r.InvalidFullPrefixSignatureForPrecompile:return"INVALID_FULL_PREFIX_SIGNATURE_FOR_PRECOMPILE";case r.InsufficientBalancesForStorageRent:return"INSUFFICIENT_BALANCES_FOR_STORAGE_RENT";case r.MaxChildRecordsExceeded:return"MAX_CHILD_RECORDS_EXCEEDED";case r.InsufficientBalancesForRenewalFees:return"INSUFFICIENT_BALANCES_FOR_RENEWAL_FEES";case r.TransactionHasUnknownFields:return"TRANSACTION_HAS_UNKNOWN_FIELDS";case r.AccountIsImmutable:return"ACCOUNT_IS_IMMUTABLE";case r.AliasAlreadyAssigned:return"ALIAS_ALREADY_ASSIGNED";default:return`UNKNOWN (${this._code})`}}static _fromCode(e){switch(e){case 0:return r.Ok;case 1:return r.InvalidTransaction;case 2:return r.PayerAccountNotFound;case 3:return r.InvalidNodeAccount;case 4:return r.TransactionExpired;case 5:return r.InvalidTransactionStart;case 6:return r.InvalidTransactionDuration;case 7:return r.InvalidSignature;case 8:return r.MemoTooLong;case 9:return r.InsufficientTxFee;case 10:return r.InsufficientPayerBalance;case 11:return r.DuplicateTransaction;case 12:return r.Busy;case 13:return r.NotSupported;case 14:return r.InvalidFileId;case 15:return r.InvalidAccountId;case 16:return r.InvalidContractId;case 17:return r.InvalidTransactionId;case 18:return r.ReceiptNotFound;case 19:return r.RecordNotFound;case 20:return r.InvalidSolidityId;case 21:return r.Unknown;case 22:return r.Success;case 23:return r.FailInvalid;case 24:return r.FailFee;case 25:return r.FailBalance;case 26:return r.KeyRequired;case 27:return r.BadEncoding;case 28:return r.InsufficientAccountBalance;case 29:return r.InvalidSolidityAddress;case 30:return r.InsufficientGas;case 31:return r.ContractSizeLimitExceeded;case 32:return r.LocalCallModificationException;case 33:return r.ContractRevertExecuted;case 34:return r.ContractExecutionException;case 35:return r.InvalidReceivingNodeAccount;case 36:return r.MissingQueryHeader;case 37:return r.AccountUpdateFailed;case 38:return r.InvalidKeyEncoding;case 39:return r.NullSolidityAddress;case 40:return r.ContractUpdateFailed;case 41:return r.InvalidQueryHeader;case 42:return r.InvalidFeeSubmitted;case 43:return r.InvalidPayerSignature;case 44:return r.KeyNotProvided;case 45:return r.InvalidExpirationTime;case 46:return r.NoWaclKey;case 47:return r.FileContentEmpty;case 48:return r.InvalidAccountAmounts;case 49:return r.EmptyTransactionBody;case 50:return r.InvalidTransactionBody;case 51:return r.InvalidSignatureTypeMismatchingKey;case 52:return r.InvalidSignatureCountMismatchingKey;case 53:return r.EmptyLiveHashBody;case 54:return r.EmptyLiveHash;case 55:return r.EmptyLiveHashKeys;case 56:return r.InvalidLiveHashSize;case 57:return r.EmptyQueryBody;case 58:return r.EmptyLiveHashQuery;case 59:return r.LiveHashNotFound;case 60:return r.AccountIdDoesNotExist;case 61:return r.LiveHashAlreadyExists;case 62:return r.InvalidFileWacl;case 63:return r.SerializationFailed;case 64:return r.TransactionOversize;case 65:return r.TransactionTooManyLayers;case 66:return r.ContractDeleted;case 67:return r.PlatformNotActive;case 68:return r.KeyPrefixMismatch;case 69:return r.PlatformTransactionNotCreated;case 70:return r.InvalidRenewalPeriod;case 71:return r.InvalidPayerAccountId;case 72:return r.AccountDeleted;case 73:return r.FileDeleted;case 74:return r.AccountRepeatedInAccountAmounts;case 75:return r.SettingNegativeAccountBalance;case 76:return r.ObtainerRequired;case 77:return r.ObtainerSameContractId;case 78:return r.ObtainerDoesNotExist;case 79:return r.ModifyingImmutableContract;case 80:return r.FileSystemException;case 81:return r.AutorenewDurationNotInRange;case 82:return r.ErrorDecodingBytestring;case 83:return r.ContractFileEmpty;case 84:return r.ContractBytecodeEmpty;case 85:return r.InvalidInitialBalance;case 86:return r.InvalidReceiveRecordThreshold;case 87:return r.InvalidSendRecordThreshold;case 88:return r.AccountIsNotGenesisAccount;case 89:return r.PayerAccountUnauthorized;case 90:return r.InvalidFreezeTransactionBody;case 91:return r.FreezeTransactionBodyNotFound;case 92:return r.TransferListSizeLimitExceeded;case 93:return r.ResultSizeLimitExceeded;case 94:return r.NotSpecialAccount;case 95:return r.ContractNegativeGas;case 96:return r.ContractNegativeValue;case 97:return r.InvalidFeeFile;case 98:return r.InvalidExchangeRateFile;case 99:return r.InsufficientLocalCallGas;case 100:return r.EntityNotAllowedToDelete;case 101:return r.AuthorizationFailed;case 102:return r.FileUploadedProtoInvalid;case 103:return r.FileUploadedProtoNotSavedToDisk;case 104:return r.FeeScheduleFilePartUploaded;case 105:return r.ExchangeRateChangeLimitExceeded;case 106:return r.MaxContractStorageExceeded;case 107:return r.TransferAccountSameAsDeleteAccount;case 108:return r.TotalLedgerBalanceInvalid;case 110:return r.ExpirationReductionNotAllowed;case 111:return r.MaxGasLimitExceeded;case 112:return r.MaxFileSizeExceeded;case 113:return r.ReceiverSigRequired;case 150:return r.InvalidTopicId;case 155:return r.InvalidAdminKey;case 156:return r.InvalidSubmitKey;case 157:return r.Unauthorized;case 158:return r.InvalidTopicMessage;case 159:return r.InvalidAutorenewAccount;case 160:return r.AutorenewAccountNotAllowed;case 162:return r.TopicExpired;case 163:return r.InvalidChunkNumber;case 164:return r.InvalidChunkTransactionId;case 165:return r.AccountFrozenForToken;case 166:return r.TokensPerAccountLimitExceeded;case 167:return r.InvalidTokenId;case 168:return r.InvalidTokenDecimals;case 169:return r.InvalidTokenInitialSupply;case 170:return r.InvalidTreasuryAccountForToken;case 171:return r.InvalidTokenSymbol;case 172:return r.TokenHasNoFreezeKey;case 173:return r.TransfersNotZeroSumForToken;case 174:return r.MissingTokenSymbol;case 175:return r.TokenSymbolTooLong;case 176:return r.AccountKycNotGrantedForToken;case 177:return r.TokenHasNoKycKey;case 178:return r.InsufficientTokenBalance;case 179:return r.TokenWasDeleted;case 180:return r.TokenHasNoSupplyKey;case 181:return r.TokenHasNoWipeKey;case 182:return r.InvalidTokenMintAmount;case 183:return r.InvalidTokenBurnAmount;case 184:return r.TokenNotAssociatedToAccount;case 185:return r.CannotWipeTokenTreasuryAccount;case 186:return r.InvalidKycKey;case 187:return r.InvalidWipeKey;case 188:return r.InvalidFreezeKey;case 189:return r.InvalidSupplyKey;case 190:return r.MissingTokenName;case 191:return r.TokenNameTooLong;case 192:return r.InvalidWipingAmount;case 193:return r.TokenIsImmutable;case 194:return r.TokenAlreadyAssociatedToAccount;case 195:return r.TransactionRequiresZeroTokenBalances;case 196:return r.AccountIsTreasury;case 197:return r.TokenIdRepeatedInTokenList;case 198:return r.TokenTransferListSizeLimitExceeded;case 199:return r.EmptyTokenTransferBody;case 200:return r.EmptyTokenTransferAccountAmounts;case 201:return r.InvalidScheduleId;case 202:return r.ScheduleIsImmutable;case 203:return r.InvalidSchedulePayerId;case 204:return r.InvalidScheduleAccountId;case 205:return r.NoNewValidSignatures;case 206:return r.UnresolvableRequiredSigners;case 207:return r.ScheduledTransactionNotInWhitelist;case 208:return r.SomeSignaturesWereInvalid;case 209:return r.TransactionIdFieldNotAllowed;case 210:return r.IdenticalScheduleAlreadyCreated;case 211:return r.InvalidZeroByteInString;case 212:return r.ScheduleAlreadyDeleted;case 213:return r.ScheduleAlreadyExecuted;case 214:return r.MessageSizeTooLarge;case 215:return r.OperationRepeatedInBucketGroups;case 216:return r.BucketCapacityOverflow;case 217:return r.NodeCapacityNotSufficientForOperation;case 218:return r.BucketHasNoThrottleGroups;case 219:return r.ThrottleGroupHasZeroOpsPerSec;case 220:return r.SuccessButMissingExpectedOperation;case 221:return r.UnparseableThrottleDefinitions;case 222:return r.InvalidThrottleDefinitions;case 223:return r.AccountExpiredAndPendingRemoval;case 224:return r.InvalidTokenMaxSupply;case 225:return r.InvalidTokenNftSerialNumber;case 226:return r.InvalidNftId;case 227:return r.MetadataTooLong;case 228:return r.BatchSizeLimitExceeded;case 229:return r.InvalidQueryRange;case 230:return r.FractionDividesByZero;case 231:return r.InsufficientPayerBalanceForCustomFee;case 232:return r.CustomFeesListTooLong;case 233:return r.InvalidCustomFeeCollector;case 234:return r.InvalidTokenIdInCustomFees;case 235:return r.TokenNotAssociatedToFeeCollector;case 236:return r.TokenMaxSupplyReached;case 237:return r.SenderDoesNotOwnNftSerialNo;case 238:return r.CustomFeeNotFullySpecified;case 239:return r.CustomFeeMustBePositive;case 240:return r.TokenHasNoFeeScheduleKey;case 241:return r.CustomFeeOutsideNumericRange;case 242:return r.RoyaltyFractionCannotExceedOne;case 243:return r.FractionalFeeMaxAmountLessThanMinAmount;case 244:return r.CustomScheduleAlreadyHasNoFees;case 245:return r.CustomFeeDenominationMustBeFungibleCommon;case 246:return r.CustomFractionalFeeOnlyAllowedForFungibleCommon;case 247:return r.InvalidCustomFeeScheduleKey;case 248:return r.InvalidTokenMintMetadata;case 249:return r.InvalidTokenBurnMetadata;case 250:return r.CurrentTreasuryStillOwnsNfts;case 251:return r.AccountStillOwnsNfts;case 252:return r.TreasuryMustOwnBurnedNft;case 253:return r.AccountDoesNotOwnWipedNft;case 254:return r.AccountAmountTransfersOnlyAllowedForFungibleCommon;case 255:return r.MaxNftsInPriceRegimeHaveBeenMinted;case 256:return r.PayerAccountDeleted;case 257:return r.CustomFeeChargingExceededMaxRecursionDepth;case 258:return r.CustomFeeChargingExceededMaxAccountAmounts;case 259:return r.InsufficientSenderAccountBalanceForCustomFee;case 260:return r.SerialNumberLimitReached;case 261:return r.CustomRoyaltyFeeOnlyAllowedForNonFungibleUnique;case 262:return r.NoRemainingAutomaticAssociations;case 263:return r.ExistingAutomaticAssociationsExceedGivenLimit;case 264:return r.RequestedNumAutomaticAssociationsExceedsAssociationLimit;case 265:return r.TokenIsPaused;case 266:return r.TokenHasNoPauseKey;case 267:return r.InvalidPauseKey;case 268:return r.FreezeUpdateFileDoesNotExist;case 269:return r.FreezeUpdateFileHashDoesNotMatch;case 270:return r.NoUpgradeHasBeenPrepared;case 271:return r.NoFreezeIsScheduled;case 272:return r.UpdateFileHashChangedSincePrepareUpgrade;case 273:return r.FreezeStartTimeMustBeFuture;case 274:return r.PreparedUpdateFileIsImmutable;case 275:return r.FreezeAlreadyScheduled;case 276:return r.FreezeUpgradeInProgress;case 277:return r.UpdateFileIdDoesNotMatchPrepared;case 278:return r.UpdateFileHashDoesNotMatchPrepared;case 279:return r.ConsensusGasExhausted;case 280:return r.RevertedSuccess;case 281:return r.MaxStorageInPriceRegimeHasBeenUsed;case 282:return r.InvalidAliasKey;case 283:return r.UnexpectedTokenDecimals;case 284:return r.InvalidProxyAccountId;case 285:return r.InvalidTransferAccountId;case 286:return r.InvalidFeeCollectorAccountId;case 287:return r.AliasIsImmutable;case 288:return r.SpenderAccountSameAsOwner;case 289:return r.AmountExceedsTokenMaxSupply;case 290:return r.NegativeAllowanceAmount;case 291:return r.CannotApproveForAllFungibleCommon;case 292:return r.SpenderDoesNotHaveAllowance;case 293:return r.AmountExceedsAllowance;case 294:return r.MaxAllowancesExceeded;case 295:return r.EmptyAllowances;case 296:return r.SpenderAccountRepeatedInAllowances;case 297:return r.RepeatedSerialNumsInNftAllowances;case 298:return r.FungibleTokenInNftAllowances;case 299:return r.NftInFungibleTokenAllowances;case 300:return r.InvalidAllowanceOwnerId;case 301:return r.InvalidAllowanceSpenderId;case 302:return r.RepeatedAllowancesToDelete;case 303:return r.InvalidDelegatingSpender;case 304:return r.DelegatingSpenderCannotGrantApproveForAll;case 305:return r.DelegatingSpenderDoesNotHaveApproveForAll;case 306:return r.ScheduleExpirationTimeTooFarInFuture;case 307:return r.ScheduleExpirationTimeMustBeHigherThanConsensusTime;case 308:return r.ScheduleFutureThrottleExceeded;case 309:return r.ScheduleFutureGasLimitExceeded;case 310:return r.InvalidEthereumTransaction;case 311:return r.WrongChainId;case 312:return r.WrongNonce;case 313:return r.AccessListUnsupported;case 314:return r.SchedulePendingExpiration;case 315:return r.ContractIsTokenTreasury;case 316:return r.ContractHasNonZeroTokenBalances;case 317:return r.ContractExpiredAndPendingRemoval;case 318:return r.ContractHasNoAutoRenewAccount;case 319:return r.PermanentRemovalRequiresSystemInitiation;case 320:return r.ProxyAccountIdFieldIsDeprecated;case 321:return r.SelfStakingIsNotAllowed;case 322:return r.InvalidStakingId;case 323:return r.StakingNotEnabled;case 324:return r.InvalidPrngRange;case 325:return r.MaxEntitiesInPriceRegimeHaveBeenCreated;case 326:return r.InvalidFullPrefixSignatureForPrecompile;case 327:return r.InsufficientBalancesForStorageRent;case 328:return r.MaxChildRecordsExceeded;case 329:return r.InsufficientBalancesForRenewalFees;case 330:return r.TransactionHasUnknownFields;case 331:return r.AccountIsImmutable;case 332:return r.AliasAlreadyAssigned;default:throw new Error(`(BUG) Status.fromCode() does not handle code: ${e}`)}}valueOf(){return this._code}};P.Ok=new P(0);P.InvalidTransaction=new P(1);P.PayerAccountNotFound=new P(2);P.InvalidNodeAccount=new P(3);P.TransactionExpired=new P(4);P.InvalidTransactionStart=new P(5);P.InvalidTransactionDuration=new P(6);P.InvalidSignature=new P(7);P.MemoTooLong=new P(8);P.InsufficientTxFee=new P(9);P.InsufficientPayerBalance=new P(10);P.DuplicateTransaction=new P(11);P.Busy=new P(12);P.NotSupported=new P(13);P.InvalidFileId=new P(14);P.InvalidAccountId=new P(15);P.InvalidContractId=new P(16);P.InvalidTransactionId=new P(17);P.ReceiptNotFound=new P(18);P.RecordNotFound=new P(19);P.InvalidSolidityId=new P(20);P.Unknown=new P(21);P.Success=new P(22);P.FailInvalid=new P(23);P.FailFee=new P(24);P.FailBalance=new P(25);P.KeyRequired=new P(26);P.BadEncoding=new P(27);P.InsufficientAccountBalance=new P(28);P.InvalidSolidityAddress=new P(29);P.InsufficientGas=new P(30);P.ContractSizeLimitExceeded=new P(31);P.LocalCallModificationException=new P(32);P.ContractRevertExecuted=new P(33);P.ContractExecutionException=new P(34);P.InvalidReceivingNodeAccount=new P(35);P.MissingQueryHeader=new P(36);P.AccountUpdateFailed=new P(37);P.InvalidKeyEncoding=new P(38);P.NullSolidityAddress=new P(39);P.ContractUpdateFailed=new P(40);P.InvalidQueryHeader=new P(41);P.InvalidFeeSubmitted=new P(42);P.InvalidPayerSignature=new P(43);P.KeyNotProvided=new P(44);P.InvalidExpirationTime=new P(45);P.NoWaclKey=new P(46);P.FileContentEmpty=new P(47);P.InvalidAccountAmounts=new P(48);P.EmptyTransactionBody=new P(49);P.InvalidTransactionBody=new P(50);P.InvalidSignatureTypeMismatchingKey=new P(51);P.InvalidSignatureCountMismatchingKey=new P(52);P.EmptyLiveHashBody=new P(53);P.EmptyLiveHash=new P(54);P.EmptyLiveHashKeys=new P(55);P.InvalidLiveHashSize=new P(56);P.EmptyQueryBody=new P(57);P.EmptyLiveHashQuery=new P(58);P.LiveHashNotFound=new P(59);P.AccountIdDoesNotExist=new P(60);P.LiveHashAlreadyExists=new P(61);P.InvalidFileWacl=new P(62);P.SerializationFailed=new P(63);P.TransactionOversize=new P(64);P.TransactionTooManyLayers=new P(65);P.ContractDeleted=new P(66);P.PlatformNotActive=new P(67);P.KeyPrefixMismatch=new P(68);P.PlatformTransactionNotCreated=new P(69);P.InvalidRenewalPeriod=new P(70);P.InvalidPayerAccountId=new P(71);P.AccountDeleted=new P(72);P.FileDeleted=new P(73);P.AccountRepeatedInAccountAmounts=new P(74);P.SettingNegativeAccountBalance=new P(75);P.ObtainerRequired=new P(76);P.ObtainerSameContractId=new P(77);P.ObtainerDoesNotExist=new P(78);P.ModifyingImmutableContract=new P(79);P.FileSystemException=new P(80);P.AutorenewDurationNotInRange=new P(81);P.ErrorDecodingBytestring=new P(82);P.ContractFileEmpty=new P(83);P.ContractBytecodeEmpty=new P(84);P.InvalidInitialBalance=new P(85);P.InvalidReceiveRecordThreshold=new P(86);P.InvalidSendRecordThreshold=new P(87);P.AccountIsNotGenesisAccount=new P(88);P.PayerAccountUnauthorized=new P(89);P.InvalidFreezeTransactionBody=new P(90);P.FreezeTransactionBodyNotFound=new P(91);P.TransferListSizeLimitExceeded=new P(92);P.ResultSizeLimitExceeded=new P(93);P.NotSpecialAccount=new P(94);P.ContractNegativeGas=new P(95);P.ContractNegativeValue=new P(96);P.InvalidFeeFile=new P(97);P.InvalidExchangeRateFile=new P(98);P.InsufficientLocalCallGas=new P(99);P.EntityNotAllowedToDelete=new P(100);P.AuthorizationFailed=new P(101);P.FileUploadedProtoInvalid=new P(102);P.FileUploadedProtoNotSavedToDisk=new P(103);P.FeeScheduleFilePartUploaded=new P(104);P.ExchangeRateChangeLimitExceeded=new P(105);P.MaxContractStorageExceeded=new P(106);P.TransferAccountSameAsDeleteAccount=new P(107);P.TotalLedgerBalanceInvalid=new P(108);P.ExpirationReductionNotAllowed=new P(110);P.MaxGasLimitExceeded=new P(111);P.MaxFileSizeExceeded=new P(112);P.ReceiverSigRequired=new P(113);P.InvalidTopicId=new P(150);P.InvalidAdminKey=new P(155);P.InvalidSubmitKey=new P(156);P.Unauthorized=new P(157);P.InvalidTopicMessage=new P(158);P.InvalidAutorenewAccount=new P(159);P.AutorenewAccountNotAllowed=new P(160);P.TopicExpired=new P(162);P.InvalidChunkNumber=new P(163);P.InvalidChunkTransactionId=new P(164);P.AccountFrozenForToken=new P(165);P.TokensPerAccountLimitExceeded=new P(166);P.InvalidTokenId=new P(167);P.InvalidTokenDecimals=new P(168);P.InvalidTokenInitialSupply=new P(169);P.InvalidTreasuryAccountForToken=new P(170);P.InvalidTokenSymbol=new P(171);P.TokenHasNoFreezeKey=new P(172);P.TransfersNotZeroSumForToken=new P(173);P.MissingTokenSymbol=new P(174);P.TokenSymbolTooLong=new P(175);P.AccountKycNotGrantedForToken=new P(176);P.TokenHasNoKycKey=new P(177);P.InsufficientTokenBalance=new P(178);P.TokenWasDeleted=new P(179);P.TokenHasNoSupplyKey=new P(180);P.TokenHasNoWipeKey=new P(181);P.InvalidTokenMintAmount=new P(182);P.InvalidTokenBurnAmount=new P(183);P.TokenNotAssociatedToAccount=new P(184);P.CannotWipeTokenTreasuryAccount=new P(185);P.InvalidKycKey=new P(186);P.InvalidWipeKey=new P(187);P.InvalidFreezeKey=new P(188);P.InvalidSupplyKey=new P(189);P.MissingTokenName=new P(190);P.TokenNameTooLong=new P(191);P.InvalidWipingAmount=new P(192);P.TokenIsImmutable=new P(193);P.TokenAlreadyAssociatedToAccount=new P(194);P.TransactionRequiresZeroTokenBalances=new P(195);P.AccountIsTreasury=new P(196);P.TokenIdRepeatedInTokenList=new P(197);P.TokenTransferListSizeLimitExceeded=new P(198);P.EmptyTokenTransferBody=new P(199);P.EmptyTokenTransferAccountAmounts=new P(200);P.InvalidScheduleId=new P(201);P.ScheduleIsImmutable=new P(202);P.InvalidSchedulePayerId=new P(203);P.InvalidScheduleAccountId=new P(204);P.NoNewValidSignatures=new P(205);P.UnresolvableRequiredSigners=new P(206);P.ScheduledTransactionNotInWhitelist=new P(207);P.SomeSignaturesWereInvalid=new P(208);P.TransactionIdFieldNotAllowed=new P(209);P.IdenticalScheduleAlreadyCreated=new P(210);P.InvalidZeroByteInString=new P(211);P.ScheduleAlreadyDeleted=new P(212);P.ScheduleAlreadyExecuted=new P(213);P.MessageSizeTooLarge=new P(214);P.OperationRepeatedInBucketGroups=new P(215);P.BucketCapacityOverflow=new P(216);P.NodeCapacityNotSufficientForOperation=new P(217);P.BucketHasNoThrottleGroups=new P(218);P.ThrottleGroupHasZeroOpsPerSec=new P(219);P.SuccessButMissingExpectedOperation=new P(220);P.UnparseableThrottleDefinitions=new P(221);P.InvalidThrottleDefinitions=new P(222);P.AccountExpiredAndPendingRemoval=new P(223);P.InvalidTokenMaxSupply=new P(224);P.InvalidTokenNftSerialNumber=new P(225);P.InvalidNftId=new P(226);P.MetadataTooLong=new P(227);P.BatchSizeLimitExceeded=new P(228);P.InvalidQueryRange=new P(229);P.FractionDividesByZero=new P(230);P.InsufficientPayerBalanceForCustomFee=new P(231);P.CustomFeesListTooLong=new P(232);P.InvalidCustomFeeCollector=new P(233);P.InvalidTokenIdInCustomFees=new P(234);P.TokenNotAssociatedToFeeCollector=new P(235);P.TokenMaxSupplyReached=new P(236);P.SenderDoesNotOwnNftSerialNo=new P(237);P.CustomFeeNotFullySpecified=new P(238);P.CustomFeeMustBePositive=new P(239);P.TokenHasNoFeeScheduleKey=new P(240);P.CustomFeeOutsideNumericRange=new P(241);P.RoyaltyFractionCannotExceedOne=new P(242);P.FractionalFeeMaxAmountLessThanMinAmount=new P(243);P.CustomScheduleAlreadyHasNoFees=new P(244);P.CustomFeeDenominationMustBeFungibleCommon=new P(245);P.CustomFractionalFeeOnlyAllowedForFungibleCommon=new P(246);P.InvalidCustomFeeScheduleKey=new P(247);P.InvalidTokenMintMetadata=new P(248);P.InvalidTokenBurnMetadata=new P(249);P.CurrentTreasuryStillOwnsNfts=new P(250);P.AccountStillOwnsNfts=new P(251);P.TreasuryMustOwnBurnedNft=new P(252);P.AccountDoesNotOwnWipedNft=new P(253);P.AccountAmountTransfersOnlyAllowedForFungibleCommon=new P(254);P.MaxNftsInPriceRegimeHaveBeenMinted=new P(255);P.PayerAccountDeleted=new P(256);P.CustomFeeChargingExceededMaxRecursionDepth=new P(257);P.CustomFeeChargingExceededMaxAccountAmounts=new P(258);P.InsufficientSenderAccountBalanceForCustomFee=new P(259);P.SerialNumberLimitReached=new P(260);P.CustomRoyaltyFeeOnlyAllowedForNonFungibleUnique=new P(261);P.NoRemainingAutomaticAssociations=new P(262);P.ExistingAutomaticAssociationsExceedGivenLimit=new P(263);P.RequestedNumAutomaticAssociationsExceedsAssociationLimit=new P(264);P.TokenIsPaused=new P(265);P.TokenHasNoPauseKey=new P(266);P.InvalidPauseKey=new P(267);P.FreezeUpdateFileDoesNotExist=new P(268);P.FreezeUpdateFileHashDoesNotMatch=new P(269);P.NoUpgradeHasBeenPrepared=new P(270);P.NoFreezeIsScheduled=new P(271);P.UpdateFileHashChangedSincePrepareUpgrade=new P(272);P.FreezeStartTimeMustBeFuture=new P(273);P.PreparedUpdateFileIsImmutable=new P(274);P.FreezeAlreadyScheduled=new P(275);P.FreezeUpgradeInProgress=new P(276);P.UpdateFileIdDoesNotMatchPrepared=new P(277);P.UpdateFileHashDoesNotMatchPrepared=new P(278);P.ConsensusGasExhausted=new P(279);P.RevertedSuccess=new P(280);P.MaxStorageInPriceRegimeHasBeenUsed=new P(281);P.InvalidAliasKey=new P(282);P.UnexpectedTokenDecimals=new P(283);P.InvalidProxyAccountId=new P(284);P.InvalidTransferAccountId=new P(285);P.InvalidFeeCollectorAccountId=new P(286);P.AliasIsImmutable=new P(287);P.SpenderAccountSameAsOwner=new P(288);P.AmountExceedsTokenMaxSupply=new P(289);P.NegativeAllowanceAmount=new P(290);P.CannotApproveForAllFungibleCommon=new P(291);P.SpenderDoesNotHaveAllowance=new P(292);P.AmountExceedsAllowance=new P(293);P.MaxAllowancesExceeded=new P(294);P.EmptyAllowances=new P(295);P.SpenderAccountRepeatedInAllowances=new P(296);P.RepeatedSerialNumsInNftAllowances=new P(297);P.FungibleTokenInNftAllowances=new P(298);P.NftInFungibleTokenAllowances=new P(299);P.InvalidAllowanceOwnerId=new P(300);P.InvalidAllowanceSpenderId=new P(301);P.RepeatedAllowancesToDelete=new P(302);P.InvalidDelegatingSpender=new P(303);P.DelegatingSpenderCannotGrantApproveForAll=new P(304);P.DelegatingSpenderDoesNotHaveApproveForAll=new P(305);P.ScheduleExpirationTimeTooFarInFuture=new P(306);P.ScheduleExpirationTimeMustBeHigherThanConsensusTime=new P(307);P.ScheduleFutureThrottleExceeded=new P(308);P.ScheduleFutureGasLimitExceeded=new P(309);P.InvalidEthereumTransaction=new P(310);P.WrongChainId=new P(311);P.WrongNonce=new P(312);P.AccessListUnsupported=new P(313);P.SchedulePendingExpiration=new P(314);P.ContractIsTokenTreasury=new P(315);P.ContractHasNonZeroTokenBalances=new P(316);P.ContractExpiredAndPendingRemoval=new P(317);P.ContractHasNoAutoRenewAccount=new P(318);P.PermanentRemovalRequiresSystemInitiation=new P(319);P.ProxyAccountIdFieldIsDeprecated=new P(320);P.SelfStakingIsNotAllowed=new P(321);P.InvalidStakingId=new P(322);P.StakingNotEnabled=new P(323);P.InvalidPrngRange=new P(324);P.MaxEntitiesInPriceRegimeHaveBeenCreated=new P(325);P.InvalidFullPrefixSignatureForPrecompile=new P(326);P.InsufficientBalancesForStorageRent=new P(327);P.MaxChildRecordsExceeded=new P(328);P.InsufficientBalancesForRenewalFees=new P(329);P.TransactionHasUnknownFields=new P(330);P.AccountIsImmutable=new P(331);P.AliasAlreadyAssigned=new P(332);var Ud=Ie(Yt(),1);var h8=Ie(vr(),1);var rs=class r extends rt{constructor(e){super(),this._bytes=e}static fromString(e){return new r(et(e))}static fromBytes(e){return new r(e)}toBytes(){return this._bytes}toString(){return He(this._bytes)}equals(e){return PJ(this._bytes,e._bytes)}};function e8(r,e){return function(){return r.apply(e,arguments)}}var{toString:jUe}=Object.prototype,{getPrototypeOf:VD}=Object,AE=(r=>e=>{let t=jUe.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),cu=r=>(r=r.toLowerCase(),e=>AE(e)===r),TE=r=>e=>typeof e===r,{isArray:M2}=Array,t8=TE("undefined");function VUe(r){return r!==null&&!t8(r)&&r.constructor!==null&&!t8(r.constructor)&&K3(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}var vie=cu("ArrayBuffer");function HUe(r){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&vie(r.buffer),e}var KUe=TE("string"),K3=TE("function"),bie=TE("number"),SE=r=>r!==null&&typeof r=="object",zUe=r=>r===!0||r===!1,xE=r=>{if(AE(r)!=="object")return!1;let e=VD(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)},GUe=cu("Date"),WUe=cu("File"),QUe=cu("Blob"),$Ue=cu("FileList"),YUe=r=>SE(r)&&K3(r.pipe),JUe=r=>{let e;return r&&(typeof FormData=="function"&&r instanceof FormData||K3(r.append)&&((e=AE(r))==="formdata"||e==="object"&&K3(r.toString)&&r.toString()==="[object FormData]"))},ZUe=cu("URLSearchParams"),XUe=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function r8(r,e,{allOwnKeys:t=!1}={}){if(r===null||typeof r>"u")return;let n,i;if(typeof r!="object"&&(r=[r]),M2(r))for(n=0,i=r.length;n<i;n++)e.call(null,r[n],n,r);else{let a=t?Object.getOwnPropertyNames(r):Object.keys(r),o=a.length,s;for(n=0;n<o;n++)s=a[n],e.call(null,r[s],s,r)}}function wie(r,e){e=e.toLowerCase();let t=Object.keys(r),n=t.length,i;for(;n-- >0;)if(i=t[n],e===i.toLowerCase())return i;return null}var _ie=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Eie=r=>!t8(r)&&r!==_ie;function jD(){let{caseless:r}=Eie(this)&&this||{},e={},t=(n,i)=>{let a=r&&wie(e,i)||i;xE(e[a])&&xE(n)?e[a]=jD(e[a],n):xE(n)?e[a]=jD({},n):M2(n)?e[a]=n.slice():e[a]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&r8(arguments[n],t);return e}var eqe=(r,e,t,{allOwnKeys:n}={})=>(r8(e,(i,a)=>{t&&K3(i)?r[a]=e8(i,t):r[a]=i},{allOwnKeys:n}),r),tqe=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),rqe=(r,e,t,n)=>{r.prototype=Object.create(e.prototype,n),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:e.prototype}),t&&Object.assign(r.prototype,t)},nqe=(r,e,t,n)=>{let i,a,o,s={};if(e=e||{},r==null)return e;do{for(i=Object.getOwnPropertyNames(r),a=i.length;a-- >0;)o=i[a],(!n||n(o,r,e))&&!s[o]&&(e[o]=r[o],s[o]=!0);r=t!==!1&&VD(r)}while(r&&(!t||t(r,e))&&r!==Object.prototype);return e},iqe=(r,e,t)=>{r=String(r),(t===void 0||t>r.length)&&(t=r.length),t-=e.length;let n=r.indexOf(e,t);return n!==-1&&n===t},aqe=r=>{if(!r)return null;if(M2(r))return r;let e=r.length;if(!bie(e))return null;let t=new Array(e);for(;e-- >0;)t[e]=r[e];return t},oqe=(r=>e=>r&&e instanceof r)(typeof Uint8Array<"u"&&VD(Uint8Array)),sqe=(r,e)=>{let n=(r&&r[Symbol.iterator]).call(r),i;for(;(i=n.next())&&!i.done;){let a=i.value;e.call(r,a[0],a[1])}},cqe=(r,e)=>{let t,n=[];for(;(t=r.exec(e))!==null;)n.push(t);return n},lqe=cu("HTMLFormElement"),uqe=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,n,i){return n.toUpperCase()+i}),gie=(({hasOwnProperty:r})=>(e,t)=>r.call(e,t))(Object.prototype),dqe=cu("RegExp"),xie=(r,e)=>{let t=Object.getOwnPropertyDescriptors(r),n={};r8(t,(i,a)=>{let o;(o=e(i,a,r))!==!1&&(n[a]=o||i)}),Object.defineProperties(r,n)},fqe=r=>{xie(r,(e,t)=>{if(K3(r)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;let n=r[t];if(K3(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},pqe=(r,e)=>{let t={},n=i=>{i.forEach(a=>{t[a]=!0})};return M2(r)?n(r):n(String(r).split(e)),t},hqe=()=>{},mqe=(r,e)=>(r=+r,Number.isFinite(r)?r:e),qD="abcdefghijklmnopqrstuvwxyz",yie="0123456789",Aie={DIGIT:yie,ALPHA:qD,ALPHA_DIGIT:qD+qD.toUpperCase()+yie},gqe=(r=16,e=Aie.ALPHA_DIGIT)=>{let t="",{length:n}=e;for(;r--;)t+=e[Math.random()*n|0];return t};function yqe(r){return!!(r&&K3(r.append)&&r[Symbol.toStringTag]==="FormData"&&r[Symbol.iterator])}var vqe=r=>{let e=new Array(10),t=(n,i)=>{if(SE(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[i]=n;let a=M2(n)?[]:{};return r8(n,(o,s)=>{let c=t(o,i+1);!t8(c)&&(a[s]=c)}),e[i]=void 0,a}}return n};return t(r,0)},bqe=cu("AsyncFunction"),wqe=r=>r&&(SE(r)||K3(r))&&K3(r.then)&&K3(r.catch),ve={isArray:M2,isArrayBuffer:vie,isBuffer:VUe,isFormData:JUe,isArrayBufferView:HUe,isString:KUe,isNumber:bie,isBoolean:zUe,isObject:SE,isPlainObject:xE,isUndefined:t8,isDate:GUe,isFile:WUe,isBlob:QUe,isRegExp:dqe,isFunction:K3,isStream:YUe,isURLSearchParams:ZUe,isTypedArray:oqe,isFileList:$Ue,forEach:r8,merge:jD,extend:eqe,trim:XUe,stripBOM:tqe,inherits:rqe,toFlatObject:nqe,kindOf:AE,kindOfTest:cu,endsWith:iqe,toArray:aqe,forEachEntry:sqe,matchAll:cqe,isHTMLForm:lqe,hasOwnProperty:gie,hasOwnProp:gie,reduceDescriptors:xie,freezeMethods:fqe,toObjectSet:pqe,toCamelCase:uqe,noop:hqe,toFiniteNumber:mqe,findKey:wie,global:_ie,isContextDefined:Eie,ALPHABET:Aie,generateString:gqe,isSpecCompliantForm:yqe,toJSONObject:vqe,isAsyncFn:bqe,isThenable:wqe};function L2(r,e,t,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),n&&(this.request=n),i&&(this.response=i)}ve.inherits(L2,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ve.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var Tie=L2.prototype,Sie={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{Sie[r]={value:r}});Object.defineProperties(L2,Sie);Object.defineProperty(Tie,"isAxiosError",{value:!0});L2.from=(r,e,t,n,i,a)=>{let o=Object.create(Tie);return ve.toFlatObject(r,o,function(c){return c!==Error.prototype},s=>s!=="isAxiosError"),L2.call(o,r.message,e,t,n,i),o.cause=r,o.name=r.name,a&&Object.assign(o,a),o};var wt=L2;var cae=Ie(sae(),1),kE=cae.default;function XD(r){return ve.isPlainObject(r)||ve.isArray(r)}function uae(r){return ve.endsWith(r,"[]")?r.slice(0,-2):r}function lae(r,e,t){return r?r.concat(e).map(function(i,a){return i=uae(i),!t&&a?"["+i+"]":i}).join(t?".":""):e}function nje(r){return ve.isArray(r)&&!r.some(XD)}var ije=ve.toFlatObject(ve,{},null,function(e){return/^is[A-Z]/.test(e)});function aje(r,e,t){if(!ve.isObject(r))throw new TypeError("target must be an object");e=e||new(kE||FormData),t=ve.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,E){return!ve.isUndefined(E[b])});let n=t.metaTokens,i=t.visitor||u,a=t.dots,o=t.indexes,c=(t.Blob||typeof Blob<"u"&&Blob)&&ve.isSpecCompliantForm(e);if(!ve.isFunction(i))throw new TypeError("visitor must be a function");function l(m){if(m===null)return"";if(ve.isDate(m))return m.toISOString();if(!c&&ve.isBlob(m))throw new wt("Blob is not supported. Use a Buffer instead.");return ve.isArrayBuffer(m)||ve.isTypedArray(m)?c&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function u(m,b,E){let I=m;if(m&&!E&&typeof m=="object"){if(ve.endsWith(b,"{}"))b=n?b:b.slice(0,-2),m=JSON.stringify(m);else if(ve.isArray(m)&&nje(m)||(ve.isFileList(m)||ve.endsWith(b,"[]"))&&(I=ve.toArray(m)))return b=uae(b),I.forEach(function(L,U){!(ve.isUndefined(L)||L===null)&&e.append(o===!0?lae([b],U,a):o===null?b:b+"[]",l(L))}),!1}return XD(m)?!0:(e.append(lae(E,b,a),l(m)),!1)}let d=[],h=Object.assign(ije,{defaultVisitor:u,convertValue:l,isVisitable:XD});function g(m,b){if(!ve.isUndefined(m)){if(d.indexOf(m)!==-1)throw Error("Circular reference detected in "+b.join("."));d.push(m),ve.forEach(m,function(I,R){(!(ve.isUndefined(I)||I===null)&&i.call(e,I,ve.isString(R)?R.trim():R,b,h))===!0&&g(I,b?b.concat(R):[R])}),d.pop()}}if(!ve.isObject(r))throw new TypeError("data must be an object");return g(r),e}var bf=aje;function dae(r){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function fae(r,e){this._pairs=[],r&&bf(r,this,e)}var pae=fae.prototype;pae.append=function(e,t){this._pairs.push([e,t])};pae.toString=function(e){let t=e?function(n){return e.call(this,n,dae)}:dae;return this._pairs.map(function(i){return t(i[0])+"="+t(i[1])},"").join("&")};var hae=fae;function oje(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function q0(r,e,t){if(!e)return r;let n=t&&t.encode||oje,i=t&&t.serialize,a;if(i?a=i(e,t):a=ve.isURLSearchParams(e)?e.toString():new hae(e,t).toString(n),a){let o=r.indexOf("#");o!==-1&&(r=r.slice(0,o)),r+=(r.indexOf("?")===-1?"?":"&")+a}return r}var eP=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ve.forEach(this.handlers,function(n){n!==null&&e(n)})}},tP=eP;var F2={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var mae=Ie(require("url"),1),gae=mae.default.URLSearchParams;var yae={isNode:!0,classes:{URLSearchParams:gae,FormData:kE,Blob:typeof Blob<"u"&&Blob||null},protocols:["http","https","file","data"]};var rP={};qy(rP,{hasBrowserEnv:()=>vae,hasStandardBrowserEnv:()=>sje,hasStandardBrowserWebWorkerEnv:()=>cje});var vae=typeof window<"u"&&typeof document<"u",sje=(r=>vae&&["ReactNative","NativeScript","NS"].indexOf(r)<0)(typeof navigator<"u"&&navigator.product),cje=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function";var Ca={...rP,...yae};function nP(r,e){return bf(r,new Ca.classes.URLSearchParams,Object.assign({visitor:function(t,n,i,a){return Ca.isNode&&ve.isBuffer(t)?(this.append(n,t.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},e))}function lje(r){return ve.matchAll(/\w+|\[(\w*)]/g,r).map(e=>e[0]==="[]"?"":e[1]||e[0])}function uje(r){let e={},t=Object.keys(r),n,i=t.length,a;for(n=0;n<i;n++)a=t[n],e[a]=r[a];return e}function dje(r){function e(t,n,i,a){let o=t[a++];if(o==="__proto__")return!0;let s=Number.isFinite(+o),c=a>=t.length;return o=!o&&ve.isArray(i)?i.length:o,c?(ve.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!s):((!i[o]||!ve.isObject(i[o]))&&(i[o]=[]),e(t,n,i[o],a)&&ve.isArray(i[o])&&(i[o]=uje(i[o])),!s)}if(ve.isFormData(r)&&ve.isFunction(r.entries)){let t={};return ve.forEachEntry(r,(n,i)=>{e(lje(n),i,t,0)}),t}return null}var NE=dje;function fje(r,e,t){if(ve.isString(r))try{return(e||JSON.parse)(r),ve.trim(r)}catch(n){if(n.name!=="SyntaxError")throw n}return(t||JSON.stringify)(r)}var iP={transitional:F2,adapter:["xhr","http"],transformRequest:[function(e,t){let n=t.getContentType()||"",i=n.indexOf("application/json")>-1,a=ve.isObject(e);if(a&&ve.isHTMLForm(e)&&(e=new FormData(e)),ve.isFormData(e))return i?JSON.stringify(NE(e)):e;if(ve.isArrayBuffer(e)||ve.isBuffer(e)||ve.isStream(e)||ve.isFile(e)||ve.isBlob(e))return e;if(ve.isArrayBufferView(e))return e.buffer;if(ve.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return nP(e,this.formSerializer).toString();if((s=ve.isFileList(e))||n.indexOf("multipart/form-data")>-1){let c=this.env&&this.env.FormData;return bf(s?{"files[]":e}:e,c&&new c,this.formSerializer)}}return a||i?(t.setContentType("application/json",!1),fje(e)):e}],transformResponse:[function(e){let t=this.transitional||iP.transitional,n=t&&t.forcedJSONParsing,i=this.responseType==="json";if(e&&ve.isString(e)&&(n&&!this.responseType||i)){let o=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(s){if(o)throw s.name==="SyntaxError"?wt.from(s,wt.ERR_BAD_RESPONSE,this,null,this.response):s}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ca.classes.FormData,Blob:Ca.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ve.forEach(["delete","get","head","post","put","patch"],r=>{iP.headers[r]={}});var U2=iP;var pje=ve.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),bae=r=>{let e={},t,n,i;return r&&r.split(`
10635
10635
  `).forEach(function(o){i=o.indexOf(":"),t=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!t||e[t]&&pje[t])&&(t==="set-cookie"?e[t]?e[t].push(n):e[t]=[n]:e[t]=e[t]?e[t]+", "+n:n)}),e};var wae=Symbol("internals");function n8(r){return r&&String(r).trim().toLowerCase()}function RE(r){return r===!1||r==null?r:ve.isArray(r)?r.map(RE):String(r)}function hje(r){let e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=t.exec(r);)e[n[1]]=n[2];return e}var mje=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function aP(r,e,t,n,i){if(ve.isFunction(n))return n.call(this,e,t);if(i&&(e=t),!!ve.isString(e)){if(ve.isString(n))return e.indexOf(n)!==-1;if(ve.isRegExp(n))return n.test(e)}}function gje(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function yje(r,e){let t=ve.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(r,n+t,{value:function(i,a,o){return this[n].call(this,e,i,a,o)},configurable:!0})})}var q2=class{constructor(e){e&&this.set(e)}set(e,t,n){let i=this;function a(s,c,l){let u=n8(c);if(!u)throw new Error("header name must be a non-empty string");let d=ve.findKey(i,u);(!d||i[d]===void 0||l===!0||l===void 0&&i[d]!==!1)&&(i[d||c]=RE(s))}let o=(s,c)=>ve.forEach(s,(l,u)=>a(l,u,c));return ve.isPlainObject(e)||e instanceof this.constructor?o(e,t):ve.isString(e)&&(e=e.trim())&&!mje(e)?o(bae(e),t):e!=null&&a(t,e,n),this}get(e,t){if(e=n8(e),e){let n=ve.findKey(this,e);if(n){let i=this[n];if(!t)return i;if(t===!0)return hje(i);if(ve.isFunction(t))return t.call(this,i,n);if(ve.isRegExp(t))return t.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=n8(e),e){let n=ve.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||aP(this,this[n],n,t)))}return!1}delete(e,t){let n=this,i=!1;function a(o){if(o=n8(o),o){let s=ve.findKey(n,o);s&&(!t||aP(n,n[s],s,t))&&(delete n[s],i=!0)}}return ve.isArray(e)?e.forEach(a):a(e),i}clear(e){let t=Object.keys(this),n=t.length,i=!1;for(;n--;){let a=t[n];(!e||aP(this,this[a],a,e,!0))&&(delete this[a],i=!0)}return i}normalize(e){let t=this,n={};return ve.forEach(this,(i,a)=>{let o=ve.findKey(n,a);if(o){t[o]=RE(i),delete t[a];return}let s=e?gje(a):String(a).trim();s!==a&&delete t[a],t[s]=RE(i),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return ve.forEach(this,(n,i)=>{n!=null&&n!==!1&&(t[i]=e&&ve.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
10636
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(i=>n.set(i)),n}static accessor(e){let n=(this[wae]=this[wae]={accessors:{}}).accessors,i=this.prototype;function a(o){let s=n8(o);n[s]||(yje(i,o),n[s]=!0)}return ve.isArray(e)?e.forEach(a):a(e),this}};q2.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ve.reduceDescriptors(q2.prototype,({value:r},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>r,set(n){this[t]=n}}});ve.freezeMethods(q2);var ka=q2;function i8(r,e){let t=this||U2,n=e||t,i=ka.from(n.headers),a=n.data;return ve.forEach(r,function(s){a=s.call(t,a,i.normalize(),e?e.status:void 0)}),i.normalize(),a}function a8(r){return!!(r&&r.__CANCEL__)}function _ae(r,e,t){wt.call(this,r??"canceled",wt.ERR_CANCELED,e,t),this.name="CanceledError"}ve.inherits(_ae,wt,{__CANCEL__:!0});var tl=_ae;function wf(r,e,t){let n=t.config.validateStatus;!t.status||!n||n(t.status)?r(t):e(new wt("Request failed with status code "+t.status,[wt.ERR_BAD_REQUEST,wt.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function oP(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function sP(r,e){return e?r.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):r}function j0(r,e){return r&&!oP(e)?sP(r,e):e}var roe=Ie(xae(),1),noe=Ie(require("http"),1),ioe=Ie(require("https"),1),aoe=Ie(require("util"),1),ooe=Ie(Vae(),1),Ld=Ie(require("zlib"),1);var K0="1.6.5";function d8(r){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return e&&e[1]||""}var iVe=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function xP(r,e,t){let n=t&&t.Blob||Ca.classes.Blob,i=d8(r);if(e===void 0&&n&&(e=!0),i==="data"){r=i.length?r.slice(i.length+1):r;let a=iVe.exec(r);if(!a)throw new wt("Invalid URL",wt.ERR_INVALID_URL);let o=a[1],s=a[2],c=a[3],l=Buffer.from(decodeURIComponent(c),s?"base64":"utf8");if(e){if(!n)throw new wt("Blob is not supported",wt.ERR_NOT_SUPPORT);return new n([l],{type:o})}return l}throw new wt("Unsupported protocol "+i,wt.ERR_NOT_SUPPORT)}var z0=Ie(require("stream"),1);var Kae=Ie(require("stream"),1);function aVe(r,e){let t=0,n=1e3/e,i=null;return function(o,s){let c=Date.now();if(o||c-t>n)return i&&(clearTimeout(i),i=null),t=c,r.apply(null,s);i||(i=setTimeout(()=>(i=null,t=Date.now(),r.apply(null,s)),n-(c-t)))}}var Hae=aVe;function oVe(r,e){r=r||10;let t=new Array(r),n=new Array(r),i=0,a=0,o;return e=e!==void 0?e:1e3,function(c){let l=Date.now(),u=n[a];o||(o=l),t[i]=c,n[i]=l;let d=a,h=0;for(;d!==i;)h+=t[d++],d=d%r;if(i=(i+1)%r,i===a&&(a=(a+1)%r),l-o<e)return;let g=u&&l-u;return g?Math.round(h*1e3/g):void 0}}var LE=oVe;var FE=Symbol("internals"),AP=class extends Kae.default.Transform{constructor(e){e=ve.toFlatObject(e,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(s,c)=>!ve.isUndefined(c[s])),super({readableHighWaterMark:e.chunkSize});let t=this,n=this[FE]={length:e.length,timeWindow:e.timeWindow,ticksRate:e.ticksRate,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null},i=LE(n.ticksRate*e.samplesCount,n.timeWindow);this.on("newListener",s=>{s==="progress"&&(n.isCaptured||(n.isCaptured=!0))});let a=0;n.updateProgress=Hae(function(){let c=n.length,l=n.bytesSeen,u=l-a;if(!u||t.destroyed)return;let d=i(u);a=l,process.nextTick(()=>{t.emit("progress",{loaded:l,total:c,progress:c?l/c:void 0,bytes:u,rate:d||void 0,estimated:d&&c&&l<=c?(c-l)/d:void 0})})},n.ticksRate);let o=()=>{n.updateProgress(!0)};this.once("end",o),this.once("error",o)}_read(e){let t=this[FE];return t.onReadCallback&&t.onReadCallback(),super._read(e)}_transform(e,t,n){let i=this,a=this[FE],o=a.maxRate,s=this.readableHighWaterMark,c=a.timeWindow,l=1e3/c,u=o/l,d=a.minChunkSize!==!1?Math.max(a.minChunkSize,u*.01):0;function h(m,b){let E=Buffer.byteLength(m);a.bytesSeen+=E,a.bytes+=E,a.isCaptured&&a.updateProgress(),i.push(m)?process.nextTick(b):a.onReadCallback=()=>{a.onReadCallback=null,process.nextTick(b)}}let g=(m,b)=>{let E=Buffer.byteLength(m),I=null,R=s,L,U=0;if(o){let V=Date.now();(!a.ts||(U=V-a.ts)>=c)&&(a.ts=V,L=u-a.bytes,a.bytes=L<0?-L:0,U=0),L=u-a.bytes}if(o){if(L<=0)return setTimeout(()=>{b(null,m)},c-U);L<R&&(R=L)}R&&E>R&&E-R>d&&(I=m.subarray(R),m=m.subarray(0,R)),h(m,I?()=>{process.nextTick(b,null,I)}:b)};g(e,function m(b,E){if(b)return n(b);E?g(E,m):n(null)})}setLength(e){return this[FE].length=+e,this}},TP=AP;var soe=Ie(require("events"),1);var Gae=require("util"),Wae=require("stream");var{asyncIterator:zae}=Symbol,sVe=async function*(r){r.stream?yield*r.stream():r.arrayBuffer?yield await r.arrayBuffer():r[zae]?yield*r[zae]():yield r},UE=sVe;var cVe=ve.ALPHABET.ALPHA_DIGIT+"-_",f8=new Gae.TextEncoder,_f=`\r
10637
- `,lVe=f8.encode(_f),uVe=2,SP=class{constructor(e,t){let{escapeName:n}=this.constructor,i=ve.isString(t),a=`Content-Disposition: form-data; name="${n(e)}"${!i&&t.name?`; filename="${n(t.name)}"`:""}${_f}`;i?t=f8.encode(String(t).replace(/\r?\n|\r\n?/g,_f)):a+=`Content-Type: ${t.type||"application/octet-stream"}${_f}`,this.headers=f8.encode(a+_f),this.contentLength=i?t.byteLength:t.size,this.size=this.headers.byteLength+this.contentLength+uVe,this.name=e,this.value=t}async*encode(){yield this.headers;let{value:e}=this;ve.isTypedArray(e)?yield e:yield*UE(e),yield lVe}static escapeName(e){return String(e).replace(/[\r\n"]/g,t=>({"\r":"%0D","\n":"%0A",'"':"%22"})[t])}},dVe=(r,e,t)=>{let{tag:n="form-data-boundary",size:i=25,boundary:a=n+"-"+ve.generateString(i,cVe)}=t||{};if(!ve.isFormData(r))throw TypeError("FormData instance required");if(a.length<1||a.length>70)throw Error("boundary must be 10-70 characters long");let o=f8.encode("--"+a+_f),s=f8.encode("--"+a+"--"+_f+_f),c=s.byteLength,l=Array.from(r.entries()).map(([d,h])=>{let g=new SP(d,h);return c+=g.size,g});c+=o.byteLength*l.length,c=ve.toFiniteNumber(c);let u={"Content-Type":`multipart/form-data; boundary=${a}`};return Number.isFinite(c)&&(u["Content-Length"]=c),e&&e(u),Wae.Readable.from(async function*(){for(let d of l)yield o,yield*d.encode();yield s}())},Qae=dVe;var $ae=Ie(require("stream"),1),IP=class extends $ae.default.Transform{__transform(e,t,n){this.push(e),n()}_transform(e,t,n){if(e.length!==0&&(this._transform=this.__transform,e[0]!==120)){let i=Buffer.alloc(2);i[0]=120,i[1]=156,this.push(i,t)}this.__transform(e,t,n)}},Yae=IP;var fVe=(r,e)=>ve.isAsyncFn(r)?function(...t){let n=t.pop();r.apply(this,t).then(i=>{try{e?n(null,...e(i)):n(null,i)}catch(a){n(a)}},n)}:r,Jae=fVe;var Zae={flush:Ld.default.constants.Z_SYNC_FLUSH,finishFlush:Ld.default.constants.Z_SYNC_FLUSH},pVe={flush:Ld.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:Ld.default.constants.BROTLI_OPERATION_FLUSH},Xae=ve.isFunction(Ld.default.createBrotliDecompress),{http:hVe,https:mVe}=ooe.default,gVe=/https:?/,eoe=Ca.protocols.map(r=>r+":");function yVe(r){r.beforeRedirects.proxy&&r.beforeRedirects.proxy(r),r.beforeRedirects.config&&r.beforeRedirects.config(r)}function coe(r,e,t){let n=e;if(!n&&n!==!1){let i=(0,roe.getProxyForUrl)(t);i&&(n=new URL(i))}if(n){if(n.username&&(n.auth=(n.username||"")+":"+(n.password||"")),n.auth){(n.auth.username||n.auth.password)&&(n.auth=(n.auth.username||"")+":"+(n.auth.password||""));let a=Buffer.from(n.auth,"utf8").toString("base64");r.headers["Proxy-Authorization"]="Basic "+a}r.headers.host=r.hostname+(r.port?":"+r.port:"");let i=n.hostname||n.host;r.hostname=i,r.host=i,r.port=n.port,r.path=t,n.protocol&&(r.protocol=n.protocol.includes(":")?n.protocol:`${n.protocol}:`)}r.beforeRedirects.proxy=function(a){coe(a,e,a.href)}}var vVe=typeof process<"u"&&ve.kindOf(process)==="process",bVe=r=>new Promise((e,t)=>{let n,i,a=(c,l)=>{i||(i=!0,n&&n(c,l))},o=c=>{a(c),e(c)},s=c=>{a(c,!0),t(c)};r(o,s,c=>n=c).catch(s)}),wVe=({address:r,family:e})=>{if(!ve.isString(r))throw TypeError("address must be a string");return{address:r,family:e||(r.indexOf(".")<0?6:4)}},toe=(r,e)=>wVe(ve.isObject(r)?r:{address:r,family:e}),loe=vVe&&function(e){return bVe(async function(n,i,a){let{data:o,lookup:s,family:c}=e,{responseType:l,responseEncoding:u}=e,d=e.method.toUpperCase(),h,g=!1,m;if(s){let T=Jae(s,S=>ve.isArray(S)?S:[S]);s=(S,_,B)=>{T(S,_,(q,k,z)=>{if(q)return B(q);let ie=ve.isArray(k)?k.map(M=>toe(M)):[toe(k,z)];_.all?B(q,ie):B(q,ie[0].address,ie[0].family)})}}let b=new soe.default,E=()=>{e.cancelToken&&e.cancelToken.unsubscribe(I),e.signal&&e.signal.removeEventListener("abort",I),b.removeAllListeners()};a((T,S)=>{h=!0,S&&(g=!0,E())});function I(T){b.emit("abort",!T||T.type?new tl(null,e,m):T)}b.once("abort",i),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(I),e.signal&&(e.signal.aborted?I():e.signal.addEventListener("abort",I)));let R=j0(e.baseURL,e.url),L=new URL(R,"http://localhost"),U=L.protocol||eoe[0];if(U==="data:"){let T;if(d!=="GET")return wf(n,i,{status:405,statusText:"method not allowed",headers:{},config:e});try{T=xP(e.url,l==="blob",{Blob:e.env&&e.env.Blob})}catch(S){throw wt.from(S,wt.ERR_BAD_REQUEST,e)}return l==="text"?(T=T.toString(u),(!u||u==="utf8")&&(T=ve.stripBOM(T))):l==="stream"&&(T=z0.default.Readable.from(T)),wf(n,i,{data:T,status:200,statusText:"OK",headers:new ka,config:e})}if(eoe.indexOf(U)===-1)return i(new wt("Unsupported protocol "+U,wt.ERR_BAD_REQUEST,e));let V=ka.from(e.headers).normalize();V.set("User-Agent","axios/"+K0,!1);let G=e.onDownloadProgress,H=e.onUploadProgress,N=e.maxRate,F,O;if(ve.isSpecCompliantForm(o)){let T=V.getContentType(/boundary=([-_\w\d]{10,70})/i);o=Qae(o,S=>{V.set(S)},{tag:`axios-${K0}-boundary`,boundary:T&&T[1]||void 0})}else if(ve.isFormData(o)&&ve.isFunction(o.getHeaders)){if(V.set(o.getHeaders()),!V.hasContentLength())try{let T=await aoe.default.promisify(o.getLength).call(o);Number.isFinite(T)&&T>=0&&V.setContentLength(T)}catch{}}else if(ve.isBlob(o))o.size&&V.setContentType(o.type||"application/octet-stream"),V.setContentLength(o.size||0),o=z0.default.Readable.from(UE(o));else if(o&&!ve.isStream(o)){if(!Buffer.isBuffer(o))if(ve.isArrayBuffer(o))o=Buffer.from(new Uint8Array(o));else if(ve.isString(o))o=Buffer.from(o,"utf-8");else return i(new wt("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",wt.ERR_BAD_REQUEST,e));if(V.setContentLength(o.length,!1),e.maxBodyLength>-1&&o.length>e.maxBodyLength)return i(new wt("Request body larger than maxBodyLength limit",wt.ERR_BAD_REQUEST,e))}let y=ve.toFiniteNumber(V.getContentLength());ve.isArray(N)?(F=N[0],O=N[1]):F=O=N,o&&(H||F)&&(ve.isStream(o)||(o=z0.default.Readable.from(o,{objectMode:!1})),o=z0.default.pipeline([o,new TP({length:y,maxRate:ve.toFiniteNumber(F)})],ve.noop),H&&o.on("progress",T=>{H(Object.assign(T,{upload:!0}))}));let x;if(e.auth){let T=e.auth.username||"",S=e.auth.password||"";x=T+":"+S}if(!x&&L.username){let T=L.username,S=L.password;x=T+":"+S}x&&V.delete("authorization");let w;try{w=q0(L.pathname+L.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(T){let S=new Error(T.message);return S.config=e,S.url=e.url,S.exists=!0,i(S)}V.set("Accept-Encoding","gzip, compress, deflate"+(Xae?", br":""),!1);let p={path:w,method:d,headers:V.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:x,protocol:U,family:c,beforeRedirect:yVe,beforeRedirects:{}};!ve.isUndefined(s)&&(p.lookup=s),e.socketPath?p.socketPath=e.socketPath:(p.hostname=L.hostname,p.port=L.port,coe(p,e.proxy,U+"//"+L.hostname+(L.port?":"+L.port:"")+p.path));let v,A=gVe.test(p.protocol);if(p.agent=A?e.httpsAgent:e.httpAgent,e.transport?v=e.transport:e.maxRedirects===0?v=A?ioe.default:noe.default:(e.maxRedirects&&(p.maxRedirects=e.maxRedirects),e.beforeRedirect&&(p.beforeRedirects.config=e.beforeRedirect),v=A?mVe:hVe),e.maxBodyLength>-1?p.maxBodyLength=e.maxBodyLength:p.maxBodyLength=1/0,e.insecureHTTPParser&&(p.insecureHTTPParser=e.insecureHTTPParser),m=v.request(p,function(S){if(m.destroyed)return;let _=[S],B=+S.headers["content-length"];if(G){let M=new TP({length:ve.toFiniteNumber(B),maxRate:ve.toFiniteNumber(O)});G&&M.on("progress",te=>{G(Object.assign(te,{download:!0}))}),_.push(M)}let q=S,k=S.req||m;if(e.decompress!==!1&&S.headers["content-encoding"])switch((d==="HEAD"||S.statusCode===204)&&delete S.headers["content-encoding"],(S.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":_.push(Ld.default.createUnzip(Zae)),delete S.headers["content-encoding"];break;case"deflate":_.push(new Yae),_.push(Ld.default.createUnzip(Zae)),delete S.headers["content-encoding"];break;case"br":Xae&&(_.push(Ld.default.createBrotliDecompress(pVe)),delete S.headers["content-encoding"])}q=_.length>1?z0.default.pipeline(_,ve.noop):_[0];let z=z0.default.finished(q,()=>{z(),E()}),ie={status:S.statusCode,statusText:S.statusMessage,headers:new ka(S.headers),config:e,request:k};if(l==="stream")ie.data=q,wf(n,i,ie);else{let M=[],te=0;q.on("data",function(se){M.push(se),te+=se.length,e.maxContentLength>-1&&te>e.maxContentLength&&(g=!0,q.destroy(),i(new wt("maxContentLength size of "+e.maxContentLength+" exceeded",wt.ERR_BAD_RESPONSE,e,k)))}),q.on("aborted",function(){if(g)return;let se=new wt("maxContentLength size of "+e.maxContentLength+" exceeded",wt.ERR_BAD_RESPONSE,e,k);q.destroy(se),i(se)}),q.on("error",function(se){m.destroyed||i(wt.from(se,null,e,k))}),q.on("end",function(){try{let se=M.length===1?M[0]:Buffer.concat(M);l!=="arraybuffer"&&(se=se.toString(u),(!u||u==="utf8")&&(se=ve.stripBOM(se))),ie.data=se}catch(se){return i(wt.from(se,null,e,ie.request,ie))}wf(n,i,ie)})}b.once("abort",M=>{q.destroyed||(q.emit("error",M),q.destroy())})}),b.once("abort",T=>{i(T),m.destroy(T)}),m.on("error",function(S){i(wt.from(S,null,e,m))}),m.on("socket",function(S){S.setKeepAlive(!0,1e3*60)}),e.timeout){let T=parseInt(e.timeout,10);if(Number.isNaN(T)){i(new wt("error trying to parse `config.timeout` to int",wt.ERR_BAD_OPTION_VALUE,e,m));return}m.setTimeout(T,function(){if(h)return;let _=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",B=e.transitional||F2;e.timeoutErrorMessage&&(_=e.timeoutErrorMessage),i(new wt(_,B.clarifyTimeoutError?wt.ETIMEDOUT:wt.ECONNABORTED,e,m)),I()})}if(ve.isStream(o)){let T=!1,S=!1;o.on("end",()=>{T=!0}),o.once("error",_=>{S=!0,m.destroy(_)}),o.on("close",()=>{!T&&!S&&I(new tl("Request stream has been aborted",e,m))}),o.pipe(m)}else m.end(o)})};var uoe=Ca.hasStandardBrowserEnv?{write(r,e,t,n,i,a){let o=[r+"="+encodeURIComponent(e)];ve.isNumber(t)&&o.push("expires="+new Date(t).toGMTString()),ve.isString(n)&&o.push("path="+n),ve.isString(i)&&o.push("domain="+i),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(r){let e=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};var doe=Ca.hasStandardBrowserEnv?function(){let e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a"),n;function i(a){let o=a;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return n=i(window.location.href),function(o){let s=ve.isString(o)?i(o):o;return s.protocol===n.protocol&&s.host===n.host}}():function(){return function(){return!0}}();function foe(r,e){let t=0,n=LE(50,250);return i=>{let a=i.loaded,o=i.lengthComputable?i.total:void 0,s=a-t,c=n(s),l=a<=o;t=a;let u={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:c||void 0,estimated:c&&o&&l?(o-a)/c:void 0,event:i};u[e?"download":"upload"]=!0,r(u)}}var _Ve=typeof XMLHttpRequest<"u",poe=_Ve&&function(r){return new Promise(function(t,n){let i=r.data,a=ka.from(r.headers).normalize(),{responseType:o,withXSRFToken:s}=r,c;function l(){r.cancelToken&&r.cancelToken.unsubscribe(c),r.signal&&r.signal.removeEventListener("abort",c)}let u;if(ve.isFormData(i)){if(Ca.hasStandardBrowserEnv||Ca.hasStandardBrowserWebWorkerEnv)a.setContentType(!1);else if((u=a.getContentType())!==!1){let[b,...E]=u?u.split(";").map(I=>I.trim()).filter(Boolean):[];a.setContentType([b||"multipart/form-data",...E].join("; "))}}let d=new XMLHttpRequest;if(r.auth){let b=r.auth.username||"",E=r.auth.password?unescape(encodeURIComponent(r.auth.password)):"";a.set("Authorization","Basic "+btoa(b+":"+E))}let h=j0(r.baseURL,r.url);d.open(r.method.toUpperCase(),q0(h,r.params,r.paramsSerializer),!0),d.timeout=r.timeout;function g(){if(!d)return;let b=ka.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),I={data:!o||o==="text"||o==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:b,config:r,request:d};wf(function(L){t(L),l()},function(L){n(L),l()},I),d=null}if("onloadend"in d?d.onloadend=g:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(g)},d.onabort=function(){d&&(n(new wt("Request aborted",wt.ECONNABORTED,r,d)),d=null)},d.onerror=function(){n(new wt("Network Error",wt.ERR_NETWORK,r,d)),d=null},d.ontimeout=function(){let E=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded",I=r.transitional||F2;r.timeoutErrorMessage&&(E=r.timeoutErrorMessage),n(new wt(E,I.clarifyTimeoutError?wt.ETIMEDOUT:wt.ECONNABORTED,r,d)),d=null},Ca.hasStandardBrowserEnv&&(s&&ve.isFunction(s)&&(s=s(r)),s||s!==!1&&doe(h))){let b=r.xsrfHeaderName&&r.xsrfCookieName&&uoe.read(r.xsrfCookieName);b&&a.set(r.xsrfHeaderName,b)}i===void 0&&a.setContentType(null),"setRequestHeader"in d&&ve.forEach(a.toJSON(),function(E,I){d.setRequestHeader(I,E)}),ve.isUndefined(r.withCredentials)||(d.withCredentials=!!r.withCredentials),o&&o!=="json"&&(d.responseType=r.responseType),typeof r.onDownloadProgress=="function"&&d.addEventListener("progress",foe(r.onDownloadProgress,!0)),typeof r.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",foe(r.onUploadProgress)),(r.cancelToken||r.signal)&&(c=b=>{d&&(n(!b||b.type?new tl(null,r,d):b),d.abort(),d=null)},r.cancelToken&&r.cancelToken.subscribe(c),r.signal&&(r.signal.aborted?c():r.signal.addEventListener("abort",c)));let m=d8(h);if(m&&Ca.protocols.indexOf(m)===-1){n(new wt("Unsupported protocol "+m+":",wt.ERR_BAD_REQUEST,r));return}d.send(i||null)})};var CP={http:loe,xhr:poe};ve.forEach(CP,(r,e)=>{if(r){try{Object.defineProperty(r,"name",{value:e})}catch{}Object.defineProperty(r,"adapterName",{value:e})}});var hoe=r=>`- ${r}`,EVe=r=>ve.isFunction(r)||r===null||r===!1,qE={getAdapter:r=>{r=ve.isArray(r)?r:[r];let{length:e}=r,t,n,i={};for(let a=0;a<e;a++){t=r[a];let o;if(n=t,!EVe(t)&&(n=CP[(o=String(t)).toLowerCase()],n===void 0))throw new wt(`Unknown adapter '${o}'`);if(n)break;i[o||"#"+a]=n}if(!n){let a=Object.entries(i).map(([s,c])=>`adapter ${s} `+(c===!1?"is not supported by the environment":"is not available in the build")),o=e?a.length>1?`since :
10636
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(i=>n.set(i)),n}static accessor(e){let n=(this[wae]=this[wae]={accessors:{}}).accessors,i=this.prototype;function a(o){let s=n8(o);n[s]||(yje(i,o),n[s]=!0)}return ve.isArray(e)?e.forEach(a):a(e),this}};q2.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ve.reduceDescriptors(q2.prototype,({value:r},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>r,set(n){this[t]=n}}});ve.freezeMethods(q2);var ka=q2;function i8(r,e){let t=this||U2,n=e||t,i=ka.from(n.headers),a=n.data;return ve.forEach(r,function(s){a=s.call(t,a,i.normalize(),e?e.status:void 0)}),i.normalize(),a}function a8(r){return!!(r&&r.__CANCEL__)}function _ae(r,e,t){wt.call(this,r??"canceled",wt.ERR_CANCELED,e,t),this.name="CanceledError"}ve.inherits(_ae,wt,{__CANCEL__:!0});var tl=_ae;function wf(r,e,t){let n=t.config.validateStatus;!t.status||!n||n(t.status)?r(t):e(new wt("Request failed with status code "+t.status,[wt.ERR_BAD_REQUEST,wt.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function oP(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function sP(r,e){return e?r.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):r}function j0(r,e){return r&&!oP(e)?sP(r,e):e}var roe=Ie(xae(),1),noe=Ie(require("http"),1),ioe=Ie(require("https"),1),aoe=Ie(require("util"),1),ooe=Ie(Vae(),1),Ld=Ie(require("zlib"),1);var K0="1.6.7";function d8(r){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return e&&e[1]||""}var iVe=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function xP(r,e,t){let n=t&&t.Blob||Ca.classes.Blob,i=d8(r);if(e===void 0&&n&&(e=!0),i==="data"){r=i.length?r.slice(i.length+1):r;let a=iVe.exec(r);if(!a)throw new wt("Invalid URL",wt.ERR_INVALID_URL);let o=a[1],s=a[2],c=a[3],l=Buffer.from(decodeURIComponent(c),s?"base64":"utf8");if(e){if(!n)throw new wt("Blob is not supported",wt.ERR_NOT_SUPPORT);return new n([l],{type:o})}return l}throw new wt("Unsupported protocol "+i,wt.ERR_NOT_SUPPORT)}var z0=Ie(require("stream"),1);var Kae=Ie(require("stream"),1);function aVe(r,e){let t=0,n=1e3/e,i=null;return function(o,s){let c=Date.now();if(o||c-t>n)return i&&(clearTimeout(i),i=null),t=c,r.apply(null,s);i||(i=setTimeout(()=>(i=null,t=Date.now(),r.apply(null,s)),n-(c-t)))}}var Hae=aVe;function oVe(r,e){r=r||10;let t=new Array(r),n=new Array(r),i=0,a=0,o;return e=e!==void 0?e:1e3,function(c){let l=Date.now(),u=n[a];o||(o=l),t[i]=c,n[i]=l;let d=a,h=0;for(;d!==i;)h+=t[d++],d=d%r;if(i=(i+1)%r,i===a&&(a=(a+1)%r),l-o<e)return;let g=u&&l-u;return g?Math.round(h*1e3/g):void 0}}var LE=oVe;var FE=Symbol("internals"),AP=class extends Kae.default.Transform{constructor(e){e=ve.toFlatObject(e,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(s,c)=>!ve.isUndefined(c[s])),super({readableHighWaterMark:e.chunkSize});let t=this,n=this[FE]={length:e.length,timeWindow:e.timeWindow,ticksRate:e.ticksRate,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null},i=LE(n.ticksRate*e.samplesCount,n.timeWindow);this.on("newListener",s=>{s==="progress"&&(n.isCaptured||(n.isCaptured=!0))});let a=0;n.updateProgress=Hae(function(){let c=n.length,l=n.bytesSeen,u=l-a;if(!u||t.destroyed)return;let d=i(u);a=l,process.nextTick(()=>{t.emit("progress",{loaded:l,total:c,progress:c?l/c:void 0,bytes:u,rate:d||void 0,estimated:d&&c&&l<=c?(c-l)/d:void 0})})},n.ticksRate);let o=()=>{n.updateProgress(!0)};this.once("end",o),this.once("error",o)}_read(e){let t=this[FE];return t.onReadCallback&&t.onReadCallback(),super._read(e)}_transform(e,t,n){let i=this,a=this[FE],o=a.maxRate,s=this.readableHighWaterMark,c=a.timeWindow,l=1e3/c,u=o/l,d=a.minChunkSize!==!1?Math.max(a.minChunkSize,u*.01):0;function h(m,b){let E=Buffer.byteLength(m);a.bytesSeen+=E,a.bytes+=E,a.isCaptured&&a.updateProgress(),i.push(m)?process.nextTick(b):a.onReadCallback=()=>{a.onReadCallback=null,process.nextTick(b)}}let g=(m,b)=>{let E=Buffer.byteLength(m),I=null,R=s,L,U=0;if(o){let V=Date.now();(!a.ts||(U=V-a.ts)>=c)&&(a.ts=V,L=u-a.bytes,a.bytes=L<0?-L:0,U=0),L=u-a.bytes}if(o){if(L<=0)return setTimeout(()=>{b(null,m)},c-U);L<R&&(R=L)}R&&E>R&&E-R>d&&(I=m.subarray(R),m=m.subarray(0,R)),h(m,I?()=>{process.nextTick(b,null,I)}:b)};g(e,function m(b,E){if(b)return n(b);E?g(E,m):n(null)})}setLength(e){return this[FE].length=+e,this}},TP=AP;var soe=Ie(require("events"),1);var Gae=require("util"),Wae=require("stream");var{asyncIterator:zae}=Symbol,sVe=async function*(r){r.stream?yield*r.stream():r.arrayBuffer?yield await r.arrayBuffer():r[zae]?yield*r[zae]():yield r},UE=sVe;var cVe=ve.ALPHABET.ALPHA_DIGIT+"-_",f8=new Gae.TextEncoder,_f=`\r
10637
+ `,lVe=f8.encode(_f),uVe=2,SP=class{constructor(e,t){let{escapeName:n}=this.constructor,i=ve.isString(t),a=`Content-Disposition: form-data; name="${n(e)}"${!i&&t.name?`; filename="${n(t.name)}"`:""}${_f}`;i?t=f8.encode(String(t).replace(/\r?\n|\r\n?/g,_f)):a+=`Content-Type: ${t.type||"application/octet-stream"}${_f}`,this.headers=f8.encode(a+_f),this.contentLength=i?t.byteLength:t.size,this.size=this.headers.byteLength+this.contentLength+uVe,this.name=e,this.value=t}async*encode(){yield this.headers;let{value:e}=this;ve.isTypedArray(e)?yield e:yield*UE(e),yield lVe}static escapeName(e){return String(e).replace(/[\r\n"]/g,t=>({"\r":"%0D","\n":"%0A",'"':"%22"})[t])}},dVe=(r,e,t)=>{let{tag:n="form-data-boundary",size:i=25,boundary:a=n+"-"+ve.generateString(i,cVe)}=t||{};if(!ve.isFormData(r))throw TypeError("FormData instance required");if(a.length<1||a.length>70)throw Error("boundary must be 10-70 characters long");let o=f8.encode("--"+a+_f),s=f8.encode("--"+a+"--"+_f+_f),c=s.byteLength,l=Array.from(r.entries()).map(([d,h])=>{let g=new SP(d,h);return c+=g.size,g});c+=o.byteLength*l.length,c=ve.toFiniteNumber(c);let u={"Content-Type":`multipart/form-data; boundary=${a}`};return Number.isFinite(c)&&(u["Content-Length"]=c),e&&e(u),Wae.Readable.from(async function*(){for(let d of l)yield o,yield*d.encode();yield s}())},Qae=dVe;var $ae=Ie(require("stream"),1),IP=class extends $ae.default.Transform{__transform(e,t,n){this.push(e),n()}_transform(e,t,n){if(e.length!==0&&(this._transform=this.__transform,e[0]!==120)){let i=Buffer.alloc(2);i[0]=120,i[1]=156,this.push(i,t)}this.__transform(e,t,n)}},Yae=IP;var fVe=(r,e)=>ve.isAsyncFn(r)?function(...t){let n=t.pop();r.apply(this,t).then(i=>{try{e?n(null,...e(i)):n(null,i)}catch(a){n(a)}},n)}:r,Jae=fVe;var Zae={flush:Ld.default.constants.Z_SYNC_FLUSH,finishFlush:Ld.default.constants.Z_SYNC_FLUSH},pVe={flush:Ld.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:Ld.default.constants.BROTLI_OPERATION_FLUSH},Xae=ve.isFunction(Ld.default.createBrotliDecompress),{http:hVe,https:mVe}=ooe.default,gVe=/https:?/,eoe=Ca.protocols.map(r=>r+":");function yVe(r,e){r.beforeRedirects.proxy&&r.beforeRedirects.proxy(r),r.beforeRedirects.config&&r.beforeRedirects.config(r,e)}function coe(r,e,t){let n=e;if(!n&&n!==!1){let i=(0,roe.getProxyForUrl)(t);i&&(n=new URL(i))}if(n){if(n.username&&(n.auth=(n.username||"")+":"+(n.password||"")),n.auth){(n.auth.username||n.auth.password)&&(n.auth=(n.auth.username||"")+":"+(n.auth.password||""));let a=Buffer.from(n.auth,"utf8").toString("base64");r.headers["Proxy-Authorization"]="Basic "+a}r.headers.host=r.hostname+(r.port?":"+r.port:"");let i=n.hostname||n.host;r.hostname=i,r.host=i,r.port=n.port,r.path=t,n.protocol&&(r.protocol=n.protocol.includes(":")?n.protocol:`${n.protocol}:`)}r.beforeRedirects.proxy=function(a){coe(a,e,a.href)}}var vVe=typeof process<"u"&&ve.kindOf(process)==="process",bVe=r=>new Promise((e,t)=>{let n,i,a=(c,l)=>{i||(i=!0,n&&n(c,l))},o=c=>{a(c),e(c)},s=c=>{a(c,!0),t(c)};r(o,s,c=>n=c).catch(s)}),wVe=({address:r,family:e})=>{if(!ve.isString(r))throw TypeError("address must be a string");return{address:r,family:e||(r.indexOf(".")<0?6:4)}},toe=(r,e)=>wVe(ve.isObject(r)?r:{address:r,family:e}),loe=vVe&&function(e){return bVe(async function(n,i,a){let{data:o,lookup:s,family:c}=e,{responseType:l,responseEncoding:u}=e,d=e.method.toUpperCase(),h,g=!1,m;if(s){let T=Jae(s,S=>ve.isArray(S)?S:[S]);s=(S,_,B)=>{T(S,_,(q,k,z)=>{if(q)return B(q);let ie=ve.isArray(k)?k.map(M=>toe(M)):[toe(k,z)];_.all?B(q,ie):B(q,ie[0].address,ie[0].family)})}}let b=new soe.default,E=()=>{e.cancelToken&&e.cancelToken.unsubscribe(I),e.signal&&e.signal.removeEventListener("abort",I),b.removeAllListeners()};a((T,S)=>{h=!0,S&&(g=!0,E())});function I(T){b.emit("abort",!T||T.type?new tl(null,e,m):T)}b.once("abort",i),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(I),e.signal&&(e.signal.aborted?I():e.signal.addEventListener("abort",I)));let R=j0(e.baseURL,e.url),L=new URL(R,"http://localhost"),U=L.protocol||eoe[0];if(U==="data:"){let T;if(d!=="GET")return wf(n,i,{status:405,statusText:"method not allowed",headers:{},config:e});try{T=xP(e.url,l==="blob",{Blob:e.env&&e.env.Blob})}catch(S){throw wt.from(S,wt.ERR_BAD_REQUEST,e)}return l==="text"?(T=T.toString(u),(!u||u==="utf8")&&(T=ve.stripBOM(T))):l==="stream"&&(T=z0.default.Readable.from(T)),wf(n,i,{data:T,status:200,statusText:"OK",headers:new ka,config:e})}if(eoe.indexOf(U)===-1)return i(new wt("Unsupported protocol "+U,wt.ERR_BAD_REQUEST,e));let V=ka.from(e.headers).normalize();V.set("User-Agent","axios/"+K0,!1);let G=e.onDownloadProgress,H=e.onUploadProgress,N=e.maxRate,F,O;if(ve.isSpecCompliantForm(o)){let T=V.getContentType(/boundary=([-_\w\d]{10,70})/i);o=Qae(o,S=>{V.set(S)},{tag:`axios-${K0}-boundary`,boundary:T&&T[1]||void 0})}else if(ve.isFormData(o)&&ve.isFunction(o.getHeaders)){if(V.set(o.getHeaders()),!V.hasContentLength())try{let T=await aoe.default.promisify(o.getLength).call(o);Number.isFinite(T)&&T>=0&&V.setContentLength(T)}catch{}}else if(ve.isBlob(o))o.size&&V.setContentType(o.type||"application/octet-stream"),V.setContentLength(o.size||0),o=z0.default.Readable.from(UE(o));else if(o&&!ve.isStream(o)){if(!Buffer.isBuffer(o))if(ve.isArrayBuffer(o))o=Buffer.from(new Uint8Array(o));else if(ve.isString(o))o=Buffer.from(o,"utf-8");else return i(new wt("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",wt.ERR_BAD_REQUEST,e));if(V.setContentLength(o.length,!1),e.maxBodyLength>-1&&o.length>e.maxBodyLength)return i(new wt("Request body larger than maxBodyLength limit",wt.ERR_BAD_REQUEST,e))}let y=ve.toFiniteNumber(V.getContentLength());ve.isArray(N)?(F=N[0],O=N[1]):F=O=N,o&&(H||F)&&(ve.isStream(o)||(o=z0.default.Readable.from(o,{objectMode:!1})),o=z0.default.pipeline([o,new TP({length:y,maxRate:ve.toFiniteNumber(F)})],ve.noop),H&&o.on("progress",T=>{H(Object.assign(T,{upload:!0}))}));let x;if(e.auth){let T=e.auth.username||"",S=e.auth.password||"";x=T+":"+S}if(!x&&L.username){let T=L.username,S=L.password;x=T+":"+S}x&&V.delete("authorization");let w;try{w=q0(L.pathname+L.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(T){let S=new Error(T.message);return S.config=e,S.url=e.url,S.exists=!0,i(S)}V.set("Accept-Encoding","gzip, compress, deflate"+(Xae?", br":""),!1);let p={path:w,method:d,headers:V.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:x,protocol:U,family:c,beforeRedirect:yVe,beforeRedirects:{}};!ve.isUndefined(s)&&(p.lookup=s),e.socketPath?p.socketPath=e.socketPath:(p.hostname=L.hostname,p.port=L.port,coe(p,e.proxy,U+"//"+L.hostname+(L.port?":"+L.port:"")+p.path));let v,A=gVe.test(p.protocol);if(p.agent=A?e.httpsAgent:e.httpAgent,e.transport?v=e.transport:e.maxRedirects===0?v=A?ioe.default:noe.default:(e.maxRedirects&&(p.maxRedirects=e.maxRedirects),e.beforeRedirect&&(p.beforeRedirects.config=e.beforeRedirect),v=A?mVe:hVe),e.maxBodyLength>-1?p.maxBodyLength=e.maxBodyLength:p.maxBodyLength=1/0,e.insecureHTTPParser&&(p.insecureHTTPParser=e.insecureHTTPParser),m=v.request(p,function(S){if(m.destroyed)return;let _=[S],B=+S.headers["content-length"];if(G){let M=new TP({length:ve.toFiniteNumber(B),maxRate:ve.toFiniteNumber(O)});G&&M.on("progress",te=>{G(Object.assign(te,{download:!0}))}),_.push(M)}let q=S,k=S.req||m;if(e.decompress!==!1&&S.headers["content-encoding"])switch((d==="HEAD"||S.statusCode===204)&&delete S.headers["content-encoding"],(S.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":_.push(Ld.default.createUnzip(Zae)),delete S.headers["content-encoding"];break;case"deflate":_.push(new Yae),_.push(Ld.default.createUnzip(Zae)),delete S.headers["content-encoding"];break;case"br":Xae&&(_.push(Ld.default.createBrotliDecompress(pVe)),delete S.headers["content-encoding"])}q=_.length>1?z0.default.pipeline(_,ve.noop):_[0];let z=z0.default.finished(q,()=>{z(),E()}),ie={status:S.statusCode,statusText:S.statusMessage,headers:new ka(S.headers),config:e,request:k};if(l==="stream")ie.data=q,wf(n,i,ie);else{let M=[],te=0;q.on("data",function(se){M.push(se),te+=se.length,e.maxContentLength>-1&&te>e.maxContentLength&&(g=!0,q.destroy(),i(new wt("maxContentLength size of "+e.maxContentLength+" exceeded",wt.ERR_BAD_RESPONSE,e,k)))}),q.on("aborted",function(){if(g)return;let se=new wt("maxContentLength size of "+e.maxContentLength+" exceeded",wt.ERR_BAD_RESPONSE,e,k);q.destroy(se),i(se)}),q.on("error",function(se){m.destroyed||i(wt.from(se,null,e,k))}),q.on("end",function(){try{let se=M.length===1?M[0]:Buffer.concat(M);l!=="arraybuffer"&&(se=se.toString(u),(!u||u==="utf8")&&(se=ve.stripBOM(se))),ie.data=se}catch(se){return i(wt.from(se,null,e,ie.request,ie))}wf(n,i,ie)})}b.once("abort",M=>{q.destroyed||(q.emit("error",M),q.destroy())})}),b.once("abort",T=>{i(T),m.destroy(T)}),m.on("error",function(S){i(wt.from(S,null,e,m))}),m.on("socket",function(S){S.setKeepAlive(!0,1e3*60)}),e.timeout){let T=parseInt(e.timeout,10);if(Number.isNaN(T)){i(new wt("error trying to parse `config.timeout` to int",wt.ERR_BAD_OPTION_VALUE,e,m));return}m.setTimeout(T,function(){if(h)return;let _=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",B=e.transitional||F2;e.timeoutErrorMessage&&(_=e.timeoutErrorMessage),i(new wt(_,B.clarifyTimeoutError?wt.ETIMEDOUT:wt.ECONNABORTED,e,m)),I()})}if(ve.isStream(o)){let T=!1,S=!1;o.on("end",()=>{T=!0}),o.once("error",_=>{S=!0,m.destroy(_)}),o.on("close",()=>{!T&&!S&&I(new tl("Request stream has been aborted",e,m))}),o.pipe(m)}else m.end(o)})};var uoe=Ca.hasStandardBrowserEnv?{write(r,e,t,n,i,a){let o=[r+"="+encodeURIComponent(e)];ve.isNumber(t)&&o.push("expires="+new Date(t).toGMTString()),ve.isString(n)&&o.push("path="+n),ve.isString(i)&&o.push("domain="+i),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(r){let e=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};var doe=Ca.hasStandardBrowserEnv?function(){let e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a"),n;function i(a){let o=a;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return n=i(window.location.href),function(o){let s=ve.isString(o)?i(o):o;return s.protocol===n.protocol&&s.host===n.host}}():function(){return function(){return!0}}();function foe(r,e){let t=0,n=LE(50,250);return i=>{let a=i.loaded,o=i.lengthComputable?i.total:void 0,s=a-t,c=n(s),l=a<=o;t=a;let u={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:c||void 0,estimated:c&&o&&l?(o-a)/c:void 0,event:i};u[e?"download":"upload"]=!0,r(u)}}var _Ve=typeof XMLHttpRequest<"u",poe=_Ve&&function(r){return new Promise(function(t,n){let i=r.data,a=ka.from(r.headers).normalize(),{responseType:o,withXSRFToken:s}=r,c;function l(){r.cancelToken&&r.cancelToken.unsubscribe(c),r.signal&&r.signal.removeEventListener("abort",c)}let u;if(ve.isFormData(i)){if(Ca.hasStandardBrowserEnv||Ca.hasStandardBrowserWebWorkerEnv)a.setContentType(!1);else if((u=a.getContentType())!==!1){let[b,...E]=u?u.split(";").map(I=>I.trim()).filter(Boolean):[];a.setContentType([b||"multipart/form-data",...E].join("; "))}}let d=new XMLHttpRequest;if(r.auth){let b=r.auth.username||"",E=r.auth.password?unescape(encodeURIComponent(r.auth.password)):"";a.set("Authorization","Basic "+btoa(b+":"+E))}let h=j0(r.baseURL,r.url);d.open(r.method.toUpperCase(),q0(h,r.params,r.paramsSerializer),!0),d.timeout=r.timeout;function g(){if(!d)return;let b=ka.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),I={data:!o||o==="text"||o==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:b,config:r,request:d};wf(function(L){t(L),l()},function(L){n(L),l()},I),d=null}if("onloadend"in d?d.onloadend=g:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(g)},d.onabort=function(){d&&(n(new wt("Request aborted",wt.ECONNABORTED,r,d)),d=null)},d.onerror=function(){n(new wt("Network Error",wt.ERR_NETWORK,r,d)),d=null},d.ontimeout=function(){let E=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded",I=r.transitional||F2;r.timeoutErrorMessage&&(E=r.timeoutErrorMessage),n(new wt(E,I.clarifyTimeoutError?wt.ETIMEDOUT:wt.ECONNABORTED,r,d)),d=null},Ca.hasStandardBrowserEnv&&(s&&ve.isFunction(s)&&(s=s(r)),s||s!==!1&&doe(h))){let b=r.xsrfHeaderName&&r.xsrfCookieName&&uoe.read(r.xsrfCookieName);b&&a.set(r.xsrfHeaderName,b)}i===void 0&&a.setContentType(null),"setRequestHeader"in d&&ve.forEach(a.toJSON(),function(E,I){d.setRequestHeader(I,E)}),ve.isUndefined(r.withCredentials)||(d.withCredentials=!!r.withCredentials),o&&o!=="json"&&(d.responseType=r.responseType),typeof r.onDownloadProgress=="function"&&d.addEventListener("progress",foe(r.onDownloadProgress,!0)),typeof r.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",foe(r.onUploadProgress)),(r.cancelToken||r.signal)&&(c=b=>{d&&(n(!b||b.type?new tl(null,r,d):b),d.abort(),d=null)},r.cancelToken&&r.cancelToken.subscribe(c),r.signal&&(r.signal.aborted?c():r.signal.addEventListener("abort",c)));let m=d8(h);if(m&&Ca.protocols.indexOf(m)===-1){n(new wt("Unsupported protocol "+m+":",wt.ERR_BAD_REQUEST,r));return}d.send(i||null)})};var CP={http:loe,xhr:poe};ve.forEach(CP,(r,e)=>{if(r){try{Object.defineProperty(r,"name",{value:e})}catch{}Object.defineProperty(r,"adapterName",{value:e})}});var hoe=r=>`- ${r}`,EVe=r=>ve.isFunction(r)||r===null||r===!1,qE={getAdapter:r=>{r=ve.isArray(r)?r:[r];let{length:e}=r,t,n,i={};for(let a=0;a<e;a++){t=r[a];let o;if(n=t,!EVe(t)&&(n=CP[(o=String(t)).toLowerCase()],n===void 0))throw new wt(`Unknown adapter '${o}'`);if(n)break;i[o||"#"+a]=n}if(!n){let a=Object.entries(i).map(([s,c])=>`adapter ${s} `+(c===!1?"is not supported by the environment":"is not available in the build")),o=e?a.length>1?`since :
10638
10638
  `+a.map(hoe).join(`
10639
- `):" "+hoe(a[0]):"as no adapter specified";throw new wt("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:CP};function kP(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new tl(null,r)}function jE(r){return kP(r),r.headers=ka.from(r.headers),r.data=i8.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),qE.getAdapter(r.adapter||U2.adapter)(r).then(function(n){return kP(r),n.data=i8.call(r,r.transformResponse,n),n.headers=ka.from(n.headers),n},function(n){return a8(n)||(kP(r),n&&n.response&&(n.response.data=i8.call(r,r.transformResponse,n.response),n.response.headers=ka.from(n.response.headers))),Promise.reject(n)})}var moe=r=>r instanceof ka?r.toJSON():r;function Fd(r,e){e=e||{};let t={};function n(l,u,d){return ve.isPlainObject(l)&&ve.isPlainObject(u)?ve.merge.call({caseless:d},l,u):ve.isPlainObject(u)?ve.merge({},u):ve.isArray(u)?u.slice():u}function i(l,u,d){if(ve.isUndefined(u)){if(!ve.isUndefined(l))return n(void 0,l,d)}else return n(l,u,d)}function a(l,u){if(!ve.isUndefined(u))return n(void 0,u)}function o(l,u){if(ve.isUndefined(u)){if(!ve.isUndefined(l))return n(void 0,l)}else return n(void 0,u)}function s(l,u,d){if(d in e)return n(l,u);if(d in r)return n(void 0,l)}let c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(l,u)=>i(moe(l),moe(u),!0)};return ve.forEach(Object.keys(Object.assign({},r,e)),function(u){let d=c[u]||i,h=d(r[u],e[u],u);ve.isUndefined(h)&&d!==s||(t[u]=h)}),t}var NP={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{NP[r]=function(n){return typeof n===r||"a"+(e<1?"n ":" ")+r}});var goe={};NP.transitional=function(e,t,n){function i(a,o){return"[Axios v"+K0+"] Transitional option '"+a+"'"+o+(n?". "+n:"")}return(a,o,s)=>{if(e===!1)throw new wt(i(o," has been removed"+(t?" in "+t:"")),wt.ERR_DEPRECATED);return t&&!goe[o]&&(goe[o]=!0,console.warn(i(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(a,o,s):!0}};function xVe(r,e,t){if(typeof r!="object")throw new wt("options must be an object",wt.ERR_BAD_OPTION_VALUE);let n=Object.keys(r),i=n.length;for(;i-- >0;){let a=n[i],o=e[a];if(o){let s=r[a],c=s===void 0||o(s,a,r);if(c!==!0)throw new wt("option "+a+" must be "+c,wt.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new wt("Unknown option "+a,wt.ERR_BAD_OPTION)}}var VE={assertOptions:xVe,validators:NP};var Ef=VE.validators,z2=class{constructor(e){this.defaults=e,this.interceptors={request:new tP,response:new tP}}request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Fd(this.defaults,t);let{transitional:n,paramsSerializer:i,headers:a}=t;n!==void 0&&VE.assertOptions(n,{silentJSONParsing:Ef.transitional(Ef.boolean),forcedJSONParsing:Ef.transitional(Ef.boolean),clarifyTimeoutError:Ef.transitional(Ef.boolean)},!1),i!=null&&(ve.isFunction(i)?t.paramsSerializer={serialize:i}:VE.assertOptions(i,{encode:Ef.function,serialize:Ef.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=a&&ve.merge(a.common,a[t.method]);a&&ve.forEach(["delete","get","head","post","put","patch","common"],m=>{delete a[m]}),t.headers=ka.concat(o,a);let s=[],c=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(t)===!1||(c=c&&b.synchronous,s.unshift(b.fulfilled,b.rejected))});let l=[];this.interceptors.response.forEach(function(b){l.push(b.fulfilled,b.rejected)});let u,d=0,h;if(!c){let m=[jE.bind(this),void 0];for(m.unshift.apply(m,s),m.push.apply(m,l),h=m.length,u=Promise.resolve(t);d<h;)u=u.then(m[d++],m[d++]);return u}h=s.length;let g=t;for(d=0;d<h;){let m=s[d++],b=s[d++];try{g=m(g)}catch(E){b.call(this,E);break}}try{u=jE.call(this,g)}catch(m){return Promise.reject(m)}for(d=0,h=l.length;d<h;)u=u.then(l[d++],l[d++]);return u}getUri(e){e=Fd(this.defaults,e);let t=j0(e.baseURL,e.url);return q0(t,e.params,e.paramsSerializer)}};ve.forEach(["delete","get","head","options"],function(e){z2.prototype[e]=function(t,n){return this.request(Fd(n||{},{method:e,url:t,data:(n||{}).data}))}});ve.forEach(["post","put","patch"],function(e){function t(n){return function(a,o,s){return this.request(Fd(s||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:a,data:o}))}}z2.prototype[e]=t(),z2.prototype[e+"Form"]=t(!0)});var p8=z2;var RP=class r{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(a){t=a});let n=this;this.promise.then(i=>{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](i);n._listeners=null}),this.promise.then=i=>{let a,o=new Promise(s=>{n.subscribe(s),a=s}).then(i);return o.cancel=function(){n.unsubscribe(a)},o},e(function(a,o,s){n.reason||(n.reason=new tl(a,o,s),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}static source(){let e;return{token:new r(function(i){e=i}),cancel:e}}},yoe=RP;function OP(r){return function(t){return r.apply(null,t)}}function DP(r){return ve.isObject(r)&&r.isAxiosError===!0}var PP={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(PP).forEach(([r,e])=>{PP[e]=r});var voe=PP;function boe(r){let e=new p8(r),t=e8(p8.prototype.request,e);return ve.extend(t,p8.prototype,e,{allOwnKeys:!0}),ve.extend(t,e,null,{allOwnKeys:!0}),t.create=function(i){return boe(Fd(r,i))},t}var ya=boe(U2);ya.Axios=p8;ya.CanceledError=tl;ya.CancelToken=yoe;ya.isCancel=a8;ya.VERSION=K0;ya.toFormData=bf;ya.AxiosError=wt;ya.Cancel=ya.CanceledError;ya.all=function(e){return Promise.all(e)};ya.spread=OP;ya.isAxiosError=DP;ya.mergeConfig=Fd;ya.AxiosHeaders=ka;ya.formToJSON=r=>NE(ve.isHTMLForm(r)?new FormData(r):r);ya.getAdapter=qE.getAdapter;ya.HttpStatusCode=voe;ya.default=ya;var G0=ya;var{Axios:_Gt,AxiosError:EGt,CanceledError:xGt,isCancel:AGt,CancelToken:TGt,VERSION:SGt,all:IGt,Cancel:CGt,isAxiosError:kGt,spread:NGt,toFormData:RGt,AxiosHeaders:OGt,HttpStatusCode:DGt,formToJSON:PGt,getAdapter:BGt,mergeConfig:MGt}=G0;var ne=class r{constructor(e,t,n,i,a){let o=q3(e,t,n);this.shard=o.shard,this.realm=o.realm,this.num=o.num,this.aliasKey=i??null,this.evmAddress=a??null,this._checksum=null}static fromString(e){let t=Ud.default.ZERO,n=Ud.default.ZERO,i=Ud.default.ZERO,a,o;if(e.startsWith("0x")&&e.length==42||e.length==40)o=rs.fromString(e);else{let s=X5(e);if(Number.isNaN(s.shard)||Number.isNaN(s.realm))throw new Error("invalid format for entity ID");s.shard!=null&&(t=Ud.default.fromString(s.shard)),s.realm!=null&&(n=Ud.default.fromString(s.realm)),s.numOrHex.length<20?i=Ud.default.fromString(s.numOrHex):s.numOrHex.length==40?o=rs.fromString(s.numOrHex):a=Xn.fromString(s.numOrHex)}return new r(t,n,i,a,o)}static fromEvmAddress(e,t,n){let i=typeof n=="string"?rs.fromString(n):n;return Qh(i.toBytes())?this.fromSolidityAddress(i.toString()):new r(e,t,0,void 0,i)}static fromEvmPublicAddress(e){return new r(0,0,0,void 0,e)}static _fromProtobuf(e){let t,n;return e.alias!=null&&(e.alias.length===20?n=rs.fromBytes(e.alias):t=rt._fromProtobufKey(h8.proto.Key.decode(e.alias))),t instanceof Xn||(t=void 0),new r(e.shardNum!=null?e.shardNum:0,e.realmNum!=null?e.realmNum:0,e.accountNum!=null?e.accountNum:0,t,n)}get checksum(){return this._checksum}getEvmAddress(){return this.evmAddress}async populateAccountNum(e){if(this.evmAddress===null)throw new Error("field `evmAddress` should not be null");let t=e.mirrorNetwork[0].slice(0,e.mirrorNetwork[0].indexOf(":"));await new Promise(a=>{setTimeout(a,3e3)});let n=`https://${t}/api/v1/accounts/${this.evmAddress.toString()}`,i=(await G0.get(n)).data.account;return this.num=Ud.default.fromString(i.slice(i.lastIndexOf(".")+1)),this}async populateAccountEvmAddress(e){if(this.num===null)throw new Error("field `num` should not be null");let t=e.mirrorNetwork[0].slice(0,e.mirrorNetwork[0].indexOf(":"));await new Promise(a=>{setTimeout(a,3e3)});let n=`https://${t}/api/v1/accounts/${this.num.toString()}`,i=(await G0.get(n)).data.evm_address;return this.evmAddress=rs.fromString(i),this}validate(e){console.warn("Deprecated: Use `validateChecksum` instead"),this.validateChecksum(e)}validateChecksum(e){if(this.aliasKey!=null)throw new Error("cannot calculate checksum with an account ID that has a aliasKey");V3(this.shard,this.realm,this.num,this._checksum,e)}static fromBytes(e){return r._fromProtobuf(h8.proto.AccountID.decode(e))}static fromSolidityAddress(e){return Qh(et(e))?new r(...t3(e)):this.fromEvmAddress(0,0,e)}toSolidityAddress(){return this.evmAddress!=null?this.evmAddress.toString():this.aliasKey!=null&&this.aliasKey._key._type=="secp256k1"?this.aliasKey.toEvmAddress():j3([this.shard,this.realm,this.num])}_toProtobuf(){let e=null;return this.aliasKey!=null?e=h8.proto.Key.encode(this.aliasKey._toProtobufKey()).finish():this.evmAddress!=null&&(e=this.evmAddress._bytes),{alias:e,accountNum:this.aliasKey!=null?null:this.num,shardNum:this.shard,realmNum:this.realm}}toBytes(){return h8.proto.AccountID.encode(this._toProtobuf()).finish()}toString(){let e=this.num.toString();return this.aliasKey!=null?e=this.aliasKey.toString():this.evmAddress!=null&&(e=this.evmAddress.toString()),`${this.shard.toString()}.${this.realm.toString()}.${e}`}toStringWithChecksum(e){if(this.aliasKey!=null)throw new Error("cannot calculate checksum with an account ID that has a aliasKey");return H3(this.toString(),e)}equals(e){let t=!1;return this.aliasKey!=null&&e.aliasKey!=null?t=this.aliasKey.equals(e.aliasKey):this.evmAddress!=null&&e.evmAddress!=null?t=this.evmAddress.equals(e.evmAddress):this.aliasKey==null&&e.aliasKey==null&&this.evmAddress==null&&e.evmAddress==null&&(t=this.num.eq(e.num)),this.shard.eq(e.shard)&&this.realm.eq(e.realm)&&t}clone(){let e=new r(this);return e._checksum=this._checksum,e.aliasKey=this.aliasKey,e.evmAddress=this.evmAddress,e}compare(e){let t=this.shard.compare(e.shard);if(t!=0||(t=this.realm.compare(e.realm),t!=0))return t;if(this.aliasKey!=null&&e.aliasKey!=null){let n=this.aliasKey.toString(),i=e.aliasKey.toString();return n>i?1:n<i?-1:0}else if(this.evmAddress!=null&&e.evmAddress!=null){let n=this.evmAddress.toString(),i=e.evmAddress.toString();return n>i?1:n<i?-1:0}else return this.aliasKey==null&&e.aliasKey==null&&this.evmAddress==null&&e.evmAddress==null?this.num.compare(e.num):1}};ir.setAccountIdConstructor((r,e,t)=>new ne(r,e,Ud.default.ZERO,t));var Xt=class r{constructor(e){this._code=e,Object.freeze(this)}static _fromValue(e){switch(e){case 0:return r.Ok;case 1:return r.Cancelled;case 2:return r.Unknown;case 3:return r.InvalidArgument;case 4:return r.DeadlineExceeded;case 5:return r.NotFound;case 6:return r.AlreadyExists;case 7:return r.PermissionDenied;case 8:return r.ResourceExhausted;case 9:return r.FailedPrecondition;case 10:return r.Aborted;case 11:return r.OutOfRange;case 12:return r.Unimplemented;case 13:return r.Internal;case 14:return r.Unavailable;case 15:return r.DataLoss;case 16:return r.Unauthenticated;case 17:return r.Timeout;case 18:return r.GrpcWeb;default:throw new Error("(BUG) non-exhaustive GrpcStatus switch statement")}}toString(){switch(this){case r.Ok:return"OK";case r.Cancelled:return"CANCELLED";case r.Unknown:return"UNKNOWN";case r.InvalidArgument:return"INVALID_ARGUMENT";case r.DeadlineExceeded:return"DEADLINE_EXCEEDED";case r.NotFound:return"NOT_FOUND";case r.AlreadyExists:return"ALREADY_EXISTS";case r.PermissionDenied:return"PERMISSION_DENIED";case r.Unauthenticated:return"UNAUTHENTICATED";case r.ResourceExhausted:return"RESOURCE_EXHAUSTED";case r.FailedPrecondition:return"FAILED_PRECONDITION";case r.Aborted:return"ABORTED";case r.OutOfRange:return"OUT_OF_RANGE";case r.Unimplemented:return"UNIMPLEMENTED";case r.Internal:return"INTERNAL";case r.Unavailable:return"UNAVAILABLE";case r.DataLoss:return"DATA_LOSS";case r.Timeout:return"TIMEOUT";case r.GrpcWeb:return"GRPC_WEB";default:return`UNKNOWN (${this._code})`}}valueOf(){return this._code}};Xt.Ok=new Xt(0);Xt.Cancelled=new Xt(1);Xt.Unknown=new Xt(2);Xt.InvalidArgument=new Xt(3);Xt.DeadlineExceeded=new Xt(4);Xt.NotFound=new Xt(5);Xt.AlreadyExists=new Xt(6);Xt.PermissionDenied=new Xt(7);Xt.ResourceExhausted=new Xt(8);Xt.FailedPrecondition=new Xt(9);Xt.Aborted=new Xt(10);Xt.OutOfRange=new Xt(11);Xt.Unimplemented=new Xt(12);Xt.Internal=new Xt(13);Xt.Unavailable=new Xt(14);Xt.DataLoss=new Xt(15);Xt.Unauthenticated=new Xt(16);Xt.Timeout=new Xt(17);Xt.GrpcWeb=new Xt(18);var qd=class r extends Error{constructor(e){super(`gRPC service failed with status: ${e.toString()}`),this.status=e,this.name="GrpcServiceError",typeof Error.captureStackTrace<"u"&&Error.captureStackTrace(this,r)}static _fromResponse(e){if(e.code!=null&&e.details!=null){let t=Xt._fromValue(e.code),n=new r(t);return n.message=e.details,n}else return e}};var rl=class r{constructor(){this.list=[],this.locked=!1,this.index=0}setList(e){if(this.locked)throw new Error("list is locked");return this.list=e,this.index=0,this}push(...e){if(this.locked)throw new Error("list is locked");return this.list.push(...e),this}setLocked(){return this.locked=!0,this}clear(){this.list=[],this.index=0}get(e){return this.list[e]}set(e,t){return e===this.length?this.list.push(t):this.list[e]=t,this}setIfAbsent(e,t){return(e==this.length||this.list[e]==null)&&this.set(e,t()),this}get next(){return this.get(this.advance())}get current(){return this.get(this.index)}advance(){let e=this.index;return this.index=(this.index+1)%this.list.length,e}get isEmpty(){return this.length===0}get length(){return this.list.length}clone(){let e=new r;return e.list=this.list,e.locked=this.locked,e}};var m8=class r extends Error{constructor(e){super(`failed with error code: ${e.toString()}`),this.status=e,this.name="HttpError",typeof Error.captureStackTrace<"u"&&Error.captureStackTrace(this,r)}};var Bn={Finished:"Finished",Retry:"Retry",Error:"Error"},HE=/\brst[^0-9a-zA-Z]stream\b/i,lu=class{constructor(){this._maxAttempts=10,this._nodeAccountIds=new rl,this._signOnDemand=!1,this._minBackoff=null,this._maxBackoff=8e3,this._operator=null,this._requestTimeout=null,this._grpcDeadline=null,this._logger=null}get nodeAccountIds(){return this._nodeAccountIds.isEmpty?null:(this._nodeAccountIds.setLocked(),this._nodeAccountIds.list)}setNodeAccountIds(e){return this._nodeAccountIds.setList(e).setLocked(),this}get maxRetries(){return console.warn("Deprecated: use maxAttempts instead"),this.maxAttempts}setMaxRetries(e){return console.warn("Deprecated: use setMaxAttempts() instead"),this.setMaxAttempts(e)}get maxAttempts(){return this._maxAttempts}setMaxAttempts(e){return this._maxAttempts=e,this}get grpcDeadline(){return this._grpcDeadline}setGrpcDeadline(e){return this._grpcDeadline=e,this}setMinBackoff(e){if(e==null)throw new Error("minBackoff cannot be null.");if(this._maxBackoff!=null&&e>this._maxBackoff)throw new Error("minBackoff cannot be larger than maxBackoff.");return this._minBackoff=e,this}get minBackoff(){return this._minBackoff}setMaxBackoff(e){if(e==null)throw new Error("maxBackoff cannot be null.");if(this._minBackoff!=null&&e<this._minBackoff)throw new Error("maxBackoff cannot be smaller than minBackoff.");return this._maxBackoff=e,this}get maxBackoff(){return this._maxBackoff}_beforeExecute(e){throw new Error("not implemented")}_makeRequestAsync(){throw new Error("not implemented")}_mapStatusError(e,t){throw new Error("not implemented")}_mapResponse(e,t,n){throw new Error("not implemented")}_execute(e,t){throw new Error("not implemented")}_getTransactionId(){throw new Error("not implemented")}_getLogId(){throw new Error("not implemented")}_requestToBytes(e){throw new Error("not implemented")}_responseToBytes(e){throw new Error("not implemented")}_advanceRequest(){this._nodeAccountIds.advance()}_shouldRetry(e,t){throw new Error("not implemented")}_shouldRetryExceptionally(e){return e instanceof qd?e.status._code===Xt.Timeout._code||e.status._code===Xt.Unavailable._code||e.status._code===Xt.ResourceExhausted._code||e.status._code===Xt.GrpcWeb._code||e.status._code===Xt.Internal._code&&HE.test(e.message):!0}_setOperatorWith(e,t,n){return this._operator={transactionSigner:n,accountId:e,publicKey:t},this}async executeWithSigner(e){return e.call(this)}async execute(e,t){this._logger=this._logger==null?e._logger!=null?e._logger:null:this._logger,this._requestTimeout==null&&(this._requestTimeout=t??e.requestTimeout),await this._beforeExecute(e),this._maxBackoff==null&&(this._maxBackoff=e.maxBackoff),this._minBackoff==null&&(this._minBackoff=e.minBackoff);let n=e._maxAttempts!=null?e._maxAttempts:this._maxAttempts,i=Date.now(),a=null;for(let o=1;o<=n;o+=1){if(this._requestTimeout!=null&&i+this._requestTimeout<=Date.now())throw new Error("timeout exceeded");let s,c;if(this._nodeAccountIds.locked?(s=this._nodeAccountIds.current,c=e._network.getNode(s)):(c=e._network.getNode(),s=c.accountId,this._nodeAccountIds.setList([s])),c==null)throw new Error(`NodeAccountId not recognized: ${s.toString()}`);let l=this._getLogId();this._logger&&this._logger.debug(`[${l}] Node AccountID: ${c.accountId.toString()}, IP: ${c.address.toString()}`);let u=c.getChannel(),d=await this._makeRequestAsync();this._advanceRequest();let h;if(!c.isHealthy()){this._logger&&this._logger.debug(`[${l}] node is not healthy, skipping waiting ${c.getRemainingTime()}`);continue}try{let b=[];this._grpcDeadline!=null&&b.push(new Promise((E,I)=>setTimeout(()=>I(new Error("grpc deadline exceeded")),this._grpcDeadline))),this._logger&&this._logger.trace(`[${this._getLogId()}] sending protobuf ${He(this._requestToBytes(d))}`),b.push(this._execute(u,d)),h=await Promise.race(b)}catch(b){let E=qd._fromResponse(b);if(a=E,this._logger&&this._logger.debug(`[${l}] received error ${JSON.stringify(E)}`),(E instanceof qd||E instanceof m8)&&this._shouldRetryExceptionally(E)&&o<=n){this._logger&&this._logger.debug(`[${this._getLogId()}] node with accountId: ${c.accountId.toString()} and proxy IP: ${c.address.toString()} is unhealthy`),e._network.increaseBackoff(c);continue}throw b}this._logger&&this._logger.trace(`[${this._getLogId()}] sending protobuf ${He(this._responseToBytes(h))}`),e._network.decreaseBackoff(c);let[g,m]=this._shouldRetry(d,h);switch(g!=null&&(a=g),m){case Bn.Retry:await AVe(o,this._minBackoff,this._maxBackoff);continue;case Bn.Finished:return this._mapResponse(h,s,d);case Bn.Error:throw this._mapStatusError(d,h);default:throw new Error("(BUG) non-exhuastive switch statement for `ExecutionState`")}}throw new Error(`max attempts of ${n.toString()} was reached for request with last error being: ${a!=null?a.toString():""}`)}toBytes(){throw new Error("not implemented")}setLogger(e){return this._logger=e,this}get logger(){return this._logger}};function AVe(r,e,t){let n=Math.min(Math.floor(e*Math.pow(2,r)),t);return new Promise(i=>setTimeout(i,n))}var uu=Ie(Yt(),1);var woe=uu.default.fromNumber(1e9),_oe=new Set,lt=class r{constructor(e,t){this.seconds=e instanceof uu.default?e:uu.default.fromNumber(e),this.nanos=t instanceof uu.default?t:uu.default.fromNumber(t),Object.freeze(this)}static generate(){let e=Math.floor(Math.random()*5e3)+8e3,t=Date.now()-e,n=Math.floor(t/1e3)+ir.timeDrift,i=Math.floor(t%1e3)*1e6+Math.floor(Math.random()*1e6),a=new r(n,i);return _oe.has(a.toString())?this.generate():(_oe.add(a.toString()),a)}static fromDate(e){let t;if(typeof e=="number")t=uu.default.fromNumber(e);else if(typeof e=="string")t=uu.default.fromNumber(Date.parse(e)).mul(1e6);else if(e instanceof Date)t=uu.default.fromNumber(e.getTime()).mul(1e6);else throw new TypeError(`invalid type '${typeof e}' for 'data', expected 'Date'`);return new r(0,0).plusNanos(t)}toDate(){return new Date(this.seconds.toInt()*1e3+Math.floor(this.nanos.toInt()/1e6))}plusNanos(e){let t=this.nanos.add(e);return new r(this.seconds.add(t.div(woe)),t.mod(woe))}_toProtobuf(){return{seconds:this.seconds,nanos:this.nanos.toInt()}}static _fromProtobuf(e){return new r(e.seconds instanceof uu.default?e.seconds.toInt():e.seconds!=null?e.seconds:0,e.nanos!=null?e.nanos:0)}toString(){let e=String(this.nanos).padStart(9,"0");return`${this.seconds.toString()}.${e}`}compare(e){let t=this.seconds.compare(e.seconds);return t!=0?t:this.nanos.compare(e.nanos)}};var BP=Ie(vr(),1),g8=Ie(Yt(),1);var Wr=class r{constructor(e,t,n=!1,i=null){this.accountId=e,this.validStart=t,this.scheduled=n,this.nonce=null,i!=null&&i!=0&&this.setNonce(i),Object.seal(this)}setNonce(e){return this.nonce=typeof e=="number"?g8.default.fromNumber(e):e,this}static withValidStart(e,t){return new r(e,t)}static generate(e){return new r(typeof e=="string"?ne.fromString(e):new ne(e),lt.generate())}static fromString(e){let t,n,i,a,o,s;return[t,s]=e.split("@"),[n,s]=s.split("."),s.includes("?")?([i,s]=s.split("?scheduled"),a=!0,s.includes("/")?o=s.replace("/",""):o=null):s.includes("/")?([i,o]=s.split("/"),a=!1):i=s,new r(ne.fromString(t),new lt(g8.default.fromValue(n),g8.default.fromValue(i)),a,o!=null?g8.default.fromString(o):null)}setScheduled(e){return this.scheduled=e,this}toString(){if(this.accountId!=null&&this.validStart!=null){let e=String(this.validStart.nanos).padStart(9,"0"),t=this.nonce!=null?"/".concat(this.nonce.toString()):"",n=this.scheduled?"?scheduled":"";return`${this.accountId.toString()}@${this.validStart.seconds.toString()}.${e}${n}${t}`}else throw new Error("neither `accountId` nor `validStart` are set")}static _fromProtobuf(e){if(e.accountID!=null&&e.transactionValidStart!=null)return new r(ne._fromProtobuf(e.accountID),lt._fromProtobuf(e.transactionValidStart),e.scheduled!=null?e.scheduled:void 0,e.nonce!=null?e.nonce:void 0);throw new Error("Neither `nonce` or `accountID` and `transactionValidStart` are set")}_toProtobuf(){return{accountID:this.accountId!=null?this.accountId._toProtobuf():null,transactionValidStart:this.validStart!=null?this.validStart._toProtobuf():null,scheduled:this.scheduled,nonce:this.nonce!=null?this.nonce.toInt():null}}static fromBytes(e){return r._fromProtobuf(BP.proto.TransactionID.decode(e))}toBytes(){return BP.proto.TransactionID.encode(this._toProtobuf()).finish()}clone(){return new r(this.accountId,this.validStart,this.scheduled,this.nonce)}compare(e){let t=this.accountId.compare(e.accountId);return t!=0?t:this.validStart.compare(e.validStart)}getReceipt(e){return ir.transactionReceiptQueryConstructor().setTransactionId(this).execute(e)}async getRecord(e){return await this.getReceipt(e),ir.transactionRecordQueryConstructor().setTransactionId(this).execute(e)}};var G3=Ie(vr(),1);var ns=class extends su{constructor(e){super(e,`transaction ${e.transactionId.toString()} failed precheck with status ${e.status.toString()}`),this.contractFunctionResult=e.contractFunctionResult}toJSON(){return{name:this.name,status:this.status.toString(),transactionId:this.transactionId.toString(),message:this.message,contractFunctionResult:this.contractFunctionResult}}};var G2=class extends Error{constructor(e,t){super(),this.message=`query cost of ${e.toString()} HBAR exceeds max set on client: ${t.toString()} HBAR`,this.name="MaxQueryPaymentExceededError",this.queryCost=e,this.maxQueryPayment=t}};var Eoe=Ie(Yt(),1),Qr=new Map,xr=class extends lu{constructor(){super(),this._paymentTransactionId=null,this._paymentTransactions=[],this._queryPayment=null,this._maxQueryPayment=null,this._timestamp=Date.now()}static fromBytes(e){let t=G3.proto.Query.decode(e);if(t.query==null)throw new Error("(BUG) query.query was not set in the protobuf");let n=Qr.get(t.query);if(n==null)throw new Error(`(BUG) Query.fromBytes() not implemented for type ${t.query}`);return n(t)}toBytes(){return G3.proto.Query.encode(this._makeRequest()).finish()}setQueryPayment(e){return this._queryPayment=e,this}setMaxQueryPayment(e){return this._maxQueryPayment=e,this}async getCost(e){if(this._nodeAccountIds.isEmpty&&this._nodeAccountIds.setList(e._network.getNodeAccountIdsForExecute()),zE.length!=1)throw new Error("CostQuery has not been loaded yet");this._timestamp=Date.now();let t=await zE[0](this).execute(e);return ze.fromTinybars(t._valueInTinybar.multipliedBy(1.1).toFixed(0))}setPaymentTransactionId(e){return this._paymentTransactionId=e,this}get paymentTransactionId(){return this._paymentTransactionId}_getTransactionId(){if(this._paymentTransactionId==null)throw new Error("Query.PaymentTransactionId was not set duration execution");return this._paymentTransactionId}_isPaymentRequired(){return!0}_validateChecksums(e){}async _beforeExecute(e){if(this._paymentTransactions.length>0)return;if(e.isAutoValidateChecksumsEnabled()&&this._validateChecksums(e),this._nodeAccountIds.isEmpty&&this._nodeAccountIds.setList(e._network.getNodeAccountIdsForExecute()),this._operator=this._operator!=null?this._operator:e._operator,this._paymentTransactionId==null)if(this._isPaymentRequired())if(this._operator!=null)this._paymentTransactionId=Wr.generate(this._operator.accountId);else throw new Error("`client` must have an `operator` or an explicit payment transaction must be provided");else this._paymentTransactionId=Wr.generate(new ne(0));let t=new ze(0),n=this._maxQueryPayment!=null?this._maxQueryPayment:e.defaultMaxQueryPayment;if(this._queryPayment!=null)t=this._queryPayment;else if(this._paymentTransactions.length===0&&this._isPaymentRequired()){let i=await this.getCost(e);if(n.toTinybars().toInt()<i.toTinybars().toInt())throw new G2(i,n);t=i,this._logger&&this._logger.debug(`[${this._getLogId()}] received cost for query ${t.toString()}`)}this._queryPayment=t,this._timestamp=Date.now(),this._nodeAccountIds.setLocked();for(let i of this._nodeAccountIds.list){let a=this._getLogId(),o=this._paymentTransactionId,s=this._queryPayment;this._logger&&this._logger.debug(`[${a}] making a payment transaction for node ${i.toString()} and transaction ID ${o.toString()} with amount ${s.toString()}`),this._paymentTransactions.push(await KE(o,i,this._isPaymentRequired()?this._operator:null,s))}}_mapResponseHeader(e){throw new Error("not implemented")}_makeRequestHeader(){let e={};return this._isPaymentRequired()&&this._paymentTransactions.length>0&&(e={responseType:G3.proto.ResponseType.ANSWER_ONLY,payment:this._paymentTransactions[this._nodeAccountIds.index]}),e}_onMakeRequest(e){throw new Error("not implemented")}_makeRequest(){let e={};return this._isPaymentRequired()&&this._paymentTransactions!=null&&(e={payment:this._paymentTransactions[this._nodeAccountIds.index],responseType:G3.proto.ResponseType.ANSWER_ONLY}),this._onMakeRequest(e)}async _makeRequestAsync(){let e={responseType:G3.proto.ResponseType.ANSWER_ONLY};if(this._isPaymentRequired()&&this._paymentTransactions!=null)if(this._nodeAccountIds.locked)e.payment=this._paymentTransactions[this._nodeAccountIds.index];else{let t=this._getLogId(),n=this._nodeAccountIds.current,i=this._paymentTransactionId,a=this._queryPayment;this._logger&&this._logger.debug(`[${t}] making a payment transaction for node ${n.toString()} and transaction ID ${i.toString()} with amount ${a.toString()}`),e.payment=await KE(i,n,this._isPaymentRequired()?this._operator:null,a)}return this._onMakeRequest(e)}_shouldRetry(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??G3.proto.ResponseCodeEnum.OK);switch(this._logger&&this._logger.debug(`[${this._getLogId()}] received status ${i.toString()}`),i){case P.Busy:case P.Unknown:case P.PlatformTransactionNotCreated:return[i,Bn.Retry];case P.Ok:return[i,Bn.Finished];default:return[i,Bn.Error]}}_mapStatusError(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??G3.proto.ResponseCodeEnum.OK);return new ns({status:i,transactionId:this._getTransactionId(),contractFunctionResult:null})}_requestToBytes(e){return G3.proto.Query.encode(e).finish()}_responseToBytes(e){return G3.proto.Response.encode(e).finish()}};async function KE(r,e,t,n){let i=[];t!=null?(i.push({accountID:t.accountId._toProtobuf(),amount:n.negated().toTinybars()}),i.push({accountID:e._toProtobuf(),amount:n.toTinybars()})):(i.push({accountID:new ne(0)._toProtobuf(),amount:n.negated().toTinybars()}),i.push({accountID:e._toProtobuf(),amount:n.toTinybars()}));let a={transactionID:r._toProtobuf(),nodeAccountID:e._toProtobuf(),transactionFee:new ze(1).toTinybars(),transactionValidDuration:{seconds:Eoe.default.fromNumber(120)},cryptoTransfer:{transfers:{accountAmounts:i}}},o={bodyBytes:G3.proto.TransactionBody.encode(a).finish()};if(t!=null){let s=await t.transactionSigner(o.bodyBytes);o.sigMap={sigPair:[t.publicKey._toProtobufSignature(s)]}}return{signedTransactionBytes:G3.proto.SignedTransaction.encode(o).finish()}}var zE=[];var MP=Ie(vr(),1);var xf=Ie(Yt(),1);var _t=class r extends rt{constructor(e,t,n,i){super();let a=q3(e,t,n);this.shard=a.shard,this.realm=a.realm,this.num=a.num,this.evmAddress=i??null,this._checksum=null}static fromEvmAddress(e,t,n){return Qh(et(n))?new r(...t3(n)):new r(e,t,0,et(n))}static fromString(e){let t=X5(e);if(Number.isNaN(t.shard)||Number.isNaN(t.realm))throw new Error("invalid format for entity ID");let n=t.shard!=null?xf.default.fromString(t.shard):xf.default.ZERO,i=t.realm!=null?xf.default.fromString(t.realm):xf.default.ZERO,[a,o]=t.numOrHex.length<40?[xf.default.fromString(t.numOrHex),void 0]:[xf.default.ZERO,et(t.numOrHex)];return new r(n,i,a,o)}static _fromProtobuf(e){return new r(e.shardNum!=null?e.shardNum:0,e.realmNum!=null?e.realmNum:0,e.contractNum!=null?e.contractNum:0)}get checksum(){return this._checksum}async populateAccountNum(e){if(this.evmAddress===null)throw new Error("field `evmAddress` should not be null");let n=`https://${e.mirrorNetwork[0].slice(0,e.mirrorNetwork[0].indexOf(":"))}/api/v1/contracts/${He(this.evmAddress)}`,i=(await G0.get(n)).data.contract_id;return this.num=xf.default.fromString(i.slice(i.lastIndexOf(".")+1)),this}validate(e){console.warn("Deprecated: Use `validateChecksum` instead"),this.validateChecksum(e)}validateChecksum(e){V3(this.shard,this.realm,this.num,this._checksum,e)}static fromBytes(e){return r._fromProtobuf(MP.proto.ContractID.decode(e))}static fromSolidityAddress(e){return Qh(et(e))?new r(...t3(e)):this.fromEvmAddress(0,0,e)}toSolidityAddress(){return this.evmAddress!=null?He(this.evmAddress):j3([this.shard,this.realm,this.num])}_toProtobuf(){return{contractNum:this.num,shardNum:this.shard,realmNum:this.realm,evmAddress:this.evmAddress}}toString(){return this.evmAddress!=null?`${this.shard.toString()}.${this.realm.toString()}.${He(this.evmAddress)}`:`${this.shard.toString()}.${this.realm.toString()}.${this.num.toString()}`}toStringWithChecksum(e){return H3(this.toString(),e)}toBytes(){return MP.proto.ContractID.encode(this._toProtobuf()).finish()}clone(){let e=new r(this);return e._checksum=this._checksum,e.evmAddress=this.evmAddress,e}compare(e){return ou([this.shard,this.realm,this.num],[e.shard,e.realm,e.num])}equals(e){let t=!1;return this.evmAddress!=null&&e.evmAddress!=null&&(t=yE(this.evmAddress,e.evmAddress)),this.shard.eq(e.shard)&&this.realm.eq(e.realm)&&this.num.eq(e.num)&&t}_toProtobufKey(){return{contractID:this._toProtobuf()}}static __fromProtobufKey(e){return r._fromProtobuf(e)}};ir.setContractId(r=>_t.__fromProtobufKey(r));var LP=Ie(vr(),1),GE=Ie(Yt(),1),zt=class r{constructor(e,t,n){let i=q3(e,t,n);this.shard=i.shard,this.realm=i.realm,this.num=i.num,this._checksum=null}static fromString(e){let t=vf(e),n=new r(t);return n._checksum=t.checksum,n}static _fromProtobuf(e){return new r(e.shardNum!=null?GE.default.fromString(e.shardNum.toString()):0,e.realmNum!=null?GE.default.fromString(e.realmNum.toString()):0,e.fileNum!=null?GE.default.fromString(e.fileNum.toString()):0)}get checksum(){return this._checksum}validate(e){console.warn("Deprecated: Use `validateChecksum` instead"),this.validateChecksum(e)}validateChecksum(e){V3(this.shard,this.realm,this.num,this._checksum,e)}static fromBytes(e){return r._fromProtobuf(LP.proto.FileID.decode(e))}static fromSolidityAddress(e){let[t,n,i]=t3(e);return new r(t,n,i)}toSolidityAddress(){return j3([this.shard,this.realm,this.num])}_toProtobuf(){return{fileNum:this.num,shardNum:this.shard,realmNum:this.realm}}toString(){return`${this.shard.toString()}.${this.realm.toString()}.${this.num.toString()}`}toStringWithChecksum(e){return H3(this.toString(),e)}toBytes(){return LP.proto.FileID.encode(this._toProtobuf()).finish()}clone(){let e=new r(this);return e._checksum=this._checksum,e}compare(e){return ou([this.shard,this.realm,this.num],[e.shard,e.realm,e.num])}};zt.ADDRESS_BOOK=new zt(102);zt.FEE_SCHEDULE=new zt(111);zt.EXCHANGE_RATES=new zt(112);var FP=Ie(vr(),1),ia=class r{constructor(e,t,n){let i=q3(e,t,n);this.shard=i.shard,this.realm=i.realm,this.num=i.num,this._checksum=null}static fromString(e){let t=vf(e),n=new r(t);return n._checksum=t.checksum,n}static _fromProtobuf(e){return new r(e.shardNum!=null?e.shardNum:0,e.realmNum!=null?e.realmNum:0,e.topicNum!=null?e.topicNum:0)}get checksum(){return this._checksum}validate(e){console.warn("Deprecated: Use `validateChecksum` instead"),this.validateChecksum(e)}validateChecksum(e){V3(this.shard,this.realm,this.num,this._checksum,e)}static fromBytes(e){return r._fromProtobuf(FP.proto.TopicID.decode(e))}static fromSolidityAddress(e){let[t,n,i]=t3(e);return new r(t,n,i)}toSolidityAddress(){return j3([this.shard,this.realm,this.num])}_toProtobuf(){return{topicNum:this.num,shardNum:this.shard,realmNum:this.realm}}toString(){return`${this.shard.toString()}.${this.realm.toString()}.${this.num.toString()}`}toStringWithChecksum(e){return H3(this.toString(),e)}toBytes(){return FP.proto.TopicID.encode(this._toProtobuf()).finish()}clone(){let e=new r(this);return e._checksum=this._checksum,e}compare(e){return ou([this.shard,this.realm,this.num],[e.shard,e.realm,e.num])}};var UP=Ie(vr(),1),Oe=class r{constructor(e,t,n){let i=q3(e,t,n);this.shard=i.shard,this.realm=i.realm,this.num=i.num,this._checksum=null}static fromString(e){let t=vf(e),n=new r(t);return n._checksum=t.checksum,n}static _fromProtobuf(e){return new r(e.shardNum!=null?e.shardNum:0,e.realmNum!=null?e.realmNum:0,e.tokenNum!=null?e.tokenNum:0)}get checksum(){return this._checksum}validate(e){console.warn("Deprecated: Use `validateChecksum` instead"),this.validateChecksum(e)}validateChecksum(e){V3(this.shard,this.realm,this.num,this._checksum,e)}static fromBytes(e){return r._fromProtobuf(UP.proto.TokenID.decode(e))}static fromSolidityAddress(e){return new r(...t3(e))}toSolidityAddress(){return j3([this.shard,this.realm,this.num])}_toProtobuf(){return{tokenNum:this.num,shardNum:this.shard,realmNum:this.realm}}toString(){return`${this.shard.toString()}.${this.realm.toString()}.${this.num.toString()}`}toStringWithChecksum(e){return H3(this.toString(),e)}toBytes(){return UP.proto.TokenID.encode(this._toProtobuf()).finish()}clone(){let e=new r(this);return e._checksum=this._checksum,e}compare(e){return ou([this.shard,this.realm,this.num],[e.shard,e.realm,e.num])}};var qP=Ie(vr(),1),Na=class r{constructor(e,t,n){let i=q3(e,t,n);this.shard=i.shard,this.realm=i.realm,this.num=i.num,this._checksum=null}static fromString(e){let t=vf(e),n=new r(t);return n._checksum=t.checksum,n}static _fromProtobuf(e){return new r(e.shardNum!=null?e.shardNum:0,e.realmNum!=null?e.realmNum:0,e.scheduleNum!=null?e.scheduleNum:0)}get checksum(){return this._checksum}validate(e){console.warn("Deprecated: Use `validateChecksum` instead"),this.validateChecksum(e)}validateChecksum(e){V3(this.shard,this.realm,this.num,this._checksum,e)}static fromBytes(e){return r._fromProtobuf(qP.proto.ScheduleID.decode(e))}static fromSolidityAddress(e){return new r(...t3(e))}toSolidityAddress(){return j3([this.shard,this.realm,this.num])}_toProtobuf(){return{scheduleNum:this.num,shardNum:this.shard,realmNum:this.realm}}toString(){return`${this.shard.toString()}.${this.realm.toString()}.${this.num.toString()}`}toStringWithChecksum(e){return H3(this.toString(),e)}toBytes(){return qP.proto.ScheduleID.encode(this._toProtobuf()).finish()}clone(){let e=new r(this);return e._checksum=this._checksum,e}compare(e){return ou([this.shard,this.realm,this.num],[e.shard,e.realm,e.num])}};var jP=Ie(Yt(),1),W0=class r{constructor(e){this.hbars=e.hbars,this.cents=e.cents,this.expirationTime=e.expirationTime,this.exchangeRateInCents=e.cents/e.hbars,Object.freeze(this)}static _fromProtobuf(e){return new r({hbars:e.hbarEquiv,cents:e.centEquiv,expirationTime:new Date(e.expirationTime!=null&&e.expirationTime.seconds!=null?jP.default.isLong(e.expirationTime.seconds)?e.expirationTime.seconds.toInt()*1e3:e.expirationTime.seconds:0)})}_toProtobuf(){return{hbarEquiv:this.hbars,centEquiv:this.cents,expirationTime:{seconds:jP.default.fromNumber(Math.trunc(this.expirationTime.getTime()/1e3))}}}toJSON(){return{hbars:this.hbars,cents:this.cents,expirationTime:this.expirationTime,exchangeRateInCents:this.exchangeRateInCents}}toString(){return JSON.stringify(this.toJSON())}};var WE=Ie(Yt(),1),VP=Ie(vr(),1);var nl=class r{constructor(e){this.status=e.status,this.accountId=e.accountId,this.fileId=e.fileId,this.contractId=e.contractId,this.topicId=e.topicId,this.tokenId=e.tokenId,this.scheduleId=e.scheduleId,this.exchangeRate=e.exchangeRate,this.topicSequenceNumber=e.topicSequenceNumber,this.topicRunningHash=e.topicRunningHash,this.totalSupply=e.totalSupply,this.scheduledTransactionId=e.scheduledTransactionId,this.serials=e.serials??[],this.duplicates=e.duplicates??[],this.children=e.children??[],Object.freeze(this)}_toProtobuf(){let e=this.duplicates.map(n=>n._toProtobuf().receipt),t=this.children.map(n=>n._toProtobuf().receipt);return{duplicateTransactionReceipts:e,childTransactionReceipts:t,receipt:{status:this.status.valueOf(),accountID:this.accountId!=null?this.accountId._toProtobuf():null,fileID:this.fileId!=null?this.fileId._toProtobuf():null,contractID:this.contractId!=null?this.contractId._toProtobuf():null,topicID:this.topicId!=null?this.topicId._toProtobuf():null,tokenID:this.tokenId!=null?this.tokenId._toProtobuf():null,scheduleID:this.scheduleId!=null?this.scheduleId._toProtobuf():null,topicRunningHash:this.topicRunningHash==null?null:this.topicRunningHash,topicSequenceNumber:this.topicSequenceNumber,exchangeRate:{nextRate:null,currentRate:this.exchangeRate!=null?this.exchangeRate._toProtobuf():null},scheduledTransactionID:this.scheduledTransactionId!=null?this.scheduledTransactionId._toProtobuf():null,serialNumbers:this.serials,newTotalSupply:this.totalSupply}}}static _fromProtobuf(e){let t=e.receipt,n=t.exchangeRate,i=e.childTransactionReceipts!=null?e.childTransactionReceipts.map(o=>r._fromProtobuf({receipt:o})):[],a=e.duplicateTransactionReceipts!=null?e.duplicateTransactionReceipts.map(o=>r._fromProtobuf({receipt:o})):[];return new r({status:P._fromCode(t.status!=null?t.status:0),accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):null,fileId:t.fileID!=null?zt._fromProtobuf(t.fileID):null,contractId:t.contractID!=null?_t._fromProtobuf(t.contractID):null,topicId:t.topicID!=null?ia._fromProtobuf(t.topicID):null,tokenId:t.tokenID!=null?Oe._fromProtobuf(t.tokenID):null,scheduleId:t.scheduleID!=null?Na._fromProtobuf(t.scheduleID):null,exchangeRate:t.exchangeRate!=null?W0._fromProtobuf(n.currentRate):null,topicSequenceNumber:t.topicSequenceNumber==null?null:WE.default.fromString(t.topicSequenceNumber.toString()),topicRunningHash:t.topicRunningHash!=null?new Uint8Array(t.topicRunningHash):null,totalSupply:t.newTotalSupply!=null?WE.default.fromString(t.newTotalSupply.toString()):null,scheduledTransactionId:t.scheduledTransactionID!=null?Wr._fromProtobuf(t.scheduledTransactionID):null,serials:t.serialNumbers!=null?t.serialNumbers.map(o=>WE.default.fromValue(o)):[],children:i,duplicates:a})}static fromBytes(e){return r._fromProtobuf(VP.proto.TransactionGetReceiptResponse.decode(e))}toBytes(){return VP.proto.TransactionGetReceiptResponse.encode(this._toProtobuf()).finish()}toJSON(){return{status:this.status.toString(),accountId:this.accountId?.toString()||null,filedId:this.fileId?.toString()||null,contractId:this.contractId?.toString()||null,topicId:this.topicId?.toString()||null,tokenId:this.tokenId?.toString()||null,scheduleId:this.scheduleId?.toString()||null,exchangeRate:this.exchangeRate?.toJSON()||null,topicSequenceNumber:this.topicSequenceNumber?.toString()||null,topicRunningHash:this.topicRunningHash!=null?He(this.topicRunningHash):null,totalSupply:this.totalSupply?.toString()||null,scheduledTransactionId:this.scheduledTransactionId?.toString()||null,serials:this.serials.map(e=>e.toString()),duplicates:this.duplicates.map(e=>e.toJSON()),children:this.children.map(e=>e.toJSON())}}toString(){return JSON.stringify(this.toJSON())}};var TVe=Ie(vr(),1),{proto:xoe}=TVe,il=class r extends xr{constructor(e={}){super(),this._transactionId=null,this._includeChildren=null,this._includeDuplicates=null,this._validateStatus=!0,e.transactionId!=null&&this.setTransactionId(e.transactionId),e.includeChildren!=null&&this.setIncludeChildren(e.includeChildren),e.includeDuplicates!=null&&this.setIncludeDuplicates(e.includeDuplicates),e.validateStatus!=null&&this.setValidateStatus(e.validateStatus)}static _fromProtobuf(e){let t=e.transactionGetReceipt;return new r({transactionId:t.transactionID?Wr._fromProtobuf(t.transactionID):void 0,includeDuplicates:t.includeDuplicates!=null?t.includeDuplicates:void 0,includeChildren:t.includeChildReceipts!=null?t.includeChildReceipts:void 0})}get transactionId(){return this._transactionId}setTransactionId(e){return this._transactionId=typeof e=="string"?Wr.fromString(e):e.clone(),this}setIncludeDuplicates(e){return this._includeDuplicates=e,this}get includeDuplicates(){return this._includeDuplicates!=null?this._includeDuplicates:!1}setIncludeChildren(e){return this._includeChildren=e,this}get includeChildren(){return this._includeChildren!=null?this._includeChildren:!1}setValidateStatus(e){return this._validateStatus=e,this}get validateStatus(){return this._validateStatus}_isPaymentRequired(){return!1}_shouldRetry(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??xoe.ResponseCodeEnum.OK);switch(this._logger&&this._logger.debug(`[${this._getLogId()}] received node precheck status ${i.toString()}`),i){case P.Busy:case P.Unknown:case P.ReceiptNotFound:return[i,Bn.Retry];case P.Ok:break;default:return[i,Bn.Error]}let s=t.transactionGetReceipt.receipt.status;switch(i=P._fromCode(s),this._logger&&this._logger.debug(`[${this._getLogId()}] received receipt status ${i.toString()}`),i){case P.Busy:case P.Unknown:case P.ReceiptNotFound:return[i,Bn.Retry];case P.Success:return[i,Bn.Finished];default:return[i,this._validateStatus?Bn.Error:Bn.Finished]}}_getTransactionId(){return this._transactionId!=null?this._transactionId:super._getTransactionId()}_mapStatusError(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??xoe.ResponseCodeEnum.OK);switch(i){case P.Ok:break;default:return new ns({status:i,transactionId:this._getTransactionId(),contractFunctionResult:null})}let a=t.transactionGetReceipt,s=a.receipt.status;if(i=P._fromCode(s),this._transactionId==null)throw new Error("Failed to construct `ReceiptStatusError` because `transactionId` is `null`");return new Xc({status:i,transactionId:this._transactionId,transactionReceipt:nl._fromProtobuf(a)})}_validateChecksums(e){this._transactionId!=null&&this._transactionId.accountId!=null&&this._transactionId.accountId.validateChecksum(e)}_execute(e,t){return e.crypto.getTransactionReceipts(t)}_mapResponseHeader(e){return e.transactionGetReceipt.header}_mapResponse(e,t,n){let i=e.transactionGetReceipt;return Promise.resolve(nl._fromProtobuf(i))}_onMakeRequest(e){return{transactionGetReceipt:{header:e,transactionID:this._transactionId!=null?this._transactionId._toProtobuf():null,includeDuplicates:this._includeDuplicates,includeChildReceipts:this._includeChildren}}}_getLogId(){return`TransactionReceiptQuery:${this._timestamp.toString()}`}};Qr.set("transactionGetReceipt",il._fromProtobuf);var du=class r{constructor(e){this.accountId=e.accountId instanceof ne?e.accountId:ne.fromString(e.accountId),this.amount=e.amount instanceof ze?e.amount:new ze(e.amount),this.isApproved=e.isApproved}static _fromProtobuf(e){let t=[];for(let n of e)t.push(new r({accountId:ne._fromProtobuf(n.accountID),amount:ze.fromTinybars(n.amount!=null?n.amount:0),isApproved:n.isApproval}));return t}_toProtobuf(){return{accountID:this.accountId._toProtobuf(),amount:this.amount.toTinybars(),isApproval:this.isApproved}}toJSON(){return{accountId:this.accountId.toString(),amount:this.amount.toTinybars().toString(),isApproved:this.isApproved}}toString(){return JSON.stringify(this.toJSON())}};var W2=class r{constructor(e){this.contractId=e.contractId,this.bloom=e.bloom,this.topics=e.topics,this.data=e.data,Object.freeze(this)}static _fromProtobuf(e){return new r({contractId:_t._fromProtobuf(e.contractID),bloom:e.bloom!=null?e.bloom:new Uint8Array,topics:e.topic!=null?e.topic:[],data:e.data!=null?e.data:new Uint8Array})}_toProtobuf(){return{contractID:this.contractId._toProtobuf(),bloom:this.bloom,topic:this.topics,data:this.data}}};function y8(r){return Buffer.from(r).toString("utf8")}function n3(r){return Buffer.from(r,"utf8")}var bn=Ie(AB(),1),n1=Ie(Yt(),1);var E3e=Ie(Yt(),1),Wze=Ie(vr(),1),{proto:_3e}=Wze,vm=class r{constructor(e){this.contractId=e.contractId,this.nonce=e.nonce,Object.freeze(this)}static _fromProtobuf(e){return new r({contractId:_t._fromProtobuf(e.contractId),nonce:e.nonce!=null?e.nonce:E3e.default.ZERO})}_toProtobuf(){return{contractId:this.contractId._toProtobuf(),nonce:this.nonce}}static fromBytes(e){return r._fromProtobuf(_3e.ContractNonceInfo.decode(e))}toBytes(){return _3e.ContractNonceInfo.encode(this._toProtobuf()).finish()}toJSON(){return{contractId:this.contractId.toString(),nonce:this.nonce.toNumber()}}toString(){return JSON.stringify(this.toJSON())}equals(e){return this.contractId.equals(e.contractId)&&this.nonce.eq(e.nonce)}};var wu=class r{constructor(e){this._createResult=e._createResult,this.contractId=e.contractId,this.bytes=e.bytes,this.errorMessage=e.errorMessage,this.bloom=e.bloom,this.gasUsed=e.gasUsed,this.logs=e.logs,this.createdContractIds=e.createdContractIds,this.evmAddress=e.evmAddress,this.stateChanges=e.stateChanges,this.gas=e.gas,this.amount=e.amount,this.functionParameters=e.functionParameters,this.senderAccountId=e.senderAccountId,this.contractNonces=e.contractNonces}static _fromProtobuf(e,t){let n=e.contractID,i=e.gasUsed,a=e.gas?e.gas:-1,o=e.amount?e.amount:-1;return new r({_createResult:t,bytes:e.contractCallResult,contractId:n!=null?_t._fromProtobuf(n):null,errorMessage:e.errorMessage!=null?e.errorMessage:null,bloom:e.bloom,gasUsed:i instanceof n1.default?i:n1.default.fromValue(i),logs:(e.logInfo!=null?e.logInfo:[]).map(s=>W2._fromProtobuf(s)),createdContractIds:(e.createdContractIDs!=null?e.createdContractIDs:[]).map(s=>_t._fromProtobuf(s)),evmAddress:e.evmAddress!=null&&e.evmAddress.value!=null?e.evmAddress.value:null,stateChanges:[],gas:a instanceof n1.default?a:n1.default.fromValue(a),amount:o instanceof n1.default?o:n1.default.fromValue(o),functionParameters:e.functionParameters,senderAccountId:e.senderId!=null?ne._fromProtobuf(e.senderId):null,contractNonces:(e.contractNonces!=null?e.contractNonces:[]).map(s=>vm._fromProtobuf(s))})}asBytes(){return this.bytes}getString(e){return y8(this.getBytes(e))}getBytes(e){let t=this.getInt32(e),n=lo(this.bytes).getInt32(t+28);return this.bytes.subarray(t+32,t+32+n)}getBytes32(e){return this.bytes.subarray((e??0)*32,(e??0)*32+32)}getBool(e){return this.bytes[(e??0)*32+31]!==0}getInt8(e){let t=(e??0)*32+31;return lo(this.bytes).getInt8(t)}getUint8(e){return this.bytes[(e??0)*32+31]}getInt16(e){let t=(e??0)*32+28;return lo(this.bytes).getInt32(t)}getUint16(e){let t=(e??0)*32+28;return lo(this.bytes).getUint32(t)}getInt24(e){let t=(e??0)*32+28;return lo(this.bytes).getInt32(t)}getUint24(e){let t=(e??0)*32+28;return lo(this.bytes).getUint32(t)}getInt32(e){let t=(e??0)*32+28;return lo(this.bytes).getInt32(t)}getUint32(e){let t=(e??0)*32+28;return lo(this.bytes).getUint32(t)}getInt40(e){let t=bn.defaultAbiCoder.decode(["int40"],this._getBytes32(e??0));return new Qe(t.toString())}getUint40(e){return new Qe(He(this._getBytes32(e).subarray(27,32)),16)}getInt48(e){let t=bn.defaultAbiCoder.decode(["int48"],this._getBytes32(e??0));return new Qe(t.toString())}getUint48(e){return new Qe(He(this._getBytes32(e).subarray(26,32)),16)}getInt56(e){let t=bn.defaultAbiCoder.decode(["int56"],this._getBytes32(e??0));return new Qe(t.toString())}getUint56(e){return new Qe(He(this._getBytes32(e).subarray(25,32)),16)}getInt64(e){let t=bn.defaultAbiCoder.decode(["int64"],this._getBytes32(e??0));return new Qe(t.toString())}getUint64(e){return new Qe(He(this._getBytes32(e).subarray(24,32)),16)}getInt72(e){let t=bn.defaultAbiCoder.decode(["int72"],this._getBytes32(e??0));return new Qe(t.toString())}getUint72(e){return new Qe(He(this._getBytes32(e).subarray(23,32)),16)}getInt80(e){let t=bn.defaultAbiCoder.decode(["int80"],this._getBytes32(e??0));return new Qe(t.toString())}getUint80(e){return new Qe(He(this._getBytes32(e).subarray(22,32)),16)}getInt88(e){let t=bn.defaultAbiCoder.decode(["int88"],this._getBytes32(e??0));return new Qe(t.toString())}getUint88(e){return new Qe(He(this._getBytes32(e).subarray(21,32)),16)}getInt96(e){let t=bn.defaultAbiCoder.decode(["int96"],this._getBytes32(e??0));return new Qe(t.toString())}getUint96(e){return new Qe(He(this._getBytes32(e).subarray(20,32)),16)}getInt104(e){let t=bn.defaultAbiCoder.decode(["int104"],this._getBytes32(e??0));return new Qe(t.toString())}getUint104(e){return new Qe(He(this._getBytes32(e).subarray(19,32)),16)}getInt112(e){let t=bn.defaultAbiCoder.decode(["int112"],this._getBytes32(e??0));return new Qe(t.toString())}getUint112(e){return new Qe(He(this._getBytes32(e).subarray(18,32)),16)}getInt120(e){let t=bn.defaultAbiCoder.decode(["int120"],this._getBytes32(e??0));return new Qe(t.toString())}getUint120(e){return new Qe(He(this._getBytes32(e).subarray(17,32)),16)}getInt128(e){let t=bn.defaultAbiCoder.decode(["int128"],this._getBytes32(e??0));return new Qe(t.toString())}getUint128(e){return new Qe(He(this._getBytes32(e).subarray(16,32)),16)}getInt136(e){let t=bn.defaultAbiCoder.decode(["int136"],this._getBytes32(e??0));return new Qe(t.toString())}getUint136(e){return new Qe(He(this._getBytes32(e).subarray(15,32)),16)}getInt144(e){let t=bn.defaultAbiCoder.decode(["int144"],this._getBytes32(e??0));return new Qe(t.toString())}getUint144(e){return new Qe(He(this._getBytes32(e).subarray(14,32)),16)}getInt152(e){let t=bn.defaultAbiCoder.decode(["int152"],this._getBytes32(e??0));return new Qe(t.toString())}getUint152(e){return new Qe(He(this._getBytes32(e).subarray(13,32)),16)}getInt160(e){let t=bn.defaultAbiCoder.decode(["int160"],this._getBytes32(e??0));return new Qe(t.toString())}getUint160(e){return new Qe(He(this._getBytes32(e).subarray(12,32)),16)}getInt168(e){let t=bn.defaultAbiCoder.decode(["int168"],this._getBytes32(e??0));return new Qe(t.toString())}getUint168(e){return new Qe(He(this._getBytes32(e).subarray(11,32)),16)}getInt176(e){let t=bn.defaultAbiCoder.decode(["int176"],this._getBytes32(e??0));return new Qe(t.toString())}getUint176(e){return new Qe(He(this._getBytes32(e).subarray(10,32)),16)}getInt184(e){let t=bn.defaultAbiCoder.decode(["int184"],this._getBytes32(e??0));return new Qe(t.toString())}getUint184(e){return new Qe(He(this._getBytes32(e).subarray(9,32)),16)}getInt192(e){let t=bn.defaultAbiCoder.decode(["int192"],this._getBytes32(e??0));return new Qe(t.toString())}getUint192(e){return new Qe(He(this._getBytes32(e).subarray(8,32)),16)}getInt200(e){let t=bn.defaultAbiCoder.decode(["int200"],this._getBytes32(e??0));return new Qe(t.toString())}getUint200(e){return new Qe(He(this._getBytes32(e).subarray(7,32)),16)}getInt208(e){let t=bn.defaultAbiCoder.decode(["int208"],this._getBytes32(e??0));return new Qe(t.toString())}getUint208(e){return new Qe(He(this._getBytes32(e).subarray(6,32)),16)}getInt216(e){let t=bn.defaultAbiCoder.decode(["int216"],this._getBytes32(e??0));return new Qe(t.toString())}getUint216(e){return new Qe(He(this._getBytes32(e).subarray(5,32)),16)}getInt224(e){let t=bn.defaultAbiCoder.decode(["int224"],this._getBytes32(e??0));return new Qe(t.toString())}getUint224(e){return new Qe(He(this._getBytes32(e).subarray(4,32)),16)}getInt232(e){let t=bn.defaultAbiCoder.decode(["int232"],this._getBytes32(e??0));return new Qe(t.toString())}getUint232(e){return new Qe(He(this._getBytes32(e).subarray(3,32)),16)}getInt240(e){let t=bn.defaultAbiCoder.decode(["int240"],this._getBytes32(e??0));return new Qe(t.toString())}getUint240(e){return new Qe(He(this._getBytes32(e).subarray(2,32)),16)}getInt248(e){let t=bn.defaultAbiCoder.decode(["int248"],this._getBytes32(e??0));return new Qe(t.toString())}getUint248(e){return new Qe(He(this._getBytes32(e).subarray(1,32)),16)}getInt256(e){let t=bn.defaultAbiCoder.decode(["int256"],this._getBytes32(e??0));return new Qe(t.toString())}getUint256(e){return new Qe(He(this._getBytes32(e)),16)}getAddress(e){return He(this.bytes.subarray((e??0)*32+12,(e??0)*32+32))}getResult(e){return bn.defaultAbiCoder.decode(e,this.bytes)}_getBytes32(e){return this.bytes.subarray((e??0)*32,(e??0)*32+32)}_toProtobuf(){return{contractID:this.contractId!=null?this.contractId._toProtobuf():null,contractCallResult:this.bytes,errorMessage:this.errorMessage,bloom:this.bloom,gasUsed:this.gasUsed,logInfo:this.logs.map(e=>e._toProtobuf()),createdContractIDs:this.createdContractIds.map(e=>e._toProtobuf()),evmAddress:this.evmAddress!=null?{value:this.evmAddress}:null,gas:this.gas,amount:this.amount,functionParameters:this.functionParameters,senderId:this.senderAccountId!=null?this.senderAccountId._toProtobuf():null,contractNonces:this.contractNonces.map(e=>e._toProtobuf())}}};var di=class{constructor(e){this._map=new Map,this.__map=new Map,this._fromString=e}get(e){let t=typeof e=="string"?e:e.toString(),n=this._map.get(t);return n??null}_set(e,t){let n=typeof e=="string"?e:e.toString();this._map.set(n,t),this.__map.set(e,t)}values(){return this._map.values()}get size(){return this._map.size}keys(){return this.__map.keys()}[Symbol.iterator](){return this.__map[Symbol.iterator]()}toString(){let e={};for(let[t,n]of this._map)e[t]=n;return JSON.stringify(e)}toJSON(){let e={};return this._map.forEach((t,n)=>{e[n]=t}),e}};var i1=class extends di{constructor(){super(e=>ne.fromString(e))}toJSON(){let e={};return this._map.forEach((t,n)=>{e[n]=t.toString()}),e}};var a1=class r extends di{constructor(){super(e=>Oe.fromString(e))}__set(e,t,n){let i=e.toString(),a=this._map.get(i);a==null&&(a=new i1,this._map.set(i,a),this.__map.set(e,a)),a._set(t,n)}static _fromProtobuf(e){let t=new r;for(let n of e){let i=Oe._fromProtobuf(n.token);for(let a of n.transfers!=null?n.transfers:[]){let o=ne._fromProtobuf(a.accountID);t.__set(i,o,a.amount)}}return t}_toProtobuf(){let e=[];for(let[t,n]of this){let i=[];for(let[a,o]of n)i.push({accountID:a._toProtobuf(),amount:o});e.push({token:t._toProtobuf(),transfers:i})}return e}};var x3e=Ie(Yt(),1);var o1=class r extends di{constructor(){super(e=>Oe.fromString(e))}__set(e,t){let n=e.toString(),i=this._map.get(n);i==null&&(i=[],this._map.set(n,i),this.__map.set(e,i)),i.push(t)}static _fromProtobuf(e){let t=new r;for(let n of e){let i=Oe._fromProtobuf(n.token);for(let a of n.nftTransfers!=null?n.nftTransfers:[]){let o=ne._fromProtobuf(a.senderAccountID),s=ne._fromProtobuf(a.receiverAccountID);t.__set(i,{sender:o,recipient:s,serial:x3e.default.fromValue(a.serialNumber),isApproved:!1})}}return t}_toProtobuf(){let e=[];for(let[t,n]of this){let i=[];for(let a of n)i.push({senderAccountID:a.sender._toProtobuf(),receiverAccountID:a.recipient._toProtobuf(),serialNumber:a.serial});e.push({token:t._toProtobuf(),nftTransfers:i})}return e}toJSON(){let e={};return this._map.forEach((t,n)=>{e[n]=t.map(i=>({sender:i.sender.toString(),recipient:i.recipient.toString(),serial:i.serial,isApproved:i.isApproved}))}),e}};var R8=Ie(vr(),1);var A3e=Ie(Yt(),1),bm=class r{constructor(e={}){this._feeCollectorAccountId=null,e.feeCollectorAccountId!=null&&this.setFeeCollectorAccountId(e.feeCollectorAccountId),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),this._amount=null,e.amount!=null&&this.setAmount(e.amount),this._payerAccountIds=null,e.payerAccountIds!=null&&this.setPayerAccountIds(e.payerAccountIds)}get feeCollectorAccountId(){return this._feeCollectorAccountId}setFeeCollectorAccountId(e){return this._feeCollectorAccountId=typeof e=="string"?ne.fromString(e):e,this}get tokenId(){return this._tokenId}setTokenId(e){return this._tokenId=typeof e=="string"?Oe.fromString(e):e,this}get amount(){return this._amount}setAmount(e){return this._amount=typeof e=="number"?A3e.default.fromNumber(e):e,this}get payerAccountIds(){return this._payerAccountIds}setPayerAccountIds(e){return this._payerAccountIds=e,this}static _fromProtobuf(e){return new r({feeCollectorAccountId:e.feeCollectorAccountId!=null?ne._fromProtobuf(e.feeCollectorAccountId):void 0,tokenId:e.tokenId!=null?Oe._fromProtobuf(e.tokenId):void 0,amount:e.amount!=null?e.amount:void 0,payerAccountIds:e.effectivePayerAccountId!=null?e.effectivePayerAccountId.map(t=>ne._fromProtobuf(t)):void 0})}_toProtobuf(){return{feeCollectorAccountId:this.feeCollectorAccountId!=null?this.feeCollectorAccountId._toProtobuf():null,tokenId:this._tokenId!=null?this._tokenId._toProtobuf():null,amount:this._amount,effectivePayerAccountId:this._payerAccountIds!=null?this._payerAccountIds.map(e=>e._toProtobuf()):null}}toJSON(){return{feeCollectorAccountId:this.feeCollectorAccountId?.toString()||null,tokenId:this._tokenId?.toString()||null,amount:this._amount?.toString()||null,payerAccountIds:this._payerAccountIds?.map(e=>e.toString())||[]}}};var N8=class r{constructor(e={}){this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),this._defaultMaxTransactionFee=new ze(5)}get accountId(){return this._accountId}setAccountId(e){return this._accountId=typeof e=="string"?ne.fromString(e):e,this}get tokenId(){return this._tokenId}setTokenId(e){return this._tokenId=typeof e=="string"?Oe.fromString(e):e,this}static _fromProtobuf(e){return new r({accountId:e.accountId!=null?ne._fromProtobuf(e.accountId):void 0,tokenId:e.tokenId!=null?Oe._fromProtobuf(e.tokenId):void 0})}_toProtobuf(){return{accountId:this._accountId!=null?this._accountId._toProtobuf():void 0,tokenId:this._tokenId!=null?this._tokenId._toProtobuf():void 0}}toJSON(){return{accountId:this._accountId?.toString()||null,tokenId:this._tokenId?.toString()||null}}};var TB=Ie(Yt(),1);var Wd=class r{constructor(e){this.tokenId=e.tokenId instanceof Oe?e.tokenId:Oe.fromString(e.tokenId),this.accountId=e.accountId instanceof ne?e.accountId:ne.fromString(e.accountId),this.expectedDecimals=e.expectedDecimals,this.amount=TB.default.fromValue(e.amount),this.isApproved=e.isApproved}static _fromProtobuf(e){let t=[];for(let n of e){let i=Oe._fromProtobuf(n.token),a=n.expectedDecimals!=null?n.expectedDecimals.value:null;for(let o of n.transfers!=null?n.transfers:[])t.push(new r({tokenId:i,accountId:ne._fromProtobuf(o.accountID),expectedDecimals:a,amount:o.amount!=null?o.amount:TB.default.ZERO,isApproved:o.isApproval==!0}))}return t}_toProtobuf(){return{accountID:this.accountId._toProtobuf(),amount:this.amount,isApproval:this.isApproved}}toJSON(){return{tokenId:this.tokenId.toString(),accountId:this.accountId.toString(),expectedDecimals:this.expectedDecimals,amount:this.amount.toString(),isApproved:this.isApproved}}toString(){return JSON.stringify(this.toJSON())}};var _u=class r{constructor(e){this.receipt=e.receipt,this.transactionHash=e.transactionHash,this.consensusTimestamp=e.consensusTimestamp,this.transactionId=e.transactionId,this.transactionMemo=e.transactionMemo,this.transactionFee=e.transactionFee,this.transfers=e.transfers,this.contractFunctionResult=e.contractFunctionResult!=null?e.contractFunctionResult:null,this.tokenTransfers=e.tokenTransfers,this.tokenTransfersList=e.tokenTransfersList,this.scheduleRef=e.scheduleRef,this.assessedCustomFees=e.assessedCustomFees,this.nftTransfers=e.nftTransfers,this.automaticTokenAssociations=e.automaticTokenAssociations,this.parentConsensusTimestamp=e.parentConsensusTimestamp,this.aliasKey=e.aliasKey,this.duplicates=e.duplicates,this.children=e.children,this.hbarAllowanceAdjustments=e.hbarAllowanceAdjustments,this.tokenAllowanceAdjustments=e.tokenAllowanceAdjustments,this.nftAllowanceAdjustments=e.nftAllowanceAdjustments,this.ethereumHash=e.ethereumHash,this.paidStakingRewards=e.paidStakingRewards,this.prngBytes=e.prngBytes,this.prngNumber=e.prngNumber,this.evmAddress=e.evmAddress,Object.freeze(this)}_toProtobuf(){let e=this.tokenTransfers._toProtobuf(),t=this.nftTransfers._toProtobuf(),n=[];for(let o of e)for(let s of t)o.token!=null&&s.token!=null&&o.token.shardNum===s.token.shardNum&&o.token.realmNum===s.token.realmNum&&o.token.tokenNum===s.token.tokenNum?n.push({token:o.token,transfers:o.transfers,nftTransfers:o.nftTransfers}):(n.push(o),n.push(s));let i=this.duplicates.map(o=>o._toProtobuf().transactionRecord),a=this.children.map(o=>o._toProtobuf().transactionRecord);return{duplicateTransactionRecords:i,childTransactionRecords:a,transactionRecord:{receipt:this.receipt._toProtobuf().receipt,transactionHash:this.transactionHash!=null?this.transactionHash:null,consensusTimestamp:this.consensusTimestamp!=null?this.consensusTimestamp._toProtobuf():null,transactionID:this.transactionId!=null?this.transactionId._toProtobuf():null,memo:this.transactionMemo!=null?this.transactionMemo:null,transactionFee:this.transactionFee!=null?this.transactionFee.toTinybars():null,contractCallResult:this.contractFunctionResult!=null&&!this.contractFunctionResult._createResult?this.contractFunctionResult._toProtobuf():null,contractCreateResult:this.contractFunctionResult!=null&&this.contractFunctionResult._createResult?this.contractFunctionResult._toProtobuf():null,transferList:this.transfers!=null?{accountAmounts:this.transfers.map(o=>o._toProtobuf())}:null,tokenTransferLists:n,scheduleRef:this.scheduleRef!=null?this.scheduleRef._toProtobuf():null,assessedCustomFees:this.assessedCustomFees.map(o=>o._toProtobuf()),automaticTokenAssociations:this.automaticTokenAssociations.map(o=>o._toProtobuf()),parentConsensusTimestamp:this.parentConsensusTimestamp!=null?this.parentConsensusTimestamp._toProtobuf():null,alias:this.aliasKey!=null?R8.proto.Key.encode(this.aliasKey._toProtobufKey()).finish():null,ethereumHash:this.ethereumHash,paidStakingRewards:this.paidStakingRewards.map(o=>o._toProtobuf()),prngBytes:this.prngBytes,prngNumber:this.prngNumber!=null?this.prngNumber:null,evmAddress:this.evmAddress!=null?this.evmAddress.toBytes():null}}}static _fromProtobuf(e){let t=e.transactionRecord,n=t.alias!=null&&t.alias.length>0?rt._fromProtobufKey(R8.proto.Key.decode(t.alias)):null;n instanceof Xn||(n=null);let i=e.childTransactionRecords!=null?e.childTransactionRecords.map(s=>r._fromProtobuf({transactionRecord:s})):[],a=e.duplicateTransactionRecords!=null?e.duplicateTransactionRecords.map(s=>r._fromProtobuf({transactionRecord:s})):[],o=t.contractCallResult!=null?wu._fromProtobuf(t.contractCallResult,!1):t.contractCreateResult!=null?wu._fromProtobuf(t.contractCreateResult,!0):void 0;return new r({receipt:nl._fromProtobuf({receipt:t.receipt}),transactionHash:t.transactionHash!=null?t.transactionHash:new Uint8Array,consensusTimestamp:lt._fromProtobuf(t.consensusTimestamp),transactionId:Wr._fromProtobuf(t.transactionID),transactionMemo:t.memo!=null?t.memo:"",transactionFee:ze.fromTinybars(t.transactionFee!=null?t.transactionFee:0),transfers:du._fromProtobuf(t.transferList!=null?t.transferList.accountAmounts!=null?t.transferList.accountAmounts:[]:[]),contractFunctionResult:o,tokenTransfers:a1._fromProtobuf(t.tokenTransferLists!=null?t.tokenTransferLists:[]),tokenTransfersList:Wd._fromProtobuf(t.tokenTransferLists!=null?t.tokenTransferLists:[]),scheduleRef:t.scheduleRef!=null?Na._fromProtobuf(t.scheduleRef):null,assessedCustomFees:t.assessedCustomFees!=null?t.assessedCustomFees.map(s=>bm._fromProtobuf(s)):[],nftTransfers:o1._fromProtobuf(t.tokenTransferLists!=null?t.tokenTransferLists:[]),automaticTokenAssociations:t.automaticTokenAssociations!=null?t.automaticTokenAssociations.map(s=>N8._fromProtobuf(s)):[],parentConsensusTimestamp:t.parentConsensusTimestamp!=null?lt._fromProtobuf(t.parentConsensusTimestamp):null,aliasKey:n,duplicates:a,children:i,hbarAllowanceAdjustments:[],tokenAllowanceAdjustments:[],nftAllowanceAdjustments:[],ethereumHash:t.ethereumHash!=null?t.ethereumHash:null,paidStakingRewards:t.paidStakingRewards!=null?du._fromProtobuf(t.paidStakingRewards):[],prngBytes:t.prngBytes!=null?t.prngBytes:null,prngNumber:t.prngNumber!=null?t.prngNumber:null,evmAddress:t.evmAddress!=null?rs.fromBytes(t.evmAddress):null})}static fromBytes(e){return r._fromProtobuf(R8.proto.TransactionGetRecordResponse.decode(e))}toBytes(){return R8.proto.TransactionGetRecordResponse.encode(this._toProtobuf()).finish()}toJSON(){return{receipt:this.receipt.toJSON(),transactionHash:He(this.transactionHash),consensusTimestamp:this.consensusTimestamp.toDate(),transactionId:this.transactionId.toString(),transactionMemo:this.transactionMemo,transactionFee:this.transactionFee.toTinybars().toString(),transfers:this.transfers.map(e=>e.toJSON()),tokenTransfers:this.tokenTransfers,tokenTransfersList:this.tokenTransfersList.map(e=>e.toJSON()),scheduleRef:this.scheduleRef?.toString()||null,assessedCustomFees:this.assessedCustomFees,nftTransfers:this.nftTransfers,automaticTokenAssociations:this.automaticTokenAssociations,parentConsensusTimestamp:this.parentConsensusTimestamp?.toDate()||null,aliasKey:this.aliasKey?.toString()||null,duplicates:this.duplicates,children:this.children,ethereumHash:this.ethereumHash!=null?He(this.ethereumHash):null,paidStakingRewards:this.paidStakingRewards,prngBytes:this.prngBytes!=null?He(this.prngBytes):null,prngNumber:this.prngNumber,evmAddress:this.evmAddress?.toString()||null}}toString(){return JSON.stringify(this.toJSON())}};var wm=class extends su{constructor(e){super(e,`Record for transaction ${e.transactionId.toString()} contained error status ${e.status.toString()}`),this.transactionRecord=e.transactionRecord}};var SB=Ie(vr(),1),{proto:T3e}=SB,s1=class r extends xr{constructor(e={}){super(),this._transactionId=null,this._includeChildren=null,this._includeDuplicates=null,this._validateReceiptStatus=!0,e.transactionId!=null&&this.setTransactionId(e.transactionId),e.includeChildren!=null&&this.setIncludeChildren(e.includeChildren),e.includeDuplicates!=null&&this.setIncludeDuplicates(e.includeDuplicates),e.validateReceiptStatus!=null&&this.setValidateReceiptStatus(e.validateReceiptStatus)}get transactionId(){return this._transactionId}static _fromProtobuf(e){let t=e.transactionGetRecord;return new r({transactionId:t.transactionID?Wr._fromProtobuf(t.transactionID):void 0,includeChildren:t.includeChildRecords!=null?t.includeChildRecords:void 0,includeDuplicates:t.includeDuplicates!=null?t.includeDuplicates:void 0})}setTransactionId(e){return this._transactionId=typeof e=="string"?Wr.fromString(e):e.clone(),this}setIncludeChildren(e){return this._includeChildren=e,this}get includeChildren(){return this._includeChildren!=null?this._includeChildren:!1}setIncludeDuplicates(e){return this._duplicates=e,this}get includeDuplicates(){return this._duplicates!=null?this._duplicates:!1}setValidateReceiptStatus(e){return this._validateReceiptStatus=e,this}get validateReceiptStatus(){return this._validateReceiptStatus}_shouldRetry(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??T3e.ResponseCodeEnum.OK);switch(this._logger&&this._logger.debug(`[${this._getLogId()}] received node precheck status ${i.toString()}`),i){case P.Busy:case P.Unknown:case P.ReceiptNotFound:case P.RecordNotFound:return[i,Bn.Retry];case P.Ok:break;default:return[i,Bn.Error]}let a=t.transactionGetRecord;if(a.header.responseType===SB.proto.ResponseType.COST_ANSWER)return[i,Bn.Finished];let l=a.transactionRecord.receipt.status;switch(i=P._fromCode(l),this._logger&&this._logger.debug(`[${this._getLogId()}] received record's receipt ${i.toString()}`),i){case P.Ok:case P.Busy:case P.Unknown:case P.ReceiptNotFound:case P.RecordNotFound:return[i,Bn.Retry];case P.Success:return[i,Bn.Finished];default:return[i,this._validateReceiptStatus?Bn.Error:Bn.Finished]}}_mapStatusError(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??T3e.ResponseCodeEnum.OK);switch(i){case P.Ok:break;case P.ContractRevertExecuted:return new wm({status:i,transactionId:this._getTransactionId(),transactionRecord:_u._fromProtobuf({transactionRecord:t.transactionGetRecord.transactionRecord})});default:return new ns({status:i,transactionId:this._getTransactionId(),contractFunctionResult:null})}let s=t.transactionGetRecord.transactionRecord.receipt,c=s.status;switch(i=P._fromCode(c),i){case P.ContractRevertExecuted:return new wm({status:i,transactionId:this._getTransactionId(),transactionRecord:_u._fromProtobuf({transactionRecord:t.transactionGetRecord.transactionRecord})});default:return new Xc({status:i,transactionId:this._getTransactionId(),transactionReceipt:nl._fromProtobuf({receipt:s})})}}_validateChecksums(e){this._transactionId!=null&&this._transactionId.accountId!=null&&this._transactionId.accountId.validateChecksum(e)}_execute(e,t){return e.crypto.getTxRecordByTxID(t)}_mapResponseHeader(e){return e.transactionGetRecord.header}_mapResponse(e,t,n){let i=e.transactionGetRecord;return Promise.resolve(_u._fromProtobuf(i))}_onMakeRequest(e){return{transactionGetRecord:{header:e,transactionID:this._transactionId!=null?this._transactionId._toProtobuf():null,includeChildRecords:this._includeChildren,includeDuplicates:this._includeDuplicates}}}_getLogId(){return`TransactionRecordQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("transactionGetRecord",s1._fromProtobuf);var c1=class r{constructor(e){this.nodeId=e.nodeId,this.transactionHash=e.transactionHash,this.transactionId=e.transactionId,Object.freeze(this)}static fromJSON(e){return new r({nodeId:ne.fromString(e.nodeId),transactionHash:et(e.transactionHash),transactionId:Wr.fromString(e.transactionId)})}async getReceipt(e){let t=await this.getReceiptQuery().execute(e);if(t.status!==P.Success)throw new Xc({transactionReceipt:t,status:t.status,transactionId:this.transactionId});return t}async getRecord(e){return await this.getReceipt(e),this.getRecordQuery().execute(e)}async getVerboseRecord(e){try{return await this.getReceiptQuery().execute(e),this.getRecordQuery().execute(e)}catch{return this.getRecordQuery().execute(e)}}async getReceiptWithSigner(e){let t=await this.getReceiptQuery().executeWithSigner(e);if(t.status!==P.Success)throw new Xc({transactionReceipt:t,status:t.status,transactionId:this.transactionId});return t}async getRecordWithSigner(e){return await this.getReceiptWithSigner(e),this.getRecordQuery().executeWithSigner(e)}getReceiptQuery(){return new il().setTransactionId(this.transactionId).setNodeAccountIds([this.nodeId])}getRecordQuery(){return new s1().setTransactionId(this.transactionId).setNodeAccountIds([this.nodeId])}toJSON(){return{nodeId:this.nodeId.toString(),transactionHash:He(this.transactionHash),transactionId:this.transactionId.toString()}}toString(){return JSON.stringify(this.toJSON())}};var S3e=Ie(require("crypto"),1);function O8(r){return Promise.resolve(S3e.default.createHash("sha384").update(r).digest())}var D8=class r extends di{constructor(){super(e=>ne.fromString(e))}static async _fromTransaction(e){let t=new r;for(let n=0;n<e._nodeAccountIds.length;n++){let i=e._nodeAccountIds.list[n],a=e._transactions.get(n),o=await O8(a.signedTransactionBytes);t._set(i,o)}return t}};var P8=class r extends di{constructor(){super(e=>Xn.fromString(e))}static _fromTransactionSigMap(e){let t=new r,n=e.sigPair!=null?e.sigPair:[];for(let i of n)i.pubKeyPrefix!=null&&(i.ed25519!=null?t._set(Xn.fromBytesED25519(i.pubKeyPrefix),i.ed25519):i.ECDSASecp256k1!=null&&t._set(Xn.fromBytesECDSA(i.pubKeyPrefix),i.ECDSASecp256k1));return t}};var _m=class r extends di{constructor(){super(e=>ne.fromString(e))}static _fromTransaction(e){let t=new r;for(let n=0;n<e._nodeAccountIds.length;n++){let i=e._signedTransactions.get(n).sigMap;i!=null&&t._set(e._nodeAccountIds.list[n],P8._fromTransactionSigMap(i))}return t}};var B8=Ie(Yt(),1);var as=Ie(vr(),1);var Eu=B8.default.fromValue(7776e3),IB=ze.fromTinybars(B8.default.fromString("9223372036854775807")),C3e=120,k3e=1024,Ge=new Map,ke=class extends lu{constructor(){super(),this._transactions=new rl,this._signedTransactions=new rl,this._signerPublicKeys=new Set,this._transactionValidDuration=C3e,this._defaultMaxTransactionFee=new ze(2),this._maxTransactionFee=null,this._transactionMemo="",this._transactionIds=new rl,this._publicKeys=[],this._transactionSigners=[],this._regenerateTransactionId=null}static fromBytes(e){let t=[],n=[],i=[],a=[],o=[],s=[],c=as.proto.TransactionList.decode(e).transactionList;if(c.length===0){let d=as.proto.Transaction.decode(e);d.signedTransactionBytes.length!==0?c.push(d):c.push({signedTransactionBytes:as.proto.SignedTransaction.encode({bodyBytes:d.bodyBytes,sigMap:d.sigMap}).finish()})}for(let d of c){if(d.signedTransactionBytes==null)throw new Error("Transaction.signedTransactionBytes are null");let h=as.proto.SignedTransaction.decode(d.signedTransactionBytes);t.push(h);let g=as.proto.TransactionBody.decode(h.bodyBytes);if(g.data==null)throw new Error("(BUG) body.data was not set in the protobuf");if(s.push(g),g.transactionID!=null){let m=Wr._fromProtobuf(g.transactionID);a.includes(m.toString())||(n.push(m),a.push(m.toString()))}if(g.nodeAccountID!=null){let m=ne._fromProtobuf(g.nodeAccountID);o.includes(m.toString())||(i.push(m),o.push(m.toString()))}}let l=s[0];if(l==null||l.data==null)throw new Error("No transaction found in bytes or failed to decode TransactionBody");let u=Ge.get(l.data);if(u==null)throw new Error(`(BUG) Transaction.fromBytes() not implemented for type ${l.data}`);return u(c,t,n,i,s)}schedule(){if(this._requireNotFrozen(),Bx.length!=1)throw new Error("ScheduleCreateTransaction has not been loaded yet");return Bx[0]()._setScheduledTransaction(this)}static _fromProtobufTransactions(e,t,n,i,a,o){let s=o[0];for(let l=0;l<i.length;l++)for(let u=0;u<a.length-1;u++)if(!pR(o[l*a.length+u],o[l*a.length+u+1],new Set(["nodeAccountID"])))throw new Error("failed to validate transaction bodies");let c=new ne(0);for(let l=0;l<a.length;l++)a[l].equals(c)&&a.splice(l--,1);e._transactions.setList(t),e._signedTransactions.setList(n).setLocked(),e._transactionIds.setList(i).setLocked(),e._nodeAccountIds.setList(a).setLocked(),e._transactionValidDuration=s.transactionValidDuration!=null&&s.transactionValidDuration.seconds!=null?B8.default.fromValue(s.transactionValidDuration.seconds).toInt():C3e,e._maxTransactionFee=s.transactionFee!=null?ze.fromTinybars(s.transactionFee):new ze(0),e._transactionMemo=s.memo!=null?s.memo:"";for(let l=0;l<a.length;l++){let u=n[l];if(u.sigMap!=null&&u.sigMap.sigPair!=null)for(let d of u.sigMap.sigPair)e._signerPublicKeys.add(He(d.pubKeyPrefix)),e._publicKeys.push(Xn.fromBytes(d.pubKeyPrefix)),e._transactionSigners.push(null)}return e}setNodeAccountIds(e){return this._requireNotFrozen(),super.setNodeAccountIds(e),this}get transactionValidDuration(){return this._transactionValidDuration}setTransactionValidDuration(e){return this._requireNotFrozen(),this._transactionValidDuration=e,this}get maxTransactionFee(){return this._maxTransactionFee}setMaxTransactionFee(e){return this._requireNotFrozen(),this._maxTransactionFee=e instanceof ze?e:new ze(e),this}get regenerateTransactionId(){return this._regenerateTransactionId}setRegenerateTransactionId(e){return this._requireNotFrozen(),this._regenerateTransactionId=e,this}get transactionMemo(){return this._transactionMemo}setTransactionMemo(e){return this._requireNotFrozen(),this._transactionMemo=e,this}get transactionId(){return this._transactionIds.isEmpty?null:(this._transactionIds.setLocked(),this._transactionIds.current)}setTransactionId(e){return this._requireNotFrozen(),this._transactionIds.setList([e]).setLocked(),this}sign(e){return this.signWith(e.publicKey,t=>Promise.resolve(e.sign(t)))}async signWith(e,t){this._signOnDemand||this._requireFrozen();let n=e.toBytesRaw(),i=He(n);if(this._signerPublicKeys.has(i))return this;if(this._transactions.clear(),this._signerPublicKeys.add(i),this._signOnDemand)return this._publicKeys.push(e),this._transactionSigners.push(t),this;this._transactionIds.setLocked(),this._nodeAccountIds.setLocked();for(let a of this._signedTransactions.list){let o=a.bodyBytes,s=await t(o);a.sigMap==null&&(a.sigMap={}),a.sigMap.sigPair==null&&(a.sigMap.sigPair=[]),a.sigMap.sigPair.push(e._toProtobufSignature(s))}return this}signWithOperator(e){let t=e._operator;if(t==null)throw new Error("`client` must have an operator to sign with the operator");return this._isFrozen()||this.freezeWith(e),this.signWith(t.publicKey,t.transactionSigner)}addSignature(e,t){this._requireOneNodeAccountId(),this.isFrozen()||this.freeze();let n=e.toBytesRaw(),i=He(n);if(this._signerPublicKeys.has(i))return this;this._transactions.clear(),this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),this._signedTransactions.setLocked();for(let a of this._signedTransactions.list)a.sigMap==null&&(a.sigMap={}),a.sigMap.sigPair==null&&(a.sigMap.sigPair=[]),a.sigMap.sigPair.push(e._toProtobufSignature(t));return this._signerPublicKeys.add(i),this._publicKeys.push(e),this._transactionSigners.push(null),this}getSignatures(){return this._requireFrozen(),this._requireNotSignOnDemand(),this._buildAllTransactions(),this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),_m._fromTransaction(this)}async getSignaturesAsync(){return this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),await this._buildAllTransactionsAsync(),this._transactions.setLocked(),this._signedTransactions.setLocked(),_m._fromTransaction(this)}_setTransactionId(){if(this._operatorAccountId==null&&this._transactionIds.isEmpty)throw new Error("`transactionId` must be set or `client` must be provided with `freezeWith`")}_setNodeAccountIds(e){if(this._nodeAccountIds.isEmpty){if(e==null)throw new Error("`nodeAccountId` must be set or `client` must be provided with `freezeWith`");this._nodeAccountIds.setList(e._network.getNodeAccountIdsForExecute())}}_buildSignedTransactions(){this._signedTransactions.locked||this._signedTransactions.setList(this._nodeAccountIds.list.map(e=>this._makeSignedTransaction(e)))}freeze(){return this.freezeWith(null)}_freezeWithAccountId(e){this._operatorAccountId==null&&(this._operatorAccountId=e)}freezeWith(e){if(this._signOnDemand=e!=null?e.signOnDemand:!1,this._operator=e!=null?e._operator:null,this._freezeWithAccountId(e!=null?e.operatorAccountId:null),this._maxTransactionFee=this._maxTransactionFee==null?e!=null&&e.defaultMaxTransactionFee!=null?e.defaultMaxTransactionFee:this._defaultMaxTransactionFee:this._maxTransactionFee,this._regenerateTransactionId=e!=null&&this._regenerateTransactionId==null?e.defaultRegenerateTransactionId:this._regenerateTransactionId,this._setNodeAccountIds(e),this._setTransactionId(),e!=null)for(let t of this._transactionIds.list)t.accountId!=null&&t.accountId.validateChecksum(e);return this._buildNewTransactionIdList(),this._signOnDemand||this._buildSignedTransactions(),this}async signWithSigner(e){return await e.signTransaction(this),this}async freezeWithSigner(e){return await e.populateTransaction(this),this.freeze(),this}toBytes(){return this._requireFrozen(),this._requireNotSignOnDemand(),this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),this._buildAllTransactions(),as.proto.TransactionList.encode({transactionList:this._transactions.list}).finish()}async toBytesAsync(){return this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),await this._buildAllTransactionsAsync(),this._transactions.setLocked(),this._signedTransactions.setLocked(),as.proto.TransactionList.encode({transactionList:this._transactions.list}).finish()}async getTransactionHash(){return this._requireFrozen(),this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),await this._buildAllTransactionsAsync(),this._transactions.setLocked(),this._signedTransactions.setLocked(),O8(this._transactions.get(0).signedTransactionBytes)}async getTransactionHashPerNode(){return this._requireFrozen(),this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),await this._buildAllTransactionsAsync(),await D8._fromTransaction(this)}isFrozen(){return this._signedTransactions.length>0}_getTransactionId(){let e=this.transactionId;if(e==null)throw new Error("transaction must have been frozen before getting the transaction ID, try calling `freeze`");return e}_validateChecksums(e){}async _beforeExecute(e){this._logger&&this._logger.info(`Network used: ${e._network.networkName}`),this._isFrozen()||this.freezeWith(e),e.isAutoValidateChecksumsEnabled()&&this._validateChecksums(e),(this._operator==null||this._operator==null)&&(this._operator=e!=null?e._operator:null),(this._operatorAccountId==null||this._operatorAccountId==null)&&(this._operatorAccountId=e!=null&&e._operator!=null?e._operator.accountId:null),this._operator!=null&&await this.signWith(this._operator.publicKey,this._operator.transactionSigner)}async _makeRequestAsync(){let e=this._transactionIds.index*this._nodeAccountIds.length+this._nodeAccountIds.index;return this._signOnDemand?await this._buildTransactionAsync():(this._buildTransaction(e),this._transactions.get(e))}async _signTransaction(){let e=this._makeSignedTransaction(this._nodeAccountIds.next),t=e.bodyBytes;for(let n=0;n<this._publicKeys.length;n++){let i=this._publicKeys[n],a=this._transactionSigners[n];if(a==null)continue;let o=await a(t);e.sigMap==null&&(e.sigMap={}),e.sigMap.sigPair==null&&(e.sigMap.sigPair=[]),e.sigMap.sigPair.push(i._toProtobufSignature(o))}return e}_buildNewTransactionIdList(){if(this._transactionIds.locked||this._operatorAccountId==null)return;let e=Wr.withValidStart(this._operatorAccountId,lt.generate());this._transactionIds.set(this._transactionIds.index,e)}_buildAllTransactions(){for(let e=0;e<this._signedTransactions.length;e++)this._buildTransaction(e)}async _buildAllTransactionsAsync(){if(!this._signOnDemand){this._buildAllTransactions();return}if(this._buildSignedTransactions(),!this._transactions.locked)for(let e=0;e<this._signedTransactions.length;e++)this._transactions.push(await this._buildTransactionAsync())}_buildTransaction(e){if(this._transactions.length<e)for(let t=this._transactions.length;t<e;t++)this._transactions.push(null);this._transactions.setIfAbsent(e,()=>({signedTransactionBytes:as.proto.SignedTransaction.encode(this._signedTransactions.get(e)).finish()}))}async _buildTransactionAsync(){return{signedTransactionBytes:as.proto.SignedTransaction.encode(await this._signTransaction()).finish()}}_shouldRetry(e,t){let{nodeTransactionPrecheckCode:n}=t,i=P._fromCode(n??as.proto.ResponseCodeEnum.OK);switch(this._logger&&(this._logger.debug(`[${this._getLogId()}] received status ${i.toString()}`),this._logger.info(`SDK Transaction Status Response: ${i.toString()}`)),i){case P.Busy:case P.Unknown:case P.PlatformTransactionNotCreated:case P.PlatformNotActive:return[i,Bn.Retry];case P.Ok:return[i,Bn.Finished];case P.TransactionExpired:return this._transactionIds.locked||this._regenerateTransactionId!=null&&!this._regenerateTransactionId?[i,Bn.Error]:(this._buildNewTransactionIdList(),[i,Bn.Retry]);default:return[i,Bn.Error]}}_mapStatusError(e,t){let{nodeTransactionPrecheckCode:n}=t,i=P._fromCode(n??as.proto.ResponseCodeEnum.OK);return this._logger&&this._logger.info(`Transaction Error Info: ${i.toString()}, ${this.transactionId.toString()}`),new ns({status:i,transactionId:this._getTransactionId(),contractFunctionResult:null})}async _mapResponse(e,t,n){let i=await O8(n.signedTransactionBytes),a=this._getTransactionId();return this._transactionIds.advance(),this._logger&&this._logger.info(`Transaction Info: ${JSON.stringify(new c1({nodeId:t,transactionHash:i,transactionId:a}).toJSON())}`),new c1({nodeId:t,transactionHash:i,transactionId:a})}_makeSignedTransaction(e){let t=this._makeTransactionBody(e);return this._logger&&this._logger.info(`Transaction Body: ${JSON.stringify(t)}`),{bodyBytes:as.proto.TransactionBody.encode(t).finish(),sigMap:{sigPair:[]}}}_makeTransactionBody(e){return{[this._getTransactionDataCase()]:this._makeTransactionData(),transactionFee:this._maxTransactionFee!=null?this._maxTransactionFee.toTinybars():null,memo:this._transactionMemo,transactionID:this._transactionIds.current._toProtobuf(),nodeAccountID:e!=null?e._toProtobuf():null,transactionValidDuration:{seconds:B8.default.fromNumber(this._transactionValidDuration)}}}_getTransactionDataCase(){throw new Error("not implemented")}_getScheduledTransactionBody(){return{memo:this.transactionMemo,transactionFee:this._maxTransactionFee==null?this._defaultMaxTransactionFee.toTinybars():this._maxTransactionFee.toTinybars(),[this._getTransactionDataCase()]:this._makeTransactionData()}}_makeTransactionData(){throw new Error("not implemented")}_isFrozen(){return this._signOnDemand||this._signedTransactions.length>0||this._transactions.length>0}_requireNotFrozen(){if(this._isFrozen())throw new Error("transaction is immutable; it has at least one signature or has been explicitly frozen")}_requireNotSignOnDemand(){if(this._signOnDemand)throw new Error("Please use `toBytesAsync()` if `signOnDemand` is enabled")}_requireFrozen(){if(!this._isFrozen())throw new Error("transaction must have been frozen before calculating the hash will be stable, try calling `freeze`")}_requireOneNodeAccountId(){if(this._nodeAccountIds.length!=1)throw"transaction did not have exactly one node ID set"}_requestToBytes(e){return as.proto.Transaction.encode(e).finish()}_responseToBytes(e){return as.proto.TransactionResponse.encode(e).finish()}},Bx=[];var CB=Ie(vr(),1);var M8=Ie(Yt(),1),oa=class r{constructor(e,t){this.tokenId=e,this.serial=typeof t=="number"?M8.default.fromNumber(t):t,Object.freeze(this)}static fromString(e){let t=e.split("/").length>1?e.split("/"):e.split("@");for(let a of t)if(a==="")throw new Error("invalid format for NftId: use [token]/[serial] or [token]@[serial]");let n=Oe.fromString(t[0]),i=M8.default.fromString(t[1]);return new r(n,i)}static _fromProtobuf(e){return new r(Oe._fromProtobuf(e.tokenID),e.serialNumber!=null?e.serialNumber:M8.default.ZERO)}static fromBytes(e){return r._fromProtobuf(CB.proto.NftID.decode(e))}_toProtobuf(){return{tokenID:this.tokenId._toProtobuf(),serialNumber:M8.default.fromValue(this.serial!==void 0?this.serial:0)}}toString(){return`${this.tokenId.toString()}/${this.serial.toString()}`}toBytes(){return CB.proto.NftID.encode(this._toProtobuf()).finish()}};var Qze=Ie(Yt(),1);var Qd=class r{constructor(e){this.spenderAccountId=e.spenderAccountId,this.ownerAccountId=e.ownerAccountId,this.amount=e.amount,Object.freeze(this)}static _fromProtobuf(e){return new r({spenderAccountId:ne._fromProtobuf(e.spender),ownerAccountId:e.owner!=null?ne._fromProtobuf(e.owner):null,amount:ze.fromTinybars(e.amount!=null?e.amount:0)})}static _fromGrantedProtobuf(e,t){return new r({spenderAccountId:ne._fromProtobuf(e.spender),ownerAccountId:t,amount:ze.fromTinybars(e.amount!=null?e.amount:0)})}_toProtobuf(){return{owner:this.ownerAccountId!=null?this.ownerAccountId._toProtobuf():null,spender:this.spenderAccountId!=null?this.spenderAccountId._toProtobuf():null,amount:this.amount!=null?this.amount.toTinybars():null}}_validateChecksums(e){this.spenderAccountId!=null&&this.spenderAccountId.validateChecksum(e),this.spenderAccountId!=null&&this.spenderAccountId.validateChecksum(e)}toJSON(){return{ownerAccountId:this.ownerAccountId!=null?this.ownerAccountId.toString():null,spenderAccountId:this.spenderAccountId!=null?this.spenderAccountId.toString():null,amount:this.amount!=null?this.amount.toString():null}}};var kB=Ie(Yt(),1),$d=class r{constructor(e){this.tokenId=e.tokenId,this.spenderAccountId=e.spenderAccountId,this.ownerAccountId=e.ownerAccountId,this.amount=e.amount,Object.freeze(this)}static _fromProtobuf(e){return new r({tokenId:Oe._fromProtobuf(e.tokenId),spenderAccountId:ne._fromProtobuf(e.spender),ownerAccountId:e.owner!=null?ne._fromProtobuf(e.owner):null,amount:e.amount!=null?kB.default.fromValue(e.amount):null})}static _fromGrantedProtobuf(e,t){return new r({tokenId:Oe._fromProtobuf(e.tokenId),spenderAccountId:ne._fromProtobuf(e.spender),ownerAccountId:t,amount:e.amount!=null?kB.default.fromValue(e.amount):null})}_toProtobuf(){return{tokenId:this.tokenId._toProtobuf(),spender:this.spenderAccountId!=null?this.spenderAccountId._toProtobuf():null,owner:this.ownerAccountId!=null?this.ownerAccountId._toProtobuf():null,amount:this.amount}}_validateChecksums(e){this.tokenId.validateChecksum(e),this.ownerAccountId!=null&&this.ownerAccountId.validateChecksum(e),this.spenderAccountId!=null&&this.spenderAccountId.validateChecksum(e)}};var NB=Ie(Yt(),1),Z3=class r{constructor(e){this.tokenId=e.tokenId,this.spenderAccountId=e.spenderAccountId,this.ownerAccountId=e.ownerAccountId,this.serialNumbers=e.serialNumbers,this.allSerials=e.allSerials,this.delegatingSpender=e.delegatingSpender,Object.freeze(this)}static _fromProtobuf(e){let t=e.approvedForAll!=null&&e.approvedForAll.value==!0;return new r({tokenId:Oe._fromProtobuf(e.tokenId),spenderAccountId:e.spender!=null?ne._fromProtobuf(e.spender):null,ownerAccountId:e.owner!=null?ne._fromProtobuf(e.owner):null,serialNumbers:t?null:e.serialNumbers!=null?e.serialNumbers.map(n=>NB.default.fromValue(n)):[],allSerials:t,delegatingSpender:e.delegatingSpender!=null?ne._fromProtobuf(e.delegatingSpender):null})}static _fromGrantedProtobuf(e,t){return new r({tokenId:Oe._fromProtobuf(e.tokenId),spenderAccountId:ne._fromProtobuf(e.spender),ownerAccountId:t,serialNumbers:[],allSerials:null,delegatingSpender:null})}static _fromRemoveProtobuf(e){return new r({tokenId:Oe._fromProtobuf(e.tokenId),spenderAccountId:null,ownerAccountId:e.owner!=null?ne._fromProtobuf(e.owner):null,serialNumbers:e.serialNumbers!=null?e.serialNumbers.map(t=>NB.default.fromValue(t)):[],allSerials:null,delegatingSpender:null})}_toProtobuf(){return{tokenId:this.tokenId._toProtobuf(),spender:this.spenderAccountId!=null?this.spenderAccountId._toProtobuf():null,owner:this.ownerAccountId!=null?this.ownerAccountId._toProtobuf():null,approvedForAll:this.serialNumbers==null?{value:this.allSerials}:null,serialNumbers:this.serialNumbers,delegatingSpender:this.delegatingSpender!=null?this.delegatingSpender._toProtobuf():null}}_validateChecksums(e){this.tokenId.validateChecksum(e),this.ownerAccountId!=null&&this.ownerAccountId.validateChecksum(e),this.spenderAccountId!=null&&this.spenderAccountId.validateChecksum(e)}};var RB=Ie(Yt(),1);var L8=class r extends ke{constructor(e={}){super(),this._hbarApprovals=e.hbarApprovals!=null?e.hbarApprovals:[],this._tokenApprovals=e.tokenApprovals!=null?e.tokenApprovals:[],this._nftApprovals=e.nftApprovals!=null?e.nftApprovals:[]}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoApproveAllowance;return ke._fromProtobufTransactions(new r({hbarApprovals:(s.cryptoAllowances!=null?s.cryptoAllowances:[]).map(c=>Qd._fromProtobuf(c)),tokenApprovals:(s.tokenAllowances!=null?s.tokenAllowances:[]).map(c=>$d._fromProtobuf(c)),nftApprovals:(s.nftAllowances!=null?s.nftAllowances:[]).map(c=>Z3._fromProtobuf(c))}),e,t,n,i,a)}get hbarApprovals(){return this._hbarApprovals}approveHbarAllowance(e,t,n){return this._requireNotFrozen(),this._hbarApprovals.push(new Qd({spenderAccountId:typeof t=="string"?ne.fromString(t):t instanceof _t?ne.fromEvmAddress(0,0,t.toSolidityAddress()):t,ownerAccountId:typeof e=="string"?ne.fromString(e):e instanceof _t?ne.fromEvmAddress(0,0,e.toSolidityAddress()):e,amount:n instanceof ze?n:new ze(n)})),this}addHbarAllowance(e,t){return this._requireNotFrozen(),this._hbarApprovals.push(new Qd({spenderAccountId:typeof e=="string"?ne.fromString(e):e,amount:t instanceof ze?t:new ze(t),ownerAccountId:null})),this}get tokenApprovals(){return this._tokenApprovals}approveTokenAllowance(e,t,n,i){return this._requireNotFrozen(),this._tokenApprovals.push(new $d({tokenId:typeof e=="string"?Oe.fromString(e):e,spenderAccountId:typeof n=="string"?ne.fromString(n):n instanceof _t?ne.fromEvmAddress(0,0,n.toSolidityAddress()):n,ownerAccountId:typeof t=="string"?ne.fromString(t):t instanceof _t?ne.fromEvmAddress(0,0,t.toSolidityAddress()):t,amount:typeof i=="number"?RB.default.fromNumber(i):i})),this}addTokenAllowance(e,t,n){return this._requireNotFrozen(),this._tokenApprovals.push(new $d({tokenId:typeof e=="string"?Oe.fromString(e):e,spenderAccountId:typeof t=="string"?ne.fromString(t):t,amount:typeof n=="number"?RB.default.fromNumber(n):n,ownerAccountId:null})),this}addTokenNftAllowance(e,t){return this._approveTokenNftAllowance(e,null,t,null)}get tokenNftApprovals(){return this._nftApprovals}_approveTokenNftAllowance(e,t,n,i){this._requireNotFrozen();let a=typeof e=="string"?oa.fromString(e):e,o=typeof n=="string"?ne.fromString(n):n instanceof _t?ne.fromEvmAddress(0,0,n.toSolidityAddress()):n,s=!1;for(let c of this._nftApprovals)if(c.tokenId.compare(a.tokenId)===0&&c.spenderAccountId!=null&&c.spenderAccountId.compare(o)===0){c.serialNumbers!=null&&c.serialNumbers.push(a.serial),s=!0;break}return s||this._nftApprovals.push(new Z3({tokenId:a.tokenId,spenderAccountId:o,ownerAccountId:typeof t=="string"?ne.fromString(t):t instanceof _t?ne.fromEvmAddress(0,0,t.toSolidityAddress()):t,serialNumbers:[a.serial],allSerials:!1,delegatingSpender:typeof i=="string"?ne.fromString(i):i})),this}approveTokenNftAllowance(e,t,n){return this._approveTokenNftAllowance(e,t,n,null)}approveTokenNftAllowanceWithDelegatingSpender(e,t,n,i){return this._approveTokenNftAllowance(e,t,n,i)}_approveAllTokenNftAllowance(e,t,n,i){return this._requireNotFrozen(),this._nftApprovals.push(new Z3({tokenId:typeof e=="string"?Oe.fromString(e):e,spenderAccountId:typeof n=="string"?ne.fromString(n):n instanceof _t?ne.fromEvmAddress(0,0,n.toSolidityAddress()):n,ownerAccountId:typeof t=="string"?ne.fromString(t):t instanceof _t?ne.fromEvmAddress(0,0,t.toSolidityAddress()):t,serialNumbers:null,allSerials:i,delegatingSpender:null})),this}addAllTokenNftAllowance(e,t,n){return this._approveAllTokenNftAllowance(e,t,n,!0)}approveTokenNftAllowanceAllSerials(e,t,n){return this._approveAllTokenNftAllowance(e,t,n,!0)}deleteTokenNftAllowanceAllSerials(e,t,n){return this._approveAllTokenNftAllowance(e,t,n,!1)}_validateChecksums(e){this._hbarApprovals.map(t=>t._validateChecksums(e)),this._tokenApprovals.map(t=>t._validateChecksums(e)),this._nftApprovals.map(t=>t._validateChecksums(e))}_execute(e,t){return e.crypto.approveAllowances(t)}_getTransactionDataCase(){return"cryptoApproveAllowance"}_makeTransactionData(){return{cryptoAllowances:this._hbarApprovals.map(e=>e._toProtobuf()),tokenAllowances:this._tokenApprovals.map(e=>e._toProtobuf()),nftAllowances:this._nftApprovals.map(e=>e._toProtobuf())}}_getLogId(){return`AccountAllowanceApproveTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("cryptoApproveAllowance",L8._fromProtobuf);var F8=class r extends ke{constructor(e={}){super(),this._nftAllowances=e.nftAllowances!=null?e.nftAllowances:[]}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoDeleteAllowance;return ke._fromProtobufTransactions(new r({nftAllowances:(s.nftAllowances!=null?s.nftAllowances:[]).map(c=>Z3._fromProtobuf(c))}),e,t,n,i,a)}get tokenNftAllowanceDeletions(){return this._nftAllowances}deleteAllTokenNftAllowances(e,t){this._requireNotFrozen();let n=typeof e=="string"?oa.fromString(e):e,i=typeof t=="string"?ne.fromString(t):t,a=!1;for(let o of this._nftAllowances)if(o.tokenId.compare(n.tokenId)===0){o.serialNumbers!=null&&o.serialNumbers.push(n.serial),a=!0;break}return a||this._nftAllowances.push(new Z3({tokenId:n.tokenId,spenderAccountId:null,serialNumbers:[n.serial],ownerAccountId:i,allSerials:!1,delegatingSpender:null})),this}_validateChecksums(e){this._nftAllowances.map(t=>t._validateChecksums(e))}_execute(e,t){return e.crypto.deleteAllowances(t)}_getTransactionDataCase(){return"cryptoDeleteAllowance"}_makeTransactionData(){return{nftAllowances:this._nftAllowances.map(e=>e._toProtobuf())}}_getLogId(){return`AccountAllowanceDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("cryptoDeleteAllowance",F8._fromProtobuf);var N3e=Ie(Yt(),1);var U8=class extends di{constructor(){super(e=>Oe.fromString(e))}};var q8=class extends di{constructor(){super(e=>Oe.fromString(e))}};var OB=Ie(vr(),1),Em=class r{constructor(e){this.hbars=e.hbars,this.tokens=e.tokens,this.tokenDecimals=e.tokenDecimals,Object.freeze(this)}static fromBytes(e){return r._fromProtobuf(OB.proto.CryptoGetAccountBalanceResponse.decode(e))}static _fromProtobuf(e){let t=new U8,n=new q8;if(e.tokenBalances!=null)for(let i of e.tokenBalances){let a=Oe._fromProtobuf(i.tokenId);n._set(a,i.decimals!=null?i.decimals:0),t._set(a,N3e.default.fromValue(i.balance))}return new r({hbars:ze.fromTinybars(e.balance),tokens:t,tokenDecimals:n})}_toProtobuf(){let e=[];for(let[t,n]of this.tokens!=null?this.tokens:[])e.push({tokenId:t._toProtobuf(),balance:n,decimals:this.tokenDecimals!=null?this.tokenDecimals.get(t):null});return{balance:this.hbars.toTinybars(),tokenBalances:e}}toBytes(){return OB.proto.CryptoGetAccountBalanceResponse.encode(this._toProtobuf()).finish()}toString(){return JSON.stringify(this.toJSON())}toJSON(){let e=[];for(let[t,n]of this.tokens!=null?this.tokens:[]){let i=this.tokenDecimals!=null?this.tokenDecimals.get(t):null;e.push({tokenId:t.toString(),balance:n.toString(),decimals:i??0})}return{hbars:this.hbars.toString(),tokens:e}}};var X3=class r extends xr{constructor(e={}){super(),this._accountId=null,this._contractId=null,e.accountId!=null&&this.setAccountId(e.accountId),e.contractId!=null&&this.setContractId(e.contractId)}static _fromProtobuf(e){let t=e.cryptogetAccountBalance;return new r({accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):void 0,contractId:t.contractID!=null?_t._fromProtobuf(t.contractID):void 0})}get accountId(){return this._accountId}setAccountId(e){return this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get contractId(){return this._contractId}setContractId(e){return this._contractId=typeof e=="string"?_t.fromString(e):e.clone(),this}_isPaymentRequired(){return!1}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e),this._contractId!=null&&this._contractId.validateChecksum(e)}_execute(e,t){return e.crypto.cryptoGetBalance(t)}_mapResponseHeader(e){return e.cryptogetAccountBalance.header}_mapResponse(e,t,n){let i=e.cryptogetAccountBalance;return Promise.resolve(Em._fromProtobuf(i))}_onMakeRequest(e){return{cryptogetAccountBalance:{header:e,accountID:this._accountId!=null?this._accountId._toProtobuf():null,contractID:this._contractId!=null?this._contractId._toProtobuf():null}}}_getLogId(){return`AccountBalanceQuery:${this._timestamp.toString()}`}};Qr.set("cryptogetAccountBalance",X3._fromProtobuf);var OJt=Ie(vr(),1);var DB=Ie(Yt(),1),fr=class r{constructor(e){this.seconds=e instanceof DB.default?e:DB.default.fromNumber(e),Object.freeze(this)}_toProtobuf(){return{seconds:this.seconds}}static _fromProtobuf(e){return new r(e.seconds)}};var PB=Ie(Yt(),1);var j8=class r extends ke{constructor(e={}){super(),this._key=null,this._initialBalance=null,this._sendRecordThreshold=IB,this._receiveRecordThreshold=IB,this._receiverSignatureRequired=!1,this._proxyAccountId=null,this._autoRenewPeriod=new fr(Eu),this._accountMemo=null,this._maxAutomaticTokenAssociations=null,this._stakedAccountId=null,this._stakedNodeId=null,this._declineStakingReward=!1,this._alias=null,e.key!=null&&this.setKey(e.key),e.receiverSignatureRequired!=null&&this.setReceiverSignatureRequired(e.receiverSignatureRequired),e.initialBalance!=null&&this.setInitialBalance(e.initialBalance),e.proxyAccountId!=null&&this.setProxyAccountId(e.proxyAccountId),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.accountMemo!=null&&this.setAccountMemo(e.accountMemo),e.maxAutomaticTokenAssociations!=null&&this.setMaxAutomaticTokenAssociations(e.maxAutomaticTokenAssociations),e.stakedAccountId!=null&&this.setStakedAccountId(e.stakedAccountId),e.stakedNodeId!=null&&this.setStakedNodeId(e.stakedNodeId),e.declineStakingReward!=null&&this.setDeclineStakingReward(e.declineStakingReward),e.alias!=null&&this.setAlias(e.alias)}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoCreateAccount,c;return s.alias!=null&&s.alias.length>0&&s.alias.length===20&&(c=rs.fromBytes(s.alias)),ke._fromProtobufTransactions(new r({key:s.key!=null?rt._fromProtobufKey(s.key):void 0,initialBalance:s.initialBalance!=null?s.initialBalance:void 0,receiverSignatureRequired:s.receiverSigRequired!=null?s.receiverSigRequired:void 0,proxyAccountId:s.proxyAccountID!=null?ne._fromProtobuf(s.proxyAccountID):void 0,autoRenewPeriod:s.autoRenewPeriod!=null&&s.autoRenewPeriod.seconds!=null?s.autoRenewPeriod.seconds:void 0,accountMemo:s.memo!=null?s.memo:void 0,maxAutomaticTokenAssociations:s.maxAutomaticTokenAssociations!=null?s.maxAutomaticTokenAssociations:void 0,stakedAccountId:s.stakedAccountId!=null?ne._fromProtobuf(s.stakedAccountId):void 0,stakedNodeId:s.stakedNodeId!=null?s.stakedNodeId:void 0,declineStakingReward:s.declineReward==!0,alias:c}),e,t,n,i,a)}get key(){return this._key}setKey(e){return this._requireNotFrozen(),this._key=e,this}get initialBalance(){return this._initialBalance}setInitialBalance(e){return this._requireNotFrozen(),this._initialBalance=e instanceof ze?e:new ze(e),this}get receiverSignatureRequired(){return this._receiverSignatureRequired}setReceiverSignatureRequired(e){return this._requireNotFrozen(),this._receiverSignatureRequired=e,this}get proxyAccountId(){return this._proxyAccountId}setProxyAccountId(e){return this._requireNotFrozen(),this._proxyAccountId=e,this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof fr?e:new fr(e),this}get accountMemo(){return this._accountMemo}setAccountMemo(e){return this._requireNotFrozen(),this._accountMemo=e,this}get maxAutomaticTokenAssociations(){return this._maxAutomaticTokenAssociations}setMaxAutomaticTokenAssociations(e){return this._requireNotFrozen(),this._maxAutomaticTokenAssociations=typeof e=="number"?PB.default.fromNumber(e):e,this}get stakedAccountId(){return this._stakedAccountId}setStakedAccountId(e){return this._requireNotFrozen(),this._stakedAccountId=typeof e=="string"?ne.fromString(e):e,this}get stakedNodeId(){return this._stakedNodeId}setStakedNodeId(e){return this._requireNotFrozen(),this._stakedNodeId=PB.default.fromValue(e),this}get declineStakingRewards(){return this._declineStakingReward}setDeclineStakingReward(e){return this._requireNotFrozen(),this._declineStakingReward=e,this}get alias(){return this._alias}setAlias(e){if(typeof e=="string")if(e.startsWith("0x")&&e.length==42||e.length==40)this._alias=rs.fromString(e);else throw new Error('evmAddress must be a valid EVM address with or without "0x" prefix');else this._alias=e;return this}_validateChecksums(e){this._proxyAccountId!=null&&this._proxyAccountId.validateChecksum(e)}_execute(e,t){return e.crypto.createAccount(t)}_getTransactionDataCase(){return"cryptoCreateAccount"}_makeTransactionData(){let e=null;return this._alias!=null&&(e=this._alias.toBytes()),{key:this._key!=null?this._key._toProtobufKey():null,initialBalance:this._initialBalance!=null?this._initialBalance.toTinybars():null,autoRenewPeriod:this._autoRenewPeriod._toProtobuf(),proxyAccountID:this._proxyAccountId!=null?this._proxyAccountId._toProtobuf():null,receiveRecordThreshold:this._receiveRecordThreshold.toTinybars(),sendRecordThreshold:this._sendRecordThreshold.toTinybars(),receiverSigRequired:this._receiverSignatureRequired,memo:this._accountMemo,maxAutomaticTokenAssociations:this._maxAutomaticTokenAssociations!=null?this._maxAutomaticTokenAssociations.toInt():null,stakedAccountId:this.stakedAccountId!=null?this.stakedAccountId._toProtobuf():null,stakedNodeId:this.stakedNodeId,declineReward:this.declineStakingRewards,alias:e}}_getLogId(){return`AccountCreateTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("cryptoCreateAccount",j8._fromProtobuf);var V8=class r extends ke{constructor(e={}){super(),this._accountId=null,this._transferAccountId=null,e.accountId!=null&&this.setAccountId(e.accountId),e.transferAccountId!=null&&this.setTransferAccountId(e.transferAccountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoDelete;return ke._fromProtobufTransactions(new r({accountId:s.deleteAccountID!=null?ne._fromProtobuf(s.deleteAccountID):void 0,transferAccountId:s.transferAccountID!=null?ne._fromProtobuf(s.transferAccountID):void 0}),e,t,n,i,a)}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get transferAccountId(){return this._transferAccountId}setTransferAccountId(e){return this._requireNotFrozen(),this._transferAccountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e),this._transferAccountId!=null&&this._transferAccountId.validateChecksum(e)}_execute(e,t){return e.crypto.cryptoDelete(t)}_getTransactionDataCase(){return"cryptoDelete"}_makeTransactionData(){return{deleteAccountID:this._accountId!=null?this._accountId._toProtobuf():null,transferAccountID:this._transferAccountId!=null?this._transferAccountId._toProtobuf():null}}_getLogId(){return`AccountDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("cryptoDelete",V8._fromProtobuf);var BB=Ie(vr(),1),l1=class r{constructor(e){this.declineStakingReward=e.declineStakingReward,this.stakePeriodStart=e.stakePeriodStart,this.pendingReward=e.pendingReward,this.stakedToMe=e.stakedToMe,this.stakedAccountId=e.stakedAccountId,this.stakedNodeId=e.stakedNodeId,Object.freeze(this)}static _fromProtobuf(e){return new r({declineStakingReward:e.declineReward==!0,stakePeriodStart:e.stakePeriodStart!=null?lt._fromProtobuf(e.stakePeriodStart):null,pendingReward:e.pendingReward!=null?ze.fromTinybars(e.pendingReward):null,stakedToMe:e.stakedToMe!=null?ze.fromTinybars(e.stakedToMe):null,stakedAccountId:e.stakedAccountId!=null?ne._fromProtobuf(e.stakedAccountId):null,stakedNodeId:e.stakedNodeId!=null?e.stakedNodeId:null})}_toProtobuf(){return{declineReward:this.declineStakingReward,stakePeriodStart:this.stakePeriodStart!=null?this.stakePeriodStart._toProtobuf():null,pendingReward:this.pendingReward!=null?this.pendingReward.toTinybars():null,stakedToMe:this.stakedToMe!=null?this.stakedToMe.toTinybars():null,stakedAccountId:this.stakedAccountId!=null?this.stakedAccountId._toProtobuf():null,stakedNodeId:this.stakedNodeId}}static fromBytes(e){return r._fromProtobuf(BB.proto.StakingInfo.decode(e))}toBytes(){return BB.proto.StakingInfo.encode(this._toProtobuf()).finish()}toString(){return JSON.stringify(this.toJSON())}toJSON(){return{declineStakingReward:this.declineStakingReward,stakePeriodStart:this.stakePeriodStart!=null?this.stakePeriodStart.toString():null,pendingReward:this.pendingReward!=null?this.pendingReward.toString():null,stakedToMe:this.stakedToMe!=null?this.stakedToMe.toString():null,stakedAccountId:this.stakedAccountId!=null?this.stakedAccountId.toString():null,stakedNodeId:this.stakedNodeId!=null?this.stakedNodeId.toString():null}}};var Of=class r{constructor(e){this.accountId=e.accountId,this.hash=e.hash,this.keys=e.keys,this.duration=e.duration,Object.freeze(this)}static _fromProtobuf(e){let t=e;return new r({accountId:ne._fromProtobuf(t.accountId),hash:t.hash!=null?t.hash:new Uint8Array,keys:t.keys!=null?Ri.__fromProtobufKeyList(t.keys):new Ri,duration:fr._fromProtobuf(t.duration)})}_toProtobuf(){return{accountId:this.accountId._toProtobuf(),hash:this.hash,keys:this.keys._toProtobufKey().keyList,duration:this.duration._toProtobuf()}}};var d1=Ie(Yt(),1);var Mx=Ie(Yt(),1);var H8=class r{constructor(e){this.tokenId=e.tokenId,this.symbol=e.symbol,this.balance=e.balance,this.isKycGranted=e.isKycGranted,this.isFrozen=e.isFrozen,this.automaticAssociation=e.automaticAssociation,Object.freeze(this)}static _fromProtobuf(e){let t=Oe._fromProtobuf(e.tokenId),n=e.kycStatus==null||e.kycStatus===0?null:e.kycStatus===1,i=e.freezeStatus==null||e.freezeStatus===0?null:e.freezeStatus===1;return new r({tokenId:t,symbol:e.symbol,balance:e.balance!=null?e.balance instanceof Mx.default?e.balance:Mx.default.fromValue(e.balance):Mx.default.ZERO,isKycGranted:n,isFrozen:i,automaticAssociation:e.automaticAssociation!=null?e.automaticAssociation:null})}_toProtobuf(){return{tokenId:this.tokenId._toProtobuf(),symbol:this.symbol,balance:this.balance,kycStatus:this.isKycGranted==null?0:this.isKycGranted?1:2,freezeStatus:this.isFrozen==null?0:this.isFrozen?1:2,automaticAssociation:this.automaticAssociation}}};var u1=class r extends di{constructor(){super(e=>Oe.fromString(e))}static _fromProtobuf(e){let t=new r;for(let n of e){let i=Oe._fromProtobuf(n.tokenId);t._set(i,H8._fromProtobuf(n))}return t}_toProtobuf(){let e=[];for(let[t,n]of this)e.push(n._toProtobuf());return e}};var K8=Ie(vr(),1);var mr=class r{constructor(e){this._ledgerId=e,Object.freeze(this)}static fromString(e){switch(e){case ec[0]:case"0":return r.MAINNET;case ec[1]:case"1":return r.TESTNET;case ec[2]:case"2":return r.PREVIEWNET;case ec[3]:case"3":return r.LOCAL_NODE;default:{let t=et(e);if(t.length==0&&e.length!=0)throw new Error("Default reached for fromString");return new r(t)}}}toString(){if(this._ledgerId.length==1)switch(this._ledgerId[0]){case 0:return ec[0];case 1:return ec[1];case 2:return ec[2];case 3:return ec[3];default:return He(this._ledgerId)}else return He(this._ledgerId)}static fromBytes(e){return new r(e)}toBytes(){return this._ledgerId}isMainnet(){return this.toString()==ec[0]}isTestnet(){return this.toString()==ec[1]}isPreviewnet(){return this.toString()==ec[2]}isLocalNode(){return this.toString()==ec[3]}},ec=["mainnet","testnet","previewnet","local-node"];mr.MAINNET=new mr(new Uint8Array([0]));mr.TESTNET=new mr(new Uint8Array([1]));mr.PREVIEWNET=new mr(new Uint8Array([2]));mr.LOCAL_NODE=new mr(new Uint8Array([3]));var xm=class r{constructor(e){this.accountId=e.accountId,this.contractAccountId=e.contractAccountId,this.isDeleted=e.isDeleted,this.proxyAccountId=e.proxyAccountId,this.proxyReceived=e.proxyReceived,this.key=e.key,this.balance=e.balance,this.sendRecordThreshold=e.sendRecordThreshold,this.receiveRecordThreshold=e.receiveRecordThreshold,this.isReceiverSignatureRequired=e.isReceiverSignatureRequired,this.expirationTime=e.expirationTime,this.autoRenewPeriod=e.autoRenewPeriod,this.liveHashes=e.liveHashes,this.tokenRelationships=e.tokenRelationships,this.accountMemo=e.accountMemo,this.ownedNfts=e.ownedNfts,this.maxAutomaticTokenAssociations=e.maxAutomaticTokenAssociations,this.aliasKey=e.aliasKey,this.ledgerId=e.ledgerId,this.hbarAllowances=e.hbarAllowances,this.tokenAllowances=e.tokenAllowances,this.nftAllowances=e.nftAllowances,this.ethereumNonce=e.ethereumNonce,this.stakingInfo=e.stakingInfo,Object.freeze(this)}static _fromProtobuf(e){let t=e.alias!=null&&e.alias.length>0?rt._fromProtobufKey(K8.proto.Key.decode(e.alias)):null;t instanceof Xn||(t=null);let n=ne._fromProtobuf(e.accountID);return new r({accountId:n,contractAccountId:e.contractAccountID!=null?e.contractAccountID:null,isDeleted:e.deleted!=null?e.deleted:!1,key:rt._fromProtobufKey(e.key),balance:ze.fromTinybars(e.balance!=null?e.balance:0),sendRecordThreshold:ze.fromTinybars(e.generateSendRecordThreshold!=null?e.generateSendRecordThreshold:0),receiveRecordThreshold:ze.fromTinybars(e.generateReceiveRecordThreshold!=null?e.generateReceiveRecordThreshold:0),isReceiverSignatureRequired:e.receiverSigRequired!=null?e.receiverSigRequired:!1,expirationTime:lt._fromProtobuf(e.expirationTime),autoRenewPeriod:e.autoRenewPeriod!=null?new fr(e.autoRenewPeriod.seconds):new fr(0),proxyAccountId:e.proxyAccountID!=null&&d1.default.fromValue(e.proxyAccountID.shardNum).toInt()!==0&&d1.default.fromValue(e.proxyAccountID.realmNum).toInt()!==0&&d1.default.fromValue(e.proxyAccountID.accountNum).toInt()!==0?ne._fromProtobuf(e.proxyAccountID):null,proxyReceived:ze.fromTinybars(e.proxyReceived!=null?e.proxyReceived:0),liveHashes:(e.liveHashes!=null?e.liveHashes:[]).map(i=>Of._fromProtobuf(i)),tokenRelationships:u1._fromProtobuf(e.tokenRelationships!=null?e.tokenRelationships:[]),accountMemo:e.memo!=null?e.memo:"",ownedNfts:e.ownedNfts?e.ownedNfts:d1.default.ZERO,maxAutomaticTokenAssociations:e.maxAutomaticTokenAssociations?d1.default.fromNumber(e.maxAutomaticTokenAssociations):d1.default.ZERO,aliasKey:t,ledgerId:e.ledgerId!=null?mr.fromBytes(e.ledgerId):null,hbarAllowances:[],tokenAllowances:[],nftAllowances:[],ethereumNonce:e.ethereumNonce!=null?e.ethereumNonce:null,stakingInfo:e.stakingInfo!=null?l1._fromProtobuf(e.stakingInfo):null})}_toProtobuf(){return{accountID:this.accountId._toProtobuf(),contractAccountID:this.contractAccountId,deleted:this.isDeleted,proxyAccountID:this.proxyAccountId!=null?this.proxyAccountId._toProtobuf():null,proxyReceived:this.proxyReceived.toTinybars(),key:this.key._toProtobufKey(),balance:this.balance.toTinybars(),generateSendRecordThreshold:this.sendRecordThreshold.toTinybars(),generateReceiveRecordThreshold:this.receiveRecordThreshold.toTinybars(),receiverSigRequired:this.isReceiverSignatureRequired,expirationTime:this.expirationTime._toProtobuf(),autoRenewPeriod:this.autoRenewPeriod._toProtobuf(),liveHashes:this.liveHashes.map(e=>e._toProtobuf()),tokenRelationships:this.tokenRelationships!=null?this.tokenRelationships._toProtobuf():null,memo:this.accountMemo,ownedNfts:this.ownedNfts,maxAutomaticTokenAssociations:this.maxAutomaticTokenAssociations.toInt(),alias:this.aliasKey!=null?K8.proto.Key.encode(this.aliasKey._toProtobufKey()).finish():null,ledgerId:this.ledgerId!=null?this.ledgerId.toBytes():null,ethereumNonce:this.ethereumNonce,stakingInfo:this.stakingInfo!=null?this.stakingInfo._toProtobuf():null}}static fromBytes(e){return r._fromProtobuf(K8.proto.CryptoGetInfoResponse.AccountInfo.decode(e))}toBytes(){return K8.proto.CryptoGetInfoResponse.AccountInfo.encode(this._toProtobuf()).finish()}toString(){return JSON.stringify(this.toJSON())}toJSON(){return{balance:this.balance.toString(),accountId:this.accountId.toString(),contractAccountId:this.contractAccountId,isDeleted:this.isDeleted,proxyAccountId:this.proxyAccountId!=null?this.proxyAccountId.toString():null,proxyReceived:this.proxyReceived.toString(),key:this.key!=null?this.key.toString():null,sendRecordThreshold:this.sendRecordThreshold.toString(),receiveRecordThreshold:this.receiveRecordThreshold.toString(),isReceiverSignatureRequired:this.isReceiverSignatureRequired,expirationTime:this.expirationTime.toString(),autoRenewPeriod:this.autoRenewPeriod.toString(),accountMemo:this.accountMemo,ownedNfts:this.ownedNfts.toString(),maxAutomaticTokenAssociations:this.maxAutomaticTokenAssociations.toString(),aliasKey:this.aliasKey!=null?this.aliasKey.toString():null,ledgerId:this.ledgerId!=null?this.ledgerId.toString():null,ethereumNonce:this.ethereumNonce!=null?this.ethereumNonce.toString():null,stakingInfo:this.stakingInfo!=null?this.stakingInfo.toJSON():null}}};var ol=class r extends xr{constructor(e={}){super(),this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e){let t=e.cryptoGetInfo;return new r({accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):void 0})}get accountId(){return this._accountId}setAccountId(e){return this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.crypto.getAccountInfo(t)}async getCost(e){return super.getCost(e)}_mapResponseHeader(e){return e.cryptoGetInfo.header}_mapResponse(e,t,n){let i=e.cryptoGetInfo;return Promise.resolve(xm._fromProtobuf(i.accountInfo))}_onMakeRequest(e){return{cryptoGetInfo:{header:e,accountID:this._accountId!=null?this._accountId._toProtobuf():null}}}_getLogId(){return`AccountInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("cryptoGetInfo",ol._fromProtobuf);var xu=class r extends xr{constructor(e={}){super(),this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e){let t=e.cryptoGetAccountRecords;return new r({accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):void 0})}get accountId(){return this._accountId}setAccountId(e){return this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.crypto.getAccountRecords(t)}_mapResponseHeader(e){return e.cryptoGetAccountRecords.header}_mapResponse(e,t,n){let a=e.cryptoGetAccountRecords.records;return Promise.resolve(a.map(o=>_u._fromProtobuf({transactionRecord:o})))}_onMakeRequest(e){return{cryptoGetAccountRecords:{header:e,accountID:this._accountId!=null?this._accountId._toProtobuf():null}}}_getLogId(){return`AccountRecordsQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("cryptoGetAccountRecords",xu._fromProtobuf);var Am=class r{constructor(e){this.accountId=e.accountId,this.amount=e.amount instanceof ze?e.amount:new ze(e.amount),Object.freeze(this)}static _fromProtobuf(e){return new r({accountId:ne._fromProtobuf(e.accountID),amount:ze.fromTinybars(e.amount!=null?e.amount:0)})}_toProtobuf(){return{accountID:this.accountId._toProtobuf(),amount:this.amount.toTinybars()}}};var z8=class r extends xr{constructor(e={}){super(),this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e){let t=e.cryptoGetProxyStakers;return new r({accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):void 0})}get accountId(){return this._accountId}setAccountId(e){return this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.crypto.getStakersByAccountID(t)}_mapResponseHeader(e){return e.cryptoGetProxyStakers.header}_mapResponse(e){let n=e.cryptoGetProxyStakers.stakers;return Promise.resolve((n.proxyStaker!=null?n.proxyStaker:[]).map(i=>Am._fromProtobuf(i)))}_onMakeRequest(e){return{cryptoGetProxyStakers:{header:e,accountID:this._accountId!=null?this._accountId._toProtobuf():null}}}_getLogId(){return`AccountStakersQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("cryptoGetProxyStakers",z8._fromProtobuf);var G8=Ie(Yt(),1);var W8=class r extends ke{constructor(e={}){super(),this._accountId=null,this._key=null,this._receiverSignatureRequired=!1,this._proxyAccountId=null,this._autoRenewPeriod=null,this._expirationTime=null,this._accountMemo=null,this._maxAutomaticTokenAssociations=null,this._aliasKey=null,this._stakedAccountId=null,this._stakedNodeId=null,this._declineStakingReward=null,e.accountId!=null&&this.setAccountId(e.accountId),e.key!=null&&this.setKey(e.key),e.receiverSignatureRequired!=null&&this.setReceiverSignatureRequired(e.receiverSignatureRequired),e.proxyAccountId!=null&&this.setProxyAccountId(e.proxyAccountId),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime),e.accountMemo!=null&&this.setAccountMemo(e.accountMemo),e.maxAutomaticTokenAssociations!=null&&this.setMaxAutomaticTokenAssociations(e.maxAutomaticTokenAssociations),e.stakedAccountId!=null&&this.setStakedAccountId(e.stakedAccountId),e.stakedNodeId!=null&&this.setStakedNodeId(e.stakedNodeId),e.declineStakingReward!=null&&this.setDeclineStakingReward(e.declineStakingReward)}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoUpdateAccount;return ke._fromProtobufTransactions(new r({accountId:s.accountIDToUpdate!=null?ne._fromProtobuf(s.accountIDToUpdate):void 0,key:s.key!=null?rt._fromProtobufKey(s.key):void 0,receiverSignatureRequired:s.receiverSigRequired!=null?s.receiverSigRequired:void 0,proxyAccountId:s.proxyAccountID!=null?ne._fromProtobuf(s.proxyAccountID):void 0,autoRenewPeriod:s.autoRenewPeriod!=null&&s.autoRenewPeriod.seconds!=null?s.autoRenewPeriod.seconds:void 0,expirationTime:s.expirationTime!=null?lt._fromProtobuf(s.expirationTime):void 0,accountMemo:s.memo!=null&&s.memo.value!=null?s.memo.value:void 0,maxAutomaticTokenAssociations:s.maxAutomaticTokenAssociations!=null&&s.maxAutomaticTokenAssociations.value!=null?G8.default.fromNumber(s.maxAutomaticTokenAssociations.value):void 0,stakedAccountId:s.stakedAccountId!=null?ne._fromProtobuf(s.stakedAccountId):void 0,stakedNodeId:s.stakedNodeId!=null?s.stakedNodeId:void 0,declineStakingReward:s.declineReward!=null&&!!s.declineReward}),e,t,n,i,a)}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get key(){return this._key}setKey(e){return this._requireNotFrozen(),this._key=e,this}get receiverSignatureRequired(){return this._receiverSignatureRequired}setReceiverSignatureRequired(e){return this._requireNotFrozen(),this._receiverSignatureRequired=e,this}get proxyAccountId(){return this._proxyAccountId}setProxyAccountId(e){return this._requireNotFrozen(),this._proxyAccountId=e,this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof fr?e:new fr(e),this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof Date?lt.fromDate(e):e,this}get accountMemo(){return this._accountMemo}setAccountMemo(e){return this._requireNotFrozen(),this._accountMemo=e,this}clearAccountMemo(){return this._requireNotFrozen(),this._accountMemo=null,this}get maxAutomaticTokenAssociations(){return this._maxAutomaticTokenAssociations}setMaxAutomaticTokenAssociations(e){return this._requireNotFrozen(),this._maxAutomaticTokenAssociations=typeof e=="number"?G8.default.fromNumber(e):e,this}get aliasKey(){return null}setAliasKey(e){return this}get stakedAccountId(){return this._stakedAccountId}setStakedAccountId(e){return this._requireNotFrozen(),this._stakedAccountId=typeof e=="string"?ne.fromString(e):e,this}clearStakedAccountId(){return this._requireNotFrozen(),this._stakedAccountId=new ne(0,0,0),this}get stakedNodeId(){return this._stakedNodeId}setStakedNodeId(e){return this._requireNotFrozen(),this._stakedNodeId=G8.default.fromValue(e),this}clearStakedNodeId(){return this._requireNotFrozen(),this._stakedNodeId=G8.default.fromNumber(-1),this}get declineStakingRewards(){return this._declineStakingReward}setDeclineStakingReward(e){return this._requireNotFrozen(),this._declineStakingReward=e,this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e),this._proxyAccountId!=null&&this._proxyAccountId.validateChecksum(e)}_execute(e,t){return e.crypto.updateAccount(t)}_getTransactionDataCase(){return"cryptoUpdateAccount"}_makeTransactionData(){return{accountIDToUpdate:this._accountId!=null?this._accountId._toProtobuf():null,key:this._key!=null?this._key._toProtobufKey():null,expirationTime:this._expirationTime!=null?this._expirationTime._toProtobuf():null,proxyAccountID:this._proxyAccountId!=null?this._proxyAccountId._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod!=null?this._autoRenewPeriod._toProtobuf():null,receiverSigRequiredWrapper:this._receiverSignatureRequired==null?null:{value:this._receiverSignatureRequired},memo:this._accountMemo!=null?{value:this._accountMemo}:null,maxAutomaticTokenAssociations:this._maxAutomaticTokenAssociations!=null?{value:this._maxAutomaticTokenAssociations.toInt()}:null,stakedAccountId:this.stakedAccountId!=null?this.stakedAccountId._toProtobuf():null,stakedNodeId:this.stakedNodeId,declineReward:this.declineStakingRewards!=null?{value:this.declineStakingRewards}:null}}_getLogId(){return`AccountUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("cryptoUpdateAccount",W8._fromProtobuf);var Tm=class{constructor(e={}){this._left=null,e.left!=null&&this.setLeft(e.left),this._right=null,e.right!=null&&this.setRight(e.right)}get left(){return this._left}setLeft(e){return this._left=e,this}get right(){return this._right}setRight(e){return this._right=e,this}toString(){return this._left!=null&&this._right!=null?`${this._left.toString()}.${this._right.toString()}`:""}};var Q8=class r{constructor(e={}){this._network=null,e.network!=null&&this.setNetwork(e.network),this._host=null,e.host!=null&&this.setHost(e.host)}get newtork(){return this._network}setNetwork(e){return this._network=e,this}get host(){return this._host}setHost(e){return this._host=e,this}static _fromProtobuf(e){return new r({network:new Tm().setLeft(e[0]).setRight(e[1]),host:new Tm().setLeft(e[2]).setRight(e[3])})}_toProtobuf(){return Uint8Array.of(this._network!=null&&this._network._left!=null?this._network._left:0,this._network!=null&&this._network.right!=null?this._network.right:0,this._host!=null&&this._host.left!=null?this._host.left:0,this._host!=null&&this._host.right!=null?this._host.right:0)}toString(){return this._network!=null&&this._host!=null?`${this._network.toString()}.${this._host.toString()}`:""}};var $8=class r{constructor(e={}){this._address=null,e.address!=null&&this.setAddress(e.address),this._port=null,e.port!=null&&this.setPort(e.port)}get address(){return this.address}setAddress(e){return this._address=e,this}get port(){return this._port}setPort(e){return this._port=e,this}static _fromProtobuf(e){return new r({address:e.ipAddressV4!=null?Q8._fromProtobuf(e.ipAddressV4):void 0,port:e.port!=null?e.port:void 0})}_toProtobuf(){return{ipAddressV4:this._address!=null?this._address._toProtobuf():null,port:this._port}}toString(){return`${this._address!=null?this._address.toString():""}:${this._port!=null?this._port.toString():""}`}toJSON(){return{address:this._address!=null?this._address.toString():null,port:this._port!=null?this._port.toString():null}}};var f1=class r{constructor(e={}){this._publicKey=null,e.publicKey!=null&&this.setPublicKey(e.publicKey),this._nodeId=null,e.nodeId!=null&&this.setNodeId(e.nodeId),this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId),this._certHash=null,e.certHash!=null&&this.setCertHash(e.certHash),this._addresses=[],e.addresses!=null&&this.setAddresses(e.addresses),this._description=null,e.description!=null&&this.setDescription(e.description),this._stake=null,e.stake!=null&&this.setStake(e.stake)}get publicKey(){return this._publicKey}setPublicKey(e){return this._publicKey=e,this}get nodeId(){return this._nodeId}setNodeId(e){return this._nodeId=e,this}get accountId(){return this._accountId}setAccountId(e){return this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get certHash(){return this._certHash}setCertHash(e){return this._certHash=e,this}get addresses(){return this._addresses}setAddresses(e){return this._addresses=e,this}get description(){return this._description}setDescription(e){return this._description=e,this}get stake(){return this._stake}setStake(e){return this._stake=e,this}static _fromProtobuf(e){return new r({publicKey:e.RSA_PubKey!=null?e.RSA_PubKey:void 0,nodeId:e.nodeId!=null?e.nodeId:void 0,accountId:e.nodeAccountId!=null?ne._fromProtobuf(e.nodeAccountId):void 0,certHash:e.nodeCertHash!=null?e.nodeCertHash:void 0,addresses:e.serviceEndpoint!=null?e.serviceEndpoint.map(t=>$8._fromProtobuf(t)):void 0,description:e.description!=null?e.description:void 0,stake:e.stake!=null?e.stake:void 0})}_toProtobuf(){return{RSA_PubKey:this._publicKey,nodeId:this._nodeId,nodeAccountId:this._accountId!=null?this._accountId._toProtobuf():null,nodeCertHash:this._certHash,serviceEndpoint:this._addresses.map(e=>e._toProtobuf()),description:this._description,stake:this._stake}}toString(){return JSON.stringify(this.toJSON())}toJSON(){return{publicKey:this._publicKey,nodeId:this._nodeId!=null?this._nodeId.toString():null,accountId:this._accountId!=null?this._accountId.toString():null,certHash:this._certHash!=null?y8(this._certHash):null,addresses:this._addresses.map(e=>e.toJSON()),description:this._description,stake:this._stake!=null?this._stake.toString():null}}};var MB=Ie(vr(),1),i3=class r{constructor(e={}){this._nodeAddresses=[],e.nodeAddresses!=null&&this.setNodeAddresses(e.nodeAddresses)}get nodeAddresses(){return this._nodeAddresses}setNodeAddresses(e){return this._nodeAddresses=e,this}static fromBytes(e){return r._fromProtobuf(MB.proto.NodeAddressBook.decode(e))}static _fromProtobuf(e){return new r({nodeAddresses:e.nodeAddress!=null?e.nodeAddress.map(t=>f1._fromProtobuf(t)):void 0})}_toProtobuf(){return{nodeAddress:this._nodeAddresses.map(e=>e._toProtobuf())}}toString(){return JSON.stringify(this.toJSON())}toJSON(){return{nodeAddresses:this._nodeAddresses.map(e=>e.toJSON())}}toBytes(){return MB.proto.NodeAddressBook.encode(this._toProtobuf()).finish()}};var Lx=Ie(vr(),1);var Y8=class extends xr{constructor(e={}){super(),this._fileId=null,e.fileId!=null&&this.setFileId(e.fileId),this._limit=null,e.limit!=null&&this.setLimit(e.limit),this._retryHandler=t=>{if(t!=null){if(t instanceof Error)return!0;switch(t.code){case 13:return HE.test(t.details.toString());case 5:case 8:case 14:case 17:return!0;default:return!1}}return!1},this._addresses=[],this._attempt=0}get fileId(){return this._fileId}setFileId(e){return this._fileId=typeof e=="string"?zt.fromString(e):e.clone(),this}get limit(){return this._limit}setLimit(e){return this._limit=e,this}setMaxAttempts(e){return this._maxAttempts=e,this}setMaxBackoff(e){return this._maxBackoff=e,this}execute(e,t){return new Promise((n,i)=>{this._makeServerStreamRequest(e,n,i,t)})}_makeServerStreamRequest(e,t,n,i){let a=Lx.com.hedera.mirror.api.proto.AddressBookQuery.encode({fileId:this._fileId!=null?this._fileId._toProtobuf():null,limit:this._limit}).finish();e._mirrorNetwork.getNextMirrorNode().getChannel().makeServerStreamRequest("NetworkService","getNodes",a,o=>{this._addresses.push(f1._fromProtobuf(Lx.proto.NodeAddress.decode(o))),this._limit!=null&&this._limit>0&&(this._limit=this._limit-1)},o=>{let s=o instanceof Error?o.message:o.details;if(this._attempt<this._maxAttempts&&!e.isClientShutDown&&this._retryHandler(o)){let c=Math.min(250*2**this._attempt,this._maxBackoff);this._attempt>=this._maxAttempts&&console.warn(`Error getting nodes from mirror for file ${this._fileId!=null?this._fileId.toString():"UNKNOWN"} during attempt ${this._attempt}. Waiting ${c} ms before next attempt: ${s}`),this._logger&&this._logger.debug(`Error getting nodes from mirror for file ${this._fileId!=null?this._fileId.toString():"UNKNOWN"} during attempt ${this._attempt}. Waiting ${c} ms before next attempt: ${s}`),this._attempt+=1,setTimeout(()=>{this._makeServerStreamRequest(e,t,n,i)},c)}else n(new Error("failed to query address book"))},()=>{t(new i3({nodeAddresses:this._addresses}))})}};ir.setAddressBookQueryConstructor(()=>new Y8);var J8=class r extends xr{constructor(e={}){super(),this._contractId=null,e.contractId!=null&&this.setContractId(e.contractId)}static _fromProtobuf(e){let t=e.contractGetBytecode;return new r({contractId:t.contractID!=null?_t._fromProtobuf(t.contractID):void 0})}get contractId(){return this._contractId}setContractId(e){return this._contractId=typeof e=="string"?_t.fromString(e):e.clone(),this}_validateChecksums(e){this._contractId!=null&&this._contractId.validateChecksum(e)}_execute(e,t){return e.smartContract.contractGetBytecode(t)}_mapResponseHeader(e){return e.contractGetBytecodeResponse.header}_mapResponse(e){let t=e.contractGetBytecodeResponse;return Promise.resolve(t.bytecode!=null?t.bytecode:new Uint8Array)}_onMakeRequest(e){return{contractGetBytecode:{header:e,contractID:this._contractId!=null?this._contractId._toProtobuf():null}}}_getLogId(){return`ContractByteCodeQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("contractGetBytecode",J8._fromProtobuf);var Df="0123456789abcdef".split(""),$ze=[1,256,65536,16777216],sl=[0,8,16,24],R3e=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],Yze=r=>({blocks:[],reset:!0,block:0,start:0,blockCount:1600-(r<<1)>>5,outputBlocks:r>>5,s:(e=>[].concat(e,e,e,e,e))([0,0,0,0,0,0,0,0,0,0])}),Jze=(r,e)=>{for(var t=e.length,n=r.blocks,i=r.blockCount<<2,a=r.blockCount,o=r.outputBlocks,s=r.s,c=0,l,u;c<t;){if(r.reset)for(r.reset=!1,n[0]=r.block,l=1;l<a+1;++l)n[l]=0;if(typeof e!="string")for(l=r.start;c<t&&l<i;++c)n[l>>2]|=e[c]<<sl[l++&3];else for(l=r.start;c<t&&l<i;++c)u=e.charCodeAt(c),u<128?n[l>>2]|=u<<sl[l++&3]:u<2048?(n[l>>2]|=(192|u>>6)<<sl[l++&3],n[l>>2]|=(128|u&63)<<sl[l++&3]):u<55296||u>=57344?(n[l>>2]|=(224|u>>12)<<sl[l++&3],n[l>>2]|=(128|u>>6&63)<<sl[l++&3],n[l>>2]|=(128|u&63)<<sl[l++&3]):(u=65536+((u&1023)<<10|e.charCodeAt(++c)&1023),n[l>>2]|=(240|u>>18)<<sl[l++&3],n[l>>2]|=(128|u>>12&63)<<sl[l++&3],n[l>>2]|=(128|u>>6&63)<<sl[l++&3],n[l>>2]|=(128|u&63)<<sl[l++&3]);if(r.lastByteIndex=l,l>=i){for(r.start=l-i,r.block=n[a],l=0;l<a;++l)s[l]^=n[l];LB(s),r.reset=!0}else r.start=l}if(l=r.lastByteIndex,n[l>>2]|=$ze[l&3],r.lastByteIndex===i)for(n[0]=n[a],l=1;l<a+1;++l)n[l]=0;for(n[a-1]|=2147483648,l=0;l<a;++l)s[l]^=n[l];LB(s);var d="",h,g=0;for(l=0;g<o;){for(l=0;l<a&&g<o;++l,++g)h=s[l],d+=Df[h>>4&15]+Df[h&15]+Df[h>>12&15]+Df[h>>8&15]+Df[h>>20&15]+Df[h>>16&15]+Df[h>>28&15]+Df[h>>24&15];g%a===0&&(LB(s),l=0)}return"0x"+d},LB=r=>{var e,t,n,i,a,o,s,c,l,u,d,h,g,m,b,E,I,R,L,U,V,G,H,N,F,O,y,x,w,p,v,A,T,S,_,B,q,k,z,ie,M,te,oe,se,re,le,ae,ue,_e,he,be,pn,it,ht,Gn,Et,Tt,yi,At,St,ci,It,Ct;for(n=0;n<48;n+=2)i=r[0]^r[10]^r[20]^r[30]^r[40],a=r[1]^r[11]^r[21]^r[31]^r[41],o=r[2]^r[12]^r[22]^r[32]^r[42],s=r[3]^r[13]^r[23]^r[33]^r[43],c=r[4]^r[14]^r[24]^r[34]^r[44],l=r[5]^r[15]^r[25]^r[35]^r[45],u=r[6]^r[16]^r[26]^r[36]^r[46],d=r[7]^r[17]^r[27]^r[37]^r[47],h=r[8]^r[18]^r[28]^r[38]^r[48],g=r[9]^r[19]^r[29]^r[39]^r[49],e=h^(o<<1|s>>>31),t=g^(s<<1|o>>>31),r[0]^=e,r[1]^=t,r[10]^=e,r[11]^=t,r[20]^=e,r[21]^=t,r[30]^=e,r[31]^=t,r[40]^=e,r[41]^=t,e=i^(c<<1|l>>>31),t=a^(l<<1|c>>>31),r[2]^=e,r[3]^=t,r[12]^=e,r[13]^=t,r[22]^=e,r[23]^=t,r[32]^=e,r[33]^=t,r[42]^=e,r[43]^=t,e=o^(u<<1|d>>>31),t=s^(d<<1|u>>>31),r[4]^=e,r[5]^=t,r[14]^=e,r[15]^=t,r[24]^=e,r[25]^=t,r[34]^=e,r[35]^=t,r[44]^=e,r[45]^=t,e=c^(h<<1|g>>>31),t=l^(g<<1|h>>>31),r[6]^=e,r[7]^=t,r[16]^=e,r[17]^=t,r[26]^=e,r[27]^=t,r[36]^=e,r[37]^=t,r[46]^=e,r[47]^=t,e=u^(i<<1|a>>>31),t=d^(a<<1|i>>>31),r[8]^=e,r[9]^=t,r[18]^=e,r[19]^=t,r[28]^=e,r[29]^=t,r[38]^=e,r[39]^=t,r[48]^=e,r[49]^=t,m=r[0],b=r[1],le=r[11]<<4|r[10]>>>28,ae=r[10]<<4|r[11]>>>28,x=r[20]<<3|r[21]>>>29,w=r[21]<<3|r[20]>>>29,St=r[31]<<9|r[30]>>>23,ci=r[30]<<9|r[31]>>>23,te=r[40]<<18|r[41]>>>14,oe=r[41]<<18|r[40]>>>14,S=r[2]<<1|r[3]>>>31,_=r[3]<<1|r[2]>>>31,E=r[13]<<12|r[12]>>>20,I=r[12]<<12|r[13]>>>20,ue=r[22]<<10|r[23]>>>22,_e=r[23]<<10|r[22]>>>22,p=r[33]<<13|r[32]>>>19,v=r[32]<<13|r[33]>>>19,It=r[42]<<2|r[43]>>>30,Ct=r[43]<<2|r[42]>>>30,ht=r[5]<<30|r[4]>>>2,Gn=r[4]<<30|r[5]>>>2,B=r[14]<<6|r[15]>>>26,q=r[15]<<6|r[14]>>>26,R=r[25]<<11|r[24]>>>21,L=r[24]<<11|r[25]>>>21,he=r[34]<<15|r[35]>>>17,be=r[35]<<15|r[34]>>>17,A=r[45]<<29|r[44]>>>3,T=r[44]<<29|r[45]>>>3,N=r[6]<<28|r[7]>>>4,F=r[7]<<28|r[6]>>>4,Et=r[17]<<23|r[16]>>>9,Tt=r[16]<<23|r[17]>>>9,k=r[26]<<25|r[27]>>>7,z=r[27]<<25|r[26]>>>7,U=r[36]<<21|r[37]>>>11,V=r[37]<<21|r[36]>>>11,pn=r[47]<<24|r[46]>>>8,it=r[46]<<24|r[47]>>>8,se=r[8]<<27|r[9]>>>5,re=r[9]<<27|r[8]>>>5,O=r[18]<<20|r[19]>>>12,y=r[19]<<20|r[18]>>>12,yi=r[29]<<7|r[28]>>>25,At=r[28]<<7|r[29]>>>25,ie=r[38]<<8|r[39]>>>24,M=r[39]<<8|r[38]>>>24,G=r[48]<<14|r[49]>>>18,H=r[49]<<14|r[48]>>>18,r[0]=m^~E&R,r[1]=b^~I&L,r[10]=N^~O&x,r[11]=F^~y&w,r[20]=S^~B&k,r[21]=_^~q&z,r[30]=se^~le&ue,r[31]=re^~ae&_e,r[40]=ht^~Et&yi,r[41]=Gn^~Tt&At,r[2]=E^~R&U,r[3]=I^~L&V,r[12]=O^~x&p,r[13]=y^~w&v,r[22]=B^~k&ie,r[23]=q^~z&M,r[32]=le^~ue&he,r[33]=ae^~_e&be,r[42]=Et^~yi&St,r[43]=Tt^~At&ci,r[4]=R^~U&G,r[5]=L^~V&H,r[14]=x^~p&A,r[15]=w^~v&T,r[24]=k^~ie&te,r[25]=z^~M&oe,r[34]=ue^~he&pn,r[35]=_e^~be&it,r[44]=yi^~St&It,r[45]=At^~ci&Ct,r[6]=U^~G&m,r[7]=V^~H&b,r[16]=p^~A&N,r[17]=v^~T&F,r[26]=ie^~te&S,r[27]=M^~oe&_,r[36]=he^~pn&se,r[37]=be^~it&re,r[46]=St^~It&ht,r[47]=ci^~Ct&Gn,r[8]=G^~m&E,r[9]=H^~b&I,r[18]=A^~N&O,r[19]=T^~F&y,r[28]=te^~S&B,r[29]=oe^~_&q,r[38]=pn^~se&le,r[39]=it^~re&ae,r[48]=It^~ht&Et,r[49]=Ct^~Gn&Tt,r[0]^=R3e[n],r[1]^=R3e[n+1]},Zze=r=>e=>{var t;if(e.slice(0,2)==="0x"){t=[];for(var n=2,i=e.length;n<i;n+=2)t.push(parseInt(e.slice(n,n+2),16))}else t=e;return Jze(Yze(r),t)},O3e=Zze(256);var Q={uint8:0,int8:1,uint16:2,int16:3,uint24:4,int24:5,uint32:6,int32:7,uint40:8,int40:9,uint48:10,int48:11,uint56:12,int56:13,uint64:14,int64:15,uint72:16,int72:17,uint80:18,int80:19,uint88:20,int88:21,uint96:22,int96:23,uint104:24,int104:25,uint112:26,int112:27,uint120:28,int120:29,uint128:30,int128:31,uint136:32,int136:33,uint144:34,int144:35,uint152:36,int152:37,uint160:38,int160:39,uint168:40,int168:41,uint176:42,int176:43,uint184:44,int184:45,uint192:46,int192:47,uint200:48,int200:49,uint208:50,int208:51,uint216:52,int216:53,uint224:54,int224:55,uint232:56,int232:57,uint240:58,int240:59,uint248:60,int248:61,uint256:62,int256:63,string:64,bool:65,bytes:66,bytes32:67,address:68,func:69},Sm=class{constructor(e){this.name=null,this._params="",this._paramTypes=[],e!=null&&(this._name=e)}addString(){return this._addParam({ty:Q.string,array:!1})}addStringArray(){return this._addParam({ty:Q.string,array:!0})}addBytes(){return this._addParam({ty:Q.bytes,array:!1})}addBytes32(){return this._addParam({ty:Q.bytes32,array:!1})}addBytesArray(){return this._addParam({ty:Q.bytes,array:!0})}addBytes32Array(){return this._addParam({ty:Q.bytes32,array:!0})}addInt8(){return this._addParam({ty:Q.int8,array:!1})}addUint8(){return this._addParam({ty:Q.uint8,array:!1})}addInt16(){return this._addParam({ty:Q.int16,array:!1})}addUint16(){return this._addParam({ty:Q.uint16,array:!1})}addInt24(){return this._addParam({ty:Q.int24,array:!1})}addUint24(){return this._addParam({ty:Q.uint24,array:!1})}addInt32(){return this._addParam({ty:Q.int32,array:!1})}addUint32(){return this._addParam({ty:Q.uint32,array:!1})}addInt40(){return this._addParam({ty:Q.int40,array:!1})}addUint40(){return this._addParam({ty:Q.uint40,array:!1})}addInt48(){return this._addParam({ty:Q.int48,array:!1})}addUint48(){return this._addParam({ty:Q.uint48,array:!1})}addInt56(){return this._addParam({ty:Q.int56,array:!1})}addUint56(){return this._addParam({ty:Q.uint56,array:!1})}addInt64(){return this._addParam({ty:Q.int64,array:!1})}addUint64(){return this._addParam({ty:Q.uint64,array:!1})}addInt72(){return this._addParam({ty:Q.int72,array:!1})}addUint72(){return this._addParam({ty:Q.uint72,array:!1})}addInt80(){return this._addParam({ty:Q.int80,array:!1})}addUint80(){return this._addParam({ty:Q.uint80,array:!1})}addInt88(){return this._addParam({ty:Q.int88,array:!1})}addUint88(){return this._addParam({ty:Q.uint88,array:!1})}addInt96(){return this._addParam({ty:Q.int96,array:!1})}addUint96(){return this._addParam({ty:Q.uint96,array:!1})}addInt104(){return this._addParam({ty:Q.int104,array:!1})}addUint104(){return this._addParam({ty:Q.uint104,array:!1})}addInt112(){return this._addParam({ty:Q.int112,array:!1})}addUint112(){return this._addParam({ty:Q.uint112,array:!1})}addInt120(){return this._addParam({ty:Q.int120,array:!1})}addUint120(){return this._addParam({ty:Q.uint120,array:!1})}addInt128(){return this._addParam({ty:Q.int128,array:!1})}addUint128(){return this._addParam({ty:Q.uint128,array:!1})}addInt136(){return this._addParam({ty:Q.int136,array:!1})}addUint136(){return this._addParam({ty:Q.uint136,array:!1})}addInt144(){return this._addParam({ty:Q.int144,array:!1})}addUint144(){return this._addParam({ty:Q.uint144,array:!1})}addInt152(){return this._addParam({ty:Q.int152,array:!1})}addUint152(){return this._addParam({ty:Q.uint152,array:!1})}addInt160(){return this._addParam({ty:Q.int160,array:!1})}addUint160(){return this._addParam({ty:Q.uint160,array:!1})}addInt168(){return this._addParam({ty:Q.int168,array:!1})}addUint168(){return this._addParam({ty:Q.uint168,array:!1})}addInt176(){return this._addParam({ty:Q.int176,array:!1})}addUint176(){return this._addParam({ty:Q.uint176,array:!1})}addInt184(){return this._addParam({ty:Q.int184,array:!1})}addUint184(){return this._addParam({ty:Q.uint184,array:!1})}addInt192(){return this._addParam({ty:Q.int192,array:!1})}addUint192(){return this._addParam({ty:Q.uint192,array:!1})}addInt200(){return this._addParam({ty:Q.int200,array:!1})}addUint200(){return this._addParam({ty:Q.uint200,array:!1})}addInt208(){return this._addParam({ty:Q.int208,array:!1})}addUint208(){return this._addParam({ty:Q.uint208,array:!1})}addInt216(){return this._addParam({ty:Q.int216,array:!1})}addUint216(){return this._addParam({ty:Q.uint216,array:!1})}addInt224(){return this._addParam({ty:Q.int224,array:!1})}addUint224(){return this._addParam({ty:Q.uint224,array:!1})}addInt232(){return this._addParam({ty:Q.int232,array:!1})}addUint232(){return this._addParam({ty:Q.uint232,array:!1})}addInt240(){return this._addParam({ty:Q.int240,array:!1})}addUint240(){return this._addParam({ty:Q.uint240,array:!1})}addInt248(){return this._addParam({ty:Q.int248,array:!1})}addUint248(){return this._addParam({ty:Q.uint248,array:!1})}addInt256(){return this._addParam({ty:Q.int256,array:!1})}addUint256(){return this._addParam({ty:Q.uint256,array:!1})}addInt8Array(){return this._addParam({ty:Q.int8,array:!0})}addUint8Array(){return this._addParam({ty:Q.uint8,array:!0})}addInt16Array(){return this._addParam({ty:Q.int16,array:!0})}addUint16Array(){return this._addParam({ty:Q.uint16,array:!0})}addInt24Array(){return this._addParam({ty:Q.int24,array:!0})}addUint24Array(){return this._addParam({ty:Q.uint24,array:!0})}addInt32Array(){return this._addParam({ty:Q.int32,array:!0})}addUint32Array(){return this._addParam({ty:Q.uint32,array:!0})}addInt40Array(){return this._addParam({ty:Q.int40,array:!0})}addUint40Array(){return this._addParam({ty:Q.uint40,array:!0})}addInt48Array(){return this._addParam({ty:Q.int48,array:!0})}addUint48Array(){return this._addParam({ty:Q.uint48,array:!0})}addInt56Array(){return this._addParam({ty:Q.int56,array:!0})}addUint56Array(){return this._addParam({ty:Q.uint56,array:!0})}addInt64Array(){return this._addParam({ty:Q.int64,array:!0})}addUint64Array(){return this._addParam({ty:Q.uint64,array:!0})}addInt72Array(){return this._addParam({ty:Q.int72,array:!0})}addUint72Array(){return this._addParam({ty:Q.uint72,array:!0})}addInt80Array(){return this._addParam({ty:Q.int80,array:!0})}addUint80Array(){return this._addParam({ty:Q.uint80,array:!0})}addInt88Array(){return this._addParam({ty:Q.int88,array:!0})}addUint88Array(){return this._addParam({ty:Q.uint88,array:!0})}addInt96Array(){return this._addParam({ty:Q.int96,array:!0})}addUint96Array(){return this._addParam({ty:Q.uint96,array:!0})}addInt104Array(){return this._addParam({ty:Q.int104,array:!0})}addUint104Array(){return this._addParam({ty:Q.uint104,array:!0})}addInt112Array(){return this._addParam({ty:Q.int112,array:!0})}addUint112Array(){return this._addParam({ty:Q.uint112,array:!0})}addInt120Array(){return this._addParam({ty:Q.int120,array:!0})}addUint120Array(){return this._addParam({ty:Q.uint120,array:!0})}addInt128Array(){return this._addParam({ty:Q.int128,array:!0})}addUint128Array(){return this._addParam({ty:Q.uint128,array:!0})}addInt136Array(){return this._addParam({ty:Q.int136,array:!0})}addUint136Array(){return this._addParam({ty:Q.uint136,array:!0})}addInt144Array(){return this._addParam({ty:Q.int144,array:!0})}addUint144Array(){return this._addParam({ty:Q.uint144,array:!0})}addInt152Array(){return this._addParam({ty:Q.int152,array:!0})}addUint152Array(){return this._addParam({ty:Q.uint152,array:!0})}addInt160Array(){return this._addParam({ty:Q.int160,array:!0})}addUint160Array(){return this._addParam({ty:Q.uint160,array:!0})}addInt168Array(){return this._addParam({ty:Q.int168,array:!0})}addUint168Array(){return this._addParam({ty:Q.uint168,array:!0})}addInt176Array(){return this._addParam({ty:Q.int176,array:!0})}addUint176Array(){return this._addParam({ty:Q.uint176,array:!0})}addInt184Array(){return this._addParam({ty:Q.int184,array:!0})}addUint184Array(){return this._addParam({ty:Q.uint184,array:!0})}addInt192Array(){return this._addParam({ty:Q.int192,array:!0})}addUint192Array(){return this._addParam({ty:Q.uint192,array:!0})}addInt200Array(){return this._addParam({ty:Q.int200,array:!0})}addUint200Array(){return this._addParam({ty:Q.uint200,array:!0})}addInt208Array(){return this._addParam({ty:Q.int208,array:!0})}addUint208Array(){return this._addParam({ty:Q.uint208,array:!0})}addInt216Array(){return this._addParam({ty:Q.int216,array:!0})}addUint216Array(){return this._addParam({ty:Q.uint216,array:!0})}addInt224Array(){return this._addParam({ty:Q.int224,array:!0})}addUint224Array(){return this._addParam({ty:Q.uint224,array:!0})}addInt232Array(){return this._addParam({ty:Q.int232,array:!0})}addUint232Array(){return this._addParam({ty:Q.uint232,array:!0})}addInt240Array(){return this._addParam({ty:Q.int240,array:!0})}addUint240Array(){return this._addParam({ty:Q.uint240,array:!0})}addInt248Array(){return this._addParam({ty:Q.int248,array:!0})}addUint248Array(){return this._addParam({ty:Q.uint248,array:!0})}addInt256Array(){return this._addParam({ty:Q.int256,array:!0})}addUint256Array(){return this._addParam({ty:Q.uint256,array:!0})}addBool(){return this._addParam({ty:Q.bool,array:!1})}addAddress(){return this._addParam({ty:Q.address,array:!1})}addAddressArray(){return this._addParam({ty:Q.address,array:!0})}addFunction(){return this._addParam({ty:Q.func,array:!1})}_addParam(e){return this._paramTypes.length>0&&(this._params+=","),this._params+=FB(e),this._paramTypes.push(e),this}_build(e){if(e!=null)this._name=e;else if(this._name==null)throw new Error("`name` required for ContractFunctionSelector");let t=He(n3(this.toString()));return et(O3e(`0x${t}`)).slice(0,4)}toString(){return`${this._name!=null?this._name.toString():""}(${this._params})`}};function FB(r){let e="";switch(r.ty){case Q.uint8:e="uint8";break;case Q.int8:e="int8";break;case Q.uint16:e="uint16";break;case Q.int16:e="int16";break;case Q.uint24:e="uint24";break;case Q.int24:e="int24";break;case Q.uint32:e="uint32";break;case Q.int32:e="int32";break;case Q.uint40:e="uint40";break;case Q.int40:e="int40";break;case Q.uint48:e="uint48";break;case Q.int48:e="int48";break;case Q.uint56:e="uint56";break;case Q.int56:e="int56";break;case Q.uint64:e="uint64";break;case Q.int64:e="int64";break;case Q.uint72:e="uint72";break;case Q.int72:e="int72";break;case Q.uint80:e="uint80";break;case Q.int80:e="int80";break;case Q.uint88:e="uint88";break;case Q.int88:e="int88";break;case Q.uint96:e="uint96";break;case Q.int96:e="int96";break;case Q.uint104:e="uint104";break;case Q.int104:e="int104";break;case Q.uint112:e="uint112";break;case Q.int112:e="int112";break;case Q.uint120:e="uint120";break;case Q.int120:e="int120";break;case Q.uint128:e="uint128";break;case Q.int128:e="int128";break;case Q.uint136:e="uint136";break;case Q.int136:e="int136";break;case Q.uint144:e="uint144";break;case Q.int144:e="int144";break;case Q.uint152:e="uint152";break;case Q.int152:e="int152";break;case Q.uint160:e="uint160";break;case Q.int160:e="int160";break;case Q.uint168:e="uint168";break;case Q.int168:e="int168";break;case Q.uint176:e="uint176";break;case Q.int176:e="int176";break;case Q.uint184:e="uint184";break;case Q.int184:e="int184";break;case Q.uint192:e="uint192";break;case Q.int192:e="int192";break;case Q.uint200:e="uint200";break;case Q.int200:e="int200";break;case Q.uint208:e="uint208";break;case Q.int208:e="int208";break;case Q.uint216:e="uint216";break;case Q.int216:e="int216";break;case Q.uint224:e="uint224";break;case Q.int224:e="int224";break;case Q.uint232:e="uint232";break;case Q.int232:e="int232";break;case Q.uint240:e="uint240";break;case Q.int240:e="int240";break;case Q.uint248:e="uint248";break;case Q.int248:e="int248";break;case Q.uint256:e="uint256";break;case Q.int256:e="int256";break;case Q.string:e="string";break;case Q.bool:e="bool";break;case Q.bytes:e="bytes";break;case Q.bytes32:e="bytes32";break;case Q.address:e="address";break;case Q.func:e="function";break;default:e="";break}return r.array&&(e+="[]"),e}var D3e=Ie(AB(),1),P3e=Ie(ra(),1);var Au=class{constructor(){this._selector=new Sm,this._arguments=[]}addString(e){return this._selector.addString(),this._addParam(e,!0)}addStringArray(e){return this._selector.addStringArray(),this._addParam(e,!0)}addBytes(e){return this._selector.addBytes(),this._addParam(e,!0)}addBytes32(e){if(e.length!==32)throw new Error(`addBytes32 expected array to be of length 32, but received ${e.length}`);return this._selector.addBytes32(),this._addParam(e,!1)}addBytesArray(e){return this._selector.addBytesArray(),this._addParam(e,!0)}addBytes32Array(e){for(let[t,n]of e.entries())if(n.length!==32)throw new Error(`addBytes32 expected array to be of length 32, but received ${n.length}`);return this._selector.addBytes32Array(),this._addParam(e,!0)}addBool(e){return this._selector.addBool(),this._addParam(e,!1)}addInt8(e){return this._selector.addInt8(),this._addParam(yt(e),!1)}addUint8(e){return this._selector.addUint8(),this._addParam(yt(e),!1)}addInt16(e){return this._selector.addInt16(),this._addParam(yt(e),!1)}addUint16(e){return this._selector.addUint16(),this._addParam(yt(e),!1)}addInt24(e){return this._selector.addInt24(),this._addParam(yt(e),!1)}addUint24(e){return this._selector.addUint24(),this._addParam(yt(e),!1)}addInt32(e){return this._selector.addInt32(),this._addParam(yt(e),!1)}addUint32(e){return this._selector.addUint32(),this._addParam(yt(e),!1)}addInt40(e){return this._selector.addInt40(),this._addParam(yt(e),!1)}addUint40(e){return this._selector.addUint40(),this._addParam(yt(e),!1)}addInt48(e){return this._selector.addInt48(),this._addParam(yt(e),!1)}addUint48(e){return this._selector.addUint48(),this._addParam(yt(e),!1)}addInt56(e){return this._selector.addInt56(),this._addParam(yt(e),!1)}addUint56(e){return this._selector.addUint56(),this._addParam(yt(e),!1)}addInt64(e){return this._selector.addInt64(),this._addParam(yt(e),!1)}addUint64(e){return this._selector.addUint64(),this._addParam(yt(e),!1)}addInt72(e){return this._selector.addInt72(),this._addParam(yt(e),!1)}addUint72(e){return this._selector.addUint72(),this._addParam(yt(e),!1)}addInt80(e){return this._selector.addInt80(),this._addParam(yt(e),!1)}addUint80(e){return this._selector.addUint80(),this._addParam(yt(e),!1)}addInt88(e){return this._selector.addInt88(),this._addParam(yt(e),!1)}addUint88(e){return this._selector.addUint88(),this._addParam(yt(e),!1)}addInt96(e){return this._selector.addInt96(),this._addParam(yt(e),!1)}addUint96(e){return this._selector.addUint96(),this._addParam(yt(e),!1)}addInt104(e){return this._selector.addInt104(),this._addParam(yt(e),!1)}addUint104(e){return this._selector.addUint104(),this._addParam(yt(e),!1)}addInt112(e){return this._selector.addInt112(),this._addParam(yt(e),!1)}addUint112(e){return this._selector.addUint112(),this._addParam(yt(e),!1)}addInt120(e){return this._selector.addInt120(),this._addParam(yt(e),!1)}addUint120(e){return this._selector.addUint120(),this._addParam(yt(e),!1)}addInt128(e){return this._selector.addInt128(),this._addParam(yt(e),!1)}addUint128(e){return this._selector.addUint128(),this._addParam(yt(e),!1)}addInt136(e){return this._selector.addInt136(),this._addParam(yt(e),!1)}addUint136(e){return this._selector.addUint136(),this._addParam(yt(e),!1)}addInt144(e){return this._selector.addInt144(),this._addParam(yt(e),!1)}addUint144(e){return this._selector.addUint144(),this._addParam(yt(e),!1)}addInt152(e){return this._selector.addInt152(),this._addParam(yt(e),!1)}addUint152(e){return this._selector.addUint152(),this._addParam(yt(e),!1)}addInt160(e){return this._selector.addInt160(),this._addParam(yt(e),!1)}addUint160(e){return this._selector.addUint160(),this._addParam(yt(e),!1)}addInt168(e){return this._selector.addInt168(),this._addParam(yt(e),!1)}addUint168(e){return this._selector.addUint168(),this._addParam(yt(e),!1)}addInt176(e){return this._selector.addInt176(),this._addParam(yt(e),!1)}addUint176(e){return this._selector.addUint176(),this._addParam(yt(e),!1)}addInt184(e){return this._selector.addInt184(),this._addParam(yt(e),!1)}addUint184(e){return this._selector.addUint184(),this._addParam(yt(e),!1)}addInt192(e){return this._selector.addInt192(),this._addParam(yt(e),!1)}addUint192(e){return this._selector.addUint192(),this._addParam(yt(e),!1)}addInt200(e){return this._selector.addInt200(),this._addParam(yt(e),!1)}addUint200(e){return this._selector.addUint200(),this._addParam(yt(e),!1)}addInt208(e){return this._selector.addInt208(),this._addParam(yt(e),!1)}addUint208(e){return this._selector.addUint208(),this._addParam(yt(e),!1)}addInt216(e){return this._selector.addInt216(),this._addParam(yt(e),!1)}addUint216(e){return this._selector.addUint216(),this._addParam(yt(e),!1)}addInt224(e){return this._selector.addInt224(),this._addParam(yt(e),!1)}addUint224(e){return this._selector.addUint224(),this._addParam(yt(e),!1)}addInt232(e){return this._selector.addInt232(),this._addParam(yt(e),!1)}addUint232(e){return this._selector.addUint232(),this._addParam(yt(e),!1)}addInt240(e){return this._selector.addInt240(),this._addParam(yt(e),!1)}addUint240(e){return this._selector.addUint240(),this._addParam(yt(e),!1)}addInt248(e){return this._selector.addInt248(),this._addParam(yt(e),!1)}addUint248(e){return this._selector.addUint248(),this._addParam(yt(e),!1)}addInt256(e){return this._selector.addInt256(),this._addParam(yt(e),!1)}addUint256(e){return this._selector.addUint256(),this._addParam(yt(e),!1)}addInt8Array(e){return this._selector.addInt8Array(),this._addParam(bt(e),!0)}addUint8Array(e){return this._selector.addUint8Array(),this._addParam(bt(e),!0)}addInt16Array(e){return this._selector.addInt16Array(),this._addParam(bt(e),!0)}addUint16Array(e){return this._selector.addUint16Array(),this._addParam(bt(e),!0)}addInt24Array(e){return this._selector.addInt24Array(),this._addParam(bt(e),!0)}addUint24Array(e){return this._selector.addUint24Array(),this._addParam(bt(e),!0)}addInt32Array(e){return this._selector.addInt32Array(),this._addParam(bt(e),!0)}addUint32Array(e){return this._selector.addUint32Array(),this._addParam(bt(e),!0)}addInt40Array(e){return this._selector.addInt40Array(),this._addParam(bt(e),!0)}addUint40Array(e){return this._selector.addUint40Array(),this._addParam(bt(e),!0)}addInt48Array(e){return this._selector.addInt48Array(),this._addParam(bt(e),!0)}addUint48Array(e){return this._selector.addUint48Array(),this._addParam(bt(e),!0)}addInt56Array(e){return this._selector.addInt56Array(),this._addParam(bt(e),!0)}addUint56Array(e){return this._selector.addUint56Array(),this._addParam(bt(e),!0)}addInt64Array(e){return this._selector.addInt64Array(),this._addParam(bt(e),!0)}addUint64Array(e){return this._selector.addUint64Array(),this._addParam(bt(e),!0)}addInt72Array(e){return this._selector.addInt72Array(),this._addParam(bt(e),!0)}addUint72Array(e){return this._selector.addUint72Array(),this._addParam(bt(e),!0)}addInt80Array(e){return this._selector.addInt80Array(),this._addParam(bt(e),!0)}addUint80Array(e){return this._selector.addUint80Array(),this._addParam(bt(e),!0)}addInt88Array(e){return this._selector.addInt88Array(),this._addParam(bt(e),!0)}addUint88Array(e){return this._selector.addUint88Array(),this._addParam(bt(e),!0)}addInt96Array(e){return this._selector.addInt96Array(),this._addParam(bt(e),!0)}addUint96Array(e){return this._selector.addUint96Array(),this._addParam(bt(e),!0)}addInt104Array(e){return this._selector.addInt104Array(),this._addParam(bt(e),!0)}addUint104Array(e){return this._selector.addUint104Array(),this._addParam(bt(e),!0)}addInt112Array(e){return this._selector.addInt112Array(),this._addParam(bt(e),!0)}addUint112Array(e){return this._selector.addUint112Array(),this._addParam(bt(e),!0)}addInt120Array(e){return this._selector.addInt120Array(),this._addParam(bt(e),!0)}addUint120Array(e){return this._selector.addUint120Array(),this._addParam(bt(e),!0)}addInt128Array(e){return this._selector.addInt128Array(),this._addParam(bt(e),!0)}addUint128Array(e){return this._selector.addUint128Array(),this._addParam(bt(e),!0)}addInt136Array(e){return this._selector.addInt136Array(),this._addParam(bt(e),!0)}addUint136Array(e){return this._selector.addUint136Array(),this._addParam(bt(e),!0)}addInt144Array(e){return this._selector.addInt144Array(),this._addParam(bt(e),!0)}addUint144Array(e){return this._selector.addUint144Array(),this._addParam(bt(e),!0)}addInt152Array(e){return this._selector.addInt152Array(),this._addParam(bt(e),!0)}addUint152Array(e){return this._selector.addUint152Array(),this._addParam(bt(e),!0)}addInt160Array(e){return this._selector.addInt160Array(),this._addParam(bt(e),!0)}addUint160Array(e){return this._selector.addUint160Array(),this._addParam(bt(e),!0)}addInt168Array(e){return this._selector.addInt168Array(),this._addParam(bt(e),!0)}addUint168Array(e){return this._selector.addUint168Array(),this._addParam(bt(e),!0)}addInt176Array(e){return this._selector.addInt176Array(),this._addParam(bt(e),!0)}addUint176Array(e){return this._selector.addUint176Array(),this._addParam(bt(e),!0)}addInt184Array(e){return this._selector.addInt184Array(),this._addParam(bt(e),!0)}addUint184Array(e){return this._selector.addUint184Array(),this._addParam(bt(e),!0)}addInt192Array(e){return this._selector.addInt192Array(),this._addParam(bt(e),!0)}addUint192Array(e){return this._selector.addUint192Array(),this._addParam(bt(e),!0)}addInt200Array(e){return this._selector.addInt200Array(),this._addParam(bt(e),!0)}addUint200Array(e){return this._selector.addUint200Array(),this._addParam(bt(e),!0)}addInt208Array(e){return this._selector.addInt208Array(),this._addParam(bt(e),!0)}addUint208Array(e){return this._selector.addUint208Array(),this._addParam(bt(e),!0)}addInt216Array(e){return this._selector.addInt216Array(),this._addParam(bt(e),!0)}addUint216Array(e){return this._selector.addUint216Array(),this._addParam(bt(e),!0)}addInt224Array(e){return this._selector.addInt224Array(),this._addParam(bt(e),!0)}addUint224Array(e){return this._selector.addUint224Array(),this._addParam(bt(e),!0)}addInt232Array(e){return this._selector.addInt232Array(),this._addParam(bt(e),!0)}addUint232Array(e){return this._selector.addUint232Array(),this._addParam(bt(e),!0)}addInt240Array(e){return this._selector.addInt240Array(),this._addParam(bt(e),!0)}addUint240Array(e){return this._selector.addUint240Array(),this._addParam(bt(e),!0)}addInt248Array(e){return this._selector.addInt248Array(),this._addParam(bt(e),!0)}addUint248Array(e){return this._selector.addUint248Array(),this._addParam(bt(e),!0)}addInt256Array(e){return this._selector.addInt256Array(),this._addParam(bt(e),!0)}addUint256Array(e){return this._selector.addUint256Array(),this._addParam(bt(e),!0)}addAddress(e){let t;if(typeof e=="string"){if(e.length!==40&&e.length!==42)throw new Error("`address` type requires parameter to be 40 or 42 characters");t=e}else t=e.toString();let n=t.length===40?et(t):et(t.substring(2));return this._selector.addAddress(),this._addParam(n,!1)}addAddressArray(e){let t=[];for(let[n,i]of e.entries()){let a;if(typeof i=="string"){if(i.length!==40&&i.length!==42)throw new Error("`address` type requires parameter to be 40 or 42 characters");a=i}else a=i.toString();let o=a.length===40?et(a):et(a.substring(2));t.push(o)}return this._selector.addAddressArray(),this._addParam(t,!0)}addFunction(e,t){let n=et(e),i=t._build();if(n.length!==20)throw new Error("`function` type requires parameter `address` to be exactly 20 bytes");this._selector.addFunction();let a=new Uint8Array(24);return a.set(n,0),a.set(i,20),this._addParam(a,!1)}_addParam(e,t){let n=this._selector._paramTypes.length-1,i=B3e(e,this._selector._paramTypes[n]);return this._arguments.push({dynamic:t,value:i}),this}_build(e){let t=e!=null,n=t?4:0,i=this._arguments.length===0?n:this._arguments.length*32+this._arguments.map(s=>s.dynamic?s.value.length:0).reduce((s,c)=>s+c)+n,a=new Uint8Array(i);t&&a.set(this._selector._build(e),0);let o=32*this._arguments.length;for(let[s,{dynamic:c,value:l}]of this._arguments.entries())if(c){let u=lo(a,n+s*32+28);u.setUint32(0,o),a.set(l,u.getUint32(0)+n),o+=l.length}else a.set(l,n+s*32);return a}};function B3e(r,e){let t=new Uint8Array(32),n=lo(t),i;if(e.array){if(!Array.isArray(r))throw new TypeError("SolidityType indicates type is array, but parameter is not an array");let a=[];for(let[c,l]of r.entries()){let u=B3e(l,{ty:e.ty,array:!1});a.push(u)}let o=a.map(c=>c.length).reduce((c,l)=>c+l,0);switch(e.ty){case Q.uint8:case Q.int8:case Q.uint16:case Q.int16:case Q.uint24:case Q.int24:case Q.uint32:case Q.int32:case Q.uint40:case Q.int40:case Q.uint48:case Q.int48:case Q.uint56:case Q.int56:case Q.uint64:case Q.int64:case Q.uint72:case Q.int72:case Q.uint80:case Q.int80:case Q.uint88:case Q.int88:case Q.uint96:case Q.int96:case Q.uint104:case Q.int104:case Q.uint112:case Q.int112:case Q.uint120:case Q.int120:case Q.uint128:case Q.int128:case Q.uint136:case Q.int136:case Q.uint144:case Q.int144:case Q.uint152:case Q.int152:case Q.uint160:case Q.int160:case Q.uint168:case Q.int168:case Q.uint176:case Q.int176:case Q.uint184:case Q.int184:case Q.uint192:case Q.int192:case Q.uint200:case Q.int200:case Q.uint208:case Q.int208:case Q.uint216:case Q.int216:case Q.uint224:case Q.int224:case Q.uint232:case Q.int232:case Q.uint240:case Q.int240:case Q.uint248:case Q.int248:case Q.uint256:case Q.int256:case Q.bool:case Q.bytes32:case Q.address:case Q.func:t=new Uint8Array(o+32);break;case Q.bytes:case Q.string:t=new Uint8Array(a.length*32+o+32);break;default:throw new TypeError(`Expected param type to be ArgumentType, but received ${e.ty}`)}n=lo(t,28),n.setUint32(0,a.length);let s=32*a.length;for(let[c,l]of a.entries())switch(e.ty){case Q.uint8:case Q.int8:case Q.uint16:case Q.int16:case Q.uint24:case Q.int24:case Q.uint32:case Q.int32:case Q.uint40:case Q.int40:case Q.uint48:case Q.int48:case Q.uint56:case Q.int56:case Q.uint64:case Q.int64:case Q.uint72:case Q.int72:case Q.uint80:case Q.int80:case Q.uint88:case Q.int88:case Q.uint96:case Q.int96:case Q.uint104:case Q.int104:case Q.uint112:case Q.int112:case Q.uint120:case Q.int120:case Q.uint128:case Q.int128:case Q.uint136:case Q.int136:case Q.uint144:case Q.int144:case Q.uint152:case Q.int152:case Q.uint160:case Q.int160:case Q.uint168:case Q.int168:case Q.uint176:case Q.int176:case Q.uint184:case Q.int184:case Q.uint192:case Q.int192:case Q.uint200:case Q.int200:case Q.uint208:case Q.int208:case Q.uint216:case Q.int216:case Q.uint224:case Q.int224:case Q.uint232:case Q.int232:case Q.uint240:case Q.int240:case Q.uint248:case Q.int248:case Q.uint256:case Q.int256:case Q.bool:case Q.bytes32:case Q.address:case Q.func:t.set(l,c*32+32);break;case Q.bytes:case Q.string:let u=lo(t,(c+1)*32+28);u.setUint32(0,s),t.set(l,u.getUint32(0)+32),s+=l.length;break;default:throw new TypeError(`Expected param type to be ArgumentType, but received ${e.ty}`)}return t}switch(e.ty){case Q.uint8:case Q.int8:case Q.uint16:case Q.int16:case Q.uint24:case Q.int24:case Q.uint32:case Q.int32:case Q.uint40:case Q.int40:case Q.uint48:case Q.int48:case Q.uint56:case Q.int56:case Q.uint64:case Q.int64:case Q.uint72:case Q.int72:case Q.uint80:case Q.int80:case Q.uint88:case Q.int88:case Q.uint96:case Q.int96:case Q.uint104:case Q.int104:case Q.uint112:case Q.int112:case Q.uint120:case Q.int120:case Q.uint128:case Q.int128:case Q.uint136:case Q.int136:case Q.uint144:case Q.int144:case Q.uint152:case Q.int152:case Q.uint160:case Q.int160:case Q.uint168:case Q.int168:case Q.uint176:case Q.int176:case Q.uint184:case Q.int184:case Q.uint192:case Q.int192:case Q.uint200:case Q.int200:case Q.uint208:case Q.int208:case Q.uint216:case Q.int216:case Q.uint224:case Q.int224:case Q.uint232:case Q.int232:case Q.uint240:case Q.int240:case Q.uint248:case Q.int248:case Q.int256:case Q.uint256:{let a=r.toString(16);r>0||r==0?a="0x"+a:a=a.slice(0,1)+"0x"+a.slice(1);let o=D3e.defaultAbiCoder.encode([FB(e)],[a]);return(0,P3e.arrayify)(o)}case Q.address:return t.set(r,12),t;case Q.bool:return t[31]=r?1:0,t;case Q.func:return t.set(r,8),t;case Q.bytes32:return t.set(r,0),t;case Q.bytes:case Q.string:return i=r instanceof Uint8Array?r:n3(r),Math.floor(i.length/32)>=0?Math.floor(i.length%32)!==0?t=new Uint8Array((Math.floor(i.length/32)+1)*32+32):t=new Uint8Array(Math.floor(i.length/32)*32+32):t=new Uint8Array(64),t.set(i,32),n=lo(t,28),n.setUint32(0,i.length),t;default:throw new Error(`Unsupported argument type: ${e.toString()}`)}}var Z8=Ie(Yt(),1),M3e=Ie(vr(),1);var X8=class r extends xr{constructor(e={}){super(),this._contractId=null,e.contractId!=null&&this.setContractId(e.contractId),this._gas=null,e.gas!=null&&this.setGas(e.gas),this._functionParameters=null,e.functionParameters!=null&&(e.functionParameters instanceof Uint8Array?this.setFunctionParameters(e.functionParameters):this.setFunction(e.functionParameters.name,e.functionParameters.parameters)),this._maxResultSize=null,e.maxResultSize!=null&&this.setMaxResultSize(e.maxResultSize),this._senderAccountId=null,e.senderAccountId!=null&&this.setSenderAccountId(e.senderAccountId)}static _fromProtobuf(e){let t=e.contractCallLocal;return new r({contractId:t.contractID!=null?_t._fromProtobuf(t.contractID):void 0,gas:t.gas!=null?t.gas:void 0,functionParameters:t.functionParameters!=null?t.functionParameters:void 0,maxResultSize:t.maxResultSize!=null?t.maxResultSize:void 0})}get contractId(){return this._contractId}setContractId(e){return this._contractId=typeof e=="string"?_t.fromString(e):e.clone(),this}get gas(){return this._gas}setGas(e){return this._gas=e instanceof Z8.default?e:Z8.default.fromValue(e),this}get senderAccountId(){return this._senderAccountId}setSenderAccountId(e){return this._senderAccountId=typeof e=="string"?ne.fromString(e):e,this}get functionParameters(){return this._functionParameters}setFunctionParameters(e){return this._functionParameters=e,this}setFunction(e,t){return this._functionParameters=(t??new Au)._build(e),this}setMaxResultSize(e){return this._maxResultSize=e instanceof Z8.default?e:Z8.default.fromValue(e),this}_validateChecksums(e){this._contractId!=null&&this._contractId.validateChecksum(e)}_mapStatusError(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??M3e.proto.ResponseCodeEnum.OK);if(!t.contractCallLocal.functionResult)return new ns({status:i,transactionId:this._getTransactionId(),contractFunctionResult:null});let o=this._mapResponseSync(t);return new ns({status:i,transactionId:this._getTransactionId(),contractFunctionResult:o})}_execute(e,t){return e.smartContract.contractCallLocalMethod(t)}_mapResponseHeader(e){return e.contractCallLocal.header}_mapResponse(e){let t=e.contractCallLocal;return Promise.resolve(wu._fromProtobuf(t.functionResult,!1))}_mapResponseSync(e){let t=e.contractCallLocal;return wu._fromProtobuf(t.functionResult,!1)}_onMakeRequest(e){return{contractCallLocal:{header:e,contractID:this._contractId!=null?this._contractId._toProtobuf():null,gas:this._gas,maxResultSize:this._maxResultSize,functionParameters:this._functionParameters,senderId:this._senderAccountId!=null?this._senderAccountId._toProtobuf():null}}}_getLogId(){return`ContractCallQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("contractCallLocal",X8._fromProtobuf);var L3e=Ie(Yt(),1),p1=class r extends ke{constructor(e={}){super(),this._keys=null,this._expirationTime=new lt(0,0).plusNanos(L3e.default.fromNumber(Date.now()).mul(1e6).add(Eu.mul(1e9))),this._contents=null,this._fileMemo=null,this._defaultMaxTransactionFee=new ze(5),e.keys!=null&&this.setKeys(e.keys),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime),e.contents!=null&&this.setContents(e.contents),e.fileMemo!=null&&this.setFileMemo(e.fileMemo)}static _fromProtobuf(e,t,n,i,a){let s=a[0].fileCreate;return ke._fromProtobufTransactions(new r({keys:s.keys!=null&&s.keys.keys!=null?s.keys.keys.map(c=>rt._fromProtobufKey(c)):void 0,expirationTime:s.expirationTime!=null?lt._fromProtobuf(s.expirationTime):void 0,contents:s.contents!=null?s.contents:void 0,fileMemo:s.memo!=null?s.memo:void 0}),e,t,n,i,a)}get keys(){return this._keys}setKeys(e){if(this._requireNotFrozen(),e instanceof Ri&&e.threshold!=null)throw new Error("Cannot set threshold key as file key");return this._keys=e instanceof Ri?e.toArray():e,this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof lt?e:lt.fromDate(e),this}get contents(){return this._contents}setContents(e){return this._requireNotFrozen(),this._contents=e instanceof Uint8Array?e:n3(e),this}get fileMemo(){return this._fileMemo}setFileMemo(e){return this._requireNotFrozen(),this._fileMemo=e,this}_execute(e,t){return e.file.createFile(t)}_getTransactionDataCase(){return"fileCreate"}_makeTransactionData(){return{keys:this._keys!=null?{keys:this._keys.map(e=>e._toProtobufKey())}:null,expirationTime:this._expirationTime._toProtobuf(),contents:this._contents,memo:this._fileMemo}}_getLogId(){return`FileCreateTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("fileCreate",p1._fromProtobuf);var h1=class r extends ke{constructor(e={}){super(),this._fileId=null,this._contents=null,this._maxChunks=20,this._chunkSize=4096,this._defaultMaxTransactionFee=new ze(5),e.fileId!=null&&this.setFileId(e.fileId),e.contents!=null&&this.setContents(e.contents),e.maxChunks!=null&&this.setMaxChunks(e.maxChunks),e.chunkSize!=null&&this.setChunkSize(e.chunkSize),this._transactionIds=new rl}static _fromProtobuf(e,t,n,i,a){let s=a[0].fileAppend,c;for(let l=0;l<a.length;l+=i.length){let u=a[l].fileAppend;if(u.contents==null)break;if(c==null){c=new Uint8Array(u.contents);continue}let d=new Uint8Array(c.length+u.contents.length);d.set(c,0),d.set(u.contents,c.length),c=d}return ke._fromProtobufTransactions(new r({fileId:s.fileID!=null?zt._fromProtobuf(s.fileID):void 0,contents:c}),e,t,n,i,a)}get fileId(){return this._fileId}setFileId(e){return this._requireNotFrozen(),this._fileId=typeof e=="string"?zt.fromString(e):e.clone(),this}get contents(){return this._contents}setContents(e){return this._requireNotFrozen(),this._contents=e instanceof Uint8Array?e:n3(e),this}get maxChunks(){return this._maxChunks}setMaxChunks(e){return this._requireNotFrozen(),this._maxChunks=e,this}get chunkSize(){return this._chunkSize}setChunkSize(e){return this._chunkSize=e,this}freezeWith(e){if(super.freezeWith(e),this._contents==null)return this;let t=Math.floor((this._contents.length+(this._chunkSize-1))/this._chunkSize);if(t>this._maxChunks)throw new Error(`Contents with size ${this._contents.length} too long for ${this._maxChunks} chunks`);let n=this._getTransactionId();this._transactionIds.locked=!1,this._transactions.clear(),this._transactionIds.clear(),this._signedTransactions.clear();for(let i=0;i<t;i++){this._transactionIds.push(n),this._transactionIds.advance();for(let a of this._nodeAccountIds.list)this._signedTransactions.push(this._makeSignedTransaction(a));n=new Wr(n.accountId,new lt(n.validStart.seconds,n.validStart.nanos.add(1)))}return this._transactionIds.advance(),this._transactionIds.setLocked(),this}schedule(){if(this._requireNotFrozen(),this._contents!=null&&this._contents.length>this._chunkSize)throw new Error(`cannot schedule \`FileAppendTransaction\` with message over ${this._chunkSize} bytes`);return super.schedule()}async execute(e,t){return(await this.executeAll(e,t))[0]}async executeAll(e,t){super._isFrozen()||this.freezeWith(e);let n=this._getTransactionId(),i=e.operatorAccountId;i!=null&&i.equals(n.accountId)&&await super.signWithOperator(e);let a=[],o=t;for(let s=0;s<this._transactionIds.length;s++){let c=Date.now(),l=await super.execute(e,o);o!=null&&(o=Date.now()-c),await l.getReceipt(e),a.push(l)}return a}_validateChecksums(e){this._fileId!=null&&this._fileId.validateChecksum(e)}_execute(e,t){return e.file.appendContent(t)}_getTransactionDataCase(){return"fileAppend"}_makeTransactionData(){let e=this._contents!=null?this._contents.length:0,t=this._transactionIds.index*this._chunkSize,n=Math.min(t+this._chunkSize,e);return{fileID:this._fileId!=null?this._fileId._toProtobuf():null,contents:this._contents!=null?this._contents.slice(t,n):null}}_getLogId(){return`FileAppendTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("fileAppend",h1._fromProtobuf);var Im=class r extends ke{constructor(e={}){super(),this._fileId=null,e.fileId!=null&&this.setFileId(e.fileId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].fileDelete;return ke._fromProtobufTransactions(new r({fileId:s.fileID!=null?zt._fromProtobuf(s.fileID):void 0}),e,t,n,i,a)}get fileId(){return this._fileId}setFileId(e){return this._requireNotFrozen(),this._fileId=typeof e=="string"?zt.fromString(e):e.clone(),this}_validateChecksums(e){this._fileId!=null&&this._fileId.validateChecksum(e)}_execute(e,t){return e.file.deleteFile(t)}_getTransactionDataCase(){return"fileDelete"}_makeTransactionData(){return{fileID:this._fileId!=null?this._fileId._toProtobuf():null}}_getLogId(){return`FileDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("fileDelete",Im._fromProtobuf);var Fx=Ie(Yt(),1);var Cm=class r extends ke{constructor(e={}){super(),this._bytecodeFileId=null,this._bytecode=null,this._adminKey=null,this._gas=null,this._initialBalance=null,this._proxyAccountId=null,this._autoRenewPeriod=new fr(Eu),this._constructorParameters=null,this._contractMemo=null,this._maxAutomaticTokenAssociations=null,this._defaultMaxTransactionFee=new ze(20),this._stakedAccountId=null,this._stakedNodeId=null,this._declineStakingReward=!1,this._autoRenewAccountId=null,e.bytecodeFileId!=null&&this.setBytecodeFileId(e.bytecodeFileId),e.bytecode!=null&&this.setBytecode(e.bytecode),e.adminKey!=null&&this.setAdminKey(e.adminKey),e.gas!=null&&this.setGas(e.gas),e.initialBalance!=null&&this.setInitialBalance(e.initialBalance),e.proxyAccountId!=null&&this.setProxyAccountId(e.proxyAccountId),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.constructorParameters!=null&&this.setConstructorParameters(e.constructorParameters),e.contractMemo!=null&&this.setContractMemo(e.contractMemo),e.maxAutomaticTokenAssociations!=null&&this.setMaxAutomaticTokenAssociations(e.maxAutomaticTokenAssociations),e.stakedAccountId!=null&&this.setStakedAccountId(e.stakedAccountId),e.stakedNodeId!=null&&this.setStakedNodeId(e.stakedNodeId),e.declineStakingReward!=null&&this.setDeclineStakingReward(e.declineStakingReward),e.autoRenewAccountId!=null&&this.setAutoRenewAccountId(e.autoRenewAccountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].contractCreateInstance;return ke._fromProtobufTransactions(new r({bytecodeFileId:s.fileID!=null?zt._fromProtobuf(s.fileID):void 0,adminKey:s.adminKey!=null?rt._fromProtobufKey(s.adminKey):void 0,gas:s.gas!=null?s.gas:void 0,initialBalance:s.initialBalance!=null?s.initialBalance:void 0,proxyAccountId:s.proxyAccountID!=null?ne._fromProtobuf(s.proxyAccountID):void 0,autoRenewPeriod:s.autoRenewPeriod!=null&&s.autoRenewPeriod.seconds!=null?s.autoRenewPeriod.seconds:void 0,constructorParameters:s.constructorParameters!=null?s.constructorParameters:void 0,contractMemo:s.memo!=null?s.memo:void 0,maxAutomaticTokenAssociations:s.maxAutomaticTokenAssociations!=null?s.maxAutomaticTokenAssociations:void 0,stakedAccountId:s.stakedAccountId!=null?ne._fromProtobuf(s.stakedAccountId):void 0,stakedNodeId:s.stakedNodeId!=null?s.stakedNodeId:void 0,declineStakingReward:s.declineReward==!0,autoRenewAccountId:s.autoRenewAccountId!=null?ne._fromProtobuf(s.autoRenewAccountId):void 0}),e,t,n,i,a)}get bytecodeFileId(){return this._bytecodeFileId}setBytecodeFileId(e){return this._requireNotFrozen(),this._bytecodeFileId=typeof e=="string"?zt.fromString(e):e.clone(),this._bytecode=null,this}get bytecode(){return this._bytecode}setBytecode(e){return this._requireNotFrozen(),this._bytecode=e,this._bytecodeFileId=null,this}get adminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}get gas(){return this._gas}setGas(e){return this._requireNotFrozen(),this._gas=e instanceof Fx.default?e:Fx.default.fromValue(e),this}get initialBalance(){return this._initialBalance}setInitialBalance(e){return this._requireNotFrozen(),this._initialBalance=e instanceof ze?e:new ze(e),this}get proxyAccountId(){return this._proxyAccountId}setProxyAccountId(e){return this._requireNotFrozen(),this._proxyAccountId=e instanceof ne?e:ne.fromString(e),this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof fr?e:new fr(e),this}get constructorParameters(){return this._constructorParameters}setConstructorParameters(e){return this._requireNotFrozen(),this._constructorParameters=e instanceof Au?e._build():e,this}get contractMemo(){return this._contractMemo}setContractMemo(e){return this._requireNotFrozen(),this._contractMemo=e,this}get maxAutomaticTokenAssociations(){return this._maxAutomaticTokenAssociations}setMaxAutomaticTokenAssociations(e){return this._maxAutomaticTokenAssociations=e,this}get stakedAccountId(){return this._stakedAccountId}setStakedAccountId(e){return this._requireNotFrozen(),this._stakedAccountId=typeof e=="string"?ne.fromString(e):e,this}get stakedNodeId(){return this._stakedNodeId}setStakedNodeId(e){return this._requireNotFrozen(),this._stakedNodeId=Fx.default.fromValue(e),this}get declineStakingRewards(){return this._declineStakingReward}setDeclineStakingReward(e){return this._requireNotFrozen(),this._declineStakingReward=e,this}get autoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=typeof e=="string"?ne.fromString(e):e,this}_validateChecksums(e){this._bytecodeFileId!=null&&this._bytecodeFileId.validateChecksum(e),this._proxyAccountId!=null&&this._proxyAccountId.validateChecksum(e)}_execute(e,t){return e.smartContract.createContract(t)}_getTransactionDataCase(){return"contractCreateInstance"}_makeTransactionData(){return{fileID:this._bytecodeFileId!=null?this._bytecodeFileId._toProtobuf():null,initcode:this._bytecode,adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,gas:this._gas,initialBalance:this._initialBalance!=null?this._initialBalance.toTinybars():null,proxyAccountID:this._proxyAccountId!=null?this._proxyAccountId._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod._toProtobuf(),constructorParameters:this._constructorParameters,memo:this._contractMemo,maxAutomaticTokenAssociations:this._maxAutomaticTokenAssociations,stakedAccountId:this.stakedAccountId!=null?this.stakedAccountId._toProtobuf():null,stakedNodeId:this.stakedNodeId,declineReward:this.declineStakingRewards,autoRenewAccountId:this._autoRenewAccountId!=null?this._autoRenewAccountId._toProtobuf():null}}_getLogId(){return`ContractCreateTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("contractCreateInstance",Cm._fromProtobuf);var ev=class r extends ke{constructor(e={}){super(),this._contractId=null,this._transferAccountId=null,this._transferContractId=null,e.contractId!=null&&this.setContractId(e.contractId),e.transferAccountId!=null&&this.setTransferAccountId(e.transferAccountId),e.transferContractId!=null&&this.setTransferContractId(e.transferContractId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].contractDeleteInstance;return ke._fromProtobufTransactions(new r({contractId:s.contractID!=null?_t._fromProtobuf(s.contractID):void 0,transferAccountId:s.transferAccountID!=null?ne._fromProtobuf(s.transferAccountID):void 0,transferContractId:s.transferContractID!=null?_t._fromProtobuf(s.transferContractID):void 0}),e,t,n,i,a)}get contractId(){return this._contractId}setContractId(e){return this._requireNotFrozen(),this._contractId=typeof e=="string"?_t.fromString(e):e.clone(),this}get transferContractId(){return this._transferContractId}setTransferContractId(e){return this._requireNotFrozen(),this._transferContractId=e instanceof _t?e:_t.fromString(e),this}get transferAccountId(){return this._transferAccountId}setTransferAccountId(e){return this._requireNotFrozen(),this._transferAccountId=e instanceof ne?e:ne.fromString(e),this}_validateChecksums(e){this._contractId!=null&&this._contractId.validateChecksum(e),this._transferAccountId!=null&&this._transferAccountId.validateChecksum(e),this._transferContractId!=null&&this._transferContractId.validateChecksum(e)}_execute(e,t){return e.smartContract.deleteContract(t)}_getTransactionDataCase(){return"contractDeleteInstance"}_makeTransactionData(){return{contractID:this._contractId!=null?this._contractId._toProtobuf():null,transferAccountID:this._transferAccountId?this._transferAccountId._toProtobuf():null,transferContractID:this._transferContractId!=null?this._transferContractId._toProtobuf():null}}_getLogId(){return`ContractDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("contractDeleteInstance",ev._fromProtobuf);var UB=Ie(Yt(),1),tv=class r extends ke{constructor(e={}){super(),this._contractId=null,this._gas=null,this._amount=null,this._functionParameters=null,e.contractId!=null&&this.setContractId(e.contractId),e.gas!=null&&this.setGas(e.gas),e.amount!=null&&this.setPayableAmount(e.amount),e.functionParameters!=null?this.setFunctionParameters(e.functionParameters):e.function!=null&&this.setFunction(e.function.name,e.function.parameters)}static _fromProtobuf(e,t,n,i,a){let s=a[0].contractCall;return ke._fromProtobufTransactions(new r({contractId:s.contractID!=null?_t._fromProtobuf(s.contractID):void 0,gas:s.gas!=null?s.gas:void 0,amount:s.amount!=null?ze.fromTinybars(s.amount):void 0,functionParameters:s.functionParameters!=null?s.functionParameters:void 0}),e,t,n,i,a)}get contractId(){return this._contractId}setContractId(e){return this._requireNotFrozen(),this._contractId=typeof e=="string"?_t.fromString(e):e.clone(),this}get gas(){return this._gas}setGas(e){return this._requireNotFrozen(),this._gas=e instanceof UB.default?e:UB.default.fromValue(e),this}get payableAmount(){return this._amount}setPayableAmount(e){return this._requireNotFrozen(),this._amount=e instanceof ze?e:new ze(e),this}get functionParameters(){return this._functionParameters}setFunctionParameters(e){return this._requireNotFrozen(),this._functionParameters=e,this}setFunction(e,t){return this._requireNotFrozen(),this._functionParameters=t!=null?t._build(e):new Au()._build(e),this}_validateChecksums(e){this._contractId!=null&&this._contractId.validateChecksum(e)}_execute(e,t){return e.smartContract.contractCallMethod(t)}_getTransactionDataCase(){return"contractCall"}_makeTransactionData(){return{contractID:this._contractId!=null?this._contractId._toProtobuf():null,gas:this._gas,amount:this._amount!=null?this._amount.toTinybars():null,functionParameters:this._functionParameters}}_getLogId(){return`ContractExecuteTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("contractCall",tv._fromProtobuf);var Ux=Ie(Yt(),1),Xze=Ie(vr(),1);var{proto:F3e}=Xze,km=class r{constructor(e){this.contractId=e.contractId,this.accountId=e.accountId,this.contractAccountId=e.contractAccountId,this.adminKey=e.adminKey!=null?e.adminKey:null,this.expirationTime=e.expirationTime,this.autoRenewPeriod=e.autoRenewPeriod,this.autoRenewAccountId=e.autoRenewAccountId,this.storage=e.storage,this.contractMemo=e.contractMemo,this.balance=e.balance,this.isDeleted=e.isDeleted,this.tokenRelationships=e.tokenRelationships,this.ledgerId=e.ledgerId,this.stakingInfo=e.stakingInfo,Object.freeze(this)}static _fromProtobuf(e){let t=e.autoRenewPeriod.seconds;return new r({contractId:_t._fromProtobuf(e.contractID),accountId:ne._fromProtobuf(e.accountID),contractAccountId:e.contractAccountID!=null?e.contractAccountID:"",adminKey:e.adminKey!=null?rt._fromProtobufKey(e.adminKey):null,expirationTime:lt._fromProtobuf(e.expirationTime),autoRenewPeriod:new fr(t),autoRenewAccountId:e.autoRenewAccountId!=null?ne._fromProtobuf(e.autoRenewAccountId):null,storage:e.storage!=null?e.storage instanceof Ux.default?e.storage:Ux.default.fromValue(e.storage):Ux.default.ZERO,contractMemo:e.memo!=null?e.memo:"",balance:ze.fromTinybars(e.balance!=null?e.balance:0),isDeleted:e.deleted,tokenRelationships:u1._fromProtobuf(e.tokenRelationships!=null?e.tokenRelationships:[]),ledgerId:e.ledgerId!=null?mr.fromBytes(e.ledgerId):null,stakingInfo:e.stakingInfo!=null?l1._fromProtobuf(e.stakingInfo):null})}_toProtobuf(){return{contractID:this.contractId._toProtobuf(),accountID:this.accountId._toProtobuf(),contractAccountID:this.contractAccountId,adminKey:this.adminKey!=null?this.adminKey._toProtobufKey():null,expirationTime:this.expirationTime._toProtobuf(),autoRenewPeriod:this.autoRenewPeriod!=null?this.autoRenewPeriod._toProtobuf():null,autoRenewAccountId:this.autoRenewAccountId!=null?this.autoRenewAccountId._toProtobuf():null,storage:this.storage,memo:this.contractMemo,balance:this.balance.toTinybars(),deleted:this.isDeleted,tokenRelationships:this.tokenRelationships!=null?this.tokenRelationships._toProtobuf():null,ledgerId:this.ledgerId!=null?this.ledgerId.toBytes():null,stakingInfo:this.stakingInfo!=null?this.stakingInfo._toProtobuf():null}}static fromBytes(e){return r._fromProtobuf(F3e.ContractGetInfoResponse.ContractInfo.decode(e))}toBytes(){return F3e.ContractGetInfoResponse.ContractInfo.encode(this._toProtobuf()).finish()}};var rv=class r extends xr{constructor(e={}){super(),this._contractId=null,e.contractId!=null&&this.setContractId(e.contractId)}static _fromProtobuf(e){let t=e.contractGetInfo;return new r({contractId:t.contractID!=null?_t._fromProtobuf(t.contractID):void 0})}get contractId(){return this._contractId}setContractId(e){return this._contractId=typeof e=="string"?_t.fromString(e):e.clone(),this}_validateChecksums(e){this._contractId!=null&&this._contractId.validateChecksum(e)}_execute(e,t){return e.smartContract.getContractInfo(t)}async getCost(e){return super.getCost(e)}_mapResponseHeader(e){return e.contractGetInfo.header}_mapResponse(e,t,n){let i=e.contractGetInfo;return Promise.resolve(km._fromProtobuf(i.contractInfo))}_onMakeRequest(e){return{contractGetInfo:{header:e,contractID:this._contractId!=null?this._contractId._toProtobuf():null}}}_getLogId(){return`ContractInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("contractGetInfo",rv._fromProtobuf);var U3e=Ie(Yt(),1),nv=class r extends ke{constructor(e={}){super(),this._contractId=null,this._expirationTime=null,this._adminKey=null,this._proxyAccountId=null,this._autoRenewPeriod=null,this._bytecodeFileId=null,this._contractMemo=null,this._maxAutomaticTokenAssociations=null,this._stakedAccountId=null,this._stakedNodeId=null,this._declineStakingReward=null,this._autoRenewAccountId=null,e.contractId!=null&&this.setContractId(e.contractId),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime),e.adminKey!=null&&this.setAdminKey(e.adminKey),e.proxyAccountId!=null&&this.setProxyAccountId(e.proxyAccountId),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.bytecodeFileId!=null&&this.setBytecodeFileId(e.bytecodeFileId),e.contractMemo!=null&&this.setContractMemo(e.contractMemo),e.maxAutomaticTokenAssociations!=null&&this.setMaxAutomaticTokenAssociations(e.maxAutomaticTokenAssociations),e.stakedAccountId!=null&&this.setStakedAccountId(e.stakedAccountId),e.stakedNodeId!=null&&this.setStakedNodeId(e.stakedNodeId),e.declineStakingReward!=null&&this.setDeclineStakingReward(e.declineStakingReward),e.autoRenewAccountId!=null&&this.setAutoRenewAccountId(e.autoRenewAccountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].contractUpdateInstance,c;s.autoRenewPeriod!=null&&s.autoRenewPeriod.seconds!=null&&(c=s.autoRenewPeriod.seconds);let l;s.memoWrapper!=null&&s.memoWrapper.value!=null&&(l=s.memoWrapper.value);let u;return s.maxAutomaticTokenAssociations!=null&&s.maxAutomaticTokenAssociations.value!=null&&(u=s.maxAutomaticTokenAssociations.value),ke._fromProtobufTransactions(new r({contractId:s.contractID!=null?_t._fromProtobuf(s.contractID):void 0,bytecodeFileId:s.fileID!=null?zt._fromProtobuf(s.fileID):void 0,expirationTime:s.expirationTime!=null?lt._fromProtobuf(s.expirationTime):void 0,adminKey:s.adminKey!=null?rt._fromProtobufKey(s.adminKey):void 0,proxyAccountId:s.proxyAccountID!=null?ne._fromProtobuf(s.proxyAccountID):void 0,autoRenewPeriod:c,contractMemo:l,maxAutomaticTokenAssociations:u,stakedAccountId:s.stakedAccountId!=null?ne._fromProtobuf(s.stakedAccountId):void 0,stakedNodeId:s.stakedNodeId!=null?s.stakedNodeId:void 0,declineStakingReward:s.declineReward!=null&&!!s.declineReward,autoRenewAccountId:s.autoRenewAccountId!=null?ne._fromProtobuf(s.autoRenewAccountId):void 0}),e,t,n,i,a)}get contractId(){return this._contractId}setContractId(e){return this._requireNotFrozen(),this._contractId=typeof e=="string"?_t.fromString(e):e.clone(),this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof lt?e:lt.fromDate(e),this}get adminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}get proxyAccountId(){return this._proxyAccountId}setProxyAccountId(e){return this._requireNotFrozen(),this._proxyAccountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof fr?e:new fr(e),this}get bytecodeFileId(){return this._bytecodeFileId}setBytecodeFileId(e){return console.warn("Deprecated: there is no replacement"),this._requireNotFrozen(),this._bytecodeFileId=typeof e=="string"?zt.fromString(e):e.clone(),this}get contractMemo(){return this._contractMemo}setContractMemo(e){return this._requireNotFrozen(),this._contractMemo=e,this}clearContractMemo(){return this._requireNotFrozen(),this._contractMemo=null,this}get maxAutomaticTokenAssociations(){return this._maxAutomaticTokenAssociations}setMaxAutomaticTokenAssociations(e){return this._requireNotFrozen(),this._maxAutomaticTokenAssociations=e,this}get stakedAccountId(){return this._stakedAccountId}setStakedAccountId(e){return this._requireNotFrozen(),this._stakedAccountId=typeof e=="string"?ne.fromString(e):e,this}get stakedNodeId(){return this._stakedNodeId}setStakedNodeId(e){return this._requireNotFrozen(),this._stakedNodeId=U3e.default.fromValue(e),this}get declineStakingRewards(){return this._declineStakingReward}setDeclineStakingReward(e){return this._requireNotFrozen(),this._declineStakingReward=e,this}get autoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=typeof e=="string"?ne.fromString(e):e,this}clearAutoRenewAccountId(){return this._autoRenewAccountId=new ne(0),this}_validateChecksums(e){this._contractId!=null&&this._contractId.validateChecksum(e),this._bytecodeFileId!=null&&this._bytecodeFileId.validateChecksum(e),this._proxyAccountId!=null&&this._proxyAccountId.validateChecksum(e)}_execute(e,t){return e.smartContract.updateContract(t)}_getTransactionDataCase(){return"contractUpdateInstance"}_makeTransactionData(){return{contractID:this._contractId!=null?this._contractId._toProtobuf():null,expirationTime:this._expirationTime!=null?this._expirationTime._toProtobuf():null,adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,proxyAccountID:this._proxyAccountId!=null?this._proxyAccountId._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod!=null?this._autoRenewPeriod._toProtobuf():null,fileID:this._bytecodeFileId?this._bytecodeFileId._toProtobuf():null,memoWrapper:this._contractMemo!=null?{value:this._contractMemo}:null,maxAutomaticTokenAssociations:this._maxAutomaticTokenAssociations!=null?{value:this._maxAutomaticTokenAssociations}:null,stakedAccountId:this.stakedAccountId!=null?this.stakedAccountId._toProtobuf():null,stakedNodeId:this.stakedNodeId,declineReward:this.declineStakingRewards!=null?{value:this.declineStakingRewards}:null,autoRenewAccountId:this._autoRenewAccountId!=null?this._autoRenewAccountId._toProtobuf():null}}_getLogId(){return`ContractUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("contractUpdateInstance",nv._fromProtobuf);var Tu=class{constructor(e={}){this._feeCollectorAccountId=null,this._allCollectorsAreExempt=!1,e.feeCollectorAccountId!=null&&this.setFeeCollectorAccountId(e.feeCollectorAccountId),e.allCollectorsAreExempt!=null&&this.setAllCollectorsAreExempt(e.allCollectorsAreExempt)}get feeCollectorAccountId(){return this._feeCollectorAccountId}setFeeCollectorAccountId(e){return this._feeCollectorAccountId=typeof e=="string"?ne.fromString(e):e,this}get allCollectorsAreExempt(){return this._allCollectorsAreExempt}setAllCollectorsAreExempt(e){return this._allCollectorsAreExempt=e,this}static _fromProtobuf(e){throw new Error("not implemented")}_toProtobuf(){throw new Error("not implemented")}};var q3e=Ie(Yt(),1);var tc=class r extends Tu{constructor(e={}){super(e),this._denominatingTokenId=null,e.denominatingTokenId!=null&&this.setDenominatingTokenId(e.denominatingTokenId),this._amount=null,e.amount!=null&&this.setAmount(e.amount)}setHbarAmount(e){return this._amount=e.toTinybars(),this._denominatingTokenId=null,this}get hbarAmount(){return this._denominatingTokenId!=null?null:ze.fromTinybars(this._amount!=null?this._amount:0)}setDenominatingTokenToSameToken(){return this._denominatingTokenId=new Oe(0,0,0),this}get denominatingTokenId(){return this._denominatingTokenId}setDenominatingTokenId(e){return this._denominatingTokenId=typeof e=="string"?Oe.fromString(e):e,this}get amount(){return this._amount}setAmount(e){return this._amount=typeof e=="number"?q3e.default.fromNumber(e):e,this}static _fromProtobuf(e){let t=e.fixedFee;return new r({feeCollectorAccountId:e.feeCollectorAccountId!=null?ne._fromProtobuf(e.feeCollectorAccountId):void 0,allCollectorsAreExempt:e.allCollectorsAreExempt!=null?e.allCollectorsAreExempt:void 0,denominatingTokenId:t.denominatingTokenId!=null?Oe._fromProtobuf(t.denominatingTokenId):void 0,amount:t.amount!=null?t.amount:void 0})}_toProtobuf(){return{feeCollectorAccountId:this.feeCollectorAccountId!=null?this.feeCollectorAccountId._toProtobuf():null,allCollectorsAreExempt:this.allCollectorsAreExempt,fixedFee:{denominatingTokenId:this._denominatingTokenId!=null?this._denominatingTokenId._toProtobuf():null,amount:this._amount}}}};var Su=class r{constructor(e){this._value=e,Object.freeze(this)}toString(){switch(this){case r.Inclusive:return"INCLUSIVE";case r.Exclusive:return"EXCLUSIVE";default:return`UNKNOWN (${this._value.toString()})`}}static _fromValue(e){switch(e){case!1:return r.Inclusive;case!0:return r.Exclusive}}valueOf(){return this._value}};Su.Inclusive=new Su(!1);Su.Exclusive=new Su(!0);var iv=Ie(Yt(),1),Iu=class r extends Tu{constructor(e={}){super(e),this._numerator=null,e.numerator!=null&&this.setNumerator(e.numerator),this._denominator=null,e.denominator!=null&&this.setDenominator(e.denominator),this._min=null,e.min!=null&&this.setMin(e.min),this._max,e.max!=null&&this.setMax(e.max),this._assessmentMethod,e.assessmentMethod!=null&&this.setAssessmentMethod(e.assessmentMethod)}get numerator(){return this._numerator}setNumerator(e){return this._numerator=typeof e=="number"?iv.default.fromNumber(e):e,this}get denominator(){return this._denominator}setDenominator(e){return this._denominator=typeof e=="number"?iv.default.fromNumber(e):e,this}get min(){return this._min}setMin(e){return this._min=typeof e=="number"?iv.default.fromNumber(e):e,this}get max(){return this._max}setMax(e){return this._max=typeof e=="number"?iv.default.fromNumber(e):e,this}get assessmentMethod(){return this._assessmentMethod}setAssessmentMethod(e){return this._assessmentMethod=e,this}static _fromProtobuf(e){let t=e.fractionalFee,n=t.fractionalAmount;return new r({feeCollectorAccountId:e.feeCollectorAccountId!=null?ne._fromProtobuf(e.feeCollectorAccountId):void 0,allCollectorsAreExempt:e.allCollectorsAreExempt!=null?e.allCollectorsAreExempt:void 0,numerator:n.numerator!=null?n.numerator:void 0,denominator:n.denominator!=null?n.denominator:void 0,min:t.minimumAmount!=null?t.minimumAmount:void 0,max:t.maximumAmount!=null?t.maximumAmount:void 0,assessmentMethod:t.netOfTransfers!=null?new Su(t.netOfTransfers):void 0})}_toProtobuf(){return{feeCollectorAccountId:this.feeCollectorAccountId!=null?this.feeCollectorAccountId._toProtobuf():null,allCollectorsAreExempt:this.allCollectorsAreExempt,fractionalFee:{fractionalAmount:{numerator:this._numerator,denominator:this._denominator},minimumAmount:this._min,maximumAmount:this._max,netOfTransfers:this._assessmentMethod!=null?this._assessmentMethod.valueOf():!1}}}};var qB=Ie(Yt(),1);var Cu=class r extends Tu{constructor(e={}){super(e),this._fallbackFee=null,e.fallbackFee!=null&&this.setFallbackFee(e.fallbackFee),this._numerator=null,e.numerator!=null&&this.setNumerator(e.numerator),this._denominator=null,e.denominator!=null&&this.setDenominator(e.denominator)}get fallbackFee(){return this._fallbackFee}setFallbackFee(e){return this._fallbackFee=e,this}get numerator(){return this._numerator}setNumerator(e){return this._numerator=typeof e=="number"?qB.default.fromNumber(e):e,this}get denominator(){return this._denominator}setDenominator(e){return this._denominator=typeof e=="number"?qB.default.fromNumber(e):e,this}static _fromProtobuf(e){let t=e.royaltyFee,n=t.exchangeValueFraction;return new r({feeCollectorAccountId:e.feeCollectorAccountId!=null?ne._fromProtobuf(e.feeCollectorAccountId):void 0,allCollectorsAreExempt:e.allCollectorsAreExempt!=null?e.allCollectorsAreExempt:void 0,fallbackFee:t.fallbackFee!=null?tc._fromProtobuf({fixedFee:t.fallbackFee}):void 0,numerator:n.numerator!=null?n.numerator:void 0,denominator:n.denominator!=null?n.denominator:void 0})}_toProtobuf(){return{feeCollectorAccountId:this.feeCollectorAccountId!=null?this.feeCollectorAccountId._toProtobuf():null,allCollectorsAreExempt:this.allCollectorsAreExempt,royaltyFee:{exchangeValueFraction:{numerator:this._numerator,denominator:this._denominator},fallbackFee:this._fallbackFee!=null?this._fallbackFee._toProtobuf().fixedFee:null}}}};var av=class r extends _t{constructor(e,t,n,i){super(e,t,n,i)}static fromEvmAddress(e,t,n){return new r(e,t,0,et(n))}static fromString(e){return new r(_t.fromString(e))}static _fromProtobuf(e){return new r(_t._fromProtobuf(e))}static fromBytes(e){return new r(_t.fromBytes(e))}static fromSolidityAddress(e){return new r(_t.fromSolidityAddress(e))}clone(){let e=new r(this);return e._checksum=this._checksum,e}_toProtobufKey(){return{delegatableContractId:this._toProtobuf()}}static __fromProtobufKey(e){return r._fromProtobuf(e)}};ir.setDelegateContractId(r=>av.__fromProtobufKey(r));var Nm=class r extends ke{constructor(e={}){super(),this._ethereumData=null,this._callDataFileId=null,this._maxGasAllowance=null,e.ethereumData!=null&&this.setEthereumData(e.ethereumData),e.callData!=null&&this.setCallDataFileId(e.callData),e.callDataFileId!=null&&this.setCallDataFileId(e.callDataFileId),e.maxGasAllowance!=null&&this.setMaxGasAllowanceHbar(e.maxGasAllowance)}static _fromProtobuf(e,t,n,i,a){let s=a[0].ethereumTransaction;return ke._fromProtobufTransactions(new r({ethereumData:s.ethereumData!=null?s.ethereumData:void 0,callData:s.callData!=null?zt._fromProtobuf(s.callData):void 0,maxGasAllowance:s.maxGasAllowance!=null?ze.fromTinybars(s.maxGasAllowance):void 0}),e,t,n,i,a)}get ethereumData(){return this._ethereumData}setEthereumData(e){return this._requireNotFrozen(),this._ethereumData=e,this}get callData(){return this.callDataFileId}setCallData(e){return this.setCallDataFileId(e)}get callDataFileId(){return this._callDataFileId}setCallDataFileId(e){return this._requireNotFrozen(),this._callDataFileId=e,this}get maxGasAllowance(){return this._maxGasAllowance}setMaxGasAllowance(e){return this.setMaxGasAllowanceHbar(e)}setMaxGasAllowanceHbar(e){return this._requireNotFrozen(),this._maxGasAllowance=e instanceof ze?e:new ze(e),this}_validateChecksums(e){this._ethereumData!=null&&this._ethereumData instanceof zt&&this._ethereumData.validateChecksum(e)}_execute(e,t){return e.smartContract.callEthereum(t)}_getTransactionDataCase(){return"ethereumTransaction"}_makeTransactionData(){return{ethereumData:this._ethereumData,callData:this._callDataFileId!=null?this._callDataFileId._toProtobuf():null,maxGasAllowance:this._maxGasAllowance!=null?this._maxGasAllowance.toTinybars():null}}_getLogId(){return`EthereumTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("ethereumTransaction",Nm._fromProtobuf);var qx=Ie(em(),1);var cl=class{constructor(e){this.callData=e.callData}static fromBytes(e){if(e.length===0)throw new Error("empty bytes");switch(e[0]){case 1:return ir.ethereumTransactionDataEip2930FromBytes(e);case 2:return ir.ethereumTransactionDataEip1559FromBytes(e);default:return ir.ethereumTransactionDataLegacyFromBytes(e)}}toBytes(){throw new Error("not implemented")}toString(){throw new Error("not implemented")}toJSON(){throw new Error("not implemented")}};var ov=class r extends cl{constructor(e){super(e),this.nonce=e.nonce,this.gasPrice=e.gasPrice,this.gasLimit=e.gasLimit,this.to=e.to,this.value=e.value,this.v=e.v,this.r=e.r,this.s=e.s}static fromBytes(e){if(e.length===0)throw new Error("empty bytes");let t=qx.decode(e);if(t.length!=9)throw new Error("invalid ethereum transaction data");return new r({nonce:et(t[0]),gasPrice:et(t[1]),gasLimit:et(t[2]),to:et(t[3]),value:et(t[4]),callData:et(t[5]),v:et(t[6]),r:et(t[7]),s:et(t[8])})}toBytes(){return et(qx.encode([this.nonce,this.gasPrice,this.gasLimit,this.to,this.value,this.callData,this.v,this.r,this.s]))}toString(){return JSON.stringify(this.toJSON(),null,2)}toJSON(){return{nonce:He(this.nonce),gasPrice:He(this.gasPrice),gasLimit:He(this.gasLimit),to:He(this.to),value:He(this.value),callData:He(this.callData),v:He(this.v),r:He(this.r),s:He(this.s)}}};ir.setEthereumTransactionDataLegacyFromBytes(r=>ov.fromBytes(r));var jx=Ie(em(),1);var sv=class r extends cl{constructor(e){super(e),this.chainId=e.chainId,this.nonce=e.nonce,this.maxPriorityGas=e.maxPriorityGas,this.maxGas=e.maxGas,this.gasLimit=e.gasLimit,this.to=e.to,this.value=e.value,this.accessList=e.accessList,this.recId=e.recId,this.r=e.r,this.s=e.s}static fromBytes(e){if(e.length===0)throw new Error("empty bytes");let t=jx.decode(e.subarray(1));if(!Array.isArray(t))throw new Error("ethereum data is not a list");if(t.length!=12)throw new Error("invalid ethereum transaction data");return new r({chainId:et(t[0]),nonce:et(t[1]),maxPriorityGas:et(t[2]),maxGas:et(t[3]),gasLimit:et(t[4]),to:et(t[5]),value:et(t[6]),callData:et(t[7]),accessList:t[8].map(n=>et(n)),recId:et(t[9]),r:et(t[10]),s:et(t[11])})}toBytes(){let e=jx.encode([this.chainId,this.nonce,this.maxPriorityGas,this.maxGas,this.gasLimit,this.to,this.value,this.callData,this.accessList,this.recId,this.r,this.s]);return et("02"+e.substring(2))}toString(){return JSON.stringify(this.toJSON(),null,2)}toJSON(){return{chainId:He(this.chainId),nonce:He(this.nonce),maxPriorityGas:He(this.maxPriorityGas),maxGas:He(this.maxGas),gasLimit:He(this.gasLimit),to:He(this.to),value:He(this.value),callData:He(this.callData),accessList:this.accessList.map(e=>He(e)),recId:He(this.recId),r:He(this.r),s:He(this.s)}}};ir.setEthereumTransactionDataEip1559FromBytes(r=>sv.fromBytes(r));var Vx=Ie(em(),1);var cv=class r extends cl{constructor(e){super(e),this.chainId=e.chainId,this.nonce=e.nonce,this.gasPrice=e.gasPrice,this.gasLimit=e.gasLimit,this.to=e.to,this.value=e.value,this.accessList=e.accessList,this.recId=e.recId,this.r=e.r,this.s=e.s}static fromBytes(e){if(e.length===0)throw new Error("empty bytes");let t=Vx.decode(e.subarray(1));if(!Array.isArray(t))throw new Error("ethereum data is not a list");if(t.length!==11)throw new Error("invalid ethereum transaction data");return new r({chainId:et(t[0]),nonce:et(t[1]),gasPrice:et(t[2]),gasLimit:et(t[3]),to:et(t[4]),value:et(t[5]),callData:et(t[6]),accessList:t[7].map(n=>et(n)),recId:et(t[8]),r:et(t[9]),s:et(t[10])})}toBytes(){let e=Vx.encode([this.chainId,this.nonce,this.gasPrice,this.gasLimit,this.to,this.value,this.callData,this.accessList,this.recId,this.r,this.s]);return et("01"+e.substring(2))}toString(){return JSON.stringify(this.toJSON(),null,2)}toJSON(){return{chainId:He(this.chainId),nonce:He(this.nonce),gasPrice:He(this.gasPrice),gasLimit:He(this.gasLimit),to:He(this.to),value:He(this.value),callData:He(this.callData),accessList:this.accessList.map(e=>He(e)),recId:He(this.recId),r:He(this.r),s:He(this.s)}}};ir.setEthereumTransactionDataEip2930FromBytes(r=>cv.fromBytes(r));var eGe=Ie(vr(),1),{proto:wtr}=eGe;var tGe=Ie(vr(),1);var nGe=Ie(vr(),1);var _o=class r{constructor(e){this._code=e,Object.freeze(this)}toString(){switch(this){case r.Default:return"DEFAULT";case r.TokenFungibleCommon:return"TOKEN_FUNGIBLE_COMMON";case r.TokenNonFungibleUnique:return"TOKEN_NON_FUNGIBLE_UNIQUE";case r.TokenFungibleCommonWithCustomFees:return"TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES";case r.TokenNonFungibleUniqueWithCustomFees:return"TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES";case r.ScheduleCreateContractCall:return"SCHEDULE_CREATE_CONTRACT_CALL";default:return`UNKNOWN (${this._code})`}}static _fromCode(e){switch(e){case 0:return r.Default;case 1:return r.TokenFungibleCommon;case 2:return r.TokenNonFungibleUnique;case 3:return r.TokenFungibleCommonWithCustomFees;case 4:return r.TokenNonFungibleUniqueWithCustomFees;case 5:return r.ScheduleCreateContractCall}throw new Error(`(BUG) SubType.fromCode() does not handle code: ${e}`)}valueOf(){return this._code}};_o.Default=new _o(0);_o.TokenFungibleCommon=new _o(1);_o.TokenNonFungibleUnique=new _o(2);_o.TokenFungibleCommonWithCustomFees=new _o(3);_o.TokenNonFungibleUniqueWithCustomFees=new _o(4);_o.ScheduleCreateContractCall=new _o(5);var sGe=Ie(vr(),1);var aGe=Ie(vr(),1);var xe=class r{constructor(e){this._code=e,Object.freeze(this)}toString(){switch(this){case r.None:return"NONE";case r.CryptoTransfer:return"CryptoTransfer";case r.CryptoUpdate:return"CryptoUpdate";case r.CryptoDelete:return"CryptoDelete";case r.CryptoAddLiveHash:return"CryptoAddLiveHash";case r.CryptoDeleteLiveHash:return"CryptoDeleteLiveHash";case r.ContractCall:return"ContractCall";case r.ContractCreate:return"ContractCreate";case r.ContractUpdate:return"ContractUpdate";case r.FileCreate:return"FileCreate";case r.FileAppend:return"FileAppend";case r.FileUpdate:return"FileUpdate";case r.FileDelete:return"FileDelete";case r.CryptoGetAccountBalance:return"CryptoGetAccountBalance";case r.CryptoGetAccountRecords:return"CryptoGetAccountRecords";case r.CryptoGetInfo:return"CryptoGetInfo";case r.ContractCallLocal:return"ContractCallLocal";case r.ContractGetInfo:return"ContractGetInfo";case r.ContractGetBytecode:return"ContractGetBytecode";case r.GetBySolidityID:return"GetBySolidityID";case r.GetByKey:return"GetByKey";case r.CryptoGetLiveHash:return"CryptoGetLiveHash";case r.CryptoGetStakers:return"CryptoGetStakers";case r.FileGetContents:return"FileGetContents";case r.FileGetInfo:return"FileGetInfo";case r.TransactionGetRecord:return"TransactionGetRecord";case r.ContractGetRecords:return"ContractGetRecords";case r.CryptoCreate:return"CryptoCreate";case r.SystemDelete:return"SystemDelete";case r.SystemUndelete:return"SystemUndelete";case r.ContractDelete:return"ContractDelete";case r.Freeze:return"Freeze";case r.CreateTransactionRecord:return"CreateTransactionRecord";case r.CryptoAccountAutoRenew:return"CryptoAccountAutoRenew";case r.ContractAutoRenew:return"ContractAutoRenew";case r.GetVersionInfo:return"GetVersionInfo";case r.TransactionGetReceipt:return"TransactionGetReceipt";case r.ConsensusCreateTopic:return"ConsensusCreateTopic";case r.ConsensusUpdateTopic:return"ConsensusUpdateTopic";case r.ConsensusDeleteTopic:return"ConsensusDeleteTopic";case r.ConsensusGetTopicInfo:return"ConsensusGetTopicInfo";case r.ConsensusSubmitMessage:return"ConsensusSubmitMessage";case r.UncheckedSubmit:return"UncheckedSubmit";case r.TokenCreate:return"TokenCreate";case r.TokenGetInfo:return"TokenGetInfo";case r.TokenFreezeAccount:return"TokenFreezeAccount";case r.TokenUnfreezeAccount:return"TokenUnfreezeAccount";case r.TokenGrantKycToAccount:return"TokenGrantKycToAccount";case r.TokenRevokeKycFromAccount:return"TokenRevokeKycFromAccount";case r.TokenDelete:return"TokenDelete";case r.TokenUpdate:return"TokenUpdate";case r.TokenMint:return"TokenMint";case r.TokenBurn:return"TokenBurn";case r.TokenAccountWipe:return"TokenAccountWipe";case r.TokenAssociateToAccount:return"TokenAssociateToAccount";case r.TokenDissociateFromAccount:return"TokenDissociateFromAccount";case r.ScheduleCreate:return"ScheduleCreate";case r.ScheduleDelete:return"ScheduleDelete";case r.ScheduleSign:return"ScheduleSign";case r.ScheduleGetInfo:return"ScheduleGetInfo";case r.TokenGetAccountNftInfos:return"TokenGetAccountNftInfos";case r.TokenGetNftInfo:return"TokenGetNftInfo";case r.TokenGetNftInfos:return"TokenGetNftInfos";case r.TokenFeeScheduleUpdate:return"TokenFeeScheduleUpdate";case r.NetworkGetExecutionTime:return"NetworkGetExecutionTime";case r.TokenPause:return"TokenPause";case r.TokenUnpause:return"TokenUnpause";case r.CryptoApproveAllowance:return"CryptoApproveAllowance";case r.CryptoDeleteAllowance:return"CryptoDeleteAllowance";case r.GetAccountDetails:return"GetAccountDetails";case r.EthereumTransaction:return"EthereumTransaction";case r.NodeStakeUpdate:return"NodeStakeUpdate";case r.Prng:return"UtilPrng";default:return`UNKNOWN (${this._code})`}}static _fromCode(e){switch(e){case 0:return r.None;case 1:return r.CryptoTransfer;case 2:return r.CryptoUpdate;case 3:return r.CryptoDelete;case 4:return r.CryptoAddLiveHash;case 5:return r.CryptoDeleteLiveHash;case 6:return r.ContractCall;case 7:return r.ContractCreate;case 8:return r.ContractUpdate;case 9:return r.FileCreate;case 10:return r.FileAppend;case 11:return r.FileUpdate;case 12:return r.FileDelete;case 13:return r.CryptoGetAccountBalance;case 14:return r.CryptoGetAccountRecords;case 15:return r.CryptoGetInfo;case 16:return r.ContractCallLocal;case 17:return r.ContractGetInfo;case 18:return r.ContractGetBytecode;case 19:return r.GetBySolidityID;case 20:return r.GetByKey;case 21:return r.CryptoGetLiveHash;case 22:return r.CryptoGetStakers;case 23:return r.FileGetContents;case 24:return r.FileGetInfo;case 25:return r.TransactionGetRecord;case 26:return r.ContractGetRecords;case 27:return r.CryptoCreate;case 28:return r.SystemDelete;case 29:return r.SystemUndelete;case 30:return r.ContractDelete;case 31:return r.Freeze;case 32:return r.CreateTransactionRecord;case 33:return r.CryptoAccountAutoRenew;case 34:return r.ContractAutoRenew;case 35:return r.GetVersionInfo;case 36:return r.TransactionGetReceipt;case 50:return r.ConsensusCreateTopic;case 51:return r.ConsensusUpdateTopic;case 52:return r.ConsensusDeleteTopic;case 53:return r.ConsensusGetTopicInfo;case 54:return r.ConsensusSubmitMessage;case 55:return r.UncheckedSubmit;case 56:return r.TokenCreate;case 58:return r.TokenGetInfo;case 59:return r.TokenFreezeAccount;case 60:return r.TokenUnfreezeAccount;case 61:return r.TokenGrantKycToAccount;case 62:return r.TokenRevokeKycFromAccount;case 63:return r.TokenDelete;case 64:return r.TokenUpdate;case 65:return r.TokenMint;case 66:return r.TokenBurn;case 67:return r.TokenAccountWipe;case 68:return r.TokenAssociateToAccount;case 69:return r.TokenDissociateFromAccount;case 70:return r.ScheduleCreate;case 71:return r.ScheduleDelete;case 72:return r.ScheduleSign;case 73:return r.ScheduleGetInfo;case 74:return r.TokenGetAccountNftInfos;case 75:return r.TokenGetNftInfo;case 76:return r.TokenGetNftInfos;case 77:return r.TokenFeeScheduleUpdate;case 78:return r.NetworkGetExecutionTime;case 79:return r.TokenPause;case 80:return r.TokenUnpause;case 81:return r.CryptoApproveAllowance;case 82:return r.CryptoDeleteAllowance;case 83:return r.GetAccountDetails;case 84:return r.EthereumTransaction;case 85:return r.NodeStakeUpdate;case 86:return r.Prng}throw new Error(`(BUG) RequestType.fromCode() does not handle code: ${e}`)}valueOf(){return this._code}};xe.None=new xe(0);xe.CryptoTransfer=new xe(1);xe.CryptoUpdate=new xe(2);xe.CryptoDelete=new xe(3);xe.CryptoAddLiveHash=new xe(4);xe.CryptoDeleteLiveHash=new xe(5);xe.ContractCall=new xe(6);xe.ContractCreate=new xe(7);xe.ContractUpdate=new xe(8);xe.FileCreate=new xe(9);xe.FileAppend=new xe(10);xe.FileUpdate=new xe(11);xe.FileDelete=new xe(12);xe.CryptoGetAccountBalance=new xe(13);xe.CryptoGetAccountRecords=new xe(14);xe.CryptoGetInfo=new xe(15);xe.ContractCallLocal=new xe(16);xe.ContractGetInfo=new xe(17);xe.ContractGetBytecode=new xe(18);xe.GetBySolidityID=new xe(19);xe.GetByKey=new xe(20);xe.CryptoGetLiveHash=new xe(21);xe.CryptoGetStakers=new xe(22);xe.FileGetContents=new xe(23);xe.FileGetInfo=new xe(24);xe.TransactionGetRecord=new xe(25);xe.ContractGetRecords=new xe(26);xe.CryptoCreate=new xe(27);xe.SystemDelete=new xe(28);xe.SystemUndelete=new xe(29);xe.ContractDelete=new xe(30);xe.Freeze=new xe(31);xe.CreateTransactionRecord=new xe(32);xe.CryptoAccountAutoRenew=new xe(33);xe.ContractAutoRenew=new xe(34);xe.GetVersionInfo=new xe(35);xe.TransactionGetReceipt=new xe(36);xe.ConsensusCreateTopic=new xe(50);xe.ConsensusUpdateTopic=new xe(51);xe.ConsensusDeleteTopic=new xe(52);xe.ConsensusGetTopicInfo=new xe(53);xe.ConsensusSubmitMessage=new xe(54);xe.UncheckedSubmit=new xe(55);xe.TokenCreate=new xe(56);xe.TokenGetInfo=new xe(58);xe.TokenFreezeAccount=new xe(59);xe.TokenUnfreezeAccount=new xe(60);xe.TokenGrantKycToAccount=new xe(61);xe.TokenRevokeKycFromAccount=new xe(62);xe.TokenDelete=new xe(63);xe.TokenUpdate=new xe(64);xe.TokenMint=new xe(65);xe.TokenBurn=new xe(66);xe.TokenAccountWipe=new xe(67);xe.TokenAssociateToAccount=new xe(68);xe.TokenDissociateFromAccount=new xe(69);xe.ScheduleCreate=new xe(70);xe.ScheduleDelete=new xe(71);xe.ScheduleSign=new xe(72);xe.ScheduleGetInfo=new xe(73);xe.TokenGetAccountNftInfos=new xe(74);xe.TokenGetNftInfo=new xe(75);xe.TokenGetNftInfos=new xe(76);xe.TokenFeeScheduleUpdate=new xe(77);xe.NetworkGetExecutionTime=new xe(78);xe.TokenPause=new xe(79);xe.TokenUnpause=new xe(80);xe.CryptoApproveAllowance=new xe(81);xe.CryptoDeleteAllowance=new xe(82);xe.GetAccountDetails=new xe(83);xe.EthereumTransaction=new xe(84);xe.NodeStakeUpdate=new xe(85);xe.Prng=new xe(86);var lGe=Ie(vr(),1);var lv=class r extends xr{constructor(e={}){super(),this._fileId=null,e.fileId!=null&&this.setFileId(e.fileId)}static _fromProtobuf(e){let t=e.fileGetContents;return new r({fileId:t.fileID!=null?zt._fromProtobuf(t.fileID):void 0})}_validateChecksums(e){this._fileId!=null&&this._fileId.validateChecksum(e)}_execute(e,t){return e.file.getFileContent(t)}get fileId(){return this._fileId}setFileId(e){return this._fileId=typeof e=="string"?zt.fromString(e):e.clone(),this}_mapResponseHeader(e){return e.fileGetContents.header}_mapResponse(e){let i=e.fileGetContents.fileContents.contents;return Promise.resolve(i)}_onMakeRequest(e){return{fileGetContents:{header:e,fileID:this._fileId!=null?this._fileId._toProtobuf():null}}}_getLogId(){return`FileContentsQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("fileGetContents",lv._fromProtobuf);var jB=Ie(Yt(),1);var VB=Ie(vr(),1),{proto:uGe}=VB,Rm=class r{constructor(e){this.fileId=e.fileId,this.size=e.size,this.expirationTime=e.expirationTime,this.isDeleted=e.isDeleted,this.keys=e.keys,this.fileMemo=e.fileMemo,this.ledgerId=e.ledgerId,Object.freeze(this)}static _fromProtobuf(e){let t=e.size;return new r({fileId:zt._fromProtobuf(e.fileID),size:t instanceof jB.default?t:jB.default.fromValue(t),expirationTime:lt._fromProtobuf(e.expirationTime),isDeleted:e.deleted,keys:e.keys!=null?Ri.__fromProtobufKeyList(e.keys):new Ri,fileMemo:e.memo!=null?e.memo:"",ledgerId:e.ledgerId!=null?mr.fromBytes(e.ledgerId):null})}_toProtobuf(){return{fileID:this.fileId._toProtobuf(),size:this.size,expirationTime:this.expirationTime._toProtobuf(),deleted:this.isDeleted,keys:this.keys._toProtobufKey().keyList,memo:this.fileMemo,ledgerId:this.ledgerId!=null?this.ledgerId.toBytes():null}}static fromBytes(e){return r._fromProtobuf(VB.proto.FileGetInfoResponse.FileInfo.decode(e))}toBytes(){return uGe.FileGetInfoResponse.FileInfo.encode(this._toProtobuf()).finish()}};var uv=class r extends xr{constructor(e={}){super(),this._fileId=null,e.fileId!=null&&this.setFileId(e.fileId)}static _fromProtobuf(e){let t=e.fileGetInfo;return new r({fileId:t.fileID!=null?zt._fromProtobuf(t.fileID):void 0})}get fileId(){return this._fileId}setFileId(e){return this._fileId=typeof e=="string"?zt.fromString(e):e.clone(),this}async getCost(e){return super.getCost(e)}_validateChecksums(e){this._fileId!=null&&this._fileId.validateChecksum(e)}_execute(e,t){return e.file.getFileInfo(t)}_mapResponseHeader(e){return e.fileGetInfo.header}_mapResponse(e,t,n){let i=e.fileGetInfo;return Promise.resolve(Rm._fromProtobuf(i.fileInfo))}_onMakeRequest(e){return{fileGetInfo:{header:e,fileID:this._fileId!=null?this._fileId._toProtobuf():null}}}_getLogId(){return`FileInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("fileGetInfo",uv._fromProtobuf);var dv=class r extends ke{constructor(e={}){super(),this._fileId=null,this._keys=null,this._expirationTime=null,this._contents=null,this._fileMemo=null,e.fileId!=null&&this.setFileId(e.fileId),e.keys!=null&&this.setKeys(e.keys),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime),e.contents!=null&&this.setContents(e.contents),e.fileMemo!=null&&this.setFileMemo(e.fileMemo)}static _fromProtobuf(e,t,n,i,a){let s=a[0].fileUpdate;return ke._fromProtobufTransactions(new r({fileId:s.fileID!=null?zt._fromProtobuf(s.fileID):void 0,keys:s.keys!=null&&s.keys.keys!=null?s.keys.keys.map(c=>rt._fromProtobufKey(c)):void 0,expirationTime:s.expirationTime!=null?lt._fromProtobuf(s.expirationTime):void 0,contents:s.contents!=null?s.contents:void 0,fileMemo:s.memo!=null&&s.memo.value!=null?s.memo.value:void 0}),e,t,n,i,a)}get fileId(){return this._fileId}setFileId(e){return this._requireNotFrozen(),this._fileId=typeof e=="string"?zt.fromString(e):e.clone(),this}get keys(){return this._keys}setKeys(e){if(this._requireNotFrozen(),e instanceof Ri&&e.threshold!=null)throw new Error("Cannot set threshold key as file key");return this._keys=e instanceof Ri?e.toArray():e,this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof lt?e:lt.fromDate(e),this}get contents(){return this._contents}setContents(e){return this._requireNotFrozen(),this._contents=e instanceof Uint8Array?e:n3(e),this}get fileMemo(){return this._fileMemo}setFileMemo(e){return this._requireNotFrozen(),this._fileMemo=e,this}clearFileMemo(){return this._requireNotFrozen(),this._fileMemo=null,this}_validateChecksums(e){this._fileId!=null&&this._fileId.validateChecksum(e)}_execute(e,t){return e.file.updateFile(t)}_getTransactionDataCase(){return"fileUpdate"}_makeTransactionData(){return{fileID:this._fileId!=null?this._fileId._toProtobuf():null,keys:this._keys!=null?{keys:this._keys.map(e=>e._toProtobufKey())}:null,expirationTime:this._expirationTime!=null?this._expirationTime._toProtobuf():null,contents:this._contents,memo:this._fileMemo!=null?{value:this._fileMemo}:null}}_getLogId(){return`FileUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("fileUpdate",dv._fromProtobuf);var Eo=class r{constructor(e){this._code=e,Object.freeze(this)}toString(){switch(this){case r.UnknownFreezeType:return"UNKNOWN_FREEZE_TYPE";case r.FreezeOnly:return"FREEZE_ONLY";case r.PrepareUpgrade:return"PREPARE_UPGRADE";case r.FreezeUpgrade:return"FREEZE_UPGRADE";case r.FreezeAbort:return"FREEZE_ABORT";case r.TelemetryUpgrade:return"TELEMETRY_UPGRADE";default:return`UNKNOWN (${this._code})`}}static _fromCode(e){switch(e){case 0:return r.UnknownFreezeType;case 1:return r.FreezeOnly;case 2:return r.PrepareUpgrade;case 3:return r.FreezeUpgrade;case 4:return r.FreezeAbort;case 5:return r.TelemetryUpgrade;default:throw new Error(`(BUG) Status.fromCode() does not handle code: ${e}`)}}valueOf(){return this._code}};Eo.UnknownFreezeType=new Eo(0);Eo.FreezeOnly=new Eo(1);Eo.PrepareUpgrade=new Eo(2);Eo.FreezeUpgrade=new Eo(3);Eo.FreezeAbort=new Eo(4);Eo.TelemetryUpgrade=new Eo(5);var fv=class r extends ke{constructor(e={}){super(),this._startTime=null,this._startTimestamp=null,this._endTime=null,this._fileId=null,this._fileHash=null,this._freezeType=null,e.startTime!=null&&this.setStartTime(e.startTime.hour,e.startTime.minute),e.endTime!=null&&this.setEndTime(e.endTime.hour,e.endTime.minute),e.startTimestamp!=null&&this.setStartTimestamp(e.startTimestamp),e.updateFileId!=null&&this.setUpdateFileId(e.updateFileId),e.fileId!=null&&this.setFileId(e.fileId),e.fileHash!=null&&this.setFileHash(e.fileHash),e.freezeType!=null&&this.setFreezeType(e.freezeType)}static _fromProtobuf(e,t,n,i,a){let s=a[0].freeze;return ke._fromProtobufTransactions(new r({startTime:s.startHour!=null&&s.startMin!=null?{hour:s.startHour,minute:s.startMin}:void 0,endTime:s.endHour!=null&&s.endMin!=null?{hour:s.endHour,minute:s.endMin}:void 0,startTimestamp:s.startTime!=null?lt._fromProtobuf(s.startTime):void 0,updateFileId:s.updateFile!=null?zt._fromProtobuf(s.updateFile):void 0,fileHash:s.fileHash!=null?s.fileHash:void 0,freezeType:s.freezeType!=null?Eo._fromCode(s.freezeType):void 0}),e,t,n,i,a)}get startTime(){return null}setStartTime(e,t){if(this._requireNotFrozen(),typeof e=="string"){let n=e.split(":");this._startTime={hour:Number(n[0]),minute:Number(n[1])}}else this._startTime={hour:e,minute:t};return this}get startTimestamp(){return this._startTimestamp}setStartTimestamp(e){return this._requireNotFrozen(),this._startTimestamp=e,this}get endTime(){return console.warn("`FreezeTransaction.endTime` is deprecated"),this._endTime}setEndTime(e,t){if(console.warn("`FreezeTransaction.endTime` is deprecated"),this._requireNotFrozen(),typeof e=="string"){let n=e.split(":");this._endTime={hour:Number(n[0]),minute:Number(n[1])}}else this._endTime={hour:e,minute:t};return this}get updateFileId(){return this.fileId}setUpdateFileId(e){return this.setFileId(e)}get fileId(){return this._fileId}setFileId(e){return this._requireNotFrozen(),this._fileId=e,this}get fileHash(){return this._fileHash}setFileHash(e){return this._requireNotFrozen(),this._fileHash=typeof e=="string"?et(e):e,this}get freezeType(){return this._freezeType}setFreezeType(e){return this._requireNotFrozen(),this._freezeType=e,this}_getTransactionDataCase(){return"freeze"}_makeTransactionData(){return{startTime:this._startTimestamp!=null?this._startTimestamp._toProtobuf():null,updateFile:this._fileId!=null?this._fileId._toProtobuf():null,fileHash:this._fileHash,freezeType:this._freezeType!=null?this._freezeType.valueOf():null}}_getLogId(){return`FreezeTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("freeze",fv._fromProtobuf);var pv=class r extends ke{constructor(e={}){super(),this._hash=null,this._keys=null,this._duration=null,this._accountId=null,e.hash!=null&&this.setHash(e.hash),e.keys!=null&&this.setKeys(e.keys),e.duration!=null&&this.setDuration(e.duration),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let c=a[0].cryptoAddLiveHash.liveHash;return ke._fromProtobufTransactions(new r({hash:c.hash!=null?c.hash:void 0,keys:c.keys!=null&&c.keys.keys!=null?c.keys.keys.map(l=>rt._fromProtobufKey(l)):void 0,duration:c.duration!=null&&c.duration.seconds!=null?c.duration.seconds:void 0,accountId:c.accountId!=null?ne._fromProtobuf(c.accountId):void 0}),e,t,n,i,a)}get hash(){return this._hash}setHash(e){return this._requireNotFrozen(),this._hash=e,this}get keys(){return this._keys}setKeys(e){return this._requireNotFrozen(),this._keys=e instanceof Ri?e.toArray():e,this}get duration(){return this._duration}setDuration(e){return this._requireNotFrozen(),this._duration=e instanceof fr?e:new fr(e),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.crypto.addLiveHash(t)}_getTransactionDataCase(){return"cryptoAddLiveHash"}_makeTransactionData(){return{liveHash:{hash:this._hash,keys:this._keys!=null?{keys:this._keys.map(e=>e._toProtobufKey())}:void 0,duration:this._duration!=null?this._duration._toProtobuf():null,accountId:this._accountId!=null?this._accountId._toProtobuf():null}}}_getLogId(){return`LiveHashAddTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("cryptoAddLiveHash",pv._fromProtobuf);var hv=class r extends ke{constructor(e={}){super(),this._hash=null,this._accountId=null,e.hash!=null&&this.setHash(e.hash),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoDeleteLiveHash;return ke._fromProtobufTransactions(new r({hash:s.liveHashToDelete!=null?s.liveHashToDelete:void 0,accountId:s.accountOfLiveHash!=null?ne._fromProtobuf(s.accountOfLiveHash):void 0}),e,t,n,i,a)}get hash(){return this._hash}setHash(e){return this._requireNotFrozen(),this._hash=e,this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.crypto.deleteLiveHash(t)}_getTransactionDataCase(){return"cryptoDeleteLiveHash"}_makeTransactionData(){return{liveHashToDelete:this._hash,accountOfLiveHash:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`LiveHashDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("cryptoDeleteLiveHash",hv._fromProtobuf);var mv=class r extends xr{constructor(e={}){super(),this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId),this._hash=null,e.hash!=null&&this.setHash(e.hash)}static _fromProtobuf(e){let t=e.cryptoGetLiveHash;return new r({accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):void 0,hash:t.hash!=null?t.hash:void 0})}get accountId(){return this._accountId}setAccountId(e){return this._accountId=e instanceof ne?e:ne.fromString(e),this}get liveHash(){return this._hash}setHash(e){return this._hash=e,this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.crypto.getLiveHash(t)}_mapResponseHeader(e){return e.cryptoGetLiveHash.header}_mapResponse(e){let t=e.cryptoGetLiveHash;return Promise.resolve(Of._fromProtobuf(t.liveHash))}_onMakeRequest(e){return{cryptoGetLiveHash:{header:e,accountID:this._accountId!=null?this._accountId._toProtobuf():null,hash:this._hash}}}_getLogId(){return`LiveHashQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("cryptoGetLiveHash",mv._fromProtobuf);var HB=Ie(vr(),1),m1=class r{constructor(e){this.major=e.major,this.minor=e.minor,this.patch=e.patch,Object.freeze(this)}static _fromProtobuf(e){return new r({major:e.major,minor:e.minor,patch:e.patch})}_toProtobuf(){return{major:this.major,minor:this.minor,patch:this.patch}}static fromBytes(e){return r._fromProtobuf(HB.proto.SemanticVersion.decode(e))}toBytes(){return HB.proto.SemanticVersion.encode(this._toProtobuf()).finish()}};var KB=Ie(vr(),1),Om=class r{constructor(e){this.protobufVersion=e.protobufVersion,this.servicesVesion=e.servicesVesion,Object.freeze(this)}static _fromProtobuf(e){return new r({protobufVersion:m1._fromProtobuf(e.hapiProtoVersion),servicesVesion:m1._fromProtobuf(e.hederaServicesVersion)})}_toProtobuf(){return{hapiProtoVersion:this.protobufVersion._toProtobuf(),hederaServicesVersion:this.servicesVesion._toProtobuf()}}static fromBytes(e){return r._fromProtobuf(KB.proto.NetworkGetVersionInfoResponse.decode(e))}toBytes(){return KB.proto.NetworkGetVersionInfoResponse.encode(this._toProtobuf()).finish()}};var gv=class r extends xr{constructor(){super()}static _fromProtobuf(e){return new r}_execute(e,t){return e.network.getVersionInfo(t)}_mapResponseHeader(e){return e.networkGetVersionInfo.header}_mapResponse(e){let t=e.networkGetVersionInfo;return Promise.resolve(Om._fromProtobuf(t))}_onMakeRequest(e){return{networkGetVersionInfo:{header:e}}}_getLogId(){return`NetworkVersionInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("networkGetVersionInfo",gv._fromProtobuf);var yv=class r extends ke{constructor(e={}){super(),this._range=null,e.range!=null&&this.setRange(e.range)}setRange(e){return this._range=e,this}get range(){return this._range}_validateChecksums(e){this._range!=null&&Dw(this._range)&&this._validateChecksums(e)}_execute(e,t){return e.util.prng(t)}static _fromProtobuf(e,t,n,i,a){let s=a[0].utilPrng;return ke._fromProtobufTransactions(new r({range:s.range}),e,t,n,i,a)}_getTransactionDataCase(){return"utilPrng"}_makeTransactionData(){return{range:this.range}}_getLogId(){return`RandomGenerate:${this._transactionIds.current.validStart.toString()}`}};Ge.set("utilPrng",yv._fromProtobuf);var Hx=Ie(vr(),1),Dm=class r extends ke{constructor(e={}){super(),this._adminKey=null,this._scheduledTransaction=null,this._payerAccountId=null,this._scheduleMemo=null,this._scheduledSignerPublicKeys=new Set,this._expirationTime=null,this._waitForExpiry=null,e.adminKey!=null&&this.setAdminKey(e.adminKey),e.payerAccountID!=null&&this.setPayerAccountId(e.payerAccountID),e.scheduleMemo!=null&&this.setScheduleMemo(e.scheduleMemo),this._defaultMaxTransactionFee=new ze(5)}static _fromProtobuf(e,t,n,i,a){let o=a[0],s=o.scheduleCreate,c=new r({adminKey:s.adminKey!=null?rt._fromProtobufKey(s.adminKey):void 0,payerAccountID:s.payerAccountID!=null?ne._fromProtobuf(s.payerAccountID):void 0,scheduleMemo:s.memo!=null?s.memo:void 0,waitForExpiry:s.waitForExpiry!=null?s.waitForExpiry:void 0,expirationTime:s.expirationTime!=null?lt._fromProtobuf(s.expirationTime):void 0});if(o.scheduleCreate!=null){let l=o.scheduleCreate.scheduledTransactionBody,u=Hx.proto.TransactionBody.encode(l).finish(),h={signedTransactionBytes:Hx.proto.SignedTransaction.encode({bodyBytes:u}).finish()},g=Hx.proto.TransactionList.encode({transactionList:[h]}).finish(),m=ke.fromBytes(g);c._setScheduledTransaction(m)}return ke._fromProtobufTransactions(c,e,t,n,i,a)}_setScheduledTransaction(e){return this._scheduledTransaction=e,this}get adminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}get payerAccountId(){return this._payerAccountId}setPayerAccountId(e){return this._requireNotFrozen(),this._payerAccountId=e,this}setScheduleMemo(e){return this._requireNotFrozen(),this._scheduleMemo=e,this}get getScheduleMemo(){return this._requireNotFrozen(),this._scheduleMemo}setScheduledTransaction(e){return this._requireNotFrozen(),e._requireNotFrozen(),this._scheduledTransaction=e.schedule()._scheduledTransaction,this}_validateChecksums(e){this._payerAccountId!=null&&this._payerAccountId.validateChecksum(e)}_execute(e,t){return e.schedule.createSchedule(t)}_getTransactionDataCase(){return"scheduleCreate"}_makeTransactionData(){return{adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,payerAccountID:this._payerAccountId!=null?this._payerAccountId._toProtobuf():null,scheduledTransactionBody:this._scheduledTransaction!=null?this._scheduledTransaction._getScheduledTransactionBody():null,memo:this._scheduleMemo,waitForExpiry:this._waitForExpiry,expirationTime:this._expirationTime!=null?this._expirationTime._toProtobuf():null}}_getLogId(){return`ScheduleCreateTransaction:${this._transactionIds.current.validStart.toString()}`}setExpirationTime(e){return this._expirationTime=e,this}get expirationTime(){return this._requireNotFrozen(),this._expirationTime}setWaitForExpiry(e){return this._waitForExpiry=e,this}get waitForExpiry(){return this._requireNotFrozen(),this._waitForExpiry}};Ge.set("scheduleCreate",Dm._fromProtobuf);Bx.push(()=>new Dm);var vv=class r extends ke{constructor(e={}){super(),this._scheduleId=null,e.scheduleId!=null&&this.setScheduleId(e.scheduleId),this._defaultMaxTransactionFee=new ze(5)}static _fromProtobuf(e,t,n,i,a){let s=a[0].scheduleDelete;return ke._fromProtobufTransactions(new r({scheduleId:s.scheduleID!=null?Na._fromProtobuf(s.scheduleID):void 0}),e,t,n,i,a)}get scheduleId(){return this._scheduleId}setScheduleId(e){return this._requireNotFrozen(),this._scheduleId=typeof e=="string"?Na.fromString(e):e.clone(),this}_validateChecksums(e){this._scheduleId!=null&&this._scheduleId.validateChecksum(e)}_execute(e,t){return e.schedule.deleteSchedule(t)}_getTransactionDataCase(){return"scheduleDelete"}_makeTransactionData(){return{scheduleID:this._scheduleId!=null?this._scheduleId._toProtobuf():null}}_getLogId(){return`ScheduleDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("scheduleDelete",vv._fromProtobuf);var dGe=Ie(vr(),1);var{proto:Kx}=dGe,Pm=class r{constructor(e){this.scheduleId=e.scheduleId,this.creatorAccountId=e.creatorAccountID,this.payerAccountId=e.payerAccountID,this.schedulableTransactionBody=e.schedulableTransactionBody,this.signers=e.signers,this.scheduleMemo=e.scheduleMemo,this.adminKey=e.adminKey!=null?e.adminKey:null,this.expirationTime=e.expirationTime,this.executed=e.executed,this.deleted=e.deleted,this.scheduledTransactionId=e.scheduledTransactionId,this.waitForExpiry=e.waitForExpiry,Object.freeze(this)}static _fromProtobuf(e){return new r({scheduleId:Na._fromProtobuf(e.scheduleID),creatorAccountID:e.creatorAccountID!=null?ne._fromProtobuf(e.creatorAccountID):null,payerAccountID:e.payerAccountID!=null?ne._fromProtobuf(e.payerAccountID):null,schedulableTransactionBody:e.scheduledTransactionBody!=null?e.scheduledTransactionBody:null,adminKey:e.adminKey!=null?rt._fromProtobufKey(e.adminKey):null,signers:e.signers!=null?Ri.__fromProtobufKeyList(e.signers):null,scheduleMemo:e.memo!=null?e.memo:null,expirationTime:e.expirationTime!=null?lt._fromProtobuf(e.expirationTime):null,executed:e.executionTime!=null?lt._fromProtobuf(e.executionTime):null,deleted:e.deletionTime!=null?lt._fromProtobuf(e.deletionTime):null,scheduledTransactionId:e.scheduledTransactionID!=null?Wr._fromProtobuf(e.scheduledTransactionID):null,waitForExpiry:e.waitForExpiry!=null?e.waitForExpiry:!1})}_toProtobuf(){return{scheduleID:this.scheduleId!=null?this.scheduleId._toProtobuf():null,creatorAccountID:this.creatorAccountId!=null?this.creatorAccountId._toProtobuf():null,payerAccountID:this.payerAccountId!=null?this.payerAccountId._toProtobuf():null,scheduledTransactionBody:this.schedulableTransactionBody!=null?this.schedulableTransactionBody:null,adminKey:this.adminKey!=null?this.adminKey._toProtobufKey():null,signers:this.signers!=null?this.signers._toProtobufKey().keyList:null,memo:this.scheduleMemo!=null?this.scheduleMemo:"",expirationTime:this.expirationTime!=null?this.expirationTime._toProtobuf():null,scheduledTransactionID:this.scheduledTransactionId!=null?this.scheduledTransactionId._toProtobuf():null,waitForExpiry:this.waitForExpiry}}get scheduledTransaction(){if(this.schedulableTransactionBody==null)throw new Error("Scheduled transaction body is empty");let e=new Kx.SchedulableTransactionBody(this.schedulableTransactionBody),t=e.data;return ke.fromBytes(Kx.TransactionList.encode({transactionList:[{signedTransactionBytes:Kx.SignedTransaction.encode({bodyBytes:Kx.TransactionBody.encode({transactionFee:this.schedulableTransactionBody.transactionFee,memo:this.schedulableTransactionBody.memo,[t]:e[t]}).finish()}).finish()}]}).finish())}};var bv=class r extends xr{constructor(e={}){super(),this._scheduleId=null,e.scheduleId!=null&&this.setScheduleId(e.scheduleId)}static _fromProtobuf(e){let t=e.scheduleGetInfo;return new r({scheduleId:t.scheduleID!=null?Na._fromProtobuf(t.scheduleID):void 0})}get scheduleId(){return this._scheduleId}setScheduleId(e){return this._scheduleId=typeof e=="string"?Na.fromString(e):e.clone(),this}async getCost(e){return super.getCost(e)}_validateChecksums(e){this._scheduleId!=null&&this._scheduleId.validateChecksum(e)}_execute(e,t){return e.schedule.getScheduleInfo(t)}_mapResponseHeader(e){return e.scheduleGetInfo.header}_mapResponse(e,t,n){let i=e.scheduleGetInfo;return Promise.resolve(Pm._fromProtobuf(i.scheduleInfo))}_onMakeRequest(e){return{scheduleGetInfo:{header:e,scheduleID:this._scheduleId!=null?this._scheduleId._toProtobuf():null}}}_getLogId(){return`ScheduleInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("scheduleGetInfo",bv._fromProtobuf);var wv=class r extends ke{constructor(e={}){super(),this._scheduleId=null,e.scheduleId!=null&&this.setScheduleId(e.scheduleId),this._defaultMaxTransactionFee=new ze(5)}static _fromProtobuf(e,t,n,i,a){let s=a[0].scheduleSign;return ke._fromProtobufTransactions(new r({scheduleId:s.scheduleID!=null?Na._fromProtobuf(s.scheduleID):void 0}),e,t,n,i,a)}get scheduleId(){return this._scheduleId}setScheduleId(e){return this._requireNotFrozen(),this._scheduleId=typeof e=="string"?Na.fromString(e):e.clone(),this}_validateChecksums(e){this._scheduleId!=null&&this._scheduleId.validateChecksum(e)}_execute(e,t){return e.schedule.signSchedule(t)}_getTransactionDataCase(){return"scheduleSign"}_makeTransactionData(){return{scheduleID:this._scheduleId!=null?this._scheduleId._toProtobuf():null}}_getLogId(){return`ScheduleSignTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("scheduleSign",wv._fromProtobuf);var Bm=class{constructor(e){this.publicKey=e.publicKey,this.signature=e.signature,this.accountId=e.accountId}};var _v=class r extends ke{constructor(e={}){super(),this._fileId=null,this._contractId=null,this._expirationTime=null,e.fileId!=null&&this.setFileId(e.fileId),e.contractId!=null&&this.setContractId(e.contractId),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime)}static _fromProtobuf(e,t,n,i,a){let s=a[0].systemDelete;return ke._fromProtobufTransactions(new r({fileId:s.fileID!=null?zt._fromProtobuf(s.fileID):void 0,contractId:s.contractID!=null?_t._fromProtobuf(s.contractID):void 0,expirationTime:s.expirationTime!=null?lt._fromProtobuf(s.expirationTime):void 0}),e,t,n,i,a)}get fileId(){return this._fileId}setFileId(e){return this._requireNotFrozen(),this._fileId=e instanceof zt?e:zt.fromString(e),this}get contractId(){return this._contractId}setContractId(e){return this._requireNotFrozen(),this._contractId=e instanceof _t?e:_t.fromString(e),this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e,this}_execute(e,t){return this._fileId!=null?e.file.systemDelete(t):e.smartContract.systemDelete(t)}_getTransactionDataCase(){return"systemDelete"}_makeTransactionData(){return{fileID:this._fileId!=null?this._fileId._toProtobuf():null,contractID:this._contractId!=null?this._contractId._toProtobuf():null,expirationTime:this._expirationTime!=null?this._expirationTime._toProtobuf():null}}_getLogId(){return`SystemDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("systemDelete",_v._fromProtobuf);var Ev=class r extends ke{constructor(e={}){super(),this._fileId=null,this._contractId=null,e.fileId!=null&&this.setFileId(e.fileId),e.contractId!=null&&this.setContractId(e.contractId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].systemUndelete;return ke._fromProtobufTransactions(new r({fileId:s.fileID!=null?zt._fromProtobuf(s.fileID):void 0,contractId:s.contractID!=null?_t._fromProtobuf(s.contractID):void 0}),e,t,n,i,a)}get fileId(){return this._fileId}setFileId(e){return this._requireNotFrozen(),this._fileId=e instanceof zt?e:zt.fromString(e),this}get contractId(){return this._contractId}setContractId(e){return this._requireNotFrozen(),this._contractId=e instanceof _t?e:_t.fromString(e),this}_execute(e,t){return this._fileId!=null?e.file.systemUndelete(t):e.smartContract.systemUndelete(t)}_getTransactionDataCase(){return"systemUndelete"}_makeTransactionData(){return{fileID:this._fileId!=null?this._fileId._toProtobuf():null,contractID:this._contractId!=null?this._contractId._toProtobuf():null}}_getLogId(){return`SystemUndeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("systemUndelete",Ev._fromProtobuf);var xv=class r extends ke{constructor(e={}){super(),this._tokenIds=null,this._accountId=null,this._defaultMaxTransactionFee=new ze(5),e.tokenIds!=null&&this.setTokenIds(e.tokenIds),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenAssociate;return ke._fromProtobufTransactions(new r({tokenIds:s.tokens!=null?s.tokens.map(c=>Oe._fromProtobuf(c)):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0}),e,t,n,i,a)}get tokenIds(){return this._tokenIds}setTokenIds(e){return this._requireNotFrozen(),this._tokenIds=e.map(t=>typeof t=="string"?Oe.fromString(t):t.clone()),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e);for(let t of this._tokenIds!=null?this._tokenIds:[])t?.validateChecksum(e)}_execute(e,t){return e.token.associateTokens(t)}_getTransactionDataCase(){return"tokenAssociate"}_makeTransactionData(){return{tokens:this._tokenIds!=null?this._tokenIds.map(e=>e._toProtobuf()):null,account:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`TokenAssociateTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenAssociate",xv._fromProtobuf);var Av=Ie(Yt(),1),Tv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._amount=null,this._serials=[],e.tokenId!=null&&this.setTokenId(e.tokenId),e.amount!=null&&this.setAmount(e.amount),e.serials!=null&&this.setSerials(e.serials)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenBurn;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?Oe._fromProtobuf(s.token):void 0,amount:s.amount!=null?s.amount:void 0,serials:s.serialNumbers!=null?s.serialNumbers:void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?Oe.fromString(e):e.clone(),this}get amount(){return this._amount}setAmount(e){return this._requireNotFrozen(),this._amount=e instanceof Av.default?e:Av.default.fromValue(e),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e)}get serials(){return this._serials}setSerials(e){return this._requireNotFrozen(),this._serials=e.map(t=>t instanceof Av.default?t:Av.default.fromValue(t)),this}_execute(e,t){return e.token.burnToken(t)}_getTransactionDataCase(){return"tokenBurn"}_makeTransactionData(){return{amount:this._amount,serialNumbers:this._serials,token:this._tokenId!=null?this._tokenId._toProtobuf():null}}_getLogId(){return`TokenBurnTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenBurn",Tv._fromProtobuf);var Sv=Ie(Yt(),1);var rc=class r{constructor(e){this._code=e,Object.freeze(this)}toString(){switch(this){case r.FungibleCommon:return"FUNGIBLE_COMMON";case r.NonFungibleUnique:return"NON_FUNGIBLE_UNIQUE";default:return`UNKNOWN (${this._code})`}}static _fromCode(e){switch(e){case 0:return r.FungibleCommon;case 1:return r.NonFungibleUnique}throw new Error(`(BUG) TokenType.fromCode() does not handle code: ${e}`)}valueOf(){return this._code}};rc.FungibleCommon=new rc(0);rc.NonFungibleUnique=new rc(1);var nc=class r{constructor(e){this._code=e,Object.freeze(this)}toString(){switch(this){case r.Infinite:return"INFINITE";case r.Finite:return"FINITE";default:return`UNKNOWN (${this._code})`}}static _fromCode(e){switch(e){case 0:return r.Infinite;case 1:return r.Finite}throw new Error(`(BUG) TokenSupplyType.fromCode() does not handle code: ${e}`)}valueOf(){return this._code}};nc.Infinite=new nc(0);nc.Finite=new nc(1);var Iv=class r extends ke{constructor(e={}){super(),this._tokenName=null,this._tokenSymbol=null,this._decimals=null,this._initialSupply=null,this._treasuryAccountId=null,this._adminKey=null,this._kycKey=null,this._freezeKey=null,this._pauseKey=null,this._wipeKey=null,this._supplyKey=null,this._feeScheduleKey=null,this._freezeDefault=null,this._autoRenewAccountId=null,this._expirationTime=null,this._autoRenewPeriod=new fr(Eu),this._tokenMemo=null,this._customFees=[],this._tokenType=null,this._supplyType=null,this._maxSupply=null,this._defaultMaxTransactionFee=new ze(30),e.tokenName!=null&&this.setTokenName(e.tokenName),e.tokenSymbol!=null&&this.setTokenSymbol(e.tokenSymbol),e.decimals!=null&&this.setDecimals(e.decimals),e.initialSupply!=null&&this.setInitialSupply(e.initialSupply),e.treasuryAccountId!=null&&this.setTreasuryAccountId(e.treasuryAccountId),e.adminKey!=null&&this.setAdminKey(e.adminKey),e.kycKey!=null&&this.setKycKey(e.kycKey),e.freezeKey!=null&&this.setFreezeKey(e.freezeKey),e.pauseKey!=null&&this.setPauseKey(e.pauseKey),e.wipeKey!=null&&this.setWipeKey(e.wipeKey),e.supplyKey!=null&&this.setSupplyKey(e.supplyKey),e.feeScheduleKey!=null&&this.setFeeScheduleKey(e.feeScheduleKey),e.freezeDefault!=null&&this.setFreezeDefault(e.freezeDefault),e.autoRenewAccountId!=null&&this.setAutoRenewAccountId(e.autoRenewAccountId),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.tokenMemo!=null&&this.setTokenMemo(e.tokenMemo),e.customFees!=null&&this.setCustomFees(e.customFees),e.tokenType!=null&&this.setTokenType(e.tokenType),e.supplyType!=null&&this.setSupplyType(e.supplyType),e.maxSupply!=null&&this.setMaxSupply(e.maxSupply)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenCreation;return ke._fromProtobufTransactions(new r({tokenName:s.name!=null?s.name:void 0,tokenSymbol:s.symbol!=null?s.symbol:void 0,decimals:s.decimals!=null?s.decimals:void 0,initialSupply:s.initialSupply!=null?s.initialSupply:void 0,treasuryAccountId:s.treasury!=null?ne._fromProtobuf(s.treasury):void 0,adminKey:s.adminKey!=null?rt._fromProtobufKey(s.adminKey):void 0,kycKey:s.kycKey!=null?rt._fromProtobufKey(s.kycKey):void 0,freezeKey:s.freezeKey!=null?rt._fromProtobufKey(s.freezeKey):void 0,pauseKey:s.pauseKey!=null?rt._fromProtobufKey(s.pauseKey):void 0,wipeKey:s.wipeKey!=null?rt._fromProtobufKey(s.wipeKey):void 0,supplyKey:s.supplyKey!=null?rt._fromProtobufKey(s.supplyKey):void 0,feeScheduleKey:s.feeScheduleKey!=null?rt._fromProtobufKey(s.feeScheduleKey):void 0,freezeDefault:s.freezeDefault!=null?s.freezeDefault:void 0,autoRenewAccountId:s.autoRenewAccount!=null?ne._fromProtobuf(s.autoRenewAccount):void 0,expirationTime:s.expiry!=null?lt._fromProtobuf(s.expiry):void 0,autoRenewPeriod:s.autoRenewPeriod!=null?fr._fromProtobuf(s.autoRenewPeriod):void 0,tokenMemo:s.memo!=null?s.memo:void 0,customFees:s.customFees!=null?s.customFees.map(c=>c.fixedFee!=null?tc._fromProtobuf(c):c.fractionalFee!=null?Iu._fromProtobuf(c):Cu._fromProtobuf(c)):void 0,tokenType:s.tokenType!=null?rc._fromCode(s.tokenType):void 0,supplyType:s.supplyType!=null?nc._fromCode(s.supplyType):void 0,maxSupply:s.maxSupply!=null?s.maxSupply:void 0}),e,t,n,i,a)}get tokenName(){return this._tokenName}setTokenName(e){return this._requireNotFrozen(),this._tokenName=e,this}get tokenSymbol(){return this._tokenSymbol}setTokenSymbol(e){return this._requireNotFrozen(),this._tokenSymbol=e,this}get decimals(){return this._decimals}setDecimals(e){return this._requireNotFrozen(),this._decimals=e instanceof Sv.default?e:Sv.default.fromValue(e),this}get initialSupply(){return this._initialSupply}setInitialSupply(e){return this._requireNotFrozen(),this._initialSupply=Sv.default.fromValue(e),this}get treasuryAccountId(){return this._treasuryAccountId}setTreasuryAccountId(e){return this._requireNotFrozen(),this._treasuryAccountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get adminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}get kycKey(){return this._kycKey}setKycKey(e){return this._requireNotFrozen(),this._kycKey=e,this}get freezeKey(){return this._freezeKey}setFreezeKey(e){return this._requireNotFrozen(),this._freezeKey=e,this}get pauseKey(){return this._pauseKey}setPauseKey(e){return this._requireNotFrozen(),this._pauseKey=e,this}get wipeKey(){return this._wipeKey}setWipeKey(e){return this._requireNotFrozen(),this._wipeKey=e,this}get supplyKey(){return this._supplyKey}setSupplyKey(e){return this._requireNotFrozen(),this._supplyKey=e,this}get feeScheduleKey(){return this._feeScheduleKey}setFeeScheduleKey(e){return this._requireNotFrozen(),this._feeScheduleKey=e,this}get freezeDefault(){return this._freezeDefault}setFreezeDefault(e){return this._requireNotFrozen(),this._freezeDefault=e,this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._autoRenewPeriod=null,this._expirationTime=e instanceof lt?e:lt.fromDate(e),this}get autoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=e instanceof ne?e:ne.fromString(e),this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof fr?e:new fr(e),this}get tokenMemo(){return this._tokenMemo}setTokenMemo(e){return this._requireNotFrozen(),this._tokenMemo=e,this}get customFees(){return this._customFees}setCustomFees(e){return this._customFees=e,this}get tokenType(){return this._tokenType}setTokenType(e){return this._tokenType=e,this}get supplyType(){return this._supplyType}setSupplyType(e){return this._supplyType=e,this}get maxSupply(){return this._maxSupply}setMaxSupply(e){return this._maxSupply=typeof e=="number"?Sv.default.fromNumber(e):e,this}_freezeWithAccountId(e){super._freezeWithAccountId(e),this._autoRenewPeriod!=null&&e!=null&&(this._autoRenewAccountId=e)}freezeWith(e){return e!=null&&e.operatorAccountId!=null&&this._freezeWithAccountId(e.operatorAccountId),super.freezeWith(e)}_validateChecksums(e){this._treasuryAccountId!=null&&this._treasuryAccountId.validateChecksum(e),this._autoRenewAccountId!=null&&this._autoRenewAccountId.validateChecksum(e)}_execute(e,t){return e.token.createToken(t)}_getTransactionDataCase(){return"tokenCreation"}_makeTransactionData(){return{name:this._tokenName,symbol:this._tokenSymbol,decimals:this._decimals!=null?this._decimals.toInt():null,initialSupply:this._initialSupply,treasury:this._treasuryAccountId!=null?this._treasuryAccountId._toProtobuf():null,adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,kycKey:this._kycKey!=null?this._kycKey._toProtobufKey():null,freezeKey:this._freezeKey!=null?this._freezeKey._toProtobufKey():null,pauseKey:this._pauseKey!=null?this._pauseKey._toProtobufKey():null,wipeKey:this._wipeKey!=null?this._wipeKey._toProtobufKey():null,supplyKey:this._supplyKey!=null?this._supplyKey._toProtobufKey():null,feeScheduleKey:this._feeScheduleKey!=null?this._feeScheduleKey._toProtobufKey():null,freezeDefault:this._freezeDefault,autoRenewAccount:this._autoRenewAccountId!=null?this._autoRenewAccountId._toProtobuf():null,expiry:this._expirationTime!=null?this._expirationTime._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod!=null?this._autoRenewPeriod._toProtobuf():null,memo:this._tokenMemo,customFees:this.customFees.map(e=>e._toProtobuf()),tokenType:this._tokenType!=null?this._tokenType._code:null,supplyType:this._supplyType!=null?this._supplyType._code:null,maxSupply:this.maxSupply}}_getLogId(){return`TokenCreateTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenCreation",Iv._fromProtobuf);var Cv=class r extends ke{constructor(e={}){super(),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenDeletion;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?Oe._fromProtobuf(s.token):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?Oe.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e)}_execute(e,t){return e.token.deleteToken(t)}_getTransactionDataCase(){return"tokenDeletion"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null}}_getLogId(){return`TokenDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenDeletion",Cv._fromProtobuf);var kv=class r extends ke{constructor(e={}){super(),this._tokenIds=null,this._accountId=null,this._defaultMaxTransactionFee=new ze(5),e.tokenIds!=null&&this.setTokenIds(e.tokenIds),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenDissociate;return ke._fromProtobufTransactions(new r({tokenIds:s.tokens!=null?s.tokens.map(c=>Oe._fromProtobuf(c)):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0}),e,t,n,i,a)}get tokenIds(){return this._tokenIds}setTokenIds(e){return this._requireNotFrozen(),this._tokenIds=e.map(t=>typeof t=="string"?Oe.fromString(t):t.clone()),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e);for(let t of this._tokenIds!=null?this._tokenIds:[])t?.validateChecksum(e)}_execute(e,t){return e.token.dissociateTokens(t)}_getTransactionDataCase(){return"tokenDissociate"}_makeTransactionData(){return{tokens:this._tokenIds!=null?this._tokenIds.map(e=>e._toProtobuf()):null,account:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`TokenDissociateTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenDissociate",kv._fromProtobuf);var Nv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._customFees=[],e.tokenId!=null&&this.setTokenId(e.tokenId),e.customFees!=null&&this.setCustomFees(e.customFees)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenFeeScheduleUpdate;return ke._fromProtobufTransactions(new r({tokenId:s.tokenId!=null?Oe._fromProtobuf(s.tokenId):void 0,customFees:s.customFees!=null?s.customFees.map(c=>c.fixedFee!=null?tc._fromProtobuf(c):c.fractionalFee!=null?Iu._fromProtobuf(c):Cu._fromProtobuf(c)):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?Oe.fromString(e):Oe._fromProtobuf(e._toProtobuf()),this}get customFees(){return this._customFees}setCustomFees(e){return this._requireNotFrozen(),this._customFees=e,this}_execute(e,t){return e.token.updateTokenFeeSchedule(t)}_getTransactionDataCase(){return"tokenFeeScheduleUpdate"}_makeTransactionData(){return{tokenId:this._tokenId!=null?this._tokenId._toProtobuf():null,customFees:this._customFees.map(e=>e._toProtobuf())}}_getLogId(){return`TokenFeeScheduleUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenFeeScheduleUpdate",Nv._fromProtobuf);var Rv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._accountId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenFreeze;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?Oe._fromProtobuf(s.token):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?Oe.fromString(e):e.clone(),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e),this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.token.freezeTokenAccount(t)}_getTransactionDataCase(){return"tokenFreeze"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null,account:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`TokenFreezeTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenFreeze",Rv._fromProtobuf);var Ov=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._accountId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenGrantKyc;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?Oe._fromProtobuf(s.token):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?Oe.fromString(e):e.clone(),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e),this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.token.grantKycToTokenAccount(t)}_getTransactionDataCase(){return"tokenGrantKyc"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null,account:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`TokenGrantKycTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenGrantKyc",Ov._fromProtobuf);var j3e=Ie(Yt(),1),zB=Ie(vr(),1);var Mm=class r{constructor(e){this.tokenId=e.tokenId,this.name=e.name,this.symbol=e.symbol,this.decimals=e.decimals,this.totalSupply=e.totalSupply,this.treasuryAccountId=e.treasuryAccountId,this.adminKey=e.adminKey,this.kycKey=e.kycKey,this.freezeKey=e.freezeKey,this.pauseKey=e.pauseKey,this.wipeKey=e.wipeKey,this.supplyKey=e.supplyKey,this.feeScheduleKey=e.feeScheduleKey,this.defaultFreezeStatus=e.defaultFreezeStatus,this.defaultKycStatus=e.defaultKycStatus,this.pauseStatus=e.pauseStatus,this.isDeleted=e.isDeleted,this.autoRenewAccountId=e.autoRenewAccountId,this.autoRenewPeriod=e.autoRenewPeriod,this.expirationTime=e.expirationTime,this.tokenMemo=e.tokenMemo,this.customFees=e.customFees,this.tokenType=e.tokenType,this.supplyType=e.supplyType,this.maxSupply=e.maxSupply,this.ledgerId=e.ledgerId}static _fromProtobuf(e){let t=e.defaultFreezeStatus,n=e.defaultKycStatus,i=e.pauseStatus,a=e.autoRenewAccount!=null?ne._fromProtobuf(e.autoRenewAccount):new ne(0);return new r({tokenId:Oe._fromProtobuf(e.tokenId),name:e.name,symbol:e.symbol,decimals:e.decimals,totalSupply:j3e.default.fromValue(e.totalSupply),treasuryAccountId:e.treasury!=null?ne._fromProtobuf(e.treasury):null,adminKey:e.adminKey!=null?rt._fromProtobufKey(e.adminKey):null,kycKey:e.kycKey!=null?rt._fromProtobufKey(e.kycKey):null,freezeKey:e.freezeKey!=null?rt._fromProtobufKey(e.freezeKey):null,pauseKey:e.pauseKey!=null?rt._fromProtobufKey(e.pauseKey):null,wipeKey:e.wipeKey!=null?rt._fromProtobufKey(e.wipeKey):null,supplyKey:e.supplyKey!=null?rt._fromProtobufKey(e.supplyKey):null,feeScheduleKey:e.feeScheduleKey!=null?rt._fromProtobufKey(e.feeScheduleKey):null,defaultFreezeStatus:t===0?null:t==1,defaultKycStatus:n===0?null:n==1,pauseStatus:i===0?null:i==1,isDeleted:e.deleted,autoRenewAccountId:a.shard.toInt()==0&&a.realm.toInt()==0&&a.num.toInt()==0?null:a,autoRenewPeriod:e.autoRenewPeriod!=null?fr._fromProtobuf(e.autoRenewPeriod):null,expirationTime:e.expiry!=null?lt._fromProtobuf(e.expiry):null,tokenMemo:e.memo!=null?e.memo:"",customFees:e.customFees!=null?e.customFees.map(o=>o.fixedFee!=null?tc._fromProtobuf(o):o.fractionalFee!=null?Iu._fromProtobuf(o):Cu._fromProtobuf(o)):[],tokenType:e.tokenType!=null?rc._fromCode(e.tokenType):null,supplyType:e.supplyType!=null?nc._fromCode(e.supplyType):null,maxSupply:e.maxSupply!=null?e.maxSupply:null,ledgerId:e.ledgerId!=null?mr.fromBytes(e.ledgerId):null})}_toProtobuf(){return{tokenId:this.tokenId._toProtobuf(),name:this.name,symbol:this.symbol,decimals:this.decimals,totalSupply:this.totalSupply,treasury:this.treasuryAccountId!=null?this.treasuryAccountId._toProtobuf():null,adminKey:this.adminKey!=null?this.adminKey._toProtobufKey():null,kycKey:this.kycKey!=null?this.kycKey._toProtobufKey():null,freezeKey:this.freezeKey!=null?this.freezeKey._toProtobufKey():null,pauseKey:this.pauseKey!=null?this.pauseKey._toProtobufKey():null,wipeKey:this.wipeKey!=null?this.wipeKey._toProtobufKey():null,supplyKey:this.supplyKey!=null?this.supplyKey._toProtobufKey():null,feeScheduleKey:this.feeScheduleKey!=null?this.feeScheduleKey._toProtobufKey():null,defaultFreezeStatus:this.defaultFreezeStatus==null?0:this.defaultFreezeStatus?1:2,defaultKycStatus:this.defaultKycStatus==null?0:this.defaultKycStatus?1:2,pauseStatus:this.pauseStatus==null?0:this.pauseStatus?1:2,deleted:this.isDeleted,autoRenewAccount:this.autoRenewAccountId!=null?this.autoRenewAccountId._toProtobuf():void 0,autoRenewPeriod:this.autoRenewPeriod!=null?this.autoRenewPeriod._toProtobuf():null,expiry:this.expirationTime!=null?this.expirationTime._toProtobuf():null,memo:this.tokenMemo,customFees:this.customFees.map(e=>e._toProtobuf()),tokenType:this.tokenType!=null?this.tokenType._code:null,supplyType:this.supplyType!=null?this.supplyType._code:null,maxSupply:this.maxSupply,ledgerId:this.ledgerId!=null?this.ledgerId.toBytes():null}}static fromBytes(e){return r._fromProtobuf(zB.proto.TokenInfo.decode(e))}toBytes(){return zB.proto.TokenInfo.encode(this._toProtobuf()).finish()}};var Dv=class r extends xr{constructor(e={}){super(),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId)}static _fromProtobuf(e){let t=e.tokenGetInfo;return new r({tokenId:t.token!=null?Oe._fromProtobuf(t.token):void 0})}get tokenId(){return this._tokenId}setTokenId(e){return this._tokenId=typeof e=="string"?Oe.fromString(e):e.clone(),this}async getCost(e){return super.getCost(e)}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e)}_execute(e,t){return e.token.getTokenInfo(t)}_mapResponseHeader(e){return e.tokenGetInfo.header}_mapResponse(e,t,n){let i=e.tokenGetInfo;return Promise.resolve(Mm._fromProtobuf(i.tokenInfo))}_onMakeRequest(e){return{tokenGetInfo:{header:e,token:this._tokenId!=null?this._tokenId._toProtobuf():null}}}_getLogId(){return`TokenInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("tokenGetInfo",Dv._fromProtobuf);var GB=Ie(Yt(),1);var Pv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._amount=null,this._metadata=[],e.tokenId!=null&&this.setTokenId(e.tokenId),e.amount!=null&&this.setAmount(e.amount),e.metadata!=null&&this.setMetadata(e.metadata)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenMint;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?Oe._fromProtobuf(s.token):void 0,amount:s.amount!=null?s.amount:void 0,metadata:s.metadata!=null?s.metadata:void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?Oe.fromString(e):e.clone(),this}get amount(){return this._amount}setAmount(e){return this._requireNotFrozen(),this._amount=e instanceof GB.default?e:GB.default.fromValue(e),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e)}get metadata(){return this._metadata}addMetadata(e){return this._requireNotFrozen(),typeof e=="string"&&console.warn("Passing a `string` for token metadata is considered a bug, and has been removed. Please provide a `Uint8Array` instead."),this._metadata.push(typeof e=="string"?et(e):e),this}setMetadata(e){this._requireNotFrozen();for(let t of e)if(typeof t=="string"){console.warn("Passing a `string` for token metadata is considered a bug, and has been removed. Please provide a `Uint8Array` instead.");break}return this._metadata=e.map(t=>typeof t=="string"?et(t):t),this}_execute(e,t){return e.token.mintToken(t)}_getTransactionDataCase(){return"tokenMint"}_makeTransactionData(){return{amount:this._amount,token:this._tokenId!=null?this._tokenId._toProtobuf():null,metadata:this._metadata}}_getLogId(){return`TokenMintTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenMint",Pv._fromProtobuf);var Lm=class r{constructor(e){this.nftId=e.nftId,this.accountId=e.accountId,this.creationTime=e.creationTime,this.metadata=e.metadata,this.ledgerId=e.ledgerId,this.spenderId=e.spenderId,Object.freeze(this)}static _fromProtobuf(e){return new r({nftId:oa._fromProtobuf(e.nftID),accountId:ne._fromProtobuf(e.accountID),creationTime:lt._fromProtobuf(e.creationTime),metadata:e.metadata!==void 0?e.metadata:null,ledgerId:e.ledgerId!=null?mr.fromBytes(e.ledgerId):null,spenderId:e.spenderId!=null?ne._fromProtobuf(e.spenderId):null})}_toProtobuf(){return{nftID:this.nftId._toProtobuf(),accountID:this.accountId._toProtobuf(),creationTime:this.creationTime._toProtobuf(),metadata:this.metadata,ledgerId:this.ledgerId!=null?this.ledgerId.toBytes():null,spenderId:this.spenderId!=null?this.spenderId._toProtobuf():null}}toJson(){return{nftId:this.nftId.toString(),accountId:this.accountId.toString(),creationTime:this.creationTime.toString(),metadata:this.metadata!=null?He(this.metadata):null,ledgerId:this.ledgerId!=null?this.ledgerId.toString():null,spenderId:this.spenderId!=null?this.spenderId.toString():null}}toString(){return JSON.stringify(this.toJson())}};var WB=Ie(Yt(),1),Bv=class r extends xr{constructor(e={}){super(),this._nftId=null,e.nftId!=null&&this.setNftId(e.nftId),this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),this._start=null,e.start!=null&&this.setStart(e.start),this._end=null,e.end!=null&&this.setEnd(e.end)}static _fromProtobuf(e){if(e.tokenGetNftInfo!=null){let t=e.tokenGetNftInfo;return new r({nftId:t.nftID!=null?oa._fromProtobuf(t.nftID):void 0})}else if(e.tokenGetAccountNftInfos!=null){let t=e.tokenGetAccountNftInfos;return new r({accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):void 0,start:t.start!=null?t.start:void 0,end:t.end!=null?t.end:void 0})}else{let t=e.tokenGetNftInfos;return new r({tokenId:t.tokenID!=null?Oe._fromProtobuf(t.tokenID):void 0,start:t.start!=null?t.start:void 0,end:t.end!=null?t.end:void 0})}}get nftId(){return this._nftId}setNftId(e){return this._nftId=typeof e=="string"?oa.fromString(e):oa._fromProtobuf(e._toProtobuf()),this}get accountId(){return console.warn("`TokenNftInfoQuery.accountId` is deprecated with no replacement"),this._accountId}setAccountId(e){return console.warn("`TokenNftInfoQuery.setAccountId()` is deprecated with no replacement"),this._accountId=typeof e=="string"?ne.fromString(e):ne._fromProtobuf(e._toProtobuf()),this}get tokenId(){return console.warn("`TokenNftInfoQuery.tokenId` is deprecated with no replacement"),this._tokenId}setTokenId(e){return console.warn("`TokenNftInfoQuery.setTokenId()` is deprecated with no replacement"),this._tokenId=typeof e=="string"?Oe.fromString(e):Oe._fromProtobuf(e._toProtobuf()),this}get start(){return console.warn("`TokenNftInfoQuery.start` is deprecated with no replacement"),this._start}setStart(e){return console.warn("`TokenNftInfoQuery.setStart()` is deprecated with no replacement"),this._start=typeof e=="number"?WB.default.fromNumber(e):e,this}get end(){return console.warn("`TokenNftInfoQuery.end` is deprecated with no replacement"),this._end}setEnd(e){return console.warn("`TokenNftInfoQuery.setEnd()` is deprecated with no replacement"),this._end=typeof e=="number"?WB.default.fromNumber(e):e,this}async getCost(e){return super.getCost(e)}_execute(e,t){return e.token.getTokenNftInfo(t)}_mapResponseHeader(e){return e.tokenGetNftInfo.header}_mapResponse(e,t,n){let i=[e.tokenGetNftInfo.nft];return Promise.resolve(i.map(a=>Lm._fromProtobuf(a)))}_onMakeRequest(e){return{tokenGetNftInfo:{header:e,nftID:this._nftId!=null?this._nftId._toProtobuf():null}}}_getLogId(){return`TokenNftInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("tokenGetNftInfo",Bv._fromProtobuf);var Mv=class r extends ke{constructor(e={}){super(),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenPause;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?Oe._fromProtobuf(s.token):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?Oe.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e)}_execute(e,t){return e.token.pauseToken(t)}_getTransactionDataCase(){return"tokenPause"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null}}_getLogId(){return`TokenPauseTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenPause",Mv._fromProtobuf);var Lv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._accountId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenRevokeKyc;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?Oe._fromProtobuf(s.token):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?Oe.fromString(e):e.clone(),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e),this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.token.revokeKycFromTokenAccount(t)}_getTransactionDataCase(){return"tokenRevokeKyc"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null,account:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`TokenRevokeKycTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenRevokeKyc",Lv._fromProtobuf);var Fv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._accountId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenUnfreeze;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?Oe._fromProtobuf(s.token):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?Oe.fromString(e):e.clone(),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e),this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.token.unfreezeTokenAccount(t)}_getTransactionDataCase(){return"tokenUnfreeze"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null,account:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`TokenUnfreezeTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenUnfreeze",Fv._fromProtobuf);var Uv=class r extends ke{constructor(e={}){super(),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenUnpause;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?Oe._fromProtobuf(s.token):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?Oe.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e)}_execute(e,t){return e.token.unpauseToken(t)}_getTransactionDataCase(){return"tokenUnpause"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null}}_getLogId(){return`TokenUnpauseTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenUnpause",Uv._fromProtobuf);var qv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._tokenName=null,this._tokenSymbol=null,this._treasuryAccountId=null,this._adminKey=null,this._kycKey=null,this._freezeKey=null,this._wipeKey=null,this._supplyKey=null,this._autoRenewAccountId=null,this._expirationTime=null,this._autoRenewPeriod=null,this._tokenMemo=null,this._feeScheduleKey=null,this._pauseKey=null,e.tokenId!=null&&this.setTokenId(e.tokenId),e.tokenName!=null&&this.setTokenName(e.tokenName),e.tokenSymbol!=null&&this.setTokenSymbol(e.tokenSymbol),e.treasuryAccountId!=null&&this.setTreasuryAccountId(e.treasuryAccountId),e.adminKey!=null&&this.setAdminKey(e.adminKey),e.kycKey!=null&&this.setKycKey(e.kycKey),e.freezeKey!=null&&this.setFreezeKey(e.freezeKey),e.wipeKey!=null&&this.setWipeKey(e.wipeKey),e.supplyKey!=null&&this.setSupplyKey(e.supplyKey),e.autoRenewAccountId!=null&&this.setAutoRenewAccountId(e.autoRenewAccountId),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.tokenMemo!=null&&this.setTokenMemo(e.tokenMemo),e.feeScheduleKey!=null&&this.setFeeScheduleKey(e.feeScheduleKey),e.pauseKey!=null&&this.setPauseKey(e.pauseKey)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenUpdate;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?Oe._fromProtobuf(s.token):void 0,tokenName:s.name!=null?s.name:void 0,tokenSymbol:s.symbol!=null?s.symbol:void 0,treasuryAccountId:s.treasury!=null?ne._fromProtobuf(s.treasury):void 0,adminKey:s.adminKey!=null?rt._fromProtobufKey(s.adminKey):void 0,kycKey:s.kycKey!=null?rt._fromProtobufKey(s.kycKey):void 0,freezeKey:s.freezeKey!=null?rt._fromProtobufKey(s.freezeKey):void 0,wipeKey:s.wipeKey!=null?rt._fromProtobufKey(s.wipeKey):void 0,supplyKey:s.supplyKey!=null?rt._fromProtobufKey(s.supplyKey):void 0,autoRenewAccountId:s.autoRenewAccount!=null?ne._fromProtobuf(s.autoRenewAccount):void 0,expirationTime:s.expiry!=null?lt._fromProtobuf(s.expiry):void 0,autoRenewPeriod:s.autoRenewPeriod!=null?fr._fromProtobuf(s.autoRenewPeriod):void 0,tokenMemo:s.memo!=null&&s.memo.value!=null?s.memo.value:void 0,feeScheduleKey:s.feeScheduleKey!=null?rt._fromProtobufKey(s.feeScheduleKey):void 0,pauseKey:s.pauseKey!=null?rt._fromProtobufKey(s.pauseKey):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?Oe.fromString(e):e.clone(),this}get tokenName(){return this._tokenName}setTokenName(e){return this._requireNotFrozen(),this._tokenName=e,this}get tokenSymbol(){return this._tokenSymbol}setTokenSymbol(e){return this._requireNotFrozen(),this._tokenSymbol=e,this}get treasuryAccountId(){return this._treasuryAccountId}setTreasuryAccountId(e){return this._requireNotFrozen(),this._treasuryAccountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get adminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}get kycKey(){return this._kycKey}setKycKey(e){return this._requireNotFrozen(),this._kycKey=e,this}get freezeKey(){return this._freezeKey}setFreezeKey(e){return this._requireNotFrozen(),this._freezeKey=e,this}get wipeKey(){return this._wipeKey}setWipeKey(e){return this._requireNotFrozen(),this._wipeKey=e,this}get supplyKey(){return this._supplyKey}setSupplyKey(e){return this._requireNotFrozen(),this._supplyKey=e,this}setsupplyKey(e){return this._requireNotFrozen(),this._supplyKey=e,this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof lt?e:lt.fromDate(e),this}get autoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=e instanceof ne?e:ne.fromString(e),this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof fr?e:new fr(e),this}get tokenMemo(){return this._tokenMemo}setTokenMemo(e){return this._requireNotFrozen(),this._tokenMemo=e,this}get feeScheduleKey(){return this._feeScheduleKey}setFeeScheduleKey(e){return this._requireNotFrozen(),this._feeScheduleKey=e,this}get pauseKey(){return this._pauseKey}setPauseKey(e){return this._requireNotFrozen(),this._pauseKey=e,this}clearTokenMemo(){return this._requireNotFrozen(),this._tokenMemo=null,this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e),this._treasuryAccountId!=null&&this._treasuryAccountId.validateChecksum(e),this._autoRenewAccountId!=null&&this._autoRenewAccountId.validateChecksum(e)}_execute(e,t){return e.token.updateToken(t)}_getTransactionDataCase(){return"tokenUpdate"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null,name:this.tokenName,symbol:this.tokenSymbol,treasury:this._treasuryAccountId!=null?this._treasuryAccountId._toProtobuf():null,adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,kycKey:this._kycKey!=null?this._kycKey._toProtobufKey():null,freezeKey:this._freezeKey!=null?this._freezeKey._toProtobufKey():null,pauseKey:this._pauseKey!=null?this._pauseKey._toProtobufKey():null,wipeKey:this._wipeKey!=null?this._wipeKey._toProtobufKey():null,supplyKey:this._supplyKey!=null?this._supplyKey._toProtobufKey():null,autoRenewAccount:this._autoRenewAccountId!=null?this._autoRenewAccountId._toProtobuf():null,expiry:this._expirationTime!=null?this._expirationTime._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod!=null?this._autoRenewPeriod._toProtobuf():null,memo:this._tokenMemo!=null?{value:this._tokenMemo}:null,feeScheduleKey:this._feeScheduleKey!=null?this._feeScheduleKey._toProtobufKey():null}}_getLogId(){return`TokenUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenUpdate",qv._fromProtobuf);var zx=Ie(Yt(),1),jv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._accountId=null,this._serials=[],this._amount=null,e.tokenId!=null&&this.setTokenId(e.tokenId),e.accountId!=null&&this.setAccountId(e.accountId),e.amount!=null&&this.setAmount(e.amount),e.serials!=null&&this.setSerials(e.serials)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenWipe;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?Oe._fromProtobuf(s.token):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0,amount:s.amount!=null?s.amount:void 0,serials:s.serialNumbers!=null?s.serialNumbers:void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?Oe.fromString(e):e.clone(),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get amount(){return this._amount}setAmount(e){return this._requireNotFrozen(),this._amount=e instanceof zx.default?e:zx.default.fromValue(e),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e),this._accountId!=null&&this._accountId.validateChecksum(e)}get serials(){return this._serials}setSerials(e){return this._requireNotFrozen(),this._serials=e.map(t=>typeof t=="number"?zx.default.fromNumber(t):t),this}_execute(e,t){return e.token.wipeTokenAccount(t)}_getTransactionDataCase(){return"tokenWipe"}_makeTransactionData(){return{amount:this._amount,token:this._tokenId!=null?this._tokenId._toProtobuf():null,account:this._accountId!=null?this._accountId._toProtobuf():null,serialNumbers:this.serials}}_getLogId(){return`TokenWipeTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenWipe",jv._fromProtobuf);var Vv=class r extends ke{constructor(e={}){super(),this._adminKey=null,this._submitKey=null,this._autoRenewAccountId=null,this._autoRenewPeriod=new fr(Eu),this._topicMemo=null,e.adminKey!=null&&this.setAdminKey(e.adminKey),e.submitKey!=null&&this.setSubmitKey(e.submitKey),e.autoRenewAccountId!=null&&this.setAutoRenewAccountId(e.autoRenewAccountId),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.topicMemo!=null&&this.setTopicMemo(e.topicMemo)}static _fromProtobuf(e,t,n,i,a){let s=a[0].consensusCreateTopic;return ke._fromProtobufTransactions(new r({adminKey:s.adminKey!=null?rt._fromProtobufKey(s.adminKey):void 0,submitKey:s.submitKey!=null?rt._fromProtobufKey(s.submitKey):void 0,autoRenewAccountId:s.autoRenewAccount!=null?ne._fromProtobuf(s.autoRenewAccount):void 0,autoRenewPeriod:s.autoRenewPeriod!=null&&s.autoRenewPeriod.seconds!=null?s.autoRenewPeriod.seconds:void 0,topicMemo:s.memo!=null?s.memo:void 0}),e,t,n,i,a)}get topicMemo(){return this._topicMemo}getTopicMemo(){return this._topicMemo}setTopicMemo(e){return this._requireNotFrozen(),this._topicMemo=e,this}get adminKey(){return this._adminKey}getAdminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}get submitKey(){return this._submitKey}getSubmitKey(){return this._submitKey}setSubmitKey(e){return this._requireNotFrozen(),this._submitKey=e,this}get autoRenewAccountId(){return this._autoRenewAccountId}getAutoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=e instanceof ne?e:ne.fromString(e),this}get autoRenewPeriod(){return this._autoRenewPeriod}getAutoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof fr?e:new fr(e),this}_validateChecksums(e){this._autoRenewAccountId!=null&&this._autoRenewAccountId.validateChecksum(e)}_execute(e,t){return e.consensus.createTopic(t)}_getTransactionDataCase(){return"consensusCreateTopic"}_makeTransactionData(){return{adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,submitKey:this._submitKey!=null?this._submitKey._toProtobufKey():null,autoRenewAccount:this._autoRenewAccountId!=null?this._autoRenewAccountId._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod._toProtobuf(),memo:this._topicMemo}}_getLogId(){return`TopicCreateTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("consensusCreateTopic",Vv._fromProtobuf);var Hv=class r extends ke{constructor(e={}){super(),this._topicId=null,e.topicId!=null&&this.setTopicId(e.topicId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].consensusDeleteTopic;return ke._fromProtobufTransactions(new r({topicId:s.topicID!=null?ia._fromProtobuf(s.topicID):void 0}),e,t,n,i,a)}get topicId(){return this._topicId}setTopicId(e){return this._requireNotFrozen(),this._topicId=typeof e=="string"?ia.fromString(e):e.clone(),this}_validateChecksums(e){this._topicId!=null&&this._topicId.validateChecksum(e)}_execute(e,t){return e.consensus.deleteTopic(t)}_getTransactionDataCase(){return"consensusDeleteTopic"}_makeTransactionData(){return{topicID:this._topicId!=null?this._topicId._toProtobuf():null}}_getLogId(){return`TopicDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("consensusDeleteTopic",Hv._fromProtobuf);var Gx=Ie(Yt(),1);var QB=Ie(vr(),1);var Fm=class r{constructor(e){this.topicId=e.topicId,this.topicMemo=e.topicMemo,this.runningHash=e.runningHash,this.sequenceNumber=e.sequenceNumber,this.expirationTime=e.expirationTime,this.adminKey=e.adminKey,this.submitKey=e.submitKey,this.autoRenewPeriod=e.autoRenewPeriod,this.autoRenewAccountId=e.autoRenewAccountId,this.ledgerId=e.ledgerId,Object.freeze(this)}static _fromProtobuf(e){let t=e.topicInfo;return new r({topicId:ia._fromProtobuf(e.topicID),topicMemo:t.memo!=null?t.memo:"",runningHash:t.runningHash!=null?t.runningHash:new Uint8Array,sequenceNumber:t.sequenceNumber!=null?t.sequenceNumber instanceof Gx.default?t.sequenceNumber:Gx.default.fromValue(t.sequenceNumber):Gx.default.ZERO,expirationTime:t.expirationTime!=null?lt._fromProtobuf(t.expirationTime):null,adminKey:t.adminKey!=null?rt._fromProtobufKey(t.adminKey):null,submitKey:t.submitKey!=null?rt._fromProtobufKey(t.submitKey):null,autoRenewPeriod:t.autoRenewPeriod!=null?new fr(t.autoRenewPeriod.seconds):null,autoRenewAccountId:t.autoRenewAccount!=null?ne._fromProtobuf(t.autoRenewAccount):null,ledgerId:t.ledgerId!=null?mr.fromBytes(t.ledgerId):null})}_toProtobuf(){return{topicID:this.topicId._toProtobuf(),topicInfo:{memo:this.topicMemo,runningHash:this.runningHash,sequenceNumber:this.sequenceNumber,expirationTime:this.expirationTime!=null?this.expirationTime._toProtobuf():null,adminKey:this.adminKey!=null?this.adminKey._toProtobufKey():null,submitKey:this.submitKey!=null?this.submitKey._toProtobufKey():null,autoRenewPeriod:this.autoRenewPeriod!=null?this.autoRenewPeriod._toProtobuf():null,autoRenewAccount:this.autoRenewAccountId!=null?this.autoRenewAccountId._toProtobuf():null}}}static fromBytes(e){return r._fromProtobuf({topicInfo:QB.proto.ConsensusTopicInfo.decode(e)})}toBytes(){return QB.proto.ConsensusTopicInfo.encode(this._toProtobuf().topicInfo).finish()}};var Kv=class r extends xr{constructor(e={}){super(),this._topicId=null,e.topicId!=null&&this.setTopicId(e.topicId)}static _fromProtobuf(e){let t=e.consensusGetTopicInfo;return new r({topicId:t.topicID!=null?ia._fromProtobuf(t.topicID):void 0})}get topicId(){return this._topicId}setTopicId(e){return this._topicId=typeof e=="string"?ia.fromString(e):e.clone(),this}async getCost(e){return super.getCost(e)}_validateChecksums(e){this._topicId!=null&&this._topicId.validateChecksum(e)}_execute(e,t){return e.consensus.getTopicInfo(t)}_mapResponseHeader(e){return e.consensusGetTopicInfo.header}_mapResponse(e,t,n){return Promise.resolve(Fm._fromProtobuf(e.consensusGetTopicInfo))}_onMakeRequest(e){return{consensusGetTopicInfo:{header:e,topicID:this._topicId!=null?this._topicId._toProtobuf():null}}}_getLogId(){return`TopicInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("consensusGetTopicInfo",Kv._fromProtobuf);var fGe=Ie(Yt(),1);var hGe=Ie(Yt(),1);var yGe=Ie(vr(),1);var vGe=Ie(Yt(),1);var zv=class r extends ke{constructor(e={}){super(),this._topicId=null,e.topicId!=null&&this.setTopicId(e.topicId),this._message=null,e.message!=null&&this.setMessage(e.message),this._maxChunks=20,this._chunkSize=k3e,e.maxChunks!=null&&this.setMaxChunks(e.maxChunks),e.chunkSize!=null&&this.setChunkSize(e.chunkSize),this._chunkInfo=null}static _fromProtobuf(e,t,n,i,a){let s=a[0].consensusSubmitMessage;return ke._fromProtobufTransactions(new r({topicId:s.topicID!=null?ia._fromProtobuf(s.topicID):void 0,message:s.message!=null?s.message:void 0}),e,t,n,i,a)}get topicId(){return this._topicId}setTopicId(e){return this._requireNotFrozen(),this._topicId=typeof e=="string"?ia.fromString(e):e.clone(),this}get message(){return this._message}getMessage(){return this._message}setMessage(e){return this._requireNotFrozen(),e=DJ(e),this._message=e instanceof Uint8Array?e:n3(e),this}get maxChunks(){return this._maxChunks}getMaxChunks(){return this._maxChunks}setMaxChunks(e){return this._requireNotFrozen(),this._maxChunks=e,this}get chunkSize(){return this._chunkSize}getChunkSize(){return this._chunkSize}setChunkSize(e){return this._chunkSize=e,this}freezeWith(e){if(super.freezeWith(e),this._message==null)return this;let t=Math.floor((this._message.length+(this._chunkSize-1))/this._chunkSize);if(t>this._maxChunks)throw new Error(`Message with size ${this._message.length} too long for ${this._maxChunks} chunks`);let n=this._getTransactionId()._toProtobuf(),i=this._getTransactionId();this._transactionIds.locked=!1,this._transactions.clear(),this._transactionIds.clear(),this._signedTransactions.clear();for(let a=0;a<t;a++){this._chunkInfo={initialTransactionID:n,total:t,number:a+1},this._transactionIds.push(i),this._transactionIds.advance();for(let o of this._nodeAccountIds.list)this._signedTransactions.push(this._makeSignedTransaction(o));i=new Wr(i.accountId,new lt(i.validStart.seconds,i.validStart.nanos.add(1)))}return this._transactionIds.advance(),this._chunkInfo=null,this}schedule(){if(this._requireNotFrozen(),this._message!=null&&this._message.length>this._chunkSize)throw new Error(`cannot schedule \`TopicMessageSubmitTransaction\` with message over ${this._chunkSize} bytes`);return super.schedule()}async execute(e,t){return(await this.executeAll(e,t))[0]}async executeAll(e,t){super._isFrozen()||this.freezeWith(e);let n=this._getTransactionId(),i=e.operatorAccountId;i!=null&&i.equals(n.accountId)&&await super.signWithOperator(e);let a=[],o=t;for(let s=0;s<this._transactionIds.length;s++){let c=Date.now();a.push(await super.execute(e,o)),o!=null&&(o=Date.now()-c)}return a}_execute(e,t){return e.consensus.submitMessage(t)}_getTransactionDataCase(){return"consensusSubmitMessage"}_makeTransactionData(){if(this._chunkInfo!=null&&this._message!=null){let t=(this._chunkInfo.number-1)*this._chunkSize,n=t+this._chunkSize;return n>this._message.length&&(n=this._message.length),{topicID:this._topicId!=null?this._topicId._toProtobuf():null,message:this._message.slice(t,n),chunkInfo:this._chunkInfo}}else return{topicID:this._topicId!=null?this._topicId._toProtobuf():null,message:this._message}}_getLogId(){return`TopicMessageSubmitTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("consensusSubmitMessage",zv._fromProtobuf);var Gv=class r extends ke{constructor(e={}){super(),this._topicId=null,e.topicId!=null&&this.setTopicId(e.topicId),this._topicMemo=null,e.topicMemo!=null&&this.setTopicMemo(e.topicMemo),this._submitKey=null,e.submitKey!=null&&this.setSubmitKey(e.submitKey),this._adminKey=null,e.adminKey!=null&&this.setAdminKey(e.adminKey),this._autoRenewAccountId=null,e.autoRenewAccountId!=null&&this.setAutoRenewAccountId(e.autoRenewAccountId),this._autoRenewPeriod=null,e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),this._expirationTime=null,e.expirationTime!=null&&this.setExpirationTime(e.expirationTime)}static _fromProtobuf(e,t,n,i,a){let s=a[0].consensusUpdateTopic;return ke._fromProtobufTransactions(new r({topicId:s.topicID!=null?ia._fromProtobuf(s.topicID):void 0,adminKey:s.adminKey!=null?rt._fromProtobufKey(s.adminKey):void 0,submitKey:s.submitKey!=null?rt._fromProtobufKey(s.submitKey):void 0,autoRenewAccountId:s.autoRenewAccount!=null?ne._fromProtobuf(s.autoRenewAccount):void 0,autoRenewPeriod:s.autoRenewPeriod!=null&&s.autoRenewPeriod.seconds!=null?s.autoRenewPeriod.seconds:void 0,topicMemo:s.memo!=null&&s.memo.value!=null?s.memo.value:void 0,expirationTime:s.expirationTime!=null?lt._fromProtobuf(s.expirationTime):void 0}),e,t,n,i,a)}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof Date?lt.fromDate(e):e,this}get topicId(){return this._topicId}setTopicId(e){return this._requireNotFrozen(),this._topicId=typeof e=="string"?ia.fromString(e):e.clone(),this}clearTopicId(){return this._requireNotFrozen(),this._topicId=null,this}get topicMemo(){return this._topicMemo}setTopicMemo(e){return this._requireNotFrozen(),this._topicMemo=e,this}clearTopicMemo(){return this._requireNotFrozen(),this._topicMemo=null,this}get adminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}clearAdminKey(){return this._requireNotFrozen(),this._adminKey=null,this}get submitKey(){return this._submitKey}setSubmitKey(e){return this._requireNotFrozen(),this._submitKey=e,this}clearSubmitKey(){return this._requireNotFrozen(),this._submitKey=null,this}get autoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=e instanceof ne?e:ne.fromString(e),this}clearAutoRenewAccountId(){return this._requireNotFrozen(),this._autoRenewAccountId=null,this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof fr?e:new fr(e),this}_validateChecksums(e){this._topicId!=null&&this._topicId.validateChecksum(e),this._autoRenewAccountId!=null&&this._autoRenewAccountId.validateChecksum(e)}_execute(e,t){return e.consensus.updateTopic(t)}_getTransactionDataCase(){return"consensusUpdateTopic"}_makeTransactionData(){return{topicID:this._topicId!=null?this._topicId._toProtobuf():null,adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,submitKey:this._submitKey!=null?this._submitKey._toProtobufKey():null,memo:this._topicMemo!=null?{value:this._topicMemo}:null,autoRenewAccount:this._autoRenewAccountId!=null?this._autoRenewAccountId._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod!=null?this._autoRenewPeriod._toProtobuf():null,expirationTime:this._expirationTime!=null?this._expirationTime._toProtobuf():null}}_getLogId(){return`TopicUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("consensusUpdateTopic",Gv._fromProtobuf);var $v=Ie(Yt(),1);var Wv=class extends di{constructor(){super(e=>Oe.fromString(e))}};var Qv=class r extends di{constructor(){super(e=>ne.fromString(e))}static _fromProtobuf(e){let t=new r;for(let n of e.accountAmounts!=null?e.accountAmounts:[]){let i=ne._fromProtobuf(n.accountID);t._set(i,ze.fromTinybars(n.amount))}return t}};var $B=Ie(Yt(),1);var Um=class r{constructor(e){this.tokenId=e.tokenId instanceof Oe?e.tokenId:Oe.fromString(e.tokenId),this.senderAccountId=e.senderAccountId instanceof ne?e.senderAccountId:ne.fromString(e.senderAccountId),this.receiverAccountId=e.receiverAccountId instanceof ne?e.receiverAccountId:ne.fromString(e.receiverAccountId),this.serialNumber=$B.default.fromValue(e.serialNumber),this.isApproved=e.isApproved}static _fromProtobuf(e){let t=[];for(let n of e){let i=Oe._fromProtobuf(n.token);for(let a of n.nftTransfers!=null?n.nftTransfers:[])t.push(new r({tokenId:i,senderAccountId:ne._fromProtobuf(a.senderAccountID),receiverAccountId:ne._fromProtobuf(a.receiverAccountID),serialNumber:a.serialNumber!=null?a.serialNumber:$B.default.ZERO,isApproved:a.isApproval==!0}))}return t}_toProtobuf(){return{senderAccountID:this.senderAccountId._toProtobuf(),receiverAccountID:this.receiverAccountId._toProtobuf(),serialNumber:this.serialNumber,isApproval:this.isApproved}}};var Yv=class r extends ke{constructor(e={}){super(),this._tokenTransfers=[],this._hbarTransfers=[],this._nftTransfers=[],this._defaultMaxTransactionFee=new ze(1);for(let t of e.tokenTransfers!=null?e.tokenTransfers:[])this.addTokenTransfer(t.tokenId,t.accountId,t.amount);for(let t of e.hbarTransfers!=null?e.hbarTransfers:[])this.addHbarTransfer(t.accountId,t.amount);for(let t of e.nftTransfers!=null?e.nftTransfers:[])this.addNftTransfer(t.tokenId,t.serial,t.sender,t.recipient)}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoTransfer,c=new r;return c._tokenTransfers=Wd._fromProtobuf(s.tokenTransfers!=null?s.tokenTransfers:[]),c._hbarTransfers=du._fromProtobuf(s.transfers!=null?s.transfers.accountAmounts!=null?s.transfers.accountAmounts:[]:[]),c._nftTransfers=Um._fromProtobuf(s.tokenTransfers!=null?s.tokenTransfers:[]),ke._fromProtobufTransactions(c,e,t,n,i,a)}get tokenTransfers(){let e=new a1;for(let t of this._tokenTransfers){let n=e.get(t.tokenId);n!=null?n._set(t.accountId,t.amount):(n=new i1,n._set(t.accountId,t.amount),e._set(t.tokenId,n))}return e}_addTokenTransfer(e,t,n,i){this._requireNotFrozen();let a=e instanceof Oe?e:Oe.fromString(e),o=t instanceof ne?t:ne.fromString(t),s=n instanceof $v.default?n:$v.default.fromNumber(n);for(let c of this._tokenTransfers)if(c.tokenId.compare(a)===0&&c.accountId.compare(o)===0)return c.amount=c.amount.add(s),c.expectedDecimals=null,this;return this._tokenTransfers.push(new Wd({tokenId:e,accountId:t,expectedDecimals:null,amount:n,isApproved:i})),this}addTokenTransfer(e,t,n){return this._addTokenTransfer(e,t,n,!1)}addApprovedTokenTransfer(e,t,n){return this._addTokenTransfer(e,t,n,!0)}addTokenTransferWithDecimals(e,t,n,i){this._requireNotFrozen();let a=e instanceof Oe?e:Oe.fromString(e),o=t instanceof ne?t:ne.fromString(t),s=n instanceof $v.default?n:$v.default.fromNumber(n),c=!1;for(let l of this._tokenTransfers)if(l.tokenId.compare(a)===0){if(l.expectedDecimals!=null&&l.expectedDecimals!==i)throw new Error("expected decimals mis-match");l.expectedDecimals=i,l.accountId.compare(o)===0&&(l.amount=l.amount.add(s),l.expectedDecimals=i,c=!0)}return c?this:(this._tokenTransfers.push(new Wd({tokenId:e,accountId:t,expectedDecimals:i,amount:n,isApproved:!1})),this)}get tokenIdDecimals(){let e=new Wv;for(let t of this._tokenTransfers)e._set(t.tokenId,t.expectedDecimals);return e}get hbarTransfers(){let e=new Qv;for(let t of this._hbarTransfers)e._set(t.accountId,t.amount);return e}_addHbarTransfer(e,t,n){this._requireNotFrozen();let i=e instanceof ne?e.clone():ne.fromString(e),a=t instanceof ze?t:new ze(t);for(let o of this._hbarTransfers)if(o.accountId.compare(i)===0)return o.amount=ze.fromTinybars(o.amount.toTinybars().add(a.toTinybars())),this;return this._hbarTransfers.push(new du({accountId:i,amount:a,isApproved:n})),this}addHbarTransfer(e,t){return this._addHbarTransfer(e,t,!1)}addApprovedHbarTransfer(e,t){return this._addHbarTransfer(e,t,!0)}_validateChecksums(e){for(let t of this._hbarTransfers)t.accountId.validateChecksum(e);for(let t of this._tokenTransfers)t.tokenId.validateChecksum(e),t.accountId.validateChecksum(e);for(let t of this._nftTransfers)t.tokenId.validateChecksum(e),t.senderAccountId.validateChecksum(e),t.receiverAccountId.validateChecksum(e)}get nftTransfers(){let e=new o1;for(let t of this._nftTransfers){let n=e.get(t.tokenId),i={sender:t.senderAccountId,recipient:t.receiverAccountId,serial:t.serialNumber,isApproved:t.isApproved};n!=null?n.push(i):e._set(t.tokenId,[i])}return e}_addNftTransfer(e,t,n,i,a){this._requireNotFrozen();let o,s,c;if(t instanceof oa)o=t,s=typeof n=="string"?ne.fromString(n):n,c=typeof i=="string"?ne.fromString(i):i;else if(t instanceof Oe)o=new oa(t,n),s=typeof i=="string"?ne.fromString(i):i,c=typeof a=="string"?ne.fromString(a):a;else try{o=oa.fromString(t),s=typeof n=="string"?ne.fromString(n):n,c=typeof i=="string"?ne.fromString(i):i}catch{let u=Oe.fromString(t);o=new oa(u,n),s=typeof i=="string"?ne.fromString(i):i,c=typeof a=="string"?ne.fromString(a):a}for(let l of this._nftTransfers)if(l.tokenId.compare(o.tokenId)===0&&l.serialNumber.compare(o.serial)===0)return l.senderAccountId=s,l.receiverAccountId=c,this;return this._nftTransfers.push(new Um({tokenId:o.tokenId,serialNumber:o.serial,senderAccountId:s,receiverAccountId:c,isApproved:e})),this}addNftTransfer(e,t,n,i){return this._addNftTransfer(!1,e,t,n,i)}addApprovedNftTransfer(e,t,n,i){return this._addNftTransfer(!0,e,t,n,i)}setHbarTransferApproval(e,t){let n=typeof e=="string"?ne.fromString(e):e;for(let i of this._hbarTransfers)i.accountId.compare(n)===0&&(i.isApproved=t);return this}setTokenTransferApproval(e,t,n){let i=typeof e=="string"?Oe.fromString(e):e,a=typeof t=="string"?ne.fromString(t):t;for(let o of this._tokenTransfers)o.tokenId.compare(i)===0&&o.accountId.compare(a)===0&&(o.isApproved=n);return this}setNftTransferApproval(e,t){let n=typeof e=="string"?oa.fromString(e):e;for(let i of this._nftTransfers)i.tokenId.compare(n.tokenId)===0&&i.serialNumber.compare(n.serial)===0&&(i.isApproved=t);return this}_execute(e,t){return e.crypto.cryptoTransfer(t)}_getTransactionDataCase(){return"cryptoTransfer"}_makeTransactionData(){let e=[];this._tokenTransfers.sort((i,a)=>{let o=i.tokenId.compare(a.tokenId);return o!==0?o:i.accountId.compare(a.accountId)}),this._nftTransfers.sort((i,a)=>{let o=i.senderAccountId.compare(a.senderAccountId);if(o!=0)return o;let s=i.receiverAccountId.compare(a.receiverAccountId);return s!=0?s:i.serialNumber.compare(a.serialNumber)});let t=0,n=0;for(;t<this._tokenTransfers.length||n<this._nftTransfers.length;)if(t<this._tokenTransfers.length&&n<this._nftTransfers.length){let i=this._tokenTransfers[t].tokenId,a=this._nftTransfers[n].tokenId,o=e.length>0?e[e.length-1]:null,s=o!=null?o.tokenId:null;if(o!=null&&s!=null&&s.compare(i)===0){o.transfers.push(this._tokenTransfers[t++]);continue}if(o!=null&&s!=null&&s.compare(a)===0){o.nftTransfers.push(this._nftTransfers[n++]);continue}let c=i.compare(a);c===0?e.push({tokenId:i,expectedDecimals:this._tokenTransfers[t].expectedDecimals,transfers:[this._tokenTransfers[t++]],nftTransfers:[this._nftTransfers[n++]]}):c<0?e.push({tokenId:i,expectedDecimals:this._tokenTransfers[t].expectedDecimals,transfers:[this._tokenTransfers[t++]],nftTransfers:[]}):e.push({tokenId:a,expectedDecimals:null,transfers:[],nftTransfers:[this._nftTransfers[n++]]})}else if(t<this._tokenTransfers.length){let i=this._tokenTransfers[t].tokenId,a;for(let s of e)s.tokenId.compare(i)===0&&(a=s);let o=a!=null?a.tokenId:null;if(a!=null&&o!=null&&o.compare(i)===0){a.transfers.push(this._tokenTransfers[t++]);continue}e.push({tokenId:i,expectedDecimals:this._tokenTransfers[t].expectedDecimals,transfers:[this._tokenTransfers[t++]],nftTransfers:[]})}else if(n<this._nftTransfers.length){let i=this._nftTransfers[n].tokenId,a;for(let s of e)s.tokenId.compare(i)===0&&(a=s);let o=a!=null?a.tokenId:null;if(a!=null&&o!=null&&o.compare(i)===0){a.nftTransfers.push(this._nftTransfers[n++]);continue}e.push({tokenId:i,expectedDecimals:null,transfers:[],nftTransfers:[this._nftTransfers[n++]]})}return this._hbarTransfers.sort((i,a)=>i.accountId.compare(a.accountId)),{transfers:{accountAmounts:this._hbarTransfers.map(i=>({accountID:i.accountId._toProtobuf(),amount:i.amount.toTinybars(),isApproval:i.isApproved}))},tokenTransfers:e.map(i=>({token:i.tokenId._toProtobuf(),expectedDecimals:i.expectedDecimals!=null?{value:i.expectedDecimals}:null,transfers:i.transfers.map(a=>a._toProtobuf()),nftTransfers:i.nftTransfers.map(a=>a._toProtobuf())}))}}_getLogId(){return`TransferTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("cryptoTransfer",Yv._fromProtobuf);var qm=class r{constructor(e,t,n){let i=typeof t=="string"?Zc.fromStringDer(t):t;this.publicKey=i.publicKey,this.signer=a=>Promise.resolve(i.sign(a)),this.provider=n,this.accountId=typeof e=="string"?ne.fromString(e):e}static createRandomED25519(){let e=Zc.generateED25519(),n=e.publicKey.toAccountId(0,0);return Promise.resolve(new r(n,e))}static createRandomECDSA(){let e=Zc.generateECDSA(),n=e.publicKey.toAccountId(0,0);return Promise.resolve(new r(n,e))}getProvider(){return this.provider}getAccountId(){return this.accountId}getAccountKey(){return this.publicKey}getLedgerId(){return this.provider==null?null:this.provider.getLedgerId()}getNetwork(){return this.provider==null?{}:this.provider.getNetwork()}getMirrorNetwork(){return this.provider==null?[]:this.provider.getMirrorNetwork()}async sign(e){let t=[];for(let n of e)t.push(new Bm({publicKey:this.publicKey,signature:await this.signer(n),accountId:this.accountId}));return t}getAccountBalance(){return this.call(new X3().setAccountId(this.accountId))}getAccountInfo(){return this.call(new ol().setAccountId(this.accountId))}getAccountRecords(){return this.call(new xu().setAccountId(this.accountId))}signTransaction(e){return e.signWith(this.publicKey,this.signer)}checkTransaction(e){let t=e.transactionId;if(t!=null&&t.accountId!=null&&t.accountId.compare(this.accountId)!=0)throw new Error("transaction's ID constructed with a different account ID");if(this.provider==null)return Promise.resolve(e);let n=(e.nodeAccountIds!=null?e.nodeAccountIds:[]).map(a=>a.toString()),i=Object.values(this.provider.getNetwork()).map(a=>a.toString());if(!n.reduce((a,o)=>a&&i.includes(o),!0))throw new Error("Transaction already set node account IDs to values not within the current network");return Promise.resolve(e)}populateTransaction(e){if(e._freezeWithAccountId(this.accountId),e.transactionId==null&&e.setTransactionId(Wr.generate(this.accountId)),e.nodeAccountIds!=null&&e.nodeAccountIds.length!=0)return Promise.resolve(e.freeze());if(this.provider==null)return Promise.resolve(e);let t=Object.values(this.provider.getNetwork()).map(n=>typeof n=="string"?ne.fromString(n):n);return Bw(t),e.setNodeAccountIds(t.slice(0,(t.length+3-1)/3)),Promise.resolve(e.freeze())}call(e){if(this.provider==null)throw new Error("cannot send request with an wallet that doesn't contain a provider");return this.provider.call(e._setOperatorWith(this.accountId,this.publicKey,this.signer))}};var ZYe=Ie(zle(),1);var Ra=class r{constructor(e){this._name=e,Object.freeze(this)}toString(){switch(this){case r.Silent:return"silent";case r.Trace:return"trace";case r.Debug:return"debug";case r.Info:return"info";case r.Warn:return"warn";case r.Error:return"error";case r.Fatal:return"fatal";default:return`Unknown log level (${this._name})`}}static _fromString(e){switch(e){case"silent":return r.Silent;case"trace":return r.Trace;case"debug":return r.Debug;case"info":return r.Info;case"warn":return r.Warn;case"error":return r.Error;case"fatal":return r.Fatal;default:throw new Error(`Unknown log level: ${e}`)}}};Ra.Silent=new Ra("silent");Ra.Trace=new Ra("trace");Ra.Debug=new Ra("debug");Ra.Info=new Ra("info");Ra.Warn=new Ra("warn");Ra.Error=new Ra("error");Ra.Fatal=new Ra("fatal");var Gle=Ie(vr(),1),fA=class extends lu{constructor(e){super(),this._query=e,this._grpcDeadline=e._grpcDeadline,this._requestTimeout=e._requestTimeout,this._nodeAccountIds=e._nodeAccountIds.clone(),this._operator=e._operator,this._header=null}_getTransactionId(){return this._query._getTransactionId()}_getLogId(){return`CostQuery:${this._query._getLogId()}`}async _beforeExecute(e){if(e==null)throw new Error("Cannot do CostQuery without Client");let t=this._operator!=null?this._operator:e._operator;if(t==null)throw new Error("`client` must have an `operator` or an explicit payment transaction must be provided");this._query._nodeAccountIds.isEmpty&&this._query._nodeAccountIds.setList(e._network.getNodeAccountIdsForExecute());let n=Wr.generate(t.accountId);this._query.paymentTransactionId==null&&this._query.setPaymentTransactionId(n);let i=this._getLogId(),a=new ne(0),o=Wr.generate(new ne(0)),s=new ze(0);this._logger&&this._logger.debug(`[${i}] making a payment transaction for node ${a.toString()} and transaction ID ${o.toString()} with amount ${s.toString()}`),this._header={payment:await KE(o,new ne(0),t,s),responseType:Gle.proto.ResponseType.COST_ANSWER}}_makeRequestAsync(){return Promise.resolve(this._query._onMakeRequest(this._header))}_shouldRetry(e,t){return this._query._shouldRetry(e,t)}_mapStatusError(e,t){return this._query._mapStatusError(e,t)}_mapResponse(e,t,n){let i=this._query._mapResponseHeader(e).cost;return Promise.resolve(ze.fromTinybars(i))}_execute(e,t){return this._query._execute(e,t)}_requestToBytes(e){return this._query._requestToBytes(e)}_responseToBytes(e){return this._query._responseToBytes(e)}};zE.push(r=>new fA(r));var Dfe=Ie(require("fs"),1),Pfe=Ie(require("util"),1);var XYe=/^(\S+):(\d+)$/,tb=class r{constructor(e={}){if(e.address!=null){let t=XYe.exec(e.address);if(t==null)throw new Error(`failed to parse address: ${e.address}`);this._address=t[1],this._port=t[2]!=null?parseInt(t[2]):null}else if(e.host!=null&&e.port!=null)this._address=e.host,this._port=e.port;else throw new Error(`failed to create a managed node address: ${JSON.stringify(e)}`);Object.freeze(this)}static fromString(e){return new r({address:e})}toInsecure(){let e=this.port===50212?50211:this.port;return new r({host:this.address,port:e})}toSecure(){let e=this.port===50211?50212:this.port;return new r({host:this.address,port:e})}get address(){return this._address}get port(){return this._port}isTransportSecurity(){return this._port==50212||this._port==443}toString(){return this.port==null?this.address:`${this.address}:${this.port}`}};var w1=class{constructor(e={}){if(e.newNode!=null)this._address=typeof e.newNode.address=="string"?tb.fromString(e.newNode.address):e.newNode.address,this._cert=void 0,this._channel=null,this._channelInitFunction=e.newNode.channelInitFunction,this._lastUsed=Date.now(),this._readmitTime=Date.now(),this._useCount=0,this._badGrpcStatusCount=0,this._minBackoff=8e3,this._maxBackoff=1e3*60*60,this._currentBackoff=this._minBackoff;else if(e.cloneNode!=null)this._address=e.cloneNode.address,this._cert=e.cloneNode.node._cert,this._channel=e.cloneNode.node._channel,this._channelInitFunction=e.cloneNode.node._channelInitFunction,this._currentBackoff=e.cloneNode.node._currentBackoff,this._lastUsed=e.cloneNode.node._lastUsed,this._readmitTime=e.cloneNode.node._readmitTime,this._useCount=e.cloneNode.node._useCount,this._badGrpcStatusCount=e.cloneNode.node._badGrpcStatusCount,this._minBackoff=e.cloneNode.node._minBackoff,this._maxBackoff=e.cloneNode.node._minBackoff;else throw new Error(`failed to create ManagedNode: ${JSON.stringify(e)}`)}getKey(){throw new Error("not implemented")}setCert(e){return this}get address(){return this._address}get attempts(){return this._badGrpcStatusCount}get minBackoff(){return this._minBackoff}setMinBackoff(e){return this._currentBackoff<=e&&(this._currentBackoff=e),this._minBackoff=e,this}get maxBackoff(){return this._maxBackoff}setMaxBackoff(e){return this._currentBackoff<=e&&(this._currentBackoff=e),this._maxBackoff=e,this}getChannel(){return this._useCount++,this.__lastUsed=Date.now(),this._channel!=null?this._channel:(this._channel=this._channelInitFunction(this.address.toString(),this._cert),this._channel)}isHealthy(){return this._readmitTime<=Date.now()}increaseBackoff(){this._currentBackoff=Math.min(this._currentBackoff*2,this._maxBackoff),this._readmitTime=Date.now()+this._currentBackoff}decreaseBackoff(){this._currentBackoff=Math.max(this._currentBackoff/2,this._minBackoff)}getRemainingTime(){return this._readmitTime-this._lastUsed}backoff(){return new Promise(e=>setTimeout(e,this.getRemainingTime()))}compare(e){let t=this.getRemainingTime()-e.getRemainingTime();return t!=0||(t=this._currentBackoff-e._currentBackoff,t!=0)||(t=this._badGrpcStatusCount-e._badGrpcStatusCount,t!=0)||(t=this._useCount-e._useCount,t!=0)?t:this._lastUsed-e._lastUsed}close(){this._channel!=null&&this._channel.close(),this._channel=null}};var Wle={"0.0.3":`-----BEGIN CERTIFICATE-----
10639
+ `):" "+hoe(a[0]):"as no adapter specified";throw new wt("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:CP};function kP(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new tl(null,r)}function jE(r){return kP(r),r.headers=ka.from(r.headers),r.data=i8.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),qE.getAdapter(r.adapter||U2.adapter)(r).then(function(n){return kP(r),n.data=i8.call(r,r.transformResponse,n),n.headers=ka.from(n.headers),n},function(n){return a8(n)||(kP(r),n&&n.response&&(n.response.data=i8.call(r,r.transformResponse,n.response),n.response.headers=ka.from(n.response.headers))),Promise.reject(n)})}var moe=r=>r instanceof ka?r.toJSON():r;function Fd(r,e){e=e||{};let t={};function n(l,u,d){return ve.isPlainObject(l)&&ve.isPlainObject(u)?ve.merge.call({caseless:d},l,u):ve.isPlainObject(u)?ve.merge({},u):ve.isArray(u)?u.slice():u}function i(l,u,d){if(ve.isUndefined(u)){if(!ve.isUndefined(l))return n(void 0,l,d)}else return n(l,u,d)}function a(l,u){if(!ve.isUndefined(u))return n(void 0,u)}function o(l,u){if(ve.isUndefined(u)){if(!ve.isUndefined(l))return n(void 0,l)}else return n(void 0,u)}function s(l,u,d){if(d in e)return n(l,u);if(d in r)return n(void 0,l)}let c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(l,u)=>i(moe(l),moe(u),!0)};return ve.forEach(Object.keys(Object.assign({},r,e)),function(u){let d=c[u]||i,h=d(r[u],e[u],u);ve.isUndefined(h)&&d!==s||(t[u]=h)}),t}var NP={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{NP[r]=function(n){return typeof n===r||"a"+(e<1?"n ":" ")+r}});var goe={};NP.transitional=function(e,t,n){function i(a,o){return"[Axios v"+K0+"] Transitional option '"+a+"'"+o+(n?". "+n:"")}return(a,o,s)=>{if(e===!1)throw new wt(i(o," has been removed"+(t?" in "+t:"")),wt.ERR_DEPRECATED);return t&&!goe[o]&&(goe[o]=!0,console.warn(i(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(a,o,s):!0}};function xVe(r,e,t){if(typeof r!="object")throw new wt("options must be an object",wt.ERR_BAD_OPTION_VALUE);let n=Object.keys(r),i=n.length;for(;i-- >0;){let a=n[i],o=e[a];if(o){let s=r[a],c=s===void 0||o(s,a,r);if(c!==!0)throw new wt("option "+a+" must be "+c,wt.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new wt("Unknown option "+a,wt.ERR_BAD_OPTION)}}var VE={assertOptions:xVe,validators:NP};var Ef=VE.validators,z2=class{constructor(e){this.defaults=e,this.interceptors={request:new tP,response:new tP}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;let a=i.stack?i.stack.replace(/^.+\n/,""):"";n.stack?a&&!String(n.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(n.stack+=`
10640
+ `+a):n.stack=a}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Fd(this.defaults,t);let{transitional:n,paramsSerializer:i,headers:a}=t;n!==void 0&&VE.assertOptions(n,{silentJSONParsing:Ef.transitional(Ef.boolean),forcedJSONParsing:Ef.transitional(Ef.boolean),clarifyTimeoutError:Ef.transitional(Ef.boolean)},!1),i!=null&&(ve.isFunction(i)?t.paramsSerializer={serialize:i}:VE.assertOptions(i,{encode:Ef.function,serialize:Ef.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=a&&ve.merge(a.common,a[t.method]);a&&ve.forEach(["delete","get","head","post","put","patch","common"],m=>{delete a[m]}),t.headers=ka.concat(o,a);let s=[],c=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(t)===!1||(c=c&&b.synchronous,s.unshift(b.fulfilled,b.rejected))});let l=[];this.interceptors.response.forEach(function(b){l.push(b.fulfilled,b.rejected)});let u,d=0,h;if(!c){let m=[jE.bind(this),void 0];for(m.unshift.apply(m,s),m.push.apply(m,l),h=m.length,u=Promise.resolve(t);d<h;)u=u.then(m[d++],m[d++]);return u}h=s.length;let g=t;for(d=0;d<h;){let m=s[d++],b=s[d++];try{g=m(g)}catch(E){b.call(this,E);break}}try{u=jE.call(this,g)}catch(m){return Promise.reject(m)}for(d=0,h=l.length;d<h;)u=u.then(l[d++],l[d++]);return u}getUri(e){e=Fd(this.defaults,e);let t=j0(e.baseURL,e.url);return q0(t,e.params,e.paramsSerializer)}};ve.forEach(["delete","get","head","options"],function(e){z2.prototype[e]=function(t,n){return this.request(Fd(n||{},{method:e,url:t,data:(n||{}).data}))}});ve.forEach(["post","put","patch"],function(e){function t(n){return function(a,o,s){return this.request(Fd(s||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:a,data:o}))}}z2.prototype[e]=t(),z2.prototype[e+"Form"]=t(!0)});var p8=z2;var RP=class r{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(a){t=a});let n=this;this.promise.then(i=>{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](i);n._listeners=null}),this.promise.then=i=>{let a,o=new Promise(s=>{n.subscribe(s),a=s}).then(i);return o.cancel=function(){n.unsubscribe(a)},o},e(function(a,o,s){n.reason||(n.reason=new tl(a,o,s),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}static source(){let e;return{token:new r(function(i){e=i}),cancel:e}}},yoe=RP;function OP(r){return function(t){return r.apply(null,t)}}function DP(r){return ve.isObject(r)&&r.isAxiosError===!0}var PP={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(PP).forEach(([r,e])=>{PP[e]=r});var voe=PP;function boe(r){let e=new p8(r),t=e8(p8.prototype.request,e);return ve.extend(t,p8.prototype,e,{allOwnKeys:!0}),ve.extend(t,e,null,{allOwnKeys:!0}),t.create=function(i){return boe(Fd(r,i))},t}var ya=boe(U2);ya.Axios=p8;ya.CanceledError=tl;ya.CancelToken=yoe;ya.isCancel=a8;ya.VERSION=K0;ya.toFormData=bf;ya.AxiosError=wt;ya.Cancel=ya.CanceledError;ya.all=function(e){return Promise.all(e)};ya.spread=OP;ya.isAxiosError=DP;ya.mergeConfig=Fd;ya.AxiosHeaders=ka;ya.formToJSON=r=>NE(ve.isHTMLForm(r)?new FormData(r):r);ya.getAdapter=qE.getAdapter;ya.HttpStatusCode=voe;ya.default=ya;var G0=ya;var{Axios:_Gt,AxiosError:EGt,CanceledError:xGt,isCancel:AGt,CancelToken:TGt,VERSION:SGt,all:IGt,Cancel:CGt,isAxiosError:kGt,spread:NGt,toFormData:RGt,AxiosHeaders:OGt,HttpStatusCode:DGt,formToJSON:PGt,getAdapter:BGt,mergeConfig:MGt}=G0;var ne=class r{constructor(e,t,n,i,a){let o=q3(e,t,n);this.shard=o.shard,this.realm=o.realm,this.num=o.num,this.aliasKey=i??null,this.evmAddress=a??null,this._checksum=null}static fromString(e){let t=Ud.default.ZERO,n=Ud.default.ZERO,i=Ud.default.ZERO,a,o;if(e.startsWith("0x")&&e.length==42||e.length==40)o=rs.fromString(e);else{let s=X5(e);if(Number.isNaN(s.shard)||Number.isNaN(s.realm))throw new Error("invalid format for entity ID");s.shard!=null&&(t=Ud.default.fromString(s.shard)),s.realm!=null&&(n=Ud.default.fromString(s.realm)),s.numOrHex.length<20?i=Ud.default.fromString(s.numOrHex):s.numOrHex.length==40?o=rs.fromString(s.numOrHex):a=Xn.fromString(s.numOrHex)}return new r(t,n,i,a,o)}static fromEvmAddress(e,t,n){let i=typeof n=="string"?rs.fromString(n):n;return Qh(i.toBytes())?this.fromSolidityAddress(i.toString()):new r(e,t,0,void 0,i)}static fromEvmPublicAddress(e){return new r(0,0,0,void 0,e)}static _fromProtobuf(e){let t,n;return e.alias!=null&&(e.alias.length===20?n=rs.fromBytes(e.alias):t=rt._fromProtobufKey(h8.proto.Key.decode(e.alias))),t instanceof Xn||(t=void 0),new r(e.shardNum!=null?e.shardNum:0,e.realmNum!=null?e.realmNum:0,e.accountNum!=null?e.accountNum:0,t,n)}get checksum(){return this._checksum}getEvmAddress(){return this.evmAddress}async populateAccountNum(e){if(this.evmAddress===null)throw new Error("field `evmAddress` should not be null");let t=e.mirrorNetwork[0].slice(0,e.mirrorNetwork[0].indexOf(":"));await new Promise(a=>{setTimeout(a,3e3)});let n=`https://${t}/api/v1/accounts/${this.evmAddress.toString()}`,i=(await G0.get(n)).data.account;return this.num=Ud.default.fromString(i.slice(i.lastIndexOf(".")+1)),this}async populateAccountEvmAddress(e){if(this.num===null)throw new Error("field `num` should not be null");let t=e.mirrorNetwork[0].slice(0,e.mirrorNetwork[0].indexOf(":"));await new Promise(a=>{setTimeout(a,3e3)});let n=`https://${t}/api/v1/accounts/${this.num.toString()}`,i=(await G0.get(n)).data.evm_address;return this.evmAddress=rs.fromString(i),this}validate(e){console.warn("Deprecated: Use `validateChecksum` instead"),this.validateChecksum(e)}validateChecksum(e){if(this.aliasKey!=null)throw new Error("cannot calculate checksum with an account ID that has a aliasKey");V3(this.shard,this.realm,this.num,this._checksum,e)}static fromBytes(e){return r._fromProtobuf(h8.proto.AccountID.decode(e))}static fromSolidityAddress(e){return Qh(et(e))?new r(...t3(e)):this.fromEvmAddress(0,0,e)}toSolidityAddress(){return this.evmAddress!=null?this.evmAddress.toString():this.aliasKey!=null&&this.aliasKey._key._type=="secp256k1"?this.aliasKey.toEvmAddress():j3([this.shard,this.realm,this.num])}_toProtobuf(){let e=null;return this.aliasKey!=null?e=h8.proto.Key.encode(this.aliasKey._toProtobufKey()).finish():this.evmAddress!=null&&(e=this.evmAddress._bytes),{alias:e,accountNum:this.aliasKey!=null?null:this.num,shardNum:this.shard,realmNum:this.realm}}toBytes(){return h8.proto.AccountID.encode(this._toProtobuf()).finish()}toString(){let e=this.num.toString();return this.aliasKey!=null?e=this.aliasKey.toString():this.evmAddress!=null&&(e=this.evmAddress.toString()),`${this.shard.toString()}.${this.realm.toString()}.${e}`}toStringWithChecksum(e){if(this.aliasKey!=null)throw new Error("cannot calculate checksum with an account ID that has a aliasKey");return H3(this.toString(),e)}equals(e){let t=!1;return this.aliasKey!=null&&e.aliasKey!=null?t=this.aliasKey.equals(e.aliasKey):this.evmAddress!=null&&e.evmAddress!=null?t=this.evmAddress.equals(e.evmAddress):this.aliasKey==null&&e.aliasKey==null&&this.evmAddress==null&&e.evmAddress==null&&(t=this.num.eq(e.num)),this.shard.eq(e.shard)&&this.realm.eq(e.realm)&&t}clone(){let e=new r(this);return e._checksum=this._checksum,e.aliasKey=this.aliasKey,e.evmAddress=this.evmAddress,e}compare(e){let t=this.shard.compare(e.shard);if(t!=0||(t=this.realm.compare(e.realm),t!=0))return t;if(this.aliasKey!=null&&e.aliasKey!=null){let n=this.aliasKey.toString(),i=e.aliasKey.toString();return n>i?1:n<i?-1:0}else if(this.evmAddress!=null&&e.evmAddress!=null){let n=this.evmAddress.toString(),i=e.evmAddress.toString();return n>i?1:n<i?-1:0}else return this.aliasKey==null&&e.aliasKey==null&&this.evmAddress==null&&e.evmAddress==null?this.num.compare(e.num):1}};ir.setAccountIdConstructor((r,e,t)=>new ne(r,e,Ud.default.ZERO,t));var Xt=class r{constructor(e){this._code=e,Object.freeze(this)}static _fromValue(e){switch(e){case 0:return r.Ok;case 1:return r.Cancelled;case 2:return r.Unknown;case 3:return r.InvalidArgument;case 4:return r.DeadlineExceeded;case 5:return r.NotFound;case 6:return r.AlreadyExists;case 7:return r.PermissionDenied;case 8:return r.ResourceExhausted;case 9:return r.FailedPrecondition;case 10:return r.Aborted;case 11:return r.OutOfRange;case 12:return r.Unimplemented;case 13:return r.Internal;case 14:return r.Unavailable;case 15:return r.DataLoss;case 16:return r.Unauthenticated;case 17:return r.Timeout;case 18:return r.GrpcWeb;default:throw new Error("(BUG) non-exhaustive GrpcStatus switch statement")}}toString(){switch(this){case r.Ok:return"OK";case r.Cancelled:return"CANCELLED";case r.Unknown:return"UNKNOWN";case r.InvalidArgument:return"INVALID_ARGUMENT";case r.DeadlineExceeded:return"DEADLINE_EXCEEDED";case r.NotFound:return"NOT_FOUND";case r.AlreadyExists:return"ALREADY_EXISTS";case r.PermissionDenied:return"PERMISSION_DENIED";case r.Unauthenticated:return"UNAUTHENTICATED";case r.ResourceExhausted:return"RESOURCE_EXHAUSTED";case r.FailedPrecondition:return"FAILED_PRECONDITION";case r.Aborted:return"ABORTED";case r.OutOfRange:return"OUT_OF_RANGE";case r.Unimplemented:return"UNIMPLEMENTED";case r.Internal:return"INTERNAL";case r.Unavailable:return"UNAVAILABLE";case r.DataLoss:return"DATA_LOSS";case r.Timeout:return"TIMEOUT";case r.GrpcWeb:return"GRPC_WEB";default:return`UNKNOWN (${this._code})`}}valueOf(){return this._code}};Xt.Ok=new Xt(0);Xt.Cancelled=new Xt(1);Xt.Unknown=new Xt(2);Xt.InvalidArgument=new Xt(3);Xt.DeadlineExceeded=new Xt(4);Xt.NotFound=new Xt(5);Xt.AlreadyExists=new Xt(6);Xt.PermissionDenied=new Xt(7);Xt.ResourceExhausted=new Xt(8);Xt.FailedPrecondition=new Xt(9);Xt.Aborted=new Xt(10);Xt.OutOfRange=new Xt(11);Xt.Unimplemented=new Xt(12);Xt.Internal=new Xt(13);Xt.Unavailable=new Xt(14);Xt.DataLoss=new Xt(15);Xt.Unauthenticated=new Xt(16);Xt.Timeout=new Xt(17);Xt.GrpcWeb=new Xt(18);var qd=class r extends Error{constructor(e){super(`gRPC service failed with status: ${e.toString()}`),this.status=e,this.name="GrpcServiceError",typeof Error.captureStackTrace<"u"&&Error.captureStackTrace(this,r)}static _fromResponse(e){if(e.code!=null&&e.details!=null){let t=Xt._fromValue(e.code),n=new r(t);return n.message=e.details,n}else return e}};var rl=class r{constructor(){this.list=[],this.locked=!1,this.index=0}setList(e){if(this.locked)throw new Error("list is locked");return this.list=e,this.index=0,this}push(...e){if(this.locked)throw new Error("list is locked");return this.list.push(...e),this}setLocked(){return this.locked=!0,this}clear(){this.list=[],this.index=0}get(e){return this.list[e]}set(e,t){return e===this.length?this.list.push(t):this.list[e]=t,this}setIfAbsent(e,t){return(e==this.length||this.list[e]==null)&&this.set(e,t()),this}get next(){return this.get(this.advance())}get current(){return this.get(this.index)}advance(){let e=this.index;return this.index=(this.index+1)%this.list.length,e}get isEmpty(){return this.length===0}get length(){return this.list.length}clone(){let e=new r;return e.list=this.list,e.locked=this.locked,e}};var m8=class r extends Error{constructor(e){super(`failed with error code: ${e.toString()}`),this.status=e,this.name="HttpError",typeof Error.captureStackTrace<"u"&&Error.captureStackTrace(this,r)}};var Bn={Finished:"Finished",Retry:"Retry",Error:"Error"},HE=/\brst[^0-9a-zA-Z]stream\b/i,lu=class{constructor(){this._maxAttempts=10,this._nodeAccountIds=new rl,this._signOnDemand=!1,this._minBackoff=null,this._maxBackoff=8e3,this._operator=null,this._requestTimeout=null,this._grpcDeadline=null,this._logger=null}get nodeAccountIds(){return this._nodeAccountIds.isEmpty?null:(this._nodeAccountIds.setLocked(),this._nodeAccountIds.list)}setNodeAccountIds(e){return this._nodeAccountIds.setList(e).setLocked(),this}get maxRetries(){return console.warn("Deprecated: use maxAttempts instead"),this.maxAttempts}setMaxRetries(e){return console.warn("Deprecated: use setMaxAttempts() instead"),this.setMaxAttempts(e)}get maxAttempts(){return this._maxAttempts}setMaxAttempts(e){return this._maxAttempts=e,this}get grpcDeadline(){return this._grpcDeadline}setGrpcDeadline(e){return this._grpcDeadline=e,this}setMinBackoff(e){if(e==null)throw new Error("minBackoff cannot be null.");if(this._maxBackoff!=null&&e>this._maxBackoff)throw new Error("minBackoff cannot be larger than maxBackoff.");return this._minBackoff=e,this}get minBackoff(){return this._minBackoff}setMaxBackoff(e){if(e==null)throw new Error("maxBackoff cannot be null.");if(this._minBackoff!=null&&e<this._minBackoff)throw new Error("maxBackoff cannot be smaller than minBackoff.");return this._maxBackoff=e,this}get maxBackoff(){return this._maxBackoff}_beforeExecute(e){throw new Error("not implemented")}_makeRequestAsync(){throw new Error("not implemented")}_mapStatusError(e,t){throw new Error("not implemented")}_mapResponse(e,t,n){throw new Error("not implemented")}_execute(e,t){throw new Error("not implemented")}_getTransactionId(){throw new Error("not implemented")}_getLogId(){throw new Error("not implemented")}_requestToBytes(e){throw new Error("not implemented")}_responseToBytes(e){throw new Error("not implemented")}_advanceRequest(){this._nodeAccountIds.advance()}_shouldRetry(e,t){throw new Error("not implemented")}_shouldRetryExceptionally(e){return e instanceof qd?e.status._code===Xt.Timeout._code||e.status._code===Xt.Unavailable._code||e.status._code===Xt.ResourceExhausted._code||e.status._code===Xt.GrpcWeb._code||e.status._code===Xt.Internal._code&&HE.test(e.message):!0}_setOperatorWith(e,t,n){return this._operator={transactionSigner:n,accountId:e,publicKey:t},this}async executeWithSigner(e){return e.call(this)}async execute(e,t){this._logger=this._logger==null?e._logger!=null?e._logger:null:this._logger,this._requestTimeout==null&&(this._requestTimeout=t??e.requestTimeout),await this._beforeExecute(e),this._maxBackoff==null&&(this._maxBackoff=e.maxBackoff),this._minBackoff==null&&(this._minBackoff=e.minBackoff);let n=e._maxAttempts!=null?e._maxAttempts:this._maxAttempts,i=Date.now(),a=null;for(let o=1;o<=n;o+=1){if(this._requestTimeout!=null&&i+this._requestTimeout<=Date.now())throw new Error("timeout exceeded");let s,c;if(this._nodeAccountIds.locked?(s=this._nodeAccountIds.current,c=e._network.getNode(s)):(c=e._network.getNode(),s=c.accountId,this._nodeAccountIds.setList([s])),c==null)throw new Error(`NodeAccountId not recognized: ${s.toString()}`);let l=this._getLogId();this._logger&&this._logger.debug(`[${l}] Node AccountID: ${c.accountId.toString()}, IP: ${c.address.toString()}`);let u=c.getChannel(),d=await this._makeRequestAsync();this._advanceRequest();let h;if(!c.isHealthy()){this._logger&&this._logger.debug(`[${l}] node is not healthy, skipping waiting ${c.getRemainingTime()}`);continue}try{let b=[];this._grpcDeadline!=null&&b.push(new Promise((E,I)=>setTimeout(()=>I(new Error("grpc deadline exceeded")),this._grpcDeadline))),this._logger&&this._logger.trace(`[${this._getLogId()}] sending protobuf ${He(this._requestToBytes(d))}`),b.push(this._execute(u,d)),h=await Promise.race(b)}catch(b){let E=qd._fromResponse(b);if(a=E,this._logger&&this._logger.debug(`[${l}] received error ${JSON.stringify(E)}`),(E instanceof qd||E instanceof m8)&&this._shouldRetryExceptionally(E)&&o<=n){this._logger&&this._logger.debug(`[${this._getLogId()}] node with accountId: ${c.accountId.toString()} and proxy IP: ${c.address.toString()} is unhealthy`),e._network.increaseBackoff(c);continue}throw b}this._logger&&this._logger.trace(`[${this._getLogId()}] sending protobuf ${He(this._responseToBytes(h))}`),e._network.decreaseBackoff(c);let[g,m]=this._shouldRetry(d,h);switch(g!=null&&(a=g),m){case Bn.Retry:await AVe(o,this._minBackoff,this._maxBackoff);continue;case Bn.Finished:return this._mapResponse(h,s,d);case Bn.Error:throw this._mapStatusError(d,h);default:throw new Error("(BUG) non-exhuastive switch statement for `ExecutionState`")}}throw new Error(`max attempts of ${n.toString()} was reached for request with last error being: ${a!=null?a.toString():""}`)}toBytes(){throw new Error("not implemented")}setLogger(e){return this._logger=e,this}get logger(){return this._logger}};function AVe(r,e,t){let n=Math.min(Math.floor(e*Math.pow(2,r)),t);return new Promise(i=>setTimeout(i,n))}var uu=Ie(Yt(),1);var woe=uu.default.fromNumber(1e9),_oe=new Set,lt=class r{constructor(e,t){this.seconds=e instanceof uu.default?e:uu.default.fromNumber(e),this.nanos=t instanceof uu.default?t:uu.default.fromNumber(t),Object.freeze(this)}static generate(){let e=Math.floor(Math.random()*5e3)+8e3,t=Date.now()-e,n=Math.floor(t/1e3)+ir.timeDrift,i=Math.floor(t%1e3)*1e6+Math.floor(Math.random()*1e6),a=new r(n,i);return _oe.has(a.toString())?this.generate():(_oe.add(a.toString()),a)}static fromDate(e){let t;if(typeof e=="number")t=uu.default.fromNumber(e);else if(typeof e=="string")t=uu.default.fromNumber(Date.parse(e)).mul(1e6);else if(e instanceof Date)t=uu.default.fromNumber(e.getTime()).mul(1e6);else throw new TypeError(`invalid type '${typeof e}' for 'data', expected 'Date'`);return new r(0,0).plusNanos(t)}toDate(){return new Date(this.seconds.toInt()*1e3+Math.floor(this.nanos.toInt()/1e6))}plusNanos(e){let t=this.nanos.add(e);return new r(this.seconds.add(t.div(woe)),t.mod(woe))}_toProtobuf(){return{seconds:this.seconds,nanos:this.nanos.toInt()}}static _fromProtobuf(e){return new r(e.seconds instanceof uu.default?e.seconds.toInt():e.seconds!=null?e.seconds:0,e.nanos!=null?e.nanos:0)}toString(){let e=String(this.nanos).padStart(9,"0");return`${this.seconds.toString()}.${e}`}compare(e){let t=this.seconds.compare(e.seconds);return t!=0?t:this.nanos.compare(e.nanos)}};var BP=Ie(vr(),1),g8=Ie(Yt(),1);var Wr=class r{constructor(e,t,n=!1,i=null){this.accountId=e,this.validStart=t,this.scheduled=n,this.nonce=null,i!=null&&i!=0&&this.setNonce(i),Object.seal(this)}setNonce(e){return this.nonce=typeof e=="number"?g8.default.fromNumber(e):e,this}static withValidStart(e,t){return new r(e,t)}static generate(e){return new r(typeof e=="string"?ne.fromString(e):new ne(e),lt.generate())}static fromString(e){let t,n,i,a,o,s;return[t,s]=e.split("@"),[n,s]=s.split("."),s.includes("?")?([i,s]=s.split("?scheduled"),a=!0,s.includes("/")?o=s.replace("/",""):o=null):s.includes("/")?([i,o]=s.split("/"),a=!1):i=s,new r(ne.fromString(t),new lt(g8.default.fromValue(n),g8.default.fromValue(i)),a,o!=null?g8.default.fromString(o):null)}setScheduled(e){return this.scheduled=e,this}toString(){if(this.accountId!=null&&this.validStart!=null){let e=String(this.validStart.nanos).padStart(9,"0"),t=this.nonce!=null?"/".concat(this.nonce.toString()):"",n=this.scheduled?"?scheduled":"";return`${this.accountId.toString()}@${this.validStart.seconds.toString()}.${e}${n}${t}`}else throw new Error("neither `accountId` nor `validStart` are set")}static _fromProtobuf(e){if(e.accountID!=null&&e.transactionValidStart!=null)return new r(ne._fromProtobuf(e.accountID),lt._fromProtobuf(e.transactionValidStart),e.scheduled!=null?e.scheduled:void 0,e.nonce!=null?e.nonce:void 0);throw new Error("Neither `nonce` or `accountID` and `transactionValidStart` are set")}_toProtobuf(){return{accountID:this.accountId!=null?this.accountId._toProtobuf():null,transactionValidStart:this.validStart!=null?this.validStart._toProtobuf():null,scheduled:this.scheduled,nonce:this.nonce!=null?this.nonce.toInt():null}}static fromBytes(e){return r._fromProtobuf(BP.proto.TransactionID.decode(e))}toBytes(){return BP.proto.TransactionID.encode(this._toProtobuf()).finish()}clone(){return new r(this.accountId,this.validStart,this.scheduled,this.nonce)}compare(e){let t=this.accountId.compare(e.accountId);return t!=0?t:this.validStart.compare(e.validStart)}getReceipt(e){return ir.transactionReceiptQueryConstructor().setTransactionId(this).execute(e)}async getRecord(e){return await this.getReceipt(e),ir.transactionRecordQueryConstructor().setTransactionId(this).execute(e)}};var G3=Ie(vr(),1);var ns=class extends su{constructor(e){super(e,`transaction ${e.transactionId.toString()} failed precheck with status ${e.status.toString()}`),this.contractFunctionResult=e.contractFunctionResult}toJSON(){return{name:this.name,status:this.status.toString(),transactionId:this.transactionId.toString(),message:this.message,contractFunctionResult:this.contractFunctionResult}}};var G2=class extends Error{constructor(e,t){super(),this.message=`query cost of ${e.toString()} HBAR exceeds max set on client: ${t.toString()} HBAR`,this.name="MaxQueryPaymentExceededError",this.queryCost=e,this.maxQueryPayment=t}};var Eoe=Ie(Yt(),1),Qr=new Map,xr=class extends lu{constructor(){super(),this._paymentTransactionId=null,this._paymentTransactions=[],this._queryPayment=null,this._maxQueryPayment=null,this._timestamp=Date.now()}static fromBytes(e){let t=G3.proto.Query.decode(e);if(t.query==null)throw new Error("(BUG) query.query was not set in the protobuf");let n=Qr.get(t.query);if(n==null)throw new Error(`(BUG) Query.fromBytes() not implemented for type ${t.query}`);return n(t)}toBytes(){return G3.proto.Query.encode(this._makeRequest()).finish()}setQueryPayment(e){return this._queryPayment=e,this}setMaxQueryPayment(e){return this._maxQueryPayment=e,this}async getCost(e){if(this._nodeAccountIds.isEmpty&&this._nodeAccountIds.setList(e._network.getNodeAccountIdsForExecute()),zE.length!=1)throw new Error("CostQuery has not been loaded yet");this._timestamp=Date.now();let t=await zE[0](this).execute(e);return ze.fromTinybars(t._valueInTinybar.multipliedBy(1.1).toFixed(0))}setPaymentTransactionId(e){return this._paymentTransactionId=e,this}get paymentTransactionId(){return this._paymentTransactionId}_getTransactionId(){if(this._paymentTransactionId==null)throw new Error("Query.PaymentTransactionId was not set duration execution");return this._paymentTransactionId}_isPaymentRequired(){return!0}_validateChecksums(e){}async _beforeExecute(e){if(this._paymentTransactions.length>0)return;if(e.isAutoValidateChecksumsEnabled()&&this._validateChecksums(e),this._nodeAccountIds.isEmpty&&this._nodeAccountIds.setList(e._network.getNodeAccountIdsForExecute()),this._operator=this._operator!=null?this._operator:e._operator,this._paymentTransactionId==null)if(this._isPaymentRequired())if(this._operator!=null)this._paymentTransactionId=Wr.generate(this._operator.accountId);else throw new Error("`client` must have an `operator` or an explicit payment transaction must be provided");else this._paymentTransactionId=Wr.generate(new ne(0));let t=new ze(0),n=this._maxQueryPayment!=null?this._maxQueryPayment:e.defaultMaxQueryPayment;if(this._queryPayment!=null)t=this._queryPayment;else if(this._paymentTransactions.length===0&&this._isPaymentRequired()){let i=await this.getCost(e);if(n.toTinybars().toInt()<i.toTinybars().toInt())throw new G2(i,n);t=i,this._logger&&this._logger.debug(`[${this._getLogId()}] received cost for query ${t.toString()}`)}this._queryPayment=t,this._timestamp=Date.now(),this._nodeAccountIds.setLocked();for(let i of this._nodeAccountIds.list){let a=this._getLogId(),o=this._paymentTransactionId,s=this._queryPayment;this._logger&&this._logger.debug(`[${a}] making a payment transaction for node ${i.toString()} and transaction ID ${o.toString()} with amount ${s.toString()}`),this._paymentTransactions.push(await KE(o,i,this._isPaymentRequired()?this._operator:null,s))}}_mapResponseHeader(e){throw new Error("not implemented")}_makeRequestHeader(){let e={};return this._isPaymentRequired()&&this._paymentTransactions.length>0&&(e={responseType:G3.proto.ResponseType.ANSWER_ONLY,payment:this._paymentTransactions[this._nodeAccountIds.index]}),e}_onMakeRequest(e){throw new Error("not implemented")}_makeRequest(){let e={};return this._isPaymentRequired()&&this._paymentTransactions!=null&&(e={payment:this._paymentTransactions[this._nodeAccountIds.index],responseType:G3.proto.ResponseType.ANSWER_ONLY}),this._onMakeRequest(e)}async _makeRequestAsync(){let e={responseType:G3.proto.ResponseType.ANSWER_ONLY};if(this._isPaymentRequired()&&this._paymentTransactions!=null)if(this._nodeAccountIds.locked)e.payment=this._paymentTransactions[this._nodeAccountIds.index];else{let t=this._getLogId(),n=this._nodeAccountIds.current,i=this._paymentTransactionId,a=this._queryPayment;this._logger&&this._logger.debug(`[${t}] making a payment transaction for node ${n.toString()} and transaction ID ${i.toString()} with amount ${a.toString()}`),e.payment=await KE(i,n,this._isPaymentRequired()?this._operator:null,a)}return this._onMakeRequest(e)}_shouldRetry(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??G3.proto.ResponseCodeEnum.OK);switch(this._logger&&this._logger.debug(`[${this._getLogId()}] received status ${i.toString()}`),i){case P.Busy:case P.Unknown:case P.PlatformTransactionNotCreated:return[i,Bn.Retry];case P.Ok:return[i,Bn.Finished];default:return[i,Bn.Error]}}_mapStatusError(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??G3.proto.ResponseCodeEnum.OK);return new ns({status:i,transactionId:this._getTransactionId(),contractFunctionResult:null})}_requestToBytes(e){return G3.proto.Query.encode(e).finish()}_responseToBytes(e){return G3.proto.Response.encode(e).finish()}};async function KE(r,e,t,n){let i=[];t!=null?(i.push({accountID:t.accountId._toProtobuf(),amount:n.negated().toTinybars()}),i.push({accountID:e._toProtobuf(),amount:n.toTinybars()})):(i.push({accountID:new ne(0)._toProtobuf(),amount:n.negated().toTinybars()}),i.push({accountID:e._toProtobuf(),amount:n.toTinybars()}));let a={transactionID:r._toProtobuf(),nodeAccountID:e._toProtobuf(),transactionFee:new ze(1).toTinybars(),transactionValidDuration:{seconds:Eoe.default.fromNumber(120)},cryptoTransfer:{transfers:{accountAmounts:i}}},o={bodyBytes:G3.proto.TransactionBody.encode(a).finish()};if(t!=null){let s=await t.transactionSigner(o.bodyBytes);o.sigMap={sigPair:[t.publicKey._toProtobufSignature(s)]}}return{signedTransactionBytes:G3.proto.SignedTransaction.encode(o).finish()}}var zE=[];var MP=Ie(vr(),1);var xf=Ie(Yt(),1);var _t=class r extends rt{constructor(e,t,n,i){super();let a=q3(e,t,n);this.shard=a.shard,this.realm=a.realm,this.num=a.num,this.evmAddress=i??null,this._checksum=null}static fromEvmAddress(e,t,n){return Qh(et(n))?new r(...t3(n)):new r(e,t,0,et(n))}static fromString(e){let t=X5(e);if(Number.isNaN(t.shard)||Number.isNaN(t.realm))throw new Error("invalid format for entity ID");let n=t.shard!=null?xf.default.fromString(t.shard):xf.default.ZERO,i=t.realm!=null?xf.default.fromString(t.realm):xf.default.ZERO,[a,o]=t.numOrHex.length<40?[xf.default.fromString(t.numOrHex),void 0]:[xf.default.ZERO,et(t.numOrHex)];return new r(n,i,a,o)}static _fromProtobuf(e){return new r(e.shardNum!=null?e.shardNum:0,e.realmNum!=null?e.realmNum:0,e.contractNum!=null?e.contractNum:0)}get checksum(){return this._checksum}async populateAccountNum(e){if(this.evmAddress===null)throw new Error("field `evmAddress` should not be null");let n=`https://${e.mirrorNetwork[0].slice(0,e.mirrorNetwork[0].indexOf(":"))}/api/v1/contracts/${He(this.evmAddress)}`,i=(await G0.get(n)).data.contract_id;return this.num=xf.default.fromString(i.slice(i.lastIndexOf(".")+1)),this}validate(e){console.warn("Deprecated: Use `validateChecksum` instead"),this.validateChecksum(e)}validateChecksum(e){V3(this.shard,this.realm,this.num,this._checksum,e)}static fromBytes(e){return r._fromProtobuf(MP.proto.ContractID.decode(e))}static fromSolidityAddress(e){return Qh(et(e))?new r(...t3(e)):this.fromEvmAddress(0,0,e)}toSolidityAddress(){return this.evmAddress!=null?He(this.evmAddress):j3([this.shard,this.realm,this.num])}_toProtobuf(){return{contractNum:this.num,shardNum:this.shard,realmNum:this.realm,evmAddress:this.evmAddress}}toString(){return this.evmAddress!=null?`${this.shard.toString()}.${this.realm.toString()}.${He(this.evmAddress)}`:`${this.shard.toString()}.${this.realm.toString()}.${this.num.toString()}`}toStringWithChecksum(e){return H3(this.toString(),e)}toBytes(){return MP.proto.ContractID.encode(this._toProtobuf()).finish()}clone(){let e=new r(this);return e._checksum=this._checksum,e.evmAddress=this.evmAddress,e}compare(e){return ou([this.shard,this.realm,this.num],[e.shard,e.realm,e.num])}equals(e){let t=!1;return this.evmAddress!=null&&e.evmAddress!=null&&(t=yE(this.evmAddress,e.evmAddress)),this.shard.eq(e.shard)&&this.realm.eq(e.realm)&&this.num.eq(e.num)&&t}_toProtobufKey(){return{contractID:this._toProtobuf()}}static __fromProtobufKey(e){return r._fromProtobuf(e)}};ir.setContractId(r=>_t.__fromProtobufKey(r));var LP=Ie(vr(),1),GE=Ie(Yt(),1),zt=class r{constructor(e,t,n){let i=q3(e,t,n);this.shard=i.shard,this.realm=i.realm,this.num=i.num,this._checksum=null}static fromString(e){let t=vf(e),n=new r(t);return n._checksum=t.checksum,n}static _fromProtobuf(e){return new r(e.shardNum!=null?GE.default.fromString(e.shardNum.toString()):0,e.realmNum!=null?GE.default.fromString(e.realmNum.toString()):0,e.fileNum!=null?GE.default.fromString(e.fileNum.toString()):0)}get checksum(){return this._checksum}validate(e){console.warn("Deprecated: Use `validateChecksum` instead"),this.validateChecksum(e)}validateChecksum(e){V3(this.shard,this.realm,this.num,this._checksum,e)}static fromBytes(e){return r._fromProtobuf(LP.proto.FileID.decode(e))}static fromSolidityAddress(e){let[t,n,i]=t3(e);return new r(t,n,i)}toSolidityAddress(){return j3([this.shard,this.realm,this.num])}_toProtobuf(){return{fileNum:this.num,shardNum:this.shard,realmNum:this.realm}}toString(){return`${this.shard.toString()}.${this.realm.toString()}.${this.num.toString()}`}toStringWithChecksum(e){return H3(this.toString(),e)}toBytes(){return LP.proto.FileID.encode(this._toProtobuf()).finish()}clone(){let e=new r(this);return e._checksum=this._checksum,e}compare(e){return ou([this.shard,this.realm,this.num],[e.shard,e.realm,e.num])}};zt.ADDRESS_BOOK=new zt(102);zt.FEE_SCHEDULE=new zt(111);zt.EXCHANGE_RATES=new zt(112);var FP=Ie(vr(),1),ia=class r{constructor(e,t,n){let i=q3(e,t,n);this.shard=i.shard,this.realm=i.realm,this.num=i.num,this._checksum=null}static fromString(e){let t=vf(e),n=new r(t);return n._checksum=t.checksum,n}static _fromProtobuf(e){return new r(e.shardNum!=null?e.shardNum:0,e.realmNum!=null?e.realmNum:0,e.topicNum!=null?e.topicNum:0)}get checksum(){return this._checksum}validate(e){console.warn("Deprecated: Use `validateChecksum` instead"),this.validateChecksum(e)}validateChecksum(e){V3(this.shard,this.realm,this.num,this._checksum,e)}static fromBytes(e){return r._fromProtobuf(FP.proto.TopicID.decode(e))}static fromSolidityAddress(e){let[t,n,i]=t3(e);return new r(t,n,i)}toSolidityAddress(){return j3([this.shard,this.realm,this.num])}_toProtobuf(){return{topicNum:this.num,shardNum:this.shard,realmNum:this.realm}}toString(){return`${this.shard.toString()}.${this.realm.toString()}.${this.num.toString()}`}toStringWithChecksum(e){return H3(this.toString(),e)}toBytes(){return FP.proto.TopicID.encode(this._toProtobuf()).finish()}clone(){let e=new r(this);return e._checksum=this._checksum,e}compare(e){return ou([this.shard,this.realm,this.num],[e.shard,e.realm,e.num])}};var UP=Ie(vr(),1),Oe=class r{constructor(e,t,n){let i=q3(e,t,n);this.shard=i.shard,this.realm=i.realm,this.num=i.num,this._checksum=null}static fromString(e){let t=vf(e),n=new r(t);return n._checksum=t.checksum,n}static _fromProtobuf(e){return new r(e.shardNum!=null?e.shardNum:0,e.realmNum!=null?e.realmNum:0,e.tokenNum!=null?e.tokenNum:0)}get checksum(){return this._checksum}validate(e){console.warn("Deprecated: Use `validateChecksum` instead"),this.validateChecksum(e)}validateChecksum(e){V3(this.shard,this.realm,this.num,this._checksum,e)}static fromBytes(e){return r._fromProtobuf(UP.proto.TokenID.decode(e))}static fromSolidityAddress(e){return new r(...t3(e))}toSolidityAddress(){return j3([this.shard,this.realm,this.num])}_toProtobuf(){return{tokenNum:this.num,shardNum:this.shard,realmNum:this.realm}}toString(){return`${this.shard.toString()}.${this.realm.toString()}.${this.num.toString()}`}toStringWithChecksum(e){return H3(this.toString(),e)}toBytes(){return UP.proto.TokenID.encode(this._toProtobuf()).finish()}clone(){let e=new r(this);return e._checksum=this._checksum,e}compare(e){return ou([this.shard,this.realm,this.num],[e.shard,e.realm,e.num])}};var qP=Ie(vr(),1),Na=class r{constructor(e,t,n){let i=q3(e,t,n);this.shard=i.shard,this.realm=i.realm,this.num=i.num,this._checksum=null}static fromString(e){let t=vf(e),n=new r(t);return n._checksum=t.checksum,n}static _fromProtobuf(e){return new r(e.shardNum!=null?e.shardNum:0,e.realmNum!=null?e.realmNum:0,e.scheduleNum!=null?e.scheduleNum:0)}get checksum(){return this._checksum}validate(e){console.warn("Deprecated: Use `validateChecksum` instead"),this.validateChecksum(e)}validateChecksum(e){V3(this.shard,this.realm,this.num,this._checksum,e)}static fromBytes(e){return r._fromProtobuf(qP.proto.ScheduleID.decode(e))}static fromSolidityAddress(e){return new r(...t3(e))}toSolidityAddress(){return j3([this.shard,this.realm,this.num])}_toProtobuf(){return{scheduleNum:this.num,shardNum:this.shard,realmNum:this.realm}}toString(){return`${this.shard.toString()}.${this.realm.toString()}.${this.num.toString()}`}toStringWithChecksum(e){return H3(this.toString(),e)}toBytes(){return qP.proto.ScheduleID.encode(this._toProtobuf()).finish()}clone(){let e=new r(this);return e._checksum=this._checksum,e}compare(e){return ou([this.shard,this.realm,this.num],[e.shard,e.realm,e.num])}};var jP=Ie(Yt(),1),W0=class r{constructor(e){this.hbars=e.hbars,this.cents=e.cents,this.expirationTime=e.expirationTime,this.exchangeRateInCents=e.cents/e.hbars,Object.freeze(this)}static _fromProtobuf(e){return new r({hbars:e.hbarEquiv,cents:e.centEquiv,expirationTime:new Date(e.expirationTime!=null&&e.expirationTime.seconds!=null?jP.default.isLong(e.expirationTime.seconds)?e.expirationTime.seconds.toInt()*1e3:e.expirationTime.seconds:0)})}_toProtobuf(){return{hbarEquiv:this.hbars,centEquiv:this.cents,expirationTime:{seconds:jP.default.fromNumber(Math.trunc(this.expirationTime.getTime()/1e3))}}}toJSON(){return{hbars:this.hbars,cents:this.cents,expirationTime:this.expirationTime,exchangeRateInCents:this.exchangeRateInCents}}toString(){return JSON.stringify(this.toJSON())}};var WE=Ie(Yt(),1),VP=Ie(vr(),1);var nl=class r{constructor(e){this.status=e.status,this.accountId=e.accountId,this.fileId=e.fileId,this.contractId=e.contractId,this.topicId=e.topicId,this.tokenId=e.tokenId,this.scheduleId=e.scheduleId,this.exchangeRate=e.exchangeRate,this.topicSequenceNumber=e.topicSequenceNumber,this.topicRunningHash=e.topicRunningHash,this.totalSupply=e.totalSupply,this.scheduledTransactionId=e.scheduledTransactionId,this.serials=e.serials??[],this.duplicates=e.duplicates??[],this.children=e.children??[],Object.freeze(this)}_toProtobuf(){let e=this.duplicates.map(n=>n._toProtobuf().receipt),t=this.children.map(n=>n._toProtobuf().receipt);return{duplicateTransactionReceipts:e,childTransactionReceipts:t,receipt:{status:this.status.valueOf(),accountID:this.accountId!=null?this.accountId._toProtobuf():null,fileID:this.fileId!=null?this.fileId._toProtobuf():null,contractID:this.contractId!=null?this.contractId._toProtobuf():null,topicID:this.topicId!=null?this.topicId._toProtobuf():null,tokenID:this.tokenId!=null?this.tokenId._toProtobuf():null,scheduleID:this.scheduleId!=null?this.scheduleId._toProtobuf():null,topicRunningHash:this.topicRunningHash==null?null:this.topicRunningHash,topicSequenceNumber:this.topicSequenceNumber,exchangeRate:{nextRate:null,currentRate:this.exchangeRate!=null?this.exchangeRate._toProtobuf():null},scheduledTransactionID:this.scheduledTransactionId!=null?this.scheduledTransactionId._toProtobuf():null,serialNumbers:this.serials,newTotalSupply:this.totalSupply}}}static _fromProtobuf(e){let t=e.receipt,n=t.exchangeRate,i=e.childTransactionReceipts!=null?e.childTransactionReceipts.map(o=>r._fromProtobuf({receipt:o})):[],a=e.duplicateTransactionReceipts!=null?e.duplicateTransactionReceipts.map(o=>r._fromProtobuf({receipt:o})):[];return new r({status:P._fromCode(t.status!=null?t.status:0),accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):null,fileId:t.fileID!=null?zt._fromProtobuf(t.fileID):null,contractId:t.contractID!=null?_t._fromProtobuf(t.contractID):null,topicId:t.topicID!=null?ia._fromProtobuf(t.topicID):null,tokenId:t.tokenID!=null?Oe._fromProtobuf(t.tokenID):null,scheduleId:t.scheduleID!=null?Na._fromProtobuf(t.scheduleID):null,exchangeRate:t.exchangeRate!=null?W0._fromProtobuf(n.currentRate):null,topicSequenceNumber:t.topicSequenceNumber==null?null:WE.default.fromString(t.topicSequenceNumber.toString()),topicRunningHash:t.topicRunningHash!=null?new Uint8Array(t.topicRunningHash):null,totalSupply:t.newTotalSupply!=null?WE.default.fromString(t.newTotalSupply.toString()):null,scheduledTransactionId:t.scheduledTransactionID!=null?Wr._fromProtobuf(t.scheduledTransactionID):null,serials:t.serialNumbers!=null?t.serialNumbers.map(o=>WE.default.fromValue(o)):[],children:i,duplicates:a})}static fromBytes(e){return r._fromProtobuf(VP.proto.TransactionGetReceiptResponse.decode(e))}toBytes(){return VP.proto.TransactionGetReceiptResponse.encode(this._toProtobuf()).finish()}toJSON(){return{status:this.status.toString(),accountId:this.accountId?.toString()||null,filedId:this.fileId?.toString()||null,contractId:this.contractId?.toString()||null,topicId:this.topicId?.toString()||null,tokenId:this.tokenId?.toString()||null,scheduleId:this.scheduleId?.toString()||null,exchangeRate:this.exchangeRate?.toJSON()||null,topicSequenceNumber:this.topicSequenceNumber?.toString()||null,topicRunningHash:this.topicRunningHash!=null?He(this.topicRunningHash):null,totalSupply:this.totalSupply?.toString()||null,scheduledTransactionId:this.scheduledTransactionId?.toString()||null,serials:this.serials.map(e=>e.toString()),duplicates:this.duplicates.map(e=>e.toJSON()),children:this.children.map(e=>e.toJSON())}}toString(){return JSON.stringify(this.toJSON())}};var TVe=Ie(vr(),1),{proto:xoe}=TVe,il=class r extends xr{constructor(e={}){super(),this._transactionId=null,this._includeChildren=null,this._includeDuplicates=null,this._validateStatus=!0,e.transactionId!=null&&this.setTransactionId(e.transactionId),e.includeChildren!=null&&this.setIncludeChildren(e.includeChildren),e.includeDuplicates!=null&&this.setIncludeDuplicates(e.includeDuplicates),e.validateStatus!=null&&this.setValidateStatus(e.validateStatus)}static _fromProtobuf(e){let t=e.transactionGetReceipt;return new r({transactionId:t.transactionID?Wr._fromProtobuf(t.transactionID):void 0,includeDuplicates:t.includeDuplicates!=null?t.includeDuplicates:void 0,includeChildren:t.includeChildReceipts!=null?t.includeChildReceipts:void 0})}get transactionId(){return this._transactionId}setTransactionId(e){return this._transactionId=typeof e=="string"?Wr.fromString(e):e.clone(),this}setIncludeDuplicates(e){return this._includeDuplicates=e,this}get includeDuplicates(){return this._includeDuplicates!=null?this._includeDuplicates:!1}setIncludeChildren(e){return this._includeChildren=e,this}get includeChildren(){return this._includeChildren!=null?this._includeChildren:!1}setValidateStatus(e){return this._validateStatus=e,this}get validateStatus(){return this._validateStatus}_isPaymentRequired(){return!1}_shouldRetry(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??xoe.ResponseCodeEnum.OK);switch(this._logger&&this._logger.debug(`[${this._getLogId()}] received node precheck status ${i.toString()}`),i){case P.Busy:case P.Unknown:case P.ReceiptNotFound:return[i,Bn.Retry];case P.Ok:break;default:return[i,Bn.Error]}let s=t.transactionGetReceipt.receipt.status;switch(i=P._fromCode(s),this._logger&&this._logger.debug(`[${this._getLogId()}] received receipt status ${i.toString()}`),i){case P.Busy:case P.Unknown:case P.ReceiptNotFound:return[i,Bn.Retry];case P.Success:return[i,Bn.Finished];default:return[i,this._validateStatus?Bn.Error:Bn.Finished]}}_getTransactionId(){return this._transactionId!=null?this._transactionId:super._getTransactionId()}_mapStatusError(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??xoe.ResponseCodeEnum.OK);switch(i){case P.Ok:break;default:return new ns({status:i,transactionId:this._getTransactionId(),contractFunctionResult:null})}let a=t.transactionGetReceipt,s=a.receipt.status;if(i=P._fromCode(s),this._transactionId==null)throw new Error("Failed to construct `ReceiptStatusError` because `transactionId` is `null`");return new Xc({status:i,transactionId:this._transactionId,transactionReceipt:nl._fromProtobuf(a)})}_validateChecksums(e){this._transactionId!=null&&this._transactionId.accountId!=null&&this._transactionId.accountId.validateChecksum(e)}_execute(e,t){return e.crypto.getTransactionReceipts(t)}_mapResponseHeader(e){return e.transactionGetReceipt.header}_mapResponse(e,t,n){let i=e.transactionGetReceipt;return Promise.resolve(nl._fromProtobuf(i))}_onMakeRequest(e){return{transactionGetReceipt:{header:e,transactionID:this._transactionId!=null?this._transactionId._toProtobuf():null,includeDuplicates:this._includeDuplicates,includeChildReceipts:this._includeChildren}}}_getLogId(){return`TransactionReceiptQuery:${this._timestamp.toString()}`}};Qr.set("transactionGetReceipt",il._fromProtobuf);var du=class r{constructor(e){this.accountId=e.accountId instanceof ne?e.accountId:ne.fromString(e.accountId),this.amount=e.amount instanceof ze?e.amount:new ze(e.amount),this.isApproved=e.isApproved}static _fromProtobuf(e){let t=[];for(let n of e)t.push(new r({accountId:ne._fromProtobuf(n.accountID),amount:ze.fromTinybars(n.amount!=null?n.amount:0),isApproved:n.isApproval}));return t}_toProtobuf(){return{accountID:this.accountId._toProtobuf(),amount:this.amount.toTinybars(),isApproval:this.isApproved}}toJSON(){return{accountId:this.accountId.toString(),amount:this.amount.toTinybars().toString(),isApproved:this.isApproved}}toString(){return JSON.stringify(this.toJSON())}};var W2=class r{constructor(e){this.contractId=e.contractId,this.bloom=e.bloom,this.topics=e.topics,this.data=e.data,Object.freeze(this)}static _fromProtobuf(e){return new r({contractId:_t._fromProtobuf(e.contractID),bloom:e.bloom!=null?e.bloom:new Uint8Array,topics:e.topic!=null?e.topic:[],data:e.data!=null?e.data:new Uint8Array})}_toProtobuf(){return{contractID:this.contractId._toProtobuf(),bloom:this.bloom,topic:this.topics,data:this.data}}};function y8(r){return Buffer.from(r).toString("utf8")}function n3(r){return Buffer.from(r,"utf8")}var bn=Ie(AB(),1),n1=Ie(Yt(),1);var E3e=Ie(Yt(),1),Wze=Ie(vr(),1),{proto:_3e}=Wze,vm=class r{constructor(e){this.contractId=e.contractId,this.nonce=e.nonce,Object.freeze(this)}static _fromProtobuf(e){return new r({contractId:_t._fromProtobuf(e.contractId),nonce:e.nonce!=null?e.nonce:E3e.default.ZERO})}_toProtobuf(){return{contractId:this.contractId._toProtobuf(),nonce:this.nonce}}static fromBytes(e){return r._fromProtobuf(_3e.ContractNonceInfo.decode(e))}toBytes(){return _3e.ContractNonceInfo.encode(this._toProtobuf()).finish()}toJSON(){return{contractId:this.contractId.toString(),nonce:this.nonce.toNumber()}}toString(){return JSON.stringify(this.toJSON())}equals(e){return this.contractId.equals(e.contractId)&&this.nonce.eq(e.nonce)}};var wu=class r{constructor(e){this._createResult=e._createResult,this.contractId=e.contractId,this.bytes=e.bytes,this.errorMessage=e.errorMessage,this.bloom=e.bloom,this.gasUsed=e.gasUsed,this.logs=e.logs,this.createdContractIds=e.createdContractIds,this.evmAddress=e.evmAddress,this.stateChanges=e.stateChanges,this.gas=e.gas,this.amount=e.amount,this.functionParameters=e.functionParameters,this.senderAccountId=e.senderAccountId,this.contractNonces=e.contractNonces}static _fromProtobuf(e,t){let n=e.contractID,i=e.gasUsed,a=e.gas?e.gas:-1,o=e.amount?e.amount:-1;return new r({_createResult:t,bytes:e.contractCallResult,contractId:n!=null?_t._fromProtobuf(n):null,errorMessage:e.errorMessage!=null?e.errorMessage:null,bloom:e.bloom,gasUsed:i instanceof n1.default?i:n1.default.fromValue(i),logs:(e.logInfo!=null?e.logInfo:[]).map(s=>W2._fromProtobuf(s)),createdContractIds:(e.createdContractIDs!=null?e.createdContractIDs:[]).map(s=>_t._fromProtobuf(s)),evmAddress:e.evmAddress!=null&&e.evmAddress.value!=null?e.evmAddress.value:null,stateChanges:[],gas:a instanceof n1.default?a:n1.default.fromValue(a),amount:o instanceof n1.default?o:n1.default.fromValue(o),functionParameters:e.functionParameters,senderAccountId:e.senderId!=null?ne._fromProtobuf(e.senderId):null,contractNonces:(e.contractNonces!=null?e.contractNonces:[]).map(s=>vm._fromProtobuf(s))})}asBytes(){return this.bytes}getString(e){return y8(this.getBytes(e))}getBytes(e){let t=this.getInt32(e),n=lo(this.bytes).getInt32(t+28);return this.bytes.subarray(t+32,t+32+n)}getBytes32(e){return this.bytes.subarray((e??0)*32,(e??0)*32+32)}getBool(e){return this.bytes[(e??0)*32+31]!==0}getInt8(e){let t=(e??0)*32+31;return lo(this.bytes).getInt8(t)}getUint8(e){return this.bytes[(e??0)*32+31]}getInt16(e){let t=(e??0)*32+28;return lo(this.bytes).getInt32(t)}getUint16(e){let t=(e??0)*32+28;return lo(this.bytes).getUint32(t)}getInt24(e){let t=(e??0)*32+28;return lo(this.bytes).getInt32(t)}getUint24(e){let t=(e??0)*32+28;return lo(this.bytes).getUint32(t)}getInt32(e){let t=(e??0)*32+28;return lo(this.bytes).getInt32(t)}getUint32(e){let t=(e??0)*32+28;return lo(this.bytes).getUint32(t)}getInt40(e){let t=bn.defaultAbiCoder.decode(["int40"],this._getBytes32(e??0));return new Qe(t.toString())}getUint40(e){return new Qe(He(this._getBytes32(e).subarray(27,32)),16)}getInt48(e){let t=bn.defaultAbiCoder.decode(["int48"],this._getBytes32(e??0));return new Qe(t.toString())}getUint48(e){return new Qe(He(this._getBytes32(e).subarray(26,32)),16)}getInt56(e){let t=bn.defaultAbiCoder.decode(["int56"],this._getBytes32(e??0));return new Qe(t.toString())}getUint56(e){return new Qe(He(this._getBytes32(e).subarray(25,32)),16)}getInt64(e){let t=bn.defaultAbiCoder.decode(["int64"],this._getBytes32(e??0));return new Qe(t.toString())}getUint64(e){return new Qe(He(this._getBytes32(e).subarray(24,32)),16)}getInt72(e){let t=bn.defaultAbiCoder.decode(["int72"],this._getBytes32(e??0));return new Qe(t.toString())}getUint72(e){return new Qe(He(this._getBytes32(e).subarray(23,32)),16)}getInt80(e){let t=bn.defaultAbiCoder.decode(["int80"],this._getBytes32(e??0));return new Qe(t.toString())}getUint80(e){return new Qe(He(this._getBytes32(e).subarray(22,32)),16)}getInt88(e){let t=bn.defaultAbiCoder.decode(["int88"],this._getBytes32(e??0));return new Qe(t.toString())}getUint88(e){return new Qe(He(this._getBytes32(e).subarray(21,32)),16)}getInt96(e){let t=bn.defaultAbiCoder.decode(["int96"],this._getBytes32(e??0));return new Qe(t.toString())}getUint96(e){return new Qe(He(this._getBytes32(e).subarray(20,32)),16)}getInt104(e){let t=bn.defaultAbiCoder.decode(["int104"],this._getBytes32(e??0));return new Qe(t.toString())}getUint104(e){return new Qe(He(this._getBytes32(e).subarray(19,32)),16)}getInt112(e){let t=bn.defaultAbiCoder.decode(["int112"],this._getBytes32(e??0));return new Qe(t.toString())}getUint112(e){return new Qe(He(this._getBytes32(e).subarray(18,32)),16)}getInt120(e){let t=bn.defaultAbiCoder.decode(["int120"],this._getBytes32(e??0));return new Qe(t.toString())}getUint120(e){return new Qe(He(this._getBytes32(e).subarray(17,32)),16)}getInt128(e){let t=bn.defaultAbiCoder.decode(["int128"],this._getBytes32(e??0));return new Qe(t.toString())}getUint128(e){return new Qe(He(this._getBytes32(e).subarray(16,32)),16)}getInt136(e){let t=bn.defaultAbiCoder.decode(["int136"],this._getBytes32(e??0));return new Qe(t.toString())}getUint136(e){return new Qe(He(this._getBytes32(e).subarray(15,32)),16)}getInt144(e){let t=bn.defaultAbiCoder.decode(["int144"],this._getBytes32(e??0));return new Qe(t.toString())}getUint144(e){return new Qe(He(this._getBytes32(e).subarray(14,32)),16)}getInt152(e){let t=bn.defaultAbiCoder.decode(["int152"],this._getBytes32(e??0));return new Qe(t.toString())}getUint152(e){return new Qe(He(this._getBytes32(e).subarray(13,32)),16)}getInt160(e){let t=bn.defaultAbiCoder.decode(["int160"],this._getBytes32(e??0));return new Qe(t.toString())}getUint160(e){return new Qe(He(this._getBytes32(e).subarray(12,32)),16)}getInt168(e){let t=bn.defaultAbiCoder.decode(["int168"],this._getBytes32(e??0));return new Qe(t.toString())}getUint168(e){return new Qe(He(this._getBytes32(e).subarray(11,32)),16)}getInt176(e){let t=bn.defaultAbiCoder.decode(["int176"],this._getBytes32(e??0));return new Qe(t.toString())}getUint176(e){return new Qe(He(this._getBytes32(e).subarray(10,32)),16)}getInt184(e){let t=bn.defaultAbiCoder.decode(["int184"],this._getBytes32(e??0));return new Qe(t.toString())}getUint184(e){return new Qe(He(this._getBytes32(e).subarray(9,32)),16)}getInt192(e){let t=bn.defaultAbiCoder.decode(["int192"],this._getBytes32(e??0));return new Qe(t.toString())}getUint192(e){return new Qe(He(this._getBytes32(e).subarray(8,32)),16)}getInt200(e){let t=bn.defaultAbiCoder.decode(["int200"],this._getBytes32(e??0));return new Qe(t.toString())}getUint200(e){return new Qe(He(this._getBytes32(e).subarray(7,32)),16)}getInt208(e){let t=bn.defaultAbiCoder.decode(["int208"],this._getBytes32(e??0));return new Qe(t.toString())}getUint208(e){return new Qe(He(this._getBytes32(e).subarray(6,32)),16)}getInt216(e){let t=bn.defaultAbiCoder.decode(["int216"],this._getBytes32(e??0));return new Qe(t.toString())}getUint216(e){return new Qe(He(this._getBytes32(e).subarray(5,32)),16)}getInt224(e){let t=bn.defaultAbiCoder.decode(["int224"],this._getBytes32(e??0));return new Qe(t.toString())}getUint224(e){return new Qe(He(this._getBytes32(e).subarray(4,32)),16)}getInt232(e){let t=bn.defaultAbiCoder.decode(["int232"],this._getBytes32(e??0));return new Qe(t.toString())}getUint232(e){return new Qe(He(this._getBytes32(e).subarray(3,32)),16)}getInt240(e){let t=bn.defaultAbiCoder.decode(["int240"],this._getBytes32(e??0));return new Qe(t.toString())}getUint240(e){return new Qe(He(this._getBytes32(e).subarray(2,32)),16)}getInt248(e){let t=bn.defaultAbiCoder.decode(["int248"],this._getBytes32(e??0));return new Qe(t.toString())}getUint248(e){return new Qe(He(this._getBytes32(e).subarray(1,32)),16)}getInt256(e){let t=bn.defaultAbiCoder.decode(["int256"],this._getBytes32(e??0));return new Qe(t.toString())}getUint256(e){return new Qe(He(this._getBytes32(e)),16)}getAddress(e){return He(this.bytes.subarray((e??0)*32+12,(e??0)*32+32))}getResult(e){return bn.defaultAbiCoder.decode(e,this.bytes)}_getBytes32(e){return this.bytes.subarray((e??0)*32,(e??0)*32+32)}_toProtobuf(){return{contractID:this.contractId!=null?this.contractId._toProtobuf():null,contractCallResult:this.bytes,errorMessage:this.errorMessage,bloom:this.bloom,gasUsed:this.gasUsed,logInfo:this.logs.map(e=>e._toProtobuf()),createdContractIDs:this.createdContractIds.map(e=>e._toProtobuf()),evmAddress:this.evmAddress!=null?{value:this.evmAddress}:null,gas:this.gas,amount:this.amount,functionParameters:this.functionParameters,senderId:this.senderAccountId!=null?this.senderAccountId._toProtobuf():null,contractNonces:this.contractNonces.map(e=>e._toProtobuf())}}};var di=class{constructor(e){this._map=new Map,this.__map=new Map,this._fromString=e}get(e){let t=typeof e=="string"?e:e.toString(),n=this._map.get(t);return n??null}_set(e,t){let n=typeof e=="string"?e:e.toString();this._map.set(n,t),this.__map.set(e,t)}values(){return this._map.values()}get size(){return this._map.size}keys(){return this.__map.keys()}[Symbol.iterator](){return this.__map[Symbol.iterator]()}toString(){let e={};for(let[t,n]of this._map)e[t]=n;return JSON.stringify(e)}toJSON(){let e={};return this._map.forEach((t,n)=>{e[n]=t}),e}};var i1=class extends di{constructor(){super(e=>ne.fromString(e))}toJSON(){let e={};return this._map.forEach((t,n)=>{e[n]=t.toString()}),e}};var a1=class r extends di{constructor(){super(e=>Oe.fromString(e))}__set(e,t,n){let i=e.toString(),a=this._map.get(i);a==null&&(a=new i1,this._map.set(i,a),this.__map.set(e,a)),a._set(t,n)}static _fromProtobuf(e){let t=new r;for(let n of e){let i=Oe._fromProtobuf(n.token);for(let a of n.transfers!=null?n.transfers:[]){let o=ne._fromProtobuf(a.accountID);t.__set(i,o,a.amount)}}return t}_toProtobuf(){let e=[];for(let[t,n]of this){let i=[];for(let[a,o]of n)i.push({accountID:a._toProtobuf(),amount:o});e.push({token:t._toProtobuf(),transfers:i})}return e}};var x3e=Ie(Yt(),1);var o1=class r extends di{constructor(){super(e=>Oe.fromString(e))}__set(e,t){let n=e.toString(),i=this._map.get(n);i==null&&(i=[],this._map.set(n,i),this.__map.set(e,i)),i.push(t)}static _fromProtobuf(e){let t=new r;for(let n of e){let i=Oe._fromProtobuf(n.token);for(let a of n.nftTransfers!=null?n.nftTransfers:[]){let o=ne._fromProtobuf(a.senderAccountID),s=ne._fromProtobuf(a.receiverAccountID);t.__set(i,{sender:o,recipient:s,serial:x3e.default.fromValue(a.serialNumber),isApproved:!1})}}return t}_toProtobuf(){let e=[];for(let[t,n]of this){let i=[];for(let a of n)i.push({senderAccountID:a.sender._toProtobuf(),receiverAccountID:a.recipient._toProtobuf(),serialNumber:a.serial});e.push({token:t._toProtobuf(),nftTransfers:i})}return e}toJSON(){let e={};return this._map.forEach((t,n)=>{e[n]=t.map(i=>({sender:i.sender.toString(),recipient:i.recipient.toString(),serial:i.serial,isApproved:i.isApproved}))}),e}};var R8=Ie(vr(),1);var A3e=Ie(Yt(),1),bm=class r{constructor(e={}){this._feeCollectorAccountId=null,e.feeCollectorAccountId!=null&&this.setFeeCollectorAccountId(e.feeCollectorAccountId),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),this._amount=null,e.amount!=null&&this.setAmount(e.amount),this._payerAccountIds=null,e.payerAccountIds!=null&&this.setPayerAccountIds(e.payerAccountIds)}get feeCollectorAccountId(){return this._feeCollectorAccountId}setFeeCollectorAccountId(e){return this._feeCollectorAccountId=typeof e=="string"?ne.fromString(e):e,this}get tokenId(){return this._tokenId}setTokenId(e){return this._tokenId=typeof e=="string"?Oe.fromString(e):e,this}get amount(){return this._amount}setAmount(e){return this._amount=typeof e=="number"?A3e.default.fromNumber(e):e,this}get payerAccountIds(){return this._payerAccountIds}setPayerAccountIds(e){return this._payerAccountIds=e,this}static _fromProtobuf(e){return new r({feeCollectorAccountId:e.feeCollectorAccountId!=null?ne._fromProtobuf(e.feeCollectorAccountId):void 0,tokenId:e.tokenId!=null?Oe._fromProtobuf(e.tokenId):void 0,amount:e.amount!=null?e.amount:void 0,payerAccountIds:e.effectivePayerAccountId!=null?e.effectivePayerAccountId.map(t=>ne._fromProtobuf(t)):void 0})}_toProtobuf(){return{feeCollectorAccountId:this.feeCollectorAccountId!=null?this.feeCollectorAccountId._toProtobuf():null,tokenId:this._tokenId!=null?this._tokenId._toProtobuf():null,amount:this._amount,effectivePayerAccountId:this._payerAccountIds!=null?this._payerAccountIds.map(e=>e._toProtobuf()):null}}toJSON(){return{feeCollectorAccountId:this.feeCollectorAccountId?.toString()||null,tokenId:this._tokenId?.toString()||null,amount:this._amount?.toString()||null,payerAccountIds:this._payerAccountIds?.map(e=>e.toString())||[]}}};var N8=class r{constructor(e={}){this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),this._defaultMaxTransactionFee=new ze(5)}get accountId(){return this._accountId}setAccountId(e){return this._accountId=typeof e=="string"?ne.fromString(e):e,this}get tokenId(){return this._tokenId}setTokenId(e){return this._tokenId=typeof e=="string"?Oe.fromString(e):e,this}static _fromProtobuf(e){return new r({accountId:e.accountId!=null?ne._fromProtobuf(e.accountId):void 0,tokenId:e.tokenId!=null?Oe._fromProtobuf(e.tokenId):void 0})}_toProtobuf(){return{accountId:this._accountId!=null?this._accountId._toProtobuf():void 0,tokenId:this._tokenId!=null?this._tokenId._toProtobuf():void 0}}toJSON(){return{accountId:this._accountId?.toString()||null,tokenId:this._tokenId?.toString()||null}}};var TB=Ie(Yt(),1);var Wd=class r{constructor(e){this.tokenId=e.tokenId instanceof Oe?e.tokenId:Oe.fromString(e.tokenId),this.accountId=e.accountId instanceof ne?e.accountId:ne.fromString(e.accountId),this.expectedDecimals=e.expectedDecimals,this.amount=TB.default.fromValue(e.amount),this.isApproved=e.isApproved}static _fromProtobuf(e){let t=[];for(let n of e){let i=Oe._fromProtobuf(n.token),a=n.expectedDecimals!=null?n.expectedDecimals.value:null;for(let o of n.transfers!=null?n.transfers:[])t.push(new r({tokenId:i,accountId:ne._fromProtobuf(o.accountID),expectedDecimals:a,amount:o.amount!=null?o.amount:TB.default.ZERO,isApproved:o.isApproval==!0}))}return t}_toProtobuf(){return{accountID:this.accountId._toProtobuf(),amount:this.amount,isApproval:this.isApproved}}toJSON(){return{tokenId:this.tokenId.toString(),accountId:this.accountId.toString(),expectedDecimals:this.expectedDecimals,amount:this.amount.toString(),isApproved:this.isApproved}}toString(){return JSON.stringify(this.toJSON())}};var _u=class r{constructor(e){this.receipt=e.receipt,this.transactionHash=e.transactionHash,this.consensusTimestamp=e.consensusTimestamp,this.transactionId=e.transactionId,this.transactionMemo=e.transactionMemo,this.transactionFee=e.transactionFee,this.transfers=e.transfers,this.contractFunctionResult=e.contractFunctionResult!=null?e.contractFunctionResult:null,this.tokenTransfers=e.tokenTransfers,this.tokenTransfersList=e.tokenTransfersList,this.scheduleRef=e.scheduleRef,this.assessedCustomFees=e.assessedCustomFees,this.nftTransfers=e.nftTransfers,this.automaticTokenAssociations=e.automaticTokenAssociations,this.parentConsensusTimestamp=e.parentConsensusTimestamp,this.aliasKey=e.aliasKey,this.duplicates=e.duplicates,this.children=e.children,this.hbarAllowanceAdjustments=e.hbarAllowanceAdjustments,this.tokenAllowanceAdjustments=e.tokenAllowanceAdjustments,this.nftAllowanceAdjustments=e.nftAllowanceAdjustments,this.ethereumHash=e.ethereumHash,this.paidStakingRewards=e.paidStakingRewards,this.prngBytes=e.prngBytes,this.prngNumber=e.prngNumber,this.evmAddress=e.evmAddress,Object.freeze(this)}_toProtobuf(){let e=this.tokenTransfers._toProtobuf(),t=this.nftTransfers._toProtobuf(),n=[];for(let o of e)for(let s of t)o.token!=null&&s.token!=null&&o.token.shardNum===s.token.shardNum&&o.token.realmNum===s.token.realmNum&&o.token.tokenNum===s.token.tokenNum?n.push({token:o.token,transfers:o.transfers,nftTransfers:o.nftTransfers}):(n.push(o),n.push(s));let i=this.duplicates.map(o=>o._toProtobuf().transactionRecord),a=this.children.map(o=>o._toProtobuf().transactionRecord);return{duplicateTransactionRecords:i,childTransactionRecords:a,transactionRecord:{receipt:this.receipt._toProtobuf().receipt,transactionHash:this.transactionHash!=null?this.transactionHash:null,consensusTimestamp:this.consensusTimestamp!=null?this.consensusTimestamp._toProtobuf():null,transactionID:this.transactionId!=null?this.transactionId._toProtobuf():null,memo:this.transactionMemo!=null?this.transactionMemo:null,transactionFee:this.transactionFee!=null?this.transactionFee.toTinybars():null,contractCallResult:this.contractFunctionResult!=null&&!this.contractFunctionResult._createResult?this.contractFunctionResult._toProtobuf():null,contractCreateResult:this.contractFunctionResult!=null&&this.contractFunctionResult._createResult?this.contractFunctionResult._toProtobuf():null,transferList:this.transfers!=null?{accountAmounts:this.transfers.map(o=>o._toProtobuf())}:null,tokenTransferLists:n,scheduleRef:this.scheduleRef!=null?this.scheduleRef._toProtobuf():null,assessedCustomFees:this.assessedCustomFees.map(o=>o._toProtobuf()),automaticTokenAssociations:this.automaticTokenAssociations.map(o=>o._toProtobuf()),parentConsensusTimestamp:this.parentConsensusTimestamp!=null?this.parentConsensusTimestamp._toProtobuf():null,alias:this.aliasKey!=null?R8.proto.Key.encode(this.aliasKey._toProtobufKey()).finish():null,ethereumHash:this.ethereumHash,paidStakingRewards:this.paidStakingRewards.map(o=>o._toProtobuf()),prngBytes:this.prngBytes,prngNumber:this.prngNumber!=null?this.prngNumber:null,evmAddress:this.evmAddress!=null?this.evmAddress.toBytes():null}}}static _fromProtobuf(e){let t=e.transactionRecord,n=t.alias!=null&&t.alias.length>0?rt._fromProtobufKey(R8.proto.Key.decode(t.alias)):null;n instanceof Xn||(n=null);let i=e.childTransactionRecords!=null?e.childTransactionRecords.map(s=>r._fromProtobuf({transactionRecord:s})):[],a=e.duplicateTransactionRecords!=null?e.duplicateTransactionRecords.map(s=>r._fromProtobuf({transactionRecord:s})):[],o=t.contractCallResult!=null?wu._fromProtobuf(t.contractCallResult,!1):t.contractCreateResult!=null?wu._fromProtobuf(t.contractCreateResult,!0):void 0;return new r({receipt:nl._fromProtobuf({receipt:t.receipt}),transactionHash:t.transactionHash!=null?t.transactionHash:new Uint8Array,consensusTimestamp:lt._fromProtobuf(t.consensusTimestamp),transactionId:Wr._fromProtobuf(t.transactionID),transactionMemo:t.memo!=null?t.memo:"",transactionFee:ze.fromTinybars(t.transactionFee!=null?t.transactionFee:0),transfers:du._fromProtobuf(t.transferList!=null?t.transferList.accountAmounts!=null?t.transferList.accountAmounts:[]:[]),contractFunctionResult:o,tokenTransfers:a1._fromProtobuf(t.tokenTransferLists!=null?t.tokenTransferLists:[]),tokenTransfersList:Wd._fromProtobuf(t.tokenTransferLists!=null?t.tokenTransferLists:[]),scheduleRef:t.scheduleRef!=null?Na._fromProtobuf(t.scheduleRef):null,assessedCustomFees:t.assessedCustomFees!=null?t.assessedCustomFees.map(s=>bm._fromProtobuf(s)):[],nftTransfers:o1._fromProtobuf(t.tokenTransferLists!=null?t.tokenTransferLists:[]),automaticTokenAssociations:t.automaticTokenAssociations!=null?t.automaticTokenAssociations.map(s=>N8._fromProtobuf(s)):[],parentConsensusTimestamp:t.parentConsensusTimestamp!=null?lt._fromProtobuf(t.parentConsensusTimestamp):null,aliasKey:n,duplicates:a,children:i,hbarAllowanceAdjustments:[],tokenAllowanceAdjustments:[],nftAllowanceAdjustments:[],ethereumHash:t.ethereumHash!=null?t.ethereumHash:null,paidStakingRewards:t.paidStakingRewards!=null?du._fromProtobuf(t.paidStakingRewards):[],prngBytes:t.prngBytes!=null?t.prngBytes:null,prngNumber:t.prngNumber!=null?t.prngNumber:null,evmAddress:t.evmAddress!=null?rs.fromBytes(t.evmAddress):null})}static fromBytes(e){return r._fromProtobuf(R8.proto.TransactionGetRecordResponse.decode(e))}toBytes(){return R8.proto.TransactionGetRecordResponse.encode(this._toProtobuf()).finish()}toJSON(){return{receipt:this.receipt.toJSON(),transactionHash:He(this.transactionHash),consensusTimestamp:this.consensusTimestamp.toDate(),transactionId:this.transactionId.toString(),transactionMemo:this.transactionMemo,transactionFee:this.transactionFee.toTinybars().toString(),transfers:this.transfers.map(e=>e.toJSON()),tokenTransfers:this.tokenTransfers,tokenTransfersList:this.tokenTransfersList.map(e=>e.toJSON()),scheduleRef:this.scheduleRef?.toString()||null,assessedCustomFees:this.assessedCustomFees,nftTransfers:this.nftTransfers,automaticTokenAssociations:this.automaticTokenAssociations,parentConsensusTimestamp:this.parentConsensusTimestamp?.toDate()||null,aliasKey:this.aliasKey?.toString()||null,duplicates:this.duplicates,children:this.children,ethereumHash:this.ethereumHash!=null?He(this.ethereumHash):null,paidStakingRewards:this.paidStakingRewards,prngBytes:this.prngBytes!=null?He(this.prngBytes):null,prngNumber:this.prngNumber,evmAddress:this.evmAddress?.toString()||null}}toString(){return JSON.stringify(this.toJSON())}};var wm=class extends su{constructor(e){super(e,`Record for transaction ${e.transactionId.toString()} contained error status ${e.status.toString()}`),this.transactionRecord=e.transactionRecord}};var SB=Ie(vr(),1),{proto:T3e}=SB,s1=class r extends xr{constructor(e={}){super(),this._transactionId=null,this._includeChildren=null,this._includeDuplicates=null,this._validateReceiptStatus=!0,e.transactionId!=null&&this.setTransactionId(e.transactionId),e.includeChildren!=null&&this.setIncludeChildren(e.includeChildren),e.includeDuplicates!=null&&this.setIncludeDuplicates(e.includeDuplicates),e.validateReceiptStatus!=null&&this.setValidateReceiptStatus(e.validateReceiptStatus)}get transactionId(){return this._transactionId}static _fromProtobuf(e){let t=e.transactionGetRecord;return new r({transactionId:t.transactionID?Wr._fromProtobuf(t.transactionID):void 0,includeChildren:t.includeChildRecords!=null?t.includeChildRecords:void 0,includeDuplicates:t.includeDuplicates!=null?t.includeDuplicates:void 0})}setTransactionId(e){return this._transactionId=typeof e=="string"?Wr.fromString(e):e.clone(),this}setIncludeChildren(e){return this._includeChildren=e,this}get includeChildren(){return this._includeChildren!=null?this._includeChildren:!1}setIncludeDuplicates(e){return this._duplicates=e,this}get includeDuplicates(){return this._duplicates!=null?this._duplicates:!1}setValidateReceiptStatus(e){return this._validateReceiptStatus=e,this}get validateReceiptStatus(){return this._validateReceiptStatus}_shouldRetry(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??T3e.ResponseCodeEnum.OK);switch(this._logger&&this._logger.debug(`[${this._getLogId()}] received node precheck status ${i.toString()}`),i){case P.Busy:case P.Unknown:case P.ReceiptNotFound:case P.RecordNotFound:return[i,Bn.Retry];case P.Ok:break;default:return[i,Bn.Error]}let a=t.transactionGetRecord;if(a.header.responseType===SB.proto.ResponseType.COST_ANSWER)return[i,Bn.Finished];let l=a.transactionRecord.receipt.status;switch(i=P._fromCode(l),this._logger&&this._logger.debug(`[${this._getLogId()}] received record's receipt ${i.toString()}`),i){case P.Ok:case P.Busy:case P.Unknown:case P.ReceiptNotFound:case P.RecordNotFound:return[i,Bn.Retry];case P.Success:return[i,Bn.Finished];default:return[i,this._validateReceiptStatus?Bn.Error:Bn.Finished]}}_mapStatusError(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??T3e.ResponseCodeEnum.OK);switch(i){case P.Ok:break;case P.ContractRevertExecuted:return new wm({status:i,transactionId:this._getTransactionId(),transactionRecord:_u._fromProtobuf({transactionRecord:t.transactionGetRecord.transactionRecord})});default:return new ns({status:i,transactionId:this._getTransactionId(),contractFunctionResult:null})}let s=t.transactionGetRecord.transactionRecord.receipt,c=s.status;switch(i=P._fromCode(c),i){case P.ContractRevertExecuted:return new wm({status:i,transactionId:this._getTransactionId(),transactionRecord:_u._fromProtobuf({transactionRecord:t.transactionGetRecord.transactionRecord})});default:return new Xc({status:i,transactionId:this._getTransactionId(),transactionReceipt:nl._fromProtobuf({receipt:s})})}}_validateChecksums(e){this._transactionId!=null&&this._transactionId.accountId!=null&&this._transactionId.accountId.validateChecksum(e)}_execute(e,t){return e.crypto.getTxRecordByTxID(t)}_mapResponseHeader(e){return e.transactionGetRecord.header}_mapResponse(e,t,n){let i=e.transactionGetRecord;return Promise.resolve(_u._fromProtobuf(i))}_onMakeRequest(e){return{transactionGetRecord:{header:e,transactionID:this._transactionId!=null?this._transactionId._toProtobuf():null,includeChildRecords:this._includeChildren,includeDuplicates:this._includeDuplicates}}}_getLogId(){return`TransactionRecordQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("transactionGetRecord",s1._fromProtobuf);var c1=class r{constructor(e){this.nodeId=e.nodeId,this.transactionHash=e.transactionHash,this.transactionId=e.transactionId,Object.freeze(this)}static fromJSON(e){return new r({nodeId:ne.fromString(e.nodeId),transactionHash:et(e.transactionHash),transactionId:Wr.fromString(e.transactionId)})}async getReceipt(e){let t=await this.getReceiptQuery().execute(e);if(t.status!==P.Success)throw new Xc({transactionReceipt:t,status:t.status,transactionId:this.transactionId});return t}async getRecord(e){return await this.getReceipt(e),this.getRecordQuery().execute(e)}async getVerboseRecord(e){try{return await this.getReceiptQuery().execute(e),this.getRecordQuery().execute(e)}catch{return this.getRecordQuery().execute(e)}}async getReceiptWithSigner(e){let t=await this.getReceiptQuery().executeWithSigner(e);if(t.status!==P.Success)throw new Xc({transactionReceipt:t,status:t.status,transactionId:this.transactionId});return t}async getRecordWithSigner(e){return await this.getReceiptWithSigner(e),this.getRecordQuery().executeWithSigner(e)}getReceiptQuery(){return new il().setTransactionId(this.transactionId).setNodeAccountIds([this.nodeId])}getRecordQuery(){return new s1().setTransactionId(this.transactionId).setNodeAccountIds([this.nodeId])}toJSON(){return{nodeId:this.nodeId.toString(),transactionHash:He(this.transactionHash),transactionId:this.transactionId.toString()}}toString(){return JSON.stringify(this.toJSON())}};var S3e=Ie(require("crypto"),1);function O8(r){return Promise.resolve(S3e.default.createHash("sha384").update(r).digest())}var D8=class r extends di{constructor(){super(e=>ne.fromString(e))}static async _fromTransaction(e){let t=new r;for(let n=0;n<e._nodeAccountIds.length;n++){let i=e._nodeAccountIds.list[n],a=e._transactions.get(n),o=await O8(a.signedTransactionBytes);t._set(i,o)}return t}};var P8=class r extends di{constructor(){super(e=>Xn.fromString(e))}static _fromTransactionSigMap(e){let t=new r,n=e.sigPair!=null?e.sigPair:[];for(let i of n)i.pubKeyPrefix!=null&&(i.ed25519!=null?t._set(Xn.fromBytesED25519(i.pubKeyPrefix),i.ed25519):i.ECDSASecp256k1!=null&&t._set(Xn.fromBytesECDSA(i.pubKeyPrefix),i.ECDSASecp256k1));return t}};var _m=class r extends di{constructor(){super(e=>ne.fromString(e))}static _fromTransaction(e){let t=new r;for(let n=0;n<e._nodeAccountIds.length;n++){let i=e._signedTransactions.get(n).sigMap;i!=null&&t._set(e._nodeAccountIds.list[n],P8._fromTransactionSigMap(i))}return t}};var B8=Ie(Yt(),1);var as=Ie(vr(),1);var Eu=B8.default.fromValue(7776e3),IB=ze.fromTinybars(B8.default.fromString("9223372036854775807")),C3e=120,k3e=1024,Ge=new Map,ke=class extends lu{constructor(){super(),this._transactions=new rl,this._signedTransactions=new rl,this._signerPublicKeys=new Set,this._transactionValidDuration=C3e,this._defaultMaxTransactionFee=new ze(2),this._maxTransactionFee=null,this._transactionMemo="",this._transactionIds=new rl,this._publicKeys=[],this._transactionSigners=[],this._regenerateTransactionId=null}static fromBytes(e){let t=[],n=[],i=[],a=[],o=[],s=[],c=as.proto.TransactionList.decode(e).transactionList;if(c.length===0){let d=as.proto.Transaction.decode(e);d.signedTransactionBytes.length!==0?c.push(d):c.push({signedTransactionBytes:as.proto.SignedTransaction.encode({bodyBytes:d.bodyBytes,sigMap:d.sigMap}).finish()})}for(let d of c){if(d.signedTransactionBytes==null)throw new Error("Transaction.signedTransactionBytes are null");let h=as.proto.SignedTransaction.decode(d.signedTransactionBytes);t.push(h);let g=as.proto.TransactionBody.decode(h.bodyBytes);if(g.data==null)throw new Error("(BUG) body.data was not set in the protobuf");if(s.push(g),g.transactionID!=null){let m=Wr._fromProtobuf(g.transactionID);a.includes(m.toString())||(n.push(m),a.push(m.toString()))}if(g.nodeAccountID!=null){let m=ne._fromProtobuf(g.nodeAccountID);o.includes(m.toString())||(i.push(m),o.push(m.toString()))}}let l=s[0];if(l==null||l.data==null)throw new Error("No transaction found in bytes or failed to decode TransactionBody");let u=Ge.get(l.data);if(u==null)throw new Error(`(BUG) Transaction.fromBytes() not implemented for type ${l.data}`);return u(c,t,n,i,s)}schedule(){if(this._requireNotFrozen(),Bx.length!=1)throw new Error("ScheduleCreateTransaction has not been loaded yet");return Bx[0]()._setScheduledTransaction(this)}static _fromProtobufTransactions(e,t,n,i,a,o){let s=o[0];for(let l=0;l<i.length;l++)for(let u=0;u<a.length-1;u++)if(!pR(o[l*a.length+u],o[l*a.length+u+1],new Set(["nodeAccountID"])))throw new Error("failed to validate transaction bodies");let c=new ne(0);for(let l=0;l<a.length;l++)a[l].equals(c)&&a.splice(l--,1);e._transactions.setList(t),e._signedTransactions.setList(n).setLocked(),e._transactionIds.setList(i).setLocked(),e._nodeAccountIds.setList(a).setLocked(),e._transactionValidDuration=s.transactionValidDuration!=null&&s.transactionValidDuration.seconds!=null?B8.default.fromValue(s.transactionValidDuration.seconds).toInt():C3e,e._maxTransactionFee=s.transactionFee!=null?ze.fromTinybars(s.transactionFee):new ze(0),e._transactionMemo=s.memo!=null?s.memo:"";for(let l=0;l<a.length;l++){let u=n[l];if(u.sigMap!=null&&u.sigMap.sigPair!=null)for(let d of u.sigMap.sigPair)e._signerPublicKeys.add(He(d.pubKeyPrefix)),e._publicKeys.push(Xn.fromBytes(d.pubKeyPrefix)),e._transactionSigners.push(null)}return e}setNodeAccountIds(e){return this._requireNotFrozen(),super.setNodeAccountIds(e),this}get transactionValidDuration(){return this._transactionValidDuration}setTransactionValidDuration(e){return this._requireNotFrozen(),this._transactionValidDuration=e,this}get maxTransactionFee(){return this._maxTransactionFee}setMaxTransactionFee(e){return this._requireNotFrozen(),this._maxTransactionFee=e instanceof ze?e:new ze(e),this}get regenerateTransactionId(){return this._regenerateTransactionId}setRegenerateTransactionId(e){return this._requireNotFrozen(),this._regenerateTransactionId=e,this}get transactionMemo(){return this._transactionMemo}setTransactionMemo(e){return this._requireNotFrozen(),this._transactionMemo=e,this}get transactionId(){return this._transactionIds.isEmpty?null:(this._transactionIds.setLocked(),this._transactionIds.current)}setTransactionId(e){return this._requireNotFrozen(),this._transactionIds.setList([e]).setLocked(),this}sign(e){return this.signWith(e.publicKey,t=>Promise.resolve(e.sign(t)))}async signWith(e,t){this._signOnDemand||this._requireFrozen();let n=e.toBytesRaw(),i=He(n);if(this._signerPublicKeys.has(i))return this;if(this._transactions.clear(),this._signerPublicKeys.add(i),this._signOnDemand)return this._publicKeys.push(e),this._transactionSigners.push(t),this;this._transactionIds.setLocked(),this._nodeAccountIds.setLocked();for(let a of this._signedTransactions.list){let o=a.bodyBytes,s=await t(o);a.sigMap==null&&(a.sigMap={}),a.sigMap.sigPair==null&&(a.sigMap.sigPair=[]),a.sigMap.sigPair.push(e._toProtobufSignature(s))}return this}signWithOperator(e){let t=e._operator;if(t==null)throw new Error("`client` must have an operator to sign with the operator");return this._isFrozen()||this.freezeWith(e),this.signWith(t.publicKey,t.transactionSigner)}addSignature(e,t){this._requireOneNodeAccountId(),this.isFrozen()||this.freeze();let n=e.toBytesRaw(),i=He(n);if(this._signerPublicKeys.has(i))return this;this._transactions.clear(),this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),this._signedTransactions.setLocked();for(let a of this._signedTransactions.list)a.sigMap==null&&(a.sigMap={}),a.sigMap.sigPair==null&&(a.sigMap.sigPair=[]),a.sigMap.sigPair.push(e._toProtobufSignature(t));return this._signerPublicKeys.add(i),this._publicKeys.push(e),this._transactionSigners.push(null),this}getSignatures(){return this._requireFrozen(),this._requireNotSignOnDemand(),this._buildAllTransactions(),this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),_m._fromTransaction(this)}async getSignaturesAsync(){return this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),await this._buildAllTransactionsAsync(),this._transactions.setLocked(),this._signedTransactions.setLocked(),_m._fromTransaction(this)}_setTransactionId(){if(this._operatorAccountId==null&&this._transactionIds.isEmpty)throw new Error("`transactionId` must be set or `client` must be provided with `freezeWith`")}_setNodeAccountIds(e){if(this._nodeAccountIds.isEmpty){if(e==null)throw new Error("`nodeAccountId` must be set or `client` must be provided with `freezeWith`");this._nodeAccountIds.setList(e._network.getNodeAccountIdsForExecute())}}_buildSignedTransactions(){this._signedTransactions.locked||this._signedTransactions.setList(this._nodeAccountIds.list.map(e=>this._makeSignedTransaction(e)))}freeze(){return this.freezeWith(null)}_freezeWithAccountId(e){this._operatorAccountId==null&&(this._operatorAccountId=e)}freezeWith(e){if(this._signOnDemand=e!=null?e.signOnDemand:!1,this._operator=e!=null?e._operator:null,this._freezeWithAccountId(e!=null?e.operatorAccountId:null),this._maxTransactionFee=this._maxTransactionFee==null?e!=null&&e.defaultMaxTransactionFee!=null?e.defaultMaxTransactionFee:this._defaultMaxTransactionFee:this._maxTransactionFee,this._regenerateTransactionId=e!=null&&this._regenerateTransactionId==null?e.defaultRegenerateTransactionId:this._regenerateTransactionId,this._setNodeAccountIds(e),this._setTransactionId(),e!=null)for(let t of this._transactionIds.list)t.accountId!=null&&t.accountId.validateChecksum(e);return this._buildNewTransactionIdList(),this._signOnDemand||this._buildSignedTransactions(),this}async signWithSigner(e){return await e.signTransaction(this),this}async freezeWithSigner(e){return await e.populateTransaction(this),this.freeze(),this}toBytes(){return this._requireFrozen(),this._requireNotSignOnDemand(),this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),this._buildAllTransactions(),as.proto.TransactionList.encode({transactionList:this._transactions.list}).finish()}async toBytesAsync(){return this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),await this._buildAllTransactionsAsync(),this._transactions.setLocked(),this._signedTransactions.setLocked(),as.proto.TransactionList.encode({transactionList:this._transactions.list}).finish()}async getTransactionHash(){return this._requireFrozen(),this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),await this._buildAllTransactionsAsync(),this._transactions.setLocked(),this._signedTransactions.setLocked(),O8(this._transactions.get(0).signedTransactionBytes)}async getTransactionHashPerNode(){return this._requireFrozen(),this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),await this._buildAllTransactionsAsync(),await D8._fromTransaction(this)}isFrozen(){return this._signedTransactions.length>0}_getTransactionId(){let e=this.transactionId;if(e==null)throw new Error("transaction must have been frozen before getting the transaction ID, try calling `freeze`");return e}_validateChecksums(e){}async _beforeExecute(e){this._logger&&this._logger.info(`Network used: ${e._network.networkName}`),this._isFrozen()||this.freezeWith(e),e.isAutoValidateChecksumsEnabled()&&this._validateChecksums(e),(this._operator==null||this._operator==null)&&(this._operator=e!=null?e._operator:null),(this._operatorAccountId==null||this._operatorAccountId==null)&&(this._operatorAccountId=e!=null&&e._operator!=null?e._operator.accountId:null),this._operator!=null&&await this.signWith(this._operator.publicKey,this._operator.transactionSigner)}async _makeRequestAsync(){let e=this._transactionIds.index*this._nodeAccountIds.length+this._nodeAccountIds.index;return this._signOnDemand?await this._buildTransactionAsync():(this._buildTransaction(e),this._transactions.get(e))}async _signTransaction(){let e=this._makeSignedTransaction(this._nodeAccountIds.next),t=e.bodyBytes;for(let n=0;n<this._publicKeys.length;n++){let i=this._publicKeys[n],a=this._transactionSigners[n];if(a==null)continue;let o=await a(t);e.sigMap==null&&(e.sigMap={}),e.sigMap.sigPair==null&&(e.sigMap.sigPair=[]),e.sigMap.sigPair.push(i._toProtobufSignature(o))}return e}_buildNewTransactionIdList(){if(this._transactionIds.locked||this._operatorAccountId==null)return;let e=Wr.withValidStart(this._operatorAccountId,lt.generate());this._transactionIds.set(this._transactionIds.index,e)}_buildAllTransactions(){for(let e=0;e<this._signedTransactions.length;e++)this._buildTransaction(e)}async _buildAllTransactionsAsync(){if(!this._signOnDemand){this._buildAllTransactions();return}if(this._buildSignedTransactions(),!this._transactions.locked)for(let e=0;e<this._signedTransactions.length;e++)this._transactions.push(await this._buildTransactionAsync())}_buildTransaction(e){if(this._transactions.length<e)for(let t=this._transactions.length;t<e;t++)this._transactions.push(null);this._transactions.setIfAbsent(e,()=>({signedTransactionBytes:as.proto.SignedTransaction.encode(this._signedTransactions.get(e)).finish()}))}async _buildTransactionAsync(){return{signedTransactionBytes:as.proto.SignedTransaction.encode(await this._signTransaction()).finish()}}_shouldRetry(e,t){let{nodeTransactionPrecheckCode:n}=t,i=P._fromCode(n??as.proto.ResponseCodeEnum.OK);switch(this._logger&&(this._logger.debug(`[${this._getLogId()}] received status ${i.toString()}`),this._logger.info(`SDK Transaction Status Response: ${i.toString()}`)),i){case P.Busy:case P.Unknown:case P.PlatformTransactionNotCreated:case P.PlatformNotActive:return[i,Bn.Retry];case P.Ok:return[i,Bn.Finished];case P.TransactionExpired:return this._transactionIds.locked||this._regenerateTransactionId!=null&&!this._regenerateTransactionId?[i,Bn.Error]:(this._buildNewTransactionIdList(),[i,Bn.Retry]);default:return[i,Bn.Error]}}_mapStatusError(e,t){let{nodeTransactionPrecheckCode:n}=t,i=P._fromCode(n??as.proto.ResponseCodeEnum.OK);return this._logger&&this._logger.info(`Transaction Error Info: ${i.toString()}, ${this.transactionId.toString()}`),new ns({status:i,transactionId:this._getTransactionId(),contractFunctionResult:null})}async _mapResponse(e,t,n){let i=await O8(n.signedTransactionBytes),a=this._getTransactionId();return this._transactionIds.advance(),this._logger&&this._logger.info(`Transaction Info: ${JSON.stringify(new c1({nodeId:t,transactionHash:i,transactionId:a}).toJSON())}`),new c1({nodeId:t,transactionHash:i,transactionId:a})}_makeSignedTransaction(e){let t=this._makeTransactionBody(e);return this._logger&&this._logger.info(`Transaction Body: ${JSON.stringify(t)}`),{bodyBytes:as.proto.TransactionBody.encode(t).finish(),sigMap:{sigPair:[]}}}_makeTransactionBody(e){return{[this._getTransactionDataCase()]:this._makeTransactionData(),transactionFee:this._maxTransactionFee!=null?this._maxTransactionFee.toTinybars():null,memo:this._transactionMemo,transactionID:this._transactionIds.current._toProtobuf(),nodeAccountID:e!=null?e._toProtobuf():null,transactionValidDuration:{seconds:B8.default.fromNumber(this._transactionValidDuration)}}}_getTransactionDataCase(){throw new Error("not implemented")}_getScheduledTransactionBody(){return{memo:this.transactionMemo,transactionFee:this._maxTransactionFee==null?this._defaultMaxTransactionFee.toTinybars():this._maxTransactionFee.toTinybars(),[this._getTransactionDataCase()]:this._makeTransactionData()}}_makeTransactionData(){throw new Error("not implemented")}_isFrozen(){return this._signOnDemand||this._signedTransactions.length>0||this._transactions.length>0}_requireNotFrozen(){if(this._isFrozen())throw new Error("transaction is immutable; it has at least one signature or has been explicitly frozen")}_requireNotSignOnDemand(){if(this._signOnDemand)throw new Error("Please use `toBytesAsync()` if `signOnDemand` is enabled")}_requireFrozen(){if(!this._isFrozen())throw new Error("transaction must have been frozen before calculating the hash will be stable, try calling `freeze`")}_requireOneNodeAccountId(){if(this._nodeAccountIds.length!=1)throw"transaction did not have exactly one node ID set"}_requestToBytes(e){return as.proto.Transaction.encode(e).finish()}_responseToBytes(e){return as.proto.TransactionResponse.encode(e).finish()}},Bx=[];var CB=Ie(vr(),1);var M8=Ie(Yt(),1),oa=class r{constructor(e,t){this.tokenId=e,this.serial=typeof t=="number"?M8.default.fromNumber(t):t,Object.freeze(this)}static fromString(e){let t=e.split("/").length>1?e.split("/"):e.split("@");for(let a of t)if(a==="")throw new Error("invalid format for NftId: use [token]/[serial] or [token]@[serial]");let n=Oe.fromString(t[0]),i=M8.default.fromString(t[1]);return new r(n,i)}static _fromProtobuf(e){return new r(Oe._fromProtobuf(e.tokenID),e.serialNumber!=null?e.serialNumber:M8.default.ZERO)}static fromBytes(e){return r._fromProtobuf(CB.proto.NftID.decode(e))}_toProtobuf(){return{tokenID:this.tokenId._toProtobuf(),serialNumber:M8.default.fromValue(this.serial!==void 0?this.serial:0)}}toString(){return`${this.tokenId.toString()}/${this.serial.toString()}`}toBytes(){return CB.proto.NftID.encode(this._toProtobuf()).finish()}};var Qze=Ie(Yt(),1);var Qd=class r{constructor(e){this.spenderAccountId=e.spenderAccountId,this.ownerAccountId=e.ownerAccountId,this.amount=e.amount,Object.freeze(this)}static _fromProtobuf(e){return new r({spenderAccountId:ne._fromProtobuf(e.spender),ownerAccountId:e.owner!=null?ne._fromProtobuf(e.owner):null,amount:ze.fromTinybars(e.amount!=null?e.amount:0)})}static _fromGrantedProtobuf(e,t){return new r({spenderAccountId:ne._fromProtobuf(e.spender),ownerAccountId:t,amount:ze.fromTinybars(e.amount!=null?e.amount:0)})}_toProtobuf(){return{owner:this.ownerAccountId!=null?this.ownerAccountId._toProtobuf():null,spender:this.spenderAccountId!=null?this.spenderAccountId._toProtobuf():null,amount:this.amount!=null?this.amount.toTinybars():null}}_validateChecksums(e){this.spenderAccountId!=null&&this.spenderAccountId.validateChecksum(e),this.spenderAccountId!=null&&this.spenderAccountId.validateChecksum(e)}toJSON(){return{ownerAccountId:this.ownerAccountId!=null?this.ownerAccountId.toString():null,spenderAccountId:this.spenderAccountId!=null?this.spenderAccountId.toString():null,amount:this.amount!=null?this.amount.toString():null}}};var kB=Ie(Yt(),1),$d=class r{constructor(e){this.tokenId=e.tokenId,this.spenderAccountId=e.spenderAccountId,this.ownerAccountId=e.ownerAccountId,this.amount=e.amount,Object.freeze(this)}static _fromProtobuf(e){return new r({tokenId:Oe._fromProtobuf(e.tokenId),spenderAccountId:ne._fromProtobuf(e.spender),ownerAccountId:e.owner!=null?ne._fromProtobuf(e.owner):null,amount:e.amount!=null?kB.default.fromValue(e.amount):null})}static _fromGrantedProtobuf(e,t){return new r({tokenId:Oe._fromProtobuf(e.tokenId),spenderAccountId:ne._fromProtobuf(e.spender),ownerAccountId:t,amount:e.amount!=null?kB.default.fromValue(e.amount):null})}_toProtobuf(){return{tokenId:this.tokenId._toProtobuf(),spender:this.spenderAccountId!=null?this.spenderAccountId._toProtobuf():null,owner:this.ownerAccountId!=null?this.ownerAccountId._toProtobuf():null,amount:this.amount}}_validateChecksums(e){this.tokenId.validateChecksum(e),this.ownerAccountId!=null&&this.ownerAccountId.validateChecksum(e),this.spenderAccountId!=null&&this.spenderAccountId.validateChecksum(e)}};var NB=Ie(Yt(),1),Z3=class r{constructor(e){this.tokenId=e.tokenId,this.spenderAccountId=e.spenderAccountId,this.ownerAccountId=e.ownerAccountId,this.serialNumbers=e.serialNumbers,this.allSerials=e.allSerials,this.delegatingSpender=e.delegatingSpender,Object.freeze(this)}static _fromProtobuf(e){let t=e.approvedForAll!=null&&e.approvedForAll.value==!0;return new r({tokenId:Oe._fromProtobuf(e.tokenId),spenderAccountId:e.spender!=null?ne._fromProtobuf(e.spender):null,ownerAccountId:e.owner!=null?ne._fromProtobuf(e.owner):null,serialNumbers:t?null:e.serialNumbers!=null?e.serialNumbers.map(n=>NB.default.fromValue(n)):[],allSerials:t,delegatingSpender:e.delegatingSpender!=null?ne._fromProtobuf(e.delegatingSpender):null})}static _fromGrantedProtobuf(e,t){return new r({tokenId:Oe._fromProtobuf(e.tokenId),spenderAccountId:ne._fromProtobuf(e.spender),ownerAccountId:t,serialNumbers:[],allSerials:null,delegatingSpender:null})}static _fromRemoveProtobuf(e){return new r({tokenId:Oe._fromProtobuf(e.tokenId),spenderAccountId:null,ownerAccountId:e.owner!=null?ne._fromProtobuf(e.owner):null,serialNumbers:e.serialNumbers!=null?e.serialNumbers.map(t=>NB.default.fromValue(t)):[],allSerials:null,delegatingSpender:null})}_toProtobuf(){return{tokenId:this.tokenId._toProtobuf(),spender:this.spenderAccountId!=null?this.spenderAccountId._toProtobuf():null,owner:this.ownerAccountId!=null?this.ownerAccountId._toProtobuf():null,approvedForAll:this.serialNumbers==null?{value:this.allSerials}:null,serialNumbers:this.serialNumbers,delegatingSpender:this.delegatingSpender!=null?this.delegatingSpender._toProtobuf():null}}_validateChecksums(e){this.tokenId.validateChecksum(e),this.ownerAccountId!=null&&this.ownerAccountId.validateChecksum(e),this.spenderAccountId!=null&&this.spenderAccountId.validateChecksum(e)}};var RB=Ie(Yt(),1);var L8=class r extends ke{constructor(e={}){super(),this._hbarApprovals=e.hbarApprovals!=null?e.hbarApprovals:[],this._tokenApprovals=e.tokenApprovals!=null?e.tokenApprovals:[],this._nftApprovals=e.nftApprovals!=null?e.nftApprovals:[]}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoApproveAllowance;return ke._fromProtobufTransactions(new r({hbarApprovals:(s.cryptoAllowances!=null?s.cryptoAllowances:[]).map(c=>Qd._fromProtobuf(c)),tokenApprovals:(s.tokenAllowances!=null?s.tokenAllowances:[]).map(c=>$d._fromProtobuf(c)),nftApprovals:(s.nftAllowances!=null?s.nftAllowances:[]).map(c=>Z3._fromProtobuf(c))}),e,t,n,i,a)}get hbarApprovals(){return this._hbarApprovals}approveHbarAllowance(e,t,n){return this._requireNotFrozen(),this._hbarApprovals.push(new Qd({spenderAccountId:typeof t=="string"?ne.fromString(t):t instanceof _t?ne.fromEvmAddress(0,0,t.toSolidityAddress()):t,ownerAccountId:typeof e=="string"?ne.fromString(e):e instanceof _t?ne.fromEvmAddress(0,0,e.toSolidityAddress()):e,amount:n instanceof ze?n:new ze(n)})),this}addHbarAllowance(e,t){return this._requireNotFrozen(),this._hbarApprovals.push(new Qd({spenderAccountId:typeof e=="string"?ne.fromString(e):e,amount:t instanceof ze?t:new ze(t),ownerAccountId:null})),this}get tokenApprovals(){return this._tokenApprovals}approveTokenAllowance(e,t,n,i){return this._requireNotFrozen(),this._tokenApprovals.push(new $d({tokenId:typeof e=="string"?Oe.fromString(e):e,spenderAccountId:typeof n=="string"?ne.fromString(n):n instanceof _t?ne.fromEvmAddress(0,0,n.toSolidityAddress()):n,ownerAccountId:typeof t=="string"?ne.fromString(t):t instanceof _t?ne.fromEvmAddress(0,0,t.toSolidityAddress()):t,amount:typeof i=="number"?RB.default.fromNumber(i):i})),this}addTokenAllowance(e,t,n){return this._requireNotFrozen(),this._tokenApprovals.push(new $d({tokenId:typeof e=="string"?Oe.fromString(e):e,spenderAccountId:typeof t=="string"?ne.fromString(t):t,amount:typeof n=="number"?RB.default.fromNumber(n):n,ownerAccountId:null})),this}addTokenNftAllowance(e,t){return this._approveTokenNftAllowance(e,null,t,null)}get tokenNftApprovals(){return this._nftApprovals}_approveTokenNftAllowance(e,t,n,i){this._requireNotFrozen();let a=typeof e=="string"?oa.fromString(e):e,o=typeof n=="string"?ne.fromString(n):n instanceof _t?ne.fromEvmAddress(0,0,n.toSolidityAddress()):n,s=!1;for(let c of this._nftApprovals)if(c.tokenId.compare(a.tokenId)===0&&c.spenderAccountId!=null&&c.spenderAccountId.compare(o)===0){c.serialNumbers!=null&&c.serialNumbers.push(a.serial),s=!0;break}return s||this._nftApprovals.push(new Z3({tokenId:a.tokenId,spenderAccountId:o,ownerAccountId:typeof t=="string"?ne.fromString(t):t instanceof _t?ne.fromEvmAddress(0,0,t.toSolidityAddress()):t,serialNumbers:[a.serial],allSerials:!1,delegatingSpender:typeof i=="string"?ne.fromString(i):i})),this}approveTokenNftAllowance(e,t,n){return this._approveTokenNftAllowance(e,t,n,null)}approveTokenNftAllowanceWithDelegatingSpender(e,t,n,i){return this._approveTokenNftAllowance(e,t,n,i)}_approveAllTokenNftAllowance(e,t,n,i){return this._requireNotFrozen(),this._nftApprovals.push(new Z3({tokenId:typeof e=="string"?Oe.fromString(e):e,spenderAccountId:typeof n=="string"?ne.fromString(n):n instanceof _t?ne.fromEvmAddress(0,0,n.toSolidityAddress()):n,ownerAccountId:typeof t=="string"?ne.fromString(t):t instanceof _t?ne.fromEvmAddress(0,0,t.toSolidityAddress()):t,serialNumbers:null,allSerials:i,delegatingSpender:null})),this}addAllTokenNftAllowance(e,t,n){return this._approveAllTokenNftAllowance(e,t,n,!0)}approveTokenNftAllowanceAllSerials(e,t,n){return this._approveAllTokenNftAllowance(e,t,n,!0)}deleteTokenNftAllowanceAllSerials(e,t,n){return this._approveAllTokenNftAllowance(e,t,n,!1)}_validateChecksums(e){this._hbarApprovals.map(t=>t._validateChecksums(e)),this._tokenApprovals.map(t=>t._validateChecksums(e)),this._nftApprovals.map(t=>t._validateChecksums(e))}_execute(e,t){return e.crypto.approveAllowances(t)}_getTransactionDataCase(){return"cryptoApproveAllowance"}_makeTransactionData(){return{cryptoAllowances:this._hbarApprovals.map(e=>e._toProtobuf()),tokenAllowances:this._tokenApprovals.map(e=>e._toProtobuf()),nftAllowances:this._nftApprovals.map(e=>e._toProtobuf())}}_getLogId(){return`AccountAllowanceApproveTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("cryptoApproveAllowance",L8._fromProtobuf);var F8=class r extends ke{constructor(e={}){super(),this._nftAllowances=e.nftAllowances!=null?e.nftAllowances:[]}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoDeleteAllowance;return ke._fromProtobufTransactions(new r({nftAllowances:(s.nftAllowances!=null?s.nftAllowances:[]).map(c=>Z3._fromProtobuf(c))}),e,t,n,i,a)}get tokenNftAllowanceDeletions(){return this._nftAllowances}deleteAllTokenNftAllowances(e,t){this._requireNotFrozen();let n=typeof e=="string"?oa.fromString(e):e,i=typeof t=="string"?ne.fromString(t):t,a=!1;for(let o of this._nftAllowances)if(o.tokenId.compare(n.tokenId)===0){o.serialNumbers!=null&&o.serialNumbers.push(n.serial),a=!0;break}return a||this._nftAllowances.push(new Z3({tokenId:n.tokenId,spenderAccountId:null,serialNumbers:[n.serial],ownerAccountId:i,allSerials:!1,delegatingSpender:null})),this}_validateChecksums(e){this._nftAllowances.map(t=>t._validateChecksums(e))}_execute(e,t){return e.crypto.deleteAllowances(t)}_getTransactionDataCase(){return"cryptoDeleteAllowance"}_makeTransactionData(){return{nftAllowances:this._nftAllowances.map(e=>e._toProtobuf())}}_getLogId(){return`AccountAllowanceDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("cryptoDeleteAllowance",F8._fromProtobuf);var N3e=Ie(Yt(),1);var U8=class extends di{constructor(){super(e=>Oe.fromString(e))}};var q8=class extends di{constructor(){super(e=>Oe.fromString(e))}};var OB=Ie(vr(),1),Em=class r{constructor(e){this.hbars=e.hbars,this.tokens=e.tokens,this.tokenDecimals=e.tokenDecimals,Object.freeze(this)}static fromBytes(e){return r._fromProtobuf(OB.proto.CryptoGetAccountBalanceResponse.decode(e))}static _fromProtobuf(e){let t=new U8,n=new q8;if(e.tokenBalances!=null)for(let i of e.tokenBalances){let a=Oe._fromProtobuf(i.tokenId);n._set(a,i.decimals!=null?i.decimals:0),t._set(a,N3e.default.fromValue(i.balance))}return new r({hbars:ze.fromTinybars(e.balance),tokens:t,tokenDecimals:n})}_toProtobuf(){let e=[];for(let[t,n]of this.tokens!=null?this.tokens:[])e.push({tokenId:t._toProtobuf(),balance:n,decimals:this.tokenDecimals!=null?this.tokenDecimals.get(t):null});return{balance:this.hbars.toTinybars(),tokenBalances:e}}toBytes(){return OB.proto.CryptoGetAccountBalanceResponse.encode(this._toProtobuf()).finish()}toString(){return JSON.stringify(this.toJSON())}toJSON(){let e=[];for(let[t,n]of this.tokens!=null?this.tokens:[]){let i=this.tokenDecimals!=null?this.tokenDecimals.get(t):null;e.push({tokenId:t.toString(),balance:n.toString(),decimals:i??0})}return{hbars:this.hbars.toString(),tokens:e}}};var X3=class r extends xr{constructor(e={}){super(),this._accountId=null,this._contractId=null,e.accountId!=null&&this.setAccountId(e.accountId),e.contractId!=null&&this.setContractId(e.contractId)}static _fromProtobuf(e){let t=e.cryptogetAccountBalance;return new r({accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):void 0,contractId:t.contractID!=null?_t._fromProtobuf(t.contractID):void 0})}get accountId(){return this._accountId}setAccountId(e){return this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get contractId(){return this._contractId}setContractId(e){return this._contractId=typeof e=="string"?_t.fromString(e):e.clone(),this}_isPaymentRequired(){return!1}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e),this._contractId!=null&&this._contractId.validateChecksum(e)}_execute(e,t){return e.crypto.cryptoGetBalance(t)}_mapResponseHeader(e){return e.cryptogetAccountBalance.header}_mapResponse(e,t,n){let i=e.cryptogetAccountBalance;return Promise.resolve(Em._fromProtobuf(i))}_onMakeRequest(e){return{cryptogetAccountBalance:{header:e,accountID:this._accountId!=null?this._accountId._toProtobuf():null,contractID:this._contractId!=null?this._contractId._toProtobuf():null}}}_getLogId(){return`AccountBalanceQuery:${this._timestamp.toString()}`}};Qr.set("cryptogetAccountBalance",X3._fromProtobuf);var OJt=Ie(vr(),1);var DB=Ie(Yt(),1),fr=class r{constructor(e){this.seconds=e instanceof DB.default?e:DB.default.fromNumber(e),Object.freeze(this)}_toProtobuf(){return{seconds:this.seconds}}static _fromProtobuf(e){return new r(e.seconds)}};var PB=Ie(Yt(),1);var j8=class r extends ke{constructor(e={}){super(),this._key=null,this._initialBalance=null,this._sendRecordThreshold=IB,this._receiveRecordThreshold=IB,this._receiverSignatureRequired=!1,this._proxyAccountId=null,this._autoRenewPeriod=new fr(Eu),this._accountMemo=null,this._maxAutomaticTokenAssociations=null,this._stakedAccountId=null,this._stakedNodeId=null,this._declineStakingReward=!1,this._alias=null,e.key!=null&&this.setKey(e.key),e.receiverSignatureRequired!=null&&this.setReceiverSignatureRequired(e.receiverSignatureRequired),e.initialBalance!=null&&this.setInitialBalance(e.initialBalance),e.proxyAccountId!=null&&this.setProxyAccountId(e.proxyAccountId),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.accountMemo!=null&&this.setAccountMemo(e.accountMemo),e.maxAutomaticTokenAssociations!=null&&this.setMaxAutomaticTokenAssociations(e.maxAutomaticTokenAssociations),e.stakedAccountId!=null&&this.setStakedAccountId(e.stakedAccountId),e.stakedNodeId!=null&&this.setStakedNodeId(e.stakedNodeId),e.declineStakingReward!=null&&this.setDeclineStakingReward(e.declineStakingReward),e.alias!=null&&this.setAlias(e.alias)}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoCreateAccount,c;return s.alias!=null&&s.alias.length>0&&s.alias.length===20&&(c=rs.fromBytes(s.alias)),ke._fromProtobufTransactions(new r({key:s.key!=null?rt._fromProtobufKey(s.key):void 0,initialBalance:s.initialBalance!=null?s.initialBalance:void 0,receiverSignatureRequired:s.receiverSigRequired!=null?s.receiverSigRequired:void 0,proxyAccountId:s.proxyAccountID!=null?ne._fromProtobuf(s.proxyAccountID):void 0,autoRenewPeriod:s.autoRenewPeriod!=null&&s.autoRenewPeriod.seconds!=null?s.autoRenewPeriod.seconds:void 0,accountMemo:s.memo!=null?s.memo:void 0,maxAutomaticTokenAssociations:s.maxAutomaticTokenAssociations!=null?s.maxAutomaticTokenAssociations:void 0,stakedAccountId:s.stakedAccountId!=null?ne._fromProtobuf(s.stakedAccountId):void 0,stakedNodeId:s.stakedNodeId!=null?s.stakedNodeId:void 0,declineStakingReward:s.declineReward==!0,alias:c}),e,t,n,i,a)}get key(){return this._key}setKey(e){return this._requireNotFrozen(),this._key=e,this}get initialBalance(){return this._initialBalance}setInitialBalance(e){return this._requireNotFrozen(),this._initialBalance=e instanceof ze?e:new ze(e),this}get receiverSignatureRequired(){return this._receiverSignatureRequired}setReceiverSignatureRequired(e){return this._requireNotFrozen(),this._receiverSignatureRequired=e,this}get proxyAccountId(){return this._proxyAccountId}setProxyAccountId(e){return this._requireNotFrozen(),this._proxyAccountId=e,this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof fr?e:new fr(e),this}get accountMemo(){return this._accountMemo}setAccountMemo(e){return this._requireNotFrozen(),this._accountMemo=e,this}get maxAutomaticTokenAssociations(){return this._maxAutomaticTokenAssociations}setMaxAutomaticTokenAssociations(e){return this._requireNotFrozen(),this._maxAutomaticTokenAssociations=typeof e=="number"?PB.default.fromNumber(e):e,this}get stakedAccountId(){return this._stakedAccountId}setStakedAccountId(e){return this._requireNotFrozen(),this._stakedAccountId=typeof e=="string"?ne.fromString(e):e,this}get stakedNodeId(){return this._stakedNodeId}setStakedNodeId(e){return this._requireNotFrozen(),this._stakedNodeId=PB.default.fromValue(e),this}get declineStakingRewards(){return this._declineStakingReward}setDeclineStakingReward(e){return this._requireNotFrozen(),this._declineStakingReward=e,this}get alias(){return this._alias}setAlias(e){if(typeof e=="string")if(e.startsWith("0x")&&e.length==42||e.length==40)this._alias=rs.fromString(e);else throw new Error('evmAddress must be a valid EVM address with or without "0x" prefix');else this._alias=e;return this}_validateChecksums(e){this._proxyAccountId!=null&&this._proxyAccountId.validateChecksum(e)}_execute(e,t){return e.crypto.createAccount(t)}_getTransactionDataCase(){return"cryptoCreateAccount"}_makeTransactionData(){let e=null;return this._alias!=null&&(e=this._alias.toBytes()),{key:this._key!=null?this._key._toProtobufKey():null,initialBalance:this._initialBalance!=null?this._initialBalance.toTinybars():null,autoRenewPeriod:this._autoRenewPeriod._toProtobuf(),proxyAccountID:this._proxyAccountId!=null?this._proxyAccountId._toProtobuf():null,receiveRecordThreshold:this._receiveRecordThreshold.toTinybars(),sendRecordThreshold:this._sendRecordThreshold.toTinybars(),receiverSigRequired:this._receiverSignatureRequired,memo:this._accountMemo,maxAutomaticTokenAssociations:this._maxAutomaticTokenAssociations!=null?this._maxAutomaticTokenAssociations.toInt():null,stakedAccountId:this.stakedAccountId!=null?this.stakedAccountId._toProtobuf():null,stakedNodeId:this.stakedNodeId,declineReward:this.declineStakingRewards,alias:e}}_getLogId(){return`AccountCreateTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("cryptoCreateAccount",j8._fromProtobuf);var V8=class r extends ke{constructor(e={}){super(),this._accountId=null,this._transferAccountId=null,e.accountId!=null&&this.setAccountId(e.accountId),e.transferAccountId!=null&&this.setTransferAccountId(e.transferAccountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoDelete;return ke._fromProtobufTransactions(new r({accountId:s.deleteAccountID!=null?ne._fromProtobuf(s.deleteAccountID):void 0,transferAccountId:s.transferAccountID!=null?ne._fromProtobuf(s.transferAccountID):void 0}),e,t,n,i,a)}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get transferAccountId(){return this._transferAccountId}setTransferAccountId(e){return this._requireNotFrozen(),this._transferAccountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e),this._transferAccountId!=null&&this._transferAccountId.validateChecksum(e)}_execute(e,t){return e.crypto.cryptoDelete(t)}_getTransactionDataCase(){return"cryptoDelete"}_makeTransactionData(){return{deleteAccountID:this._accountId!=null?this._accountId._toProtobuf():null,transferAccountID:this._transferAccountId!=null?this._transferAccountId._toProtobuf():null}}_getLogId(){return`AccountDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("cryptoDelete",V8._fromProtobuf);var BB=Ie(vr(),1),l1=class r{constructor(e){this.declineStakingReward=e.declineStakingReward,this.stakePeriodStart=e.stakePeriodStart,this.pendingReward=e.pendingReward,this.stakedToMe=e.stakedToMe,this.stakedAccountId=e.stakedAccountId,this.stakedNodeId=e.stakedNodeId,Object.freeze(this)}static _fromProtobuf(e){return new r({declineStakingReward:e.declineReward==!0,stakePeriodStart:e.stakePeriodStart!=null?lt._fromProtobuf(e.stakePeriodStart):null,pendingReward:e.pendingReward!=null?ze.fromTinybars(e.pendingReward):null,stakedToMe:e.stakedToMe!=null?ze.fromTinybars(e.stakedToMe):null,stakedAccountId:e.stakedAccountId!=null?ne._fromProtobuf(e.stakedAccountId):null,stakedNodeId:e.stakedNodeId!=null?e.stakedNodeId:null})}_toProtobuf(){return{declineReward:this.declineStakingReward,stakePeriodStart:this.stakePeriodStart!=null?this.stakePeriodStart._toProtobuf():null,pendingReward:this.pendingReward!=null?this.pendingReward.toTinybars():null,stakedToMe:this.stakedToMe!=null?this.stakedToMe.toTinybars():null,stakedAccountId:this.stakedAccountId!=null?this.stakedAccountId._toProtobuf():null,stakedNodeId:this.stakedNodeId}}static fromBytes(e){return r._fromProtobuf(BB.proto.StakingInfo.decode(e))}toBytes(){return BB.proto.StakingInfo.encode(this._toProtobuf()).finish()}toString(){return JSON.stringify(this.toJSON())}toJSON(){return{declineStakingReward:this.declineStakingReward,stakePeriodStart:this.stakePeriodStart!=null?this.stakePeriodStart.toString():null,pendingReward:this.pendingReward!=null?this.pendingReward.toString():null,stakedToMe:this.stakedToMe!=null?this.stakedToMe.toString():null,stakedAccountId:this.stakedAccountId!=null?this.stakedAccountId.toString():null,stakedNodeId:this.stakedNodeId!=null?this.stakedNodeId.toString():null}}};var Of=class r{constructor(e){this.accountId=e.accountId,this.hash=e.hash,this.keys=e.keys,this.duration=e.duration,Object.freeze(this)}static _fromProtobuf(e){let t=e;return new r({accountId:ne._fromProtobuf(t.accountId),hash:t.hash!=null?t.hash:new Uint8Array,keys:t.keys!=null?Ri.__fromProtobufKeyList(t.keys):new Ri,duration:fr._fromProtobuf(t.duration)})}_toProtobuf(){return{accountId:this.accountId._toProtobuf(),hash:this.hash,keys:this.keys._toProtobufKey().keyList,duration:this.duration._toProtobuf()}}};var d1=Ie(Yt(),1);var Mx=Ie(Yt(),1);var H8=class r{constructor(e){this.tokenId=e.tokenId,this.symbol=e.symbol,this.balance=e.balance,this.isKycGranted=e.isKycGranted,this.isFrozen=e.isFrozen,this.automaticAssociation=e.automaticAssociation,Object.freeze(this)}static _fromProtobuf(e){let t=Oe._fromProtobuf(e.tokenId),n=e.kycStatus==null||e.kycStatus===0?null:e.kycStatus===1,i=e.freezeStatus==null||e.freezeStatus===0?null:e.freezeStatus===1;return new r({tokenId:t,symbol:e.symbol,balance:e.balance!=null?e.balance instanceof Mx.default?e.balance:Mx.default.fromValue(e.balance):Mx.default.ZERO,isKycGranted:n,isFrozen:i,automaticAssociation:e.automaticAssociation!=null?e.automaticAssociation:null})}_toProtobuf(){return{tokenId:this.tokenId._toProtobuf(),symbol:this.symbol,balance:this.balance,kycStatus:this.isKycGranted==null?0:this.isKycGranted?1:2,freezeStatus:this.isFrozen==null?0:this.isFrozen?1:2,automaticAssociation:this.automaticAssociation}}};var u1=class r extends di{constructor(){super(e=>Oe.fromString(e))}static _fromProtobuf(e){let t=new r;for(let n of e){let i=Oe._fromProtobuf(n.tokenId);t._set(i,H8._fromProtobuf(n))}return t}_toProtobuf(){let e=[];for(let[t,n]of this)e.push(n._toProtobuf());return e}};var K8=Ie(vr(),1);var mr=class r{constructor(e){this._ledgerId=e,Object.freeze(this)}static fromString(e){switch(e){case ec[0]:case"0":return r.MAINNET;case ec[1]:case"1":return r.TESTNET;case ec[2]:case"2":return r.PREVIEWNET;case ec[3]:case"3":return r.LOCAL_NODE;default:{let t=et(e);if(t.length==0&&e.length!=0)throw new Error("Default reached for fromString");return new r(t)}}}toString(){if(this._ledgerId.length==1)switch(this._ledgerId[0]){case 0:return ec[0];case 1:return ec[1];case 2:return ec[2];case 3:return ec[3];default:return He(this._ledgerId)}else return He(this._ledgerId)}static fromBytes(e){return new r(e)}toBytes(){return this._ledgerId}isMainnet(){return this.toString()==ec[0]}isTestnet(){return this.toString()==ec[1]}isPreviewnet(){return this.toString()==ec[2]}isLocalNode(){return this.toString()==ec[3]}},ec=["mainnet","testnet","previewnet","local-node"];mr.MAINNET=new mr(new Uint8Array([0]));mr.TESTNET=new mr(new Uint8Array([1]));mr.PREVIEWNET=new mr(new Uint8Array([2]));mr.LOCAL_NODE=new mr(new Uint8Array([3]));var xm=class r{constructor(e){this.accountId=e.accountId,this.contractAccountId=e.contractAccountId,this.isDeleted=e.isDeleted,this.proxyAccountId=e.proxyAccountId,this.proxyReceived=e.proxyReceived,this.key=e.key,this.balance=e.balance,this.sendRecordThreshold=e.sendRecordThreshold,this.receiveRecordThreshold=e.receiveRecordThreshold,this.isReceiverSignatureRequired=e.isReceiverSignatureRequired,this.expirationTime=e.expirationTime,this.autoRenewPeriod=e.autoRenewPeriod,this.liveHashes=e.liveHashes,this.tokenRelationships=e.tokenRelationships,this.accountMemo=e.accountMemo,this.ownedNfts=e.ownedNfts,this.maxAutomaticTokenAssociations=e.maxAutomaticTokenAssociations,this.aliasKey=e.aliasKey,this.ledgerId=e.ledgerId,this.hbarAllowances=e.hbarAllowances,this.tokenAllowances=e.tokenAllowances,this.nftAllowances=e.nftAllowances,this.ethereumNonce=e.ethereumNonce,this.stakingInfo=e.stakingInfo,Object.freeze(this)}static _fromProtobuf(e){let t=e.alias!=null&&e.alias.length>0?rt._fromProtobufKey(K8.proto.Key.decode(e.alias)):null;t instanceof Xn||(t=null);let n=ne._fromProtobuf(e.accountID);return new r({accountId:n,contractAccountId:e.contractAccountID!=null?e.contractAccountID:null,isDeleted:e.deleted!=null?e.deleted:!1,key:rt._fromProtobufKey(e.key),balance:ze.fromTinybars(e.balance!=null?e.balance:0),sendRecordThreshold:ze.fromTinybars(e.generateSendRecordThreshold!=null?e.generateSendRecordThreshold:0),receiveRecordThreshold:ze.fromTinybars(e.generateReceiveRecordThreshold!=null?e.generateReceiveRecordThreshold:0),isReceiverSignatureRequired:e.receiverSigRequired!=null?e.receiverSigRequired:!1,expirationTime:lt._fromProtobuf(e.expirationTime),autoRenewPeriod:e.autoRenewPeriod!=null?new fr(e.autoRenewPeriod.seconds):new fr(0),proxyAccountId:e.proxyAccountID!=null&&d1.default.fromValue(e.proxyAccountID.shardNum).toInt()!==0&&d1.default.fromValue(e.proxyAccountID.realmNum).toInt()!==0&&d1.default.fromValue(e.proxyAccountID.accountNum).toInt()!==0?ne._fromProtobuf(e.proxyAccountID):null,proxyReceived:ze.fromTinybars(e.proxyReceived!=null?e.proxyReceived:0),liveHashes:(e.liveHashes!=null?e.liveHashes:[]).map(i=>Of._fromProtobuf(i)),tokenRelationships:u1._fromProtobuf(e.tokenRelationships!=null?e.tokenRelationships:[]),accountMemo:e.memo!=null?e.memo:"",ownedNfts:e.ownedNfts?e.ownedNfts:d1.default.ZERO,maxAutomaticTokenAssociations:e.maxAutomaticTokenAssociations?d1.default.fromNumber(e.maxAutomaticTokenAssociations):d1.default.ZERO,aliasKey:t,ledgerId:e.ledgerId!=null?mr.fromBytes(e.ledgerId):null,hbarAllowances:[],tokenAllowances:[],nftAllowances:[],ethereumNonce:e.ethereumNonce!=null?e.ethereumNonce:null,stakingInfo:e.stakingInfo!=null?l1._fromProtobuf(e.stakingInfo):null})}_toProtobuf(){return{accountID:this.accountId._toProtobuf(),contractAccountID:this.contractAccountId,deleted:this.isDeleted,proxyAccountID:this.proxyAccountId!=null?this.proxyAccountId._toProtobuf():null,proxyReceived:this.proxyReceived.toTinybars(),key:this.key._toProtobufKey(),balance:this.balance.toTinybars(),generateSendRecordThreshold:this.sendRecordThreshold.toTinybars(),generateReceiveRecordThreshold:this.receiveRecordThreshold.toTinybars(),receiverSigRequired:this.isReceiverSignatureRequired,expirationTime:this.expirationTime._toProtobuf(),autoRenewPeriod:this.autoRenewPeriod._toProtobuf(),liveHashes:this.liveHashes.map(e=>e._toProtobuf()),tokenRelationships:this.tokenRelationships!=null?this.tokenRelationships._toProtobuf():null,memo:this.accountMemo,ownedNfts:this.ownedNfts,maxAutomaticTokenAssociations:this.maxAutomaticTokenAssociations.toInt(),alias:this.aliasKey!=null?K8.proto.Key.encode(this.aliasKey._toProtobufKey()).finish():null,ledgerId:this.ledgerId!=null?this.ledgerId.toBytes():null,ethereumNonce:this.ethereumNonce,stakingInfo:this.stakingInfo!=null?this.stakingInfo._toProtobuf():null}}static fromBytes(e){return r._fromProtobuf(K8.proto.CryptoGetInfoResponse.AccountInfo.decode(e))}toBytes(){return K8.proto.CryptoGetInfoResponse.AccountInfo.encode(this._toProtobuf()).finish()}toString(){return JSON.stringify(this.toJSON())}toJSON(){return{balance:this.balance.toString(),accountId:this.accountId.toString(),contractAccountId:this.contractAccountId,isDeleted:this.isDeleted,proxyAccountId:this.proxyAccountId!=null?this.proxyAccountId.toString():null,proxyReceived:this.proxyReceived.toString(),key:this.key!=null?this.key.toString():null,sendRecordThreshold:this.sendRecordThreshold.toString(),receiveRecordThreshold:this.receiveRecordThreshold.toString(),isReceiverSignatureRequired:this.isReceiverSignatureRequired,expirationTime:this.expirationTime.toString(),autoRenewPeriod:this.autoRenewPeriod.toString(),accountMemo:this.accountMemo,ownedNfts:this.ownedNfts.toString(),maxAutomaticTokenAssociations:this.maxAutomaticTokenAssociations.toString(),aliasKey:this.aliasKey!=null?this.aliasKey.toString():null,ledgerId:this.ledgerId!=null?this.ledgerId.toString():null,ethereumNonce:this.ethereumNonce!=null?this.ethereumNonce.toString():null,stakingInfo:this.stakingInfo!=null?this.stakingInfo.toJSON():null}}};var ol=class r extends xr{constructor(e={}){super(),this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e){let t=e.cryptoGetInfo;return new r({accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):void 0})}get accountId(){return this._accountId}setAccountId(e){return this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.crypto.getAccountInfo(t)}async getCost(e){return super.getCost(e)}_mapResponseHeader(e){return e.cryptoGetInfo.header}_mapResponse(e,t,n){let i=e.cryptoGetInfo;return Promise.resolve(xm._fromProtobuf(i.accountInfo))}_onMakeRequest(e){return{cryptoGetInfo:{header:e,accountID:this._accountId!=null?this._accountId._toProtobuf():null}}}_getLogId(){return`AccountInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("cryptoGetInfo",ol._fromProtobuf);var xu=class r extends xr{constructor(e={}){super(),this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e){let t=e.cryptoGetAccountRecords;return new r({accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):void 0})}get accountId(){return this._accountId}setAccountId(e){return this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.crypto.getAccountRecords(t)}_mapResponseHeader(e){return e.cryptoGetAccountRecords.header}_mapResponse(e,t,n){let a=e.cryptoGetAccountRecords.records;return Promise.resolve(a.map(o=>_u._fromProtobuf({transactionRecord:o})))}_onMakeRequest(e){return{cryptoGetAccountRecords:{header:e,accountID:this._accountId!=null?this._accountId._toProtobuf():null}}}_getLogId(){return`AccountRecordsQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("cryptoGetAccountRecords",xu._fromProtobuf);var Am=class r{constructor(e){this.accountId=e.accountId,this.amount=e.amount instanceof ze?e.amount:new ze(e.amount),Object.freeze(this)}static _fromProtobuf(e){return new r({accountId:ne._fromProtobuf(e.accountID),amount:ze.fromTinybars(e.amount!=null?e.amount:0)})}_toProtobuf(){return{accountID:this.accountId._toProtobuf(),amount:this.amount.toTinybars()}}};var z8=class r extends xr{constructor(e={}){super(),this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e){let t=e.cryptoGetProxyStakers;return new r({accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):void 0})}get accountId(){return this._accountId}setAccountId(e){return this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.crypto.getStakersByAccountID(t)}_mapResponseHeader(e){return e.cryptoGetProxyStakers.header}_mapResponse(e){let n=e.cryptoGetProxyStakers.stakers;return Promise.resolve((n.proxyStaker!=null?n.proxyStaker:[]).map(i=>Am._fromProtobuf(i)))}_onMakeRequest(e){return{cryptoGetProxyStakers:{header:e,accountID:this._accountId!=null?this._accountId._toProtobuf():null}}}_getLogId(){return`AccountStakersQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("cryptoGetProxyStakers",z8._fromProtobuf);var G8=Ie(Yt(),1);var W8=class r extends ke{constructor(e={}){super(),this._accountId=null,this._key=null,this._receiverSignatureRequired=!1,this._proxyAccountId=null,this._autoRenewPeriod=null,this._expirationTime=null,this._accountMemo=null,this._maxAutomaticTokenAssociations=null,this._aliasKey=null,this._stakedAccountId=null,this._stakedNodeId=null,this._declineStakingReward=null,e.accountId!=null&&this.setAccountId(e.accountId),e.key!=null&&this.setKey(e.key),e.receiverSignatureRequired!=null&&this.setReceiverSignatureRequired(e.receiverSignatureRequired),e.proxyAccountId!=null&&this.setProxyAccountId(e.proxyAccountId),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime),e.accountMemo!=null&&this.setAccountMemo(e.accountMemo),e.maxAutomaticTokenAssociations!=null&&this.setMaxAutomaticTokenAssociations(e.maxAutomaticTokenAssociations),e.stakedAccountId!=null&&this.setStakedAccountId(e.stakedAccountId),e.stakedNodeId!=null&&this.setStakedNodeId(e.stakedNodeId),e.declineStakingReward!=null&&this.setDeclineStakingReward(e.declineStakingReward)}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoUpdateAccount;return ke._fromProtobufTransactions(new r({accountId:s.accountIDToUpdate!=null?ne._fromProtobuf(s.accountIDToUpdate):void 0,key:s.key!=null?rt._fromProtobufKey(s.key):void 0,receiverSignatureRequired:s.receiverSigRequired!=null?s.receiverSigRequired:void 0,proxyAccountId:s.proxyAccountID!=null?ne._fromProtobuf(s.proxyAccountID):void 0,autoRenewPeriod:s.autoRenewPeriod!=null&&s.autoRenewPeriod.seconds!=null?s.autoRenewPeriod.seconds:void 0,expirationTime:s.expirationTime!=null?lt._fromProtobuf(s.expirationTime):void 0,accountMemo:s.memo!=null&&s.memo.value!=null?s.memo.value:void 0,maxAutomaticTokenAssociations:s.maxAutomaticTokenAssociations!=null&&s.maxAutomaticTokenAssociations.value!=null?G8.default.fromNumber(s.maxAutomaticTokenAssociations.value):void 0,stakedAccountId:s.stakedAccountId!=null?ne._fromProtobuf(s.stakedAccountId):void 0,stakedNodeId:s.stakedNodeId!=null?s.stakedNodeId:void 0,declineStakingReward:s.declineReward!=null&&!!s.declineReward}),e,t,n,i,a)}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get key(){return this._key}setKey(e){return this._requireNotFrozen(),this._key=e,this}get receiverSignatureRequired(){return this._receiverSignatureRequired}setReceiverSignatureRequired(e){return this._requireNotFrozen(),this._receiverSignatureRequired=e,this}get proxyAccountId(){return this._proxyAccountId}setProxyAccountId(e){return this._requireNotFrozen(),this._proxyAccountId=e,this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof fr?e:new fr(e),this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof Date?lt.fromDate(e):e,this}get accountMemo(){return this._accountMemo}setAccountMemo(e){return this._requireNotFrozen(),this._accountMemo=e,this}clearAccountMemo(){return this._requireNotFrozen(),this._accountMemo=null,this}get maxAutomaticTokenAssociations(){return this._maxAutomaticTokenAssociations}setMaxAutomaticTokenAssociations(e){return this._requireNotFrozen(),this._maxAutomaticTokenAssociations=typeof e=="number"?G8.default.fromNumber(e):e,this}get aliasKey(){return null}setAliasKey(e){return this}get stakedAccountId(){return this._stakedAccountId}setStakedAccountId(e){return this._requireNotFrozen(),this._stakedAccountId=typeof e=="string"?ne.fromString(e):e,this}clearStakedAccountId(){return this._requireNotFrozen(),this._stakedAccountId=new ne(0,0,0),this}get stakedNodeId(){return this._stakedNodeId}setStakedNodeId(e){return this._requireNotFrozen(),this._stakedNodeId=G8.default.fromValue(e),this}clearStakedNodeId(){return this._requireNotFrozen(),this._stakedNodeId=G8.default.fromNumber(-1),this}get declineStakingRewards(){return this._declineStakingReward}setDeclineStakingReward(e){return this._requireNotFrozen(),this._declineStakingReward=e,this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e),this._proxyAccountId!=null&&this._proxyAccountId.validateChecksum(e)}_execute(e,t){return e.crypto.updateAccount(t)}_getTransactionDataCase(){return"cryptoUpdateAccount"}_makeTransactionData(){return{accountIDToUpdate:this._accountId!=null?this._accountId._toProtobuf():null,key:this._key!=null?this._key._toProtobufKey():null,expirationTime:this._expirationTime!=null?this._expirationTime._toProtobuf():null,proxyAccountID:this._proxyAccountId!=null?this._proxyAccountId._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod!=null?this._autoRenewPeriod._toProtobuf():null,receiverSigRequiredWrapper:this._receiverSignatureRequired==null?null:{value:this._receiverSignatureRequired},memo:this._accountMemo!=null?{value:this._accountMemo}:null,maxAutomaticTokenAssociations:this._maxAutomaticTokenAssociations!=null?{value:this._maxAutomaticTokenAssociations.toInt()}:null,stakedAccountId:this.stakedAccountId!=null?this.stakedAccountId._toProtobuf():null,stakedNodeId:this.stakedNodeId,declineReward:this.declineStakingRewards!=null?{value:this.declineStakingRewards}:null}}_getLogId(){return`AccountUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("cryptoUpdateAccount",W8._fromProtobuf);var Tm=class{constructor(e={}){this._left=null,e.left!=null&&this.setLeft(e.left),this._right=null,e.right!=null&&this.setRight(e.right)}get left(){return this._left}setLeft(e){return this._left=e,this}get right(){return this._right}setRight(e){return this._right=e,this}toString(){return this._left!=null&&this._right!=null?`${this._left.toString()}.${this._right.toString()}`:""}};var Q8=class r{constructor(e={}){this._network=null,e.network!=null&&this.setNetwork(e.network),this._host=null,e.host!=null&&this.setHost(e.host)}get newtork(){return this._network}setNetwork(e){return this._network=e,this}get host(){return this._host}setHost(e){return this._host=e,this}static _fromProtobuf(e){return new r({network:new Tm().setLeft(e[0]).setRight(e[1]),host:new Tm().setLeft(e[2]).setRight(e[3])})}_toProtobuf(){return Uint8Array.of(this._network!=null&&this._network._left!=null?this._network._left:0,this._network!=null&&this._network.right!=null?this._network.right:0,this._host!=null&&this._host.left!=null?this._host.left:0,this._host!=null&&this._host.right!=null?this._host.right:0)}toString(){return this._network!=null&&this._host!=null?`${this._network.toString()}.${this._host.toString()}`:""}};var $8=class r{constructor(e={}){this._address=null,e.address!=null&&this.setAddress(e.address),this._port=null,e.port!=null&&this.setPort(e.port)}get address(){return this.address}setAddress(e){return this._address=e,this}get port(){return this._port}setPort(e){return this._port=e,this}static _fromProtobuf(e){return new r({address:e.ipAddressV4!=null?Q8._fromProtobuf(e.ipAddressV4):void 0,port:e.port!=null?e.port:void 0})}_toProtobuf(){return{ipAddressV4:this._address!=null?this._address._toProtobuf():null,port:this._port}}toString(){return`${this._address!=null?this._address.toString():""}:${this._port!=null?this._port.toString():""}`}toJSON(){return{address:this._address!=null?this._address.toString():null,port:this._port!=null?this._port.toString():null}}};var f1=class r{constructor(e={}){this._publicKey=null,e.publicKey!=null&&this.setPublicKey(e.publicKey),this._nodeId=null,e.nodeId!=null&&this.setNodeId(e.nodeId),this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId),this._certHash=null,e.certHash!=null&&this.setCertHash(e.certHash),this._addresses=[],e.addresses!=null&&this.setAddresses(e.addresses),this._description=null,e.description!=null&&this.setDescription(e.description),this._stake=null,e.stake!=null&&this.setStake(e.stake)}get publicKey(){return this._publicKey}setPublicKey(e){return this._publicKey=e,this}get nodeId(){return this._nodeId}setNodeId(e){return this._nodeId=e,this}get accountId(){return this._accountId}setAccountId(e){return this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get certHash(){return this._certHash}setCertHash(e){return this._certHash=e,this}get addresses(){return this._addresses}setAddresses(e){return this._addresses=e,this}get description(){return this._description}setDescription(e){return this._description=e,this}get stake(){return this._stake}setStake(e){return this._stake=e,this}static _fromProtobuf(e){return new r({publicKey:e.RSA_PubKey!=null?e.RSA_PubKey:void 0,nodeId:e.nodeId!=null?e.nodeId:void 0,accountId:e.nodeAccountId!=null?ne._fromProtobuf(e.nodeAccountId):void 0,certHash:e.nodeCertHash!=null?e.nodeCertHash:void 0,addresses:e.serviceEndpoint!=null?e.serviceEndpoint.map(t=>$8._fromProtobuf(t)):void 0,description:e.description!=null?e.description:void 0,stake:e.stake!=null?e.stake:void 0})}_toProtobuf(){return{RSA_PubKey:this._publicKey,nodeId:this._nodeId,nodeAccountId:this._accountId!=null?this._accountId._toProtobuf():null,nodeCertHash:this._certHash,serviceEndpoint:this._addresses.map(e=>e._toProtobuf()),description:this._description,stake:this._stake}}toString(){return JSON.stringify(this.toJSON())}toJSON(){return{publicKey:this._publicKey,nodeId:this._nodeId!=null?this._nodeId.toString():null,accountId:this._accountId!=null?this._accountId.toString():null,certHash:this._certHash!=null?y8(this._certHash):null,addresses:this._addresses.map(e=>e.toJSON()),description:this._description,stake:this._stake!=null?this._stake.toString():null}}};var MB=Ie(vr(),1),i3=class r{constructor(e={}){this._nodeAddresses=[],e.nodeAddresses!=null&&this.setNodeAddresses(e.nodeAddresses)}get nodeAddresses(){return this._nodeAddresses}setNodeAddresses(e){return this._nodeAddresses=e,this}static fromBytes(e){return r._fromProtobuf(MB.proto.NodeAddressBook.decode(e))}static _fromProtobuf(e){return new r({nodeAddresses:e.nodeAddress!=null?e.nodeAddress.map(t=>f1._fromProtobuf(t)):void 0})}_toProtobuf(){return{nodeAddress:this._nodeAddresses.map(e=>e._toProtobuf())}}toString(){return JSON.stringify(this.toJSON())}toJSON(){return{nodeAddresses:this._nodeAddresses.map(e=>e.toJSON())}}toBytes(){return MB.proto.NodeAddressBook.encode(this._toProtobuf()).finish()}};var Lx=Ie(vr(),1);var Y8=class extends xr{constructor(e={}){super(),this._fileId=null,e.fileId!=null&&this.setFileId(e.fileId),this._limit=null,e.limit!=null&&this.setLimit(e.limit),this._retryHandler=t=>{if(t!=null){if(t instanceof Error)return!0;switch(t.code){case 13:return HE.test(t.details.toString());case 5:case 8:case 14:case 17:return!0;default:return!1}}return!1},this._addresses=[],this._attempt=0}get fileId(){return this._fileId}setFileId(e){return this._fileId=typeof e=="string"?zt.fromString(e):e.clone(),this}get limit(){return this._limit}setLimit(e){return this._limit=e,this}setMaxAttempts(e){return this._maxAttempts=e,this}setMaxBackoff(e){return this._maxBackoff=e,this}execute(e,t){return new Promise((n,i)=>{this._makeServerStreamRequest(e,n,i,t)})}_makeServerStreamRequest(e,t,n,i){let a=Lx.com.hedera.mirror.api.proto.AddressBookQuery.encode({fileId:this._fileId!=null?this._fileId._toProtobuf():null,limit:this._limit}).finish();e._mirrorNetwork.getNextMirrorNode().getChannel().makeServerStreamRequest("NetworkService","getNodes",a,o=>{this._addresses.push(f1._fromProtobuf(Lx.proto.NodeAddress.decode(o))),this._limit!=null&&this._limit>0&&(this._limit=this._limit-1)},o=>{let s=o instanceof Error?o.message:o.details;if(this._attempt<this._maxAttempts&&!e.isClientShutDown&&this._retryHandler(o)){let c=Math.min(250*2**this._attempt,this._maxBackoff);this._attempt>=this._maxAttempts&&console.warn(`Error getting nodes from mirror for file ${this._fileId!=null?this._fileId.toString():"UNKNOWN"} during attempt ${this._attempt}. Waiting ${c} ms before next attempt: ${s}`),this._logger&&this._logger.debug(`Error getting nodes from mirror for file ${this._fileId!=null?this._fileId.toString():"UNKNOWN"} during attempt ${this._attempt}. Waiting ${c} ms before next attempt: ${s}`),this._attempt+=1,setTimeout(()=>{this._makeServerStreamRequest(e,t,n,i)},c)}else n(new Error("failed to query address book"))},()=>{t(new i3({nodeAddresses:this._addresses}))})}};ir.setAddressBookQueryConstructor(()=>new Y8);var J8=class r extends xr{constructor(e={}){super(),this._contractId=null,e.contractId!=null&&this.setContractId(e.contractId)}static _fromProtobuf(e){let t=e.contractGetBytecode;return new r({contractId:t.contractID!=null?_t._fromProtobuf(t.contractID):void 0})}get contractId(){return this._contractId}setContractId(e){return this._contractId=typeof e=="string"?_t.fromString(e):e.clone(),this}_validateChecksums(e){this._contractId!=null&&this._contractId.validateChecksum(e)}_execute(e,t){return e.smartContract.contractGetBytecode(t)}_mapResponseHeader(e){return e.contractGetBytecodeResponse.header}_mapResponse(e){let t=e.contractGetBytecodeResponse;return Promise.resolve(t.bytecode!=null?t.bytecode:new Uint8Array)}_onMakeRequest(e){return{contractGetBytecode:{header:e,contractID:this._contractId!=null?this._contractId._toProtobuf():null}}}_getLogId(){return`ContractByteCodeQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("contractGetBytecode",J8._fromProtobuf);var Df="0123456789abcdef".split(""),$ze=[1,256,65536,16777216],sl=[0,8,16,24],R3e=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],Yze=r=>({blocks:[],reset:!0,block:0,start:0,blockCount:1600-(r<<1)>>5,outputBlocks:r>>5,s:(e=>[].concat(e,e,e,e,e))([0,0,0,0,0,0,0,0,0,0])}),Jze=(r,e)=>{for(var t=e.length,n=r.blocks,i=r.blockCount<<2,a=r.blockCount,o=r.outputBlocks,s=r.s,c=0,l,u;c<t;){if(r.reset)for(r.reset=!1,n[0]=r.block,l=1;l<a+1;++l)n[l]=0;if(typeof e!="string")for(l=r.start;c<t&&l<i;++c)n[l>>2]|=e[c]<<sl[l++&3];else for(l=r.start;c<t&&l<i;++c)u=e.charCodeAt(c),u<128?n[l>>2]|=u<<sl[l++&3]:u<2048?(n[l>>2]|=(192|u>>6)<<sl[l++&3],n[l>>2]|=(128|u&63)<<sl[l++&3]):u<55296||u>=57344?(n[l>>2]|=(224|u>>12)<<sl[l++&3],n[l>>2]|=(128|u>>6&63)<<sl[l++&3],n[l>>2]|=(128|u&63)<<sl[l++&3]):(u=65536+((u&1023)<<10|e.charCodeAt(++c)&1023),n[l>>2]|=(240|u>>18)<<sl[l++&3],n[l>>2]|=(128|u>>12&63)<<sl[l++&3],n[l>>2]|=(128|u>>6&63)<<sl[l++&3],n[l>>2]|=(128|u&63)<<sl[l++&3]);if(r.lastByteIndex=l,l>=i){for(r.start=l-i,r.block=n[a],l=0;l<a;++l)s[l]^=n[l];LB(s),r.reset=!0}else r.start=l}if(l=r.lastByteIndex,n[l>>2]|=$ze[l&3],r.lastByteIndex===i)for(n[0]=n[a],l=1;l<a+1;++l)n[l]=0;for(n[a-1]|=2147483648,l=0;l<a;++l)s[l]^=n[l];LB(s);var d="",h,g=0;for(l=0;g<o;){for(l=0;l<a&&g<o;++l,++g)h=s[l],d+=Df[h>>4&15]+Df[h&15]+Df[h>>12&15]+Df[h>>8&15]+Df[h>>20&15]+Df[h>>16&15]+Df[h>>28&15]+Df[h>>24&15];g%a===0&&(LB(s),l=0)}return"0x"+d},LB=r=>{var e,t,n,i,a,o,s,c,l,u,d,h,g,m,b,E,I,R,L,U,V,G,H,N,F,O,y,x,w,p,v,A,T,S,_,B,q,k,z,ie,M,te,oe,se,re,le,ae,ue,_e,he,be,pn,it,ht,Gn,Et,Tt,yi,At,St,ci,It,Ct;for(n=0;n<48;n+=2)i=r[0]^r[10]^r[20]^r[30]^r[40],a=r[1]^r[11]^r[21]^r[31]^r[41],o=r[2]^r[12]^r[22]^r[32]^r[42],s=r[3]^r[13]^r[23]^r[33]^r[43],c=r[4]^r[14]^r[24]^r[34]^r[44],l=r[5]^r[15]^r[25]^r[35]^r[45],u=r[6]^r[16]^r[26]^r[36]^r[46],d=r[7]^r[17]^r[27]^r[37]^r[47],h=r[8]^r[18]^r[28]^r[38]^r[48],g=r[9]^r[19]^r[29]^r[39]^r[49],e=h^(o<<1|s>>>31),t=g^(s<<1|o>>>31),r[0]^=e,r[1]^=t,r[10]^=e,r[11]^=t,r[20]^=e,r[21]^=t,r[30]^=e,r[31]^=t,r[40]^=e,r[41]^=t,e=i^(c<<1|l>>>31),t=a^(l<<1|c>>>31),r[2]^=e,r[3]^=t,r[12]^=e,r[13]^=t,r[22]^=e,r[23]^=t,r[32]^=e,r[33]^=t,r[42]^=e,r[43]^=t,e=o^(u<<1|d>>>31),t=s^(d<<1|u>>>31),r[4]^=e,r[5]^=t,r[14]^=e,r[15]^=t,r[24]^=e,r[25]^=t,r[34]^=e,r[35]^=t,r[44]^=e,r[45]^=t,e=c^(h<<1|g>>>31),t=l^(g<<1|h>>>31),r[6]^=e,r[7]^=t,r[16]^=e,r[17]^=t,r[26]^=e,r[27]^=t,r[36]^=e,r[37]^=t,r[46]^=e,r[47]^=t,e=u^(i<<1|a>>>31),t=d^(a<<1|i>>>31),r[8]^=e,r[9]^=t,r[18]^=e,r[19]^=t,r[28]^=e,r[29]^=t,r[38]^=e,r[39]^=t,r[48]^=e,r[49]^=t,m=r[0],b=r[1],le=r[11]<<4|r[10]>>>28,ae=r[10]<<4|r[11]>>>28,x=r[20]<<3|r[21]>>>29,w=r[21]<<3|r[20]>>>29,St=r[31]<<9|r[30]>>>23,ci=r[30]<<9|r[31]>>>23,te=r[40]<<18|r[41]>>>14,oe=r[41]<<18|r[40]>>>14,S=r[2]<<1|r[3]>>>31,_=r[3]<<1|r[2]>>>31,E=r[13]<<12|r[12]>>>20,I=r[12]<<12|r[13]>>>20,ue=r[22]<<10|r[23]>>>22,_e=r[23]<<10|r[22]>>>22,p=r[33]<<13|r[32]>>>19,v=r[32]<<13|r[33]>>>19,It=r[42]<<2|r[43]>>>30,Ct=r[43]<<2|r[42]>>>30,ht=r[5]<<30|r[4]>>>2,Gn=r[4]<<30|r[5]>>>2,B=r[14]<<6|r[15]>>>26,q=r[15]<<6|r[14]>>>26,R=r[25]<<11|r[24]>>>21,L=r[24]<<11|r[25]>>>21,he=r[34]<<15|r[35]>>>17,be=r[35]<<15|r[34]>>>17,A=r[45]<<29|r[44]>>>3,T=r[44]<<29|r[45]>>>3,N=r[6]<<28|r[7]>>>4,F=r[7]<<28|r[6]>>>4,Et=r[17]<<23|r[16]>>>9,Tt=r[16]<<23|r[17]>>>9,k=r[26]<<25|r[27]>>>7,z=r[27]<<25|r[26]>>>7,U=r[36]<<21|r[37]>>>11,V=r[37]<<21|r[36]>>>11,pn=r[47]<<24|r[46]>>>8,it=r[46]<<24|r[47]>>>8,se=r[8]<<27|r[9]>>>5,re=r[9]<<27|r[8]>>>5,O=r[18]<<20|r[19]>>>12,y=r[19]<<20|r[18]>>>12,yi=r[29]<<7|r[28]>>>25,At=r[28]<<7|r[29]>>>25,ie=r[38]<<8|r[39]>>>24,M=r[39]<<8|r[38]>>>24,G=r[48]<<14|r[49]>>>18,H=r[49]<<14|r[48]>>>18,r[0]=m^~E&R,r[1]=b^~I&L,r[10]=N^~O&x,r[11]=F^~y&w,r[20]=S^~B&k,r[21]=_^~q&z,r[30]=se^~le&ue,r[31]=re^~ae&_e,r[40]=ht^~Et&yi,r[41]=Gn^~Tt&At,r[2]=E^~R&U,r[3]=I^~L&V,r[12]=O^~x&p,r[13]=y^~w&v,r[22]=B^~k&ie,r[23]=q^~z&M,r[32]=le^~ue&he,r[33]=ae^~_e&be,r[42]=Et^~yi&St,r[43]=Tt^~At&ci,r[4]=R^~U&G,r[5]=L^~V&H,r[14]=x^~p&A,r[15]=w^~v&T,r[24]=k^~ie&te,r[25]=z^~M&oe,r[34]=ue^~he&pn,r[35]=_e^~be&it,r[44]=yi^~St&It,r[45]=At^~ci&Ct,r[6]=U^~G&m,r[7]=V^~H&b,r[16]=p^~A&N,r[17]=v^~T&F,r[26]=ie^~te&S,r[27]=M^~oe&_,r[36]=he^~pn&se,r[37]=be^~it&re,r[46]=St^~It&ht,r[47]=ci^~Ct&Gn,r[8]=G^~m&E,r[9]=H^~b&I,r[18]=A^~N&O,r[19]=T^~F&y,r[28]=te^~S&B,r[29]=oe^~_&q,r[38]=pn^~se&le,r[39]=it^~re&ae,r[48]=It^~ht&Et,r[49]=Ct^~Gn&Tt,r[0]^=R3e[n],r[1]^=R3e[n+1]},Zze=r=>e=>{var t;if(e.slice(0,2)==="0x"){t=[];for(var n=2,i=e.length;n<i;n+=2)t.push(parseInt(e.slice(n,n+2),16))}else t=e;return Jze(Yze(r),t)},O3e=Zze(256);var Q={uint8:0,int8:1,uint16:2,int16:3,uint24:4,int24:5,uint32:6,int32:7,uint40:8,int40:9,uint48:10,int48:11,uint56:12,int56:13,uint64:14,int64:15,uint72:16,int72:17,uint80:18,int80:19,uint88:20,int88:21,uint96:22,int96:23,uint104:24,int104:25,uint112:26,int112:27,uint120:28,int120:29,uint128:30,int128:31,uint136:32,int136:33,uint144:34,int144:35,uint152:36,int152:37,uint160:38,int160:39,uint168:40,int168:41,uint176:42,int176:43,uint184:44,int184:45,uint192:46,int192:47,uint200:48,int200:49,uint208:50,int208:51,uint216:52,int216:53,uint224:54,int224:55,uint232:56,int232:57,uint240:58,int240:59,uint248:60,int248:61,uint256:62,int256:63,string:64,bool:65,bytes:66,bytes32:67,address:68,func:69},Sm=class{constructor(e){this.name=null,this._params="",this._paramTypes=[],e!=null&&(this._name=e)}addString(){return this._addParam({ty:Q.string,array:!1})}addStringArray(){return this._addParam({ty:Q.string,array:!0})}addBytes(){return this._addParam({ty:Q.bytes,array:!1})}addBytes32(){return this._addParam({ty:Q.bytes32,array:!1})}addBytesArray(){return this._addParam({ty:Q.bytes,array:!0})}addBytes32Array(){return this._addParam({ty:Q.bytes32,array:!0})}addInt8(){return this._addParam({ty:Q.int8,array:!1})}addUint8(){return this._addParam({ty:Q.uint8,array:!1})}addInt16(){return this._addParam({ty:Q.int16,array:!1})}addUint16(){return this._addParam({ty:Q.uint16,array:!1})}addInt24(){return this._addParam({ty:Q.int24,array:!1})}addUint24(){return this._addParam({ty:Q.uint24,array:!1})}addInt32(){return this._addParam({ty:Q.int32,array:!1})}addUint32(){return this._addParam({ty:Q.uint32,array:!1})}addInt40(){return this._addParam({ty:Q.int40,array:!1})}addUint40(){return this._addParam({ty:Q.uint40,array:!1})}addInt48(){return this._addParam({ty:Q.int48,array:!1})}addUint48(){return this._addParam({ty:Q.uint48,array:!1})}addInt56(){return this._addParam({ty:Q.int56,array:!1})}addUint56(){return this._addParam({ty:Q.uint56,array:!1})}addInt64(){return this._addParam({ty:Q.int64,array:!1})}addUint64(){return this._addParam({ty:Q.uint64,array:!1})}addInt72(){return this._addParam({ty:Q.int72,array:!1})}addUint72(){return this._addParam({ty:Q.uint72,array:!1})}addInt80(){return this._addParam({ty:Q.int80,array:!1})}addUint80(){return this._addParam({ty:Q.uint80,array:!1})}addInt88(){return this._addParam({ty:Q.int88,array:!1})}addUint88(){return this._addParam({ty:Q.uint88,array:!1})}addInt96(){return this._addParam({ty:Q.int96,array:!1})}addUint96(){return this._addParam({ty:Q.uint96,array:!1})}addInt104(){return this._addParam({ty:Q.int104,array:!1})}addUint104(){return this._addParam({ty:Q.uint104,array:!1})}addInt112(){return this._addParam({ty:Q.int112,array:!1})}addUint112(){return this._addParam({ty:Q.uint112,array:!1})}addInt120(){return this._addParam({ty:Q.int120,array:!1})}addUint120(){return this._addParam({ty:Q.uint120,array:!1})}addInt128(){return this._addParam({ty:Q.int128,array:!1})}addUint128(){return this._addParam({ty:Q.uint128,array:!1})}addInt136(){return this._addParam({ty:Q.int136,array:!1})}addUint136(){return this._addParam({ty:Q.uint136,array:!1})}addInt144(){return this._addParam({ty:Q.int144,array:!1})}addUint144(){return this._addParam({ty:Q.uint144,array:!1})}addInt152(){return this._addParam({ty:Q.int152,array:!1})}addUint152(){return this._addParam({ty:Q.uint152,array:!1})}addInt160(){return this._addParam({ty:Q.int160,array:!1})}addUint160(){return this._addParam({ty:Q.uint160,array:!1})}addInt168(){return this._addParam({ty:Q.int168,array:!1})}addUint168(){return this._addParam({ty:Q.uint168,array:!1})}addInt176(){return this._addParam({ty:Q.int176,array:!1})}addUint176(){return this._addParam({ty:Q.uint176,array:!1})}addInt184(){return this._addParam({ty:Q.int184,array:!1})}addUint184(){return this._addParam({ty:Q.uint184,array:!1})}addInt192(){return this._addParam({ty:Q.int192,array:!1})}addUint192(){return this._addParam({ty:Q.uint192,array:!1})}addInt200(){return this._addParam({ty:Q.int200,array:!1})}addUint200(){return this._addParam({ty:Q.uint200,array:!1})}addInt208(){return this._addParam({ty:Q.int208,array:!1})}addUint208(){return this._addParam({ty:Q.uint208,array:!1})}addInt216(){return this._addParam({ty:Q.int216,array:!1})}addUint216(){return this._addParam({ty:Q.uint216,array:!1})}addInt224(){return this._addParam({ty:Q.int224,array:!1})}addUint224(){return this._addParam({ty:Q.uint224,array:!1})}addInt232(){return this._addParam({ty:Q.int232,array:!1})}addUint232(){return this._addParam({ty:Q.uint232,array:!1})}addInt240(){return this._addParam({ty:Q.int240,array:!1})}addUint240(){return this._addParam({ty:Q.uint240,array:!1})}addInt248(){return this._addParam({ty:Q.int248,array:!1})}addUint248(){return this._addParam({ty:Q.uint248,array:!1})}addInt256(){return this._addParam({ty:Q.int256,array:!1})}addUint256(){return this._addParam({ty:Q.uint256,array:!1})}addInt8Array(){return this._addParam({ty:Q.int8,array:!0})}addUint8Array(){return this._addParam({ty:Q.uint8,array:!0})}addInt16Array(){return this._addParam({ty:Q.int16,array:!0})}addUint16Array(){return this._addParam({ty:Q.uint16,array:!0})}addInt24Array(){return this._addParam({ty:Q.int24,array:!0})}addUint24Array(){return this._addParam({ty:Q.uint24,array:!0})}addInt32Array(){return this._addParam({ty:Q.int32,array:!0})}addUint32Array(){return this._addParam({ty:Q.uint32,array:!0})}addInt40Array(){return this._addParam({ty:Q.int40,array:!0})}addUint40Array(){return this._addParam({ty:Q.uint40,array:!0})}addInt48Array(){return this._addParam({ty:Q.int48,array:!0})}addUint48Array(){return this._addParam({ty:Q.uint48,array:!0})}addInt56Array(){return this._addParam({ty:Q.int56,array:!0})}addUint56Array(){return this._addParam({ty:Q.uint56,array:!0})}addInt64Array(){return this._addParam({ty:Q.int64,array:!0})}addUint64Array(){return this._addParam({ty:Q.uint64,array:!0})}addInt72Array(){return this._addParam({ty:Q.int72,array:!0})}addUint72Array(){return this._addParam({ty:Q.uint72,array:!0})}addInt80Array(){return this._addParam({ty:Q.int80,array:!0})}addUint80Array(){return this._addParam({ty:Q.uint80,array:!0})}addInt88Array(){return this._addParam({ty:Q.int88,array:!0})}addUint88Array(){return this._addParam({ty:Q.uint88,array:!0})}addInt96Array(){return this._addParam({ty:Q.int96,array:!0})}addUint96Array(){return this._addParam({ty:Q.uint96,array:!0})}addInt104Array(){return this._addParam({ty:Q.int104,array:!0})}addUint104Array(){return this._addParam({ty:Q.uint104,array:!0})}addInt112Array(){return this._addParam({ty:Q.int112,array:!0})}addUint112Array(){return this._addParam({ty:Q.uint112,array:!0})}addInt120Array(){return this._addParam({ty:Q.int120,array:!0})}addUint120Array(){return this._addParam({ty:Q.uint120,array:!0})}addInt128Array(){return this._addParam({ty:Q.int128,array:!0})}addUint128Array(){return this._addParam({ty:Q.uint128,array:!0})}addInt136Array(){return this._addParam({ty:Q.int136,array:!0})}addUint136Array(){return this._addParam({ty:Q.uint136,array:!0})}addInt144Array(){return this._addParam({ty:Q.int144,array:!0})}addUint144Array(){return this._addParam({ty:Q.uint144,array:!0})}addInt152Array(){return this._addParam({ty:Q.int152,array:!0})}addUint152Array(){return this._addParam({ty:Q.uint152,array:!0})}addInt160Array(){return this._addParam({ty:Q.int160,array:!0})}addUint160Array(){return this._addParam({ty:Q.uint160,array:!0})}addInt168Array(){return this._addParam({ty:Q.int168,array:!0})}addUint168Array(){return this._addParam({ty:Q.uint168,array:!0})}addInt176Array(){return this._addParam({ty:Q.int176,array:!0})}addUint176Array(){return this._addParam({ty:Q.uint176,array:!0})}addInt184Array(){return this._addParam({ty:Q.int184,array:!0})}addUint184Array(){return this._addParam({ty:Q.uint184,array:!0})}addInt192Array(){return this._addParam({ty:Q.int192,array:!0})}addUint192Array(){return this._addParam({ty:Q.uint192,array:!0})}addInt200Array(){return this._addParam({ty:Q.int200,array:!0})}addUint200Array(){return this._addParam({ty:Q.uint200,array:!0})}addInt208Array(){return this._addParam({ty:Q.int208,array:!0})}addUint208Array(){return this._addParam({ty:Q.uint208,array:!0})}addInt216Array(){return this._addParam({ty:Q.int216,array:!0})}addUint216Array(){return this._addParam({ty:Q.uint216,array:!0})}addInt224Array(){return this._addParam({ty:Q.int224,array:!0})}addUint224Array(){return this._addParam({ty:Q.uint224,array:!0})}addInt232Array(){return this._addParam({ty:Q.int232,array:!0})}addUint232Array(){return this._addParam({ty:Q.uint232,array:!0})}addInt240Array(){return this._addParam({ty:Q.int240,array:!0})}addUint240Array(){return this._addParam({ty:Q.uint240,array:!0})}addInt248Array(){return this._addParam({ty:Q.int248,array:!0})}addUint248Array(){return this._addParam({ty:Q.uint248,array:!0})}addInt256Array(){return this._addParam({ty:Q.int256,array:!0})}addUint256Array(){return this._addParam({ty:Q.uint256,array:!0})}addBool(){return this._addParam({ty:Q.bool,array:!1})}addAddress(){return this._addParam({ty:Q.address,array:!1})}addAddressArray(){return this._addParam({ty:Q.address,array:!0})}addFunction(){return this._addParam({ty:Q.func,array:!1})}_addParam(e){return this._paramTypes.length>0&&(this._params+=","),this._params+=FB(e),this._paramTypes.push(e),this}_build(e){if(e!=null)this._name=e;else if(this._name==null)throw new Error("`name` required for ContractFunctionSelector");let t=He(n3(this.toString()));return et(O3e(`0x${t}`)).slice(0,4)}toString(){return`${this._name!=null?this._name.toString():""}(${this._params})`}};function FB(r){let e="";switch(r.ty){case Q.uint8:e="uint8";break;case Q.int8:e="int8";break;case Q.uint16:e="uint16";break;case Q.int16:e="int16";break;case Q.uint24:e="uint24";break;case Q.int24:e="int24";break;case Q.uint32:e="uint32";break;case Q.int32:e="int32";break;case Q.uint40:e="uint40";break;case Q.int40:e="int40";break;case Q.uint48:e="uint48";break;case Q.int48:e="int48";break;case Q.uint56:e="uint56";break;case Q.int56:e="int56";break;case Q.uint64:e="uint64";break;case Q.int64:e="int64";break;case Q.uint72:e="uint72";break;case Q.int72:e="int72";break;case Q.uint80:e="uint80";break;case Q.int80:e="int80";break;case Q.uint88:e="uint88";break;case Q.int88:e="int88";break;case Q.uint96:e="uint96";break;case Q.int96:e="int96";break;case Q.uint104:e="uint104";break;case Q.int104:e="int104";break;case Q.uint112:e="uint112";break;case Q.int112:e="int112";break;case Q.uint120:e="uint120";break;case Q.int120:e="int120";break;case Q.uint128:e="uint128";break;case Q.int128:e="int128";break;case Q.uint136:e="uint136";break;case Q.int136:e="int136";break;case Q.uint144:e="uint144";break;case Q.int144:e="int144";break;case Q.uint152:e="uint152";break;case Q.int152:e="int152";break;case Q.uint160:e="uint160";break;case Q.int160:e="int160";break;case Q.uint168:e="uint168";break;case Q.int168:e="int168";break;case Q.uint176:e="uint176";break;case Q.int176:e="int176";break;case Q.uint184:e="uint184";break;case Q.int184:e="int184";break;case Q.uint192:e="uint192";break;case Q.int192:e="int192";break;case Q.uint200:e="uint200";break;case Q.int200:e="int200";break;case Q.uint208:e="uint208";break;case Q.int208:e="int208";break;case Q.uint216:e="uint216";break;case Q.int216:e="int216";break;case Q.uint224:e="uint224";break;case Q.int224:e="int224";break;case Q.uint232:e="uint232";break;case Q.int232:e="int232";break;case Q.uint240:e="uint240";break;case Q.int240:e="int240";break;case Q.uint248:e="uint248";break;case Q.int248:e="int248";break;case Q.uint256:e="uint256";break;case Q.int256:e="int256";break;case Q.string:e="string";break;case Q.bool:e="bool";break;case Q.bytes:e="bytes";break;case Q.bytes32:e="bytes32";break;case Q.address:e="address";break;case Q.func:e="function";break;default:e="";break}return r.array&&(e+="[]"),e}var D3e=Ie(AB(),1),P3e=Ie(ra(),1);var Au=class{constructor(){this._selector=new Sm,this._arguments=[]}addString(e){return this._selector.addString(),this._addParam(e,!0)}addStringArray(e){return this._selector.addStringArray(),this._addParam(e,!0)}addBytes(e){return this._selector.addBytes(),this._addParam(e,!0)}addBytes32(e){if(e.length!==32)throw new Error(`addBytes32 expected array to be of length 32, but received ${e.length}`);return this._selector.addBytes32(),this._addParam(e,!1)}addBytesArray(e){return this._selector.addBytesArray(),this._addParam(e,!0)}addBytes32Array(e){for(let[t,n]of e.entries())if(n.length!==32)throw new Error(`addBytes32 expected array to be of length 32, but received ${n.length}`);return this._selector.addBytes32Array(),this._addParam(e,!0)}addBool(e){return this._selector.addBool(),this._addParam(e,!1)}addInt8(e){return this._selector.addInt8(),this._addParam(yt(e),!1)}addUint8(e){return this._selector.addUint8(),this._addParam(yt(e),!1)}addInt16(e){return this._selector.addInt16(),this._addParam(yt(e),!1)}addUint16(e){return this._selector.addUint16(),this._addParam(yt(e),!1)}addInt24(e){return this._selector.addInt24(),this._addParam(yt(e),!1)}addUint24(e){return this._selector.addUint24(),this._addParam(yt(e),!1)}addInt32(e){return this._selector.addInt32(),this._addParam(yt(e),!1)}addUint32(e){return this._selector.addUint32(),this._addParam(yt(e),!1)}addInt40(e){return this._selector.addInt40(),this._addParam(yt(e),!1)}addUint40(e){return this._selector.addUint40(),this._addParam(yt(e),!1)}addInt48(e){return this._selector.addInt48(),this._addParam(yt(e),!1)}addUint48(e){return this._selector.addUint48(),this._addParam(yt(e),!1)}addInt56(e){return this._selector.addInt56(),this._addParam(yt(e),!1)}addUint56(e){return this._selector.addUint56(),this._addParam(yt(e),!1)}addInt64(e){return this._selector.addInt64(),this._addParam(yt(e),!1)}addUint64(e){return this._selector.addUint64(),this._addParam(yt(e),!1)}addInt72(e){return this._selector.addInt72(),this._addParam(yt(e),!1)}addUint72(e){return this._selector.addUint72(),this._addParam(yt(e),!1)}addInt80(e){return this._selector.addInt80(),this._addParam(yt(e),!1)}addUint80(e){return this._selector.addUint80(),this._addParam(yt(e),!1)}addInt88(e){return this._selector.addInt88(),this._addParam(yt(e),!1)}addUint88(e){return this._selector.addUint88(),this._addParam(yt(e),!1)}addInt96(e){return this._selector.addInt96(),this._addParam(yt(e),!1)}addUint96(e){return this._selector.addUint96(),this._addParam(yt(e),!1)}addInt104(e){return this._selector.addInt104(),this._addParam(yt(e),!1)}addUint104(e){return this._selector.addUint104(),this._addParam(yt(e),!1)}addInt112(e){return this._selector.addInt112(),this._addParam(yt(e),!1)}addUint112(e){return this._selector.addUint112(),this._addParam(yt(e),!1)}addInt120(e){return this._selector.addInt120(),this._addParam(yt(e),!1)}addUint120(e){return this._selector.addUint120(),this._addParam(yt(e),!1)}addInt128(e){return this._selector.addInt128(),this._addParam(yt(e),!1)}addUint128(e){return this._selector.addUint128(),this._addParam(yt(e),!1)}addInt136(e){return this._selector.addInt136(),this._addParam(yt(e),!1)}addUint136(e){return this._selector.addUint136(),this._addParam(yt(e),!1)}addInt144(e){return this._selector.addInt144(),this._addParam(yt(e),!1)}addUint144(e){return this._selector.addUint144(),this._addParam(yt(e),!1)}addInt152(e){return this._selector.addInt152(),this._addParam(yt(e),!1)}addUint152(e){return this._selector.addUint152(),this._addParam(yt(e),!1)}addInt160(e){return this._selector.addInt160(),this._addParam(yt(e),!1)}addUint160(e){return this._selector.addUint160(),this._addParam(yt(e),!1)}addInt168(e){return this._selector.addInt168(),this._addParam(yt(e),!1)}addUint168(e){return this._selector.addUint168(),this._addParam(yt(e),!1)}addInt176(e){return this._selector.addInt176(),this._addParam(yt(e),!1)}addUint176(e){return this._selector.addUint176(),this._addParam(yt(e),!1)}addInt184(e){return this._selector.addInt184(),this._addParam(yt(e),!1)}addUint184(e){return this._selector.addUint184(),this._addParam(yt(e),!1)}addInt192(e){return this._selector.addInt192(),this._addParam(yt(e),!1)}addUint192(e){return this._selector.addUint192(),this._addParam(yt(e),!1)}addInt200(e){return this._selector.addInt200(),this._addParam(yt(e),!1)}addUint200(e){return this._selector.addUint200(),this._addParam(yt(e),!1)}addInt208(e){return this._selector.addInt208(),this._addParam(yt(e),!1)}addUint208(e){return this._selector.addUint208(),this._addParam(yt(e),!1)}addInt216(e){return this._selector.addInt216(),this._addParam(yt(e),!1)}addUint216(e){return this._selector.addUint216(),this._addParam(yt(e),!1)}addInt224(e){return this._selector.addInt224(),this._addParam(yt(e),!1)}addUint224(e){return this._selector.addUint224(),this._addParam(yt(e),!1)}addInt232(e){return this._selector.addInt232(),this._addParam(yt(e),!1)}addUint232(e){return this._selector.addUint232(),this._addParam(yt(e),!1)}addInt240(e){return this._selector.addInt240(),this._addParam(yt(e),!1)}addUint240(e){return this._selector.addUint240(),this._addParam(yt(e),!1)}addInt248(e){return this._selector.addInt248(),this._addParam(yt(e),!1)}addUint248(e){return this._selector.addUint248(),this._addParam(yt(e),!1)}addInt256(e){return this._selector.addInt256(),this._addParam(yt(e),!1)}addUint256(e){return this._selector.addUint256(),this._addParam(yt(e),!1)}addInt8Array(e){return this._selector.addInt8Array(),this._addParam(bt(e),!0)}addUint8Array(e){return this._selector.addUint8Array(),this._addParam(bt(e),!0)}addInt16Array(e){return this._selector.addInt16Array(),this._addParam(bt(e),!0)}addUint16Array(e){return this._selector.addUint16Array(),this._addParam(bt(e),!0)}addInt24Array(e){return this._selector.addInt24Array(),this._addParam(bt(e),!0)}addUint24Array(e){return this._selector.addUint24Array(),this._addParam(bt(e),!0)}addInt32Array(e){return this._selector.addInt32Array(),this._addParam(bt(e),!0)}addUint32Array(e){return this._selector.addUint32Array(),this._addParam(bt(e),!0)}addInt40Array(e){return this._selector.addInt40Array(),this._addParam(bt(e),!0)}addUint40Array(e){return this._selector.addUint40Array(),this._addParam(bt(e),!0)}addInt48Array(e){return this._selector.addInt48Array(),this._addParam(bt(e),!0)}addUint48Array(e){return this._selector.addUint48Array(),this._addParam(bt(e),!0)}addInt56Array(e){return this._selector.addInt56Array(),this._addParam(bt(e),!0)}addUint56Array(e){return this._selector.addUint56Array(),this._addParam(bt(e),!0)}addInt64Array(e){return this._selector.addInt64Array(),this._addParam(bt(e),!0)}addUint64Array(e){return this._selector.addUint64Array(),this._addParam(bt(e),!0)}addInt72Array(e){return this._selector.addInt72Array(),this._addParam(bt(e),!0)}addUint72Array(e){return this._selector.addUint72Array(),this._addParam(bt(e),!0)}addInt80Array(e){return this._selector.addInt80Array(),this._addParam(bt(e),!0)}addUint80Array(e){return this._selector.addUint80Array(),this._addParam(bt(e),!0)}addInt88Array(e){return this._selector.addInt88Array(),this._addParam(bt(e),!0)}addUint88Array(e){return this._selector.addUint88Array(),this._addParam(bt(e),!0)}addInt96Array(e){return this._selector.addInt96Array(),this._addParam(bt(e),!0)}addUint96Array(e){return this._selector.addUint96Array(),this._addParam(bt(e),!0)}addInt104Array(e){return this._selector.addInt104Array(),this._addParam(bt(e),!0)}addUint104Array(e){return this._selector.addUint104Array(),this._addParam(bt(e),!0)}addInt112Array(e){return this._selector.addInt112Array(),this._addParam(bt(e),!0)}addUint112Array(e){return this._selector.addUint112Array(),this._addParam(bt(e),!0)}addInt120Array(e){return this._selector.addInt120Array(),this._addParam(bt(e),!0)}addUint120Array(e){return this._selector.addUint120Array(),this._addParam(bt(e),!0)}addInt128Array(e){return this._selector.addInt128Array(),this._addParam(bt(e),!0)}addUint128Array(e){return this._selector.addUint128Array(),this._addParam(bt(e),!0)}addInt136Array(e){return this._selector.addInt136Array(),this._addParam(bt(e),!0)}addUint136Array(e){return this._selector.addUint136Array(),this._addParam(bt(e),!0)}addInt144Array(e){return this._selector.addInt144Array(),this._addParam(bt(e),!0)}addUint144Array(e){return this._selector.addUint144Array(),this._addParam(bt(e),!0)}addInt152Array(e){return this._selector.addInt152Array(),this._addParam(bt(e),!0)}addUint152Array(e){return this._selector.addUint152Array(),this._addParam(bt(e),!0)}addInt160Array(e){return this._selector.addInt160Array(),this._addParam(bt(e),!0)}addUint160Array(e){return this._selector.addUint160Array(),this._addParam(bt(e),!0)}addInt168Array(e){return this._selector.addInt168Array(),this._addParam(bt(e),!0)}addUint168Array(e){return this._selector.addUint168Array(),this._addParam(bt(e),!0)}addInt176Array(e){return this._selector.addInt176Array(),this._addParam(bt(e),!0)}addUint176Array(e){return this._selector.addUint176Array(),this._addParam(bt(e),!0)}addInt184Array(e){return this._selector.addInt184Array(),this._addParam(bt(e),!0)}addUint184Array(e){return this._selector.addUint184Array(),this._addParam(bt(e),!0)}addInt192Array(e){return this._selector.addInt192Array(),this._addParam(bt(e),!0)}addUint192Array(e){return this._selector.addUint192Array(),this._addParam(bt(e),!0)}addInt200Array(e){return this._selector.addInt200Array(),this._addParam(bt(e),!0)}addUint200Array(e){return this._selector.addUint200Array(),this._addParam(bt(e),!0)}addInt208Array(e){return this._selector.addInt208Array(),this._addParam(bt(e),!0)}addUint208Array(e){return this._selector.addUint208Array(),this._addParam(bt(e),!0)}addInt216Array(e){return this._selector.addInt216Array(),this._addParam(bt(e),!0)}addUint216Array(e){return this._selector.addUint216Array(),this._addParam(bt(e),!0)}addInt224Array(e){return this._selector.addInt224Array(),this._addParam(bt(e),!0)}addUint224Array(e){return this._selector.addUint224Array(),this._addParam(bt(e),!0)}addInt232Array(e){return this._selector.addInt232Array(),this._addParam(bt(e),!0)}addUint232Array(e){return this._selector.addUint232Array(),this._addParam(bt(e),!0)}addInt240Array(e){return this._selector.addInt240Array(),this._addParam(bt(e),!0)}addUint240Array(e){return this._selector.addUint240Array(),this._addParam(bt(e),!0)}addInt248Array(e){return this._selector.addInt248Array(),this._addParam(bt(e),!0)}addUint248Array(e){return this._selector.addUint248Array(),this._addParam(bt(e),!0)}addInt256Array(e){return this._selector.addInt256Array(),this._addParam(bt(e),!0)}addUint256Array(e){return this._selector.addUint256Array(),this._addParam(bt(e),!0)}addAddress(e){let t;if(typeof e=="string"){if(e.length!==40&&e.length!==42)throw new Error("`address` type requires parameter to be 40 or 42 characters");t=e}else t=e.toString();let n=t.length===40?et(t):et(t.substring(2));return this._selector.addAddress(),this._addParam(n,!1)}addAddressArray(e){let t=[];for(let[n,i]of e.entries()){let a;if(typeof i=="string"){if(i.length!==40&&i.length!==42)throw new Error("`address` type requires parameter to be 40 or 42 characters");a=i}else a=i.toString();let o=a.length===40?et(a):et(a.substring(2));t.push(o)}return this._selector.addAddressArray(),this._addParam(t,!0)}addFunction(e,t){let n=et(e),i=t._build();if(n.length!==20)throw new Error("`function` type requires parameter `address` to be exactly 20 bytes");this._selector.addFunction();let a=new Uint8Array(24);return a.set(n,0),a.set(i,20),this._addParam(a,!1)}_addParam(e,t){let n=this._selector._paramTypes.length-1,i=B3e(e,this._selector._paramTypes[n]);return this._arguments.push({dynamic:t,value:i}),this}_build(e){let t=e!=null,n=t?4:0,i=this._arguments.length===0?n:this._arguments.length*32+this._arguments.map(s=>s.dynamic?s.value.length:0).reduce((s,c)=>s+c)+n,a=new Uint8Array(i);t&&a.set(this._selector._build(e),0);let o=32*this._arguments.length;for(let[s,{dynamic:c,value:l}]of this._arguments.entries())if(c){let u=lo(a,n+s*32+28);u.setUint32(0,o),a.set(l,u.getUint32(0)+n),o+=l.length}else a.set(l,n+s*32);return a}};function B3e(r,e){let t=new Uint8Array(32),n=lo(t),i;if(e.array){if(!Array.isArray(r))throw new TypeError("SolidityType indicates type is array, but parameter is not an array");let a=[];for(let[c,l]of r.entries()){let u=B3e(l,{ty:e.ty,array:!1});a.push(u)}let o=a.map(c=>c.length).reduce((c,l)=>c+l,0);switch(e.ty){case Q.uint8:case Q.int8:case Q.uint16:case Q.int16:case Q.uint24:case Q.int24:case Q.uint32:case Q.int32:case Q.uint40:case Q.int40:case Q.uint48:case Q.int48:case Q.uint56:case Q.int56:case Q.uint64:case Q.int64:case Q.uint72:case Q.int72:case Q.uint80:case Q.int80:case Q.uint88:case Q.int88:case Q.uint96:case Q.int96:case Q.uint104:case Q.int104:case Q.uint112:case Q.int112:case Q.uint120:case Q.int120:case Q.uint128:case Q.int128:case Q.uint136:case Q.int136:case Q.uint144:case Q.int144:case Q.uint152:case Q.int152:case Q.uint160:case Q.int160:case Q.uint168:case Q.int168:case Q.uint176:case Q.int176:case Q.uint184:case Q.int184:case Q.uint192:case Q.int192:case Q.uint200:case Q.int200:case Q.uint208:case Q.int208:case Q.uint216:case Q.int216:case Q.uint224:case Q.int224:case Q.uint232:case Q.int232:case Q.uint240:case Q.int240:case Q.uint248:case Q.int248:case Q.uint256:case Q.int256:case Q.bool:case Q.bytes32:case Q.address:case Q.func:t=new Uint8Array(o+32);break;case Q.bytes:case Q.string:t=new Uint8Array(a.length*32+o+32);break;default:throw new TypeError(`Expected param type to be ArgumentType, but received ${e.ty}`)}n=lo(t,28),n.setUint32(0,a.length);let s=32*a.length;for(let[c,l]of a.entries())switch(e.ty){case Q.uint8:case Q.int8:case Q.uint16:case Q.int16:case Q.uint24:case Q.int24:case Q.uint32:case Q.int32:case Q.uint40:case Q.int40:case Q.uint48:case Q.int48:case Q.uint56:case Q.int56:case Q.uint64:case Q.int64:case Q.uint72:case Q.int72:case Q.uint80:case Q.int80:case Q.uint88:case Q.int88:case Q.uint96:case Q.int96:case Q.uint104:case Q.int104:case Q.uint112:case Q.int112:case Q.uint120:case Q.int120:case Q.uint128:case Q.int128:case Q.uint136:case Q.int136:case Q.uint144:case Q.int144:case Q.uint152:case Q.int152:case Q.uint160:case Q.int160:case Q.uint168:case Q.int168:case Q.uint176:case Q.int176:case Q.uint184:case Q.int184:case Q.uint192:case Q.int192:case Q.uint200:case Q.int200:case Q.uint208:case Q.int208:case Q.uint216:case Q.int216:case Q.uint224:case Q.int224:case Q.uint232:case Q.int232:case Q.uint240:case Q.int240:case Q.uint248:case Q.int248:case Q.uint256:case Q.int256:case Q.bool:case Q.bytes32:case Q.address:case Q.func:t.set(l,c*32+32);break;case Q.bytes:case Q.string:let u=lo(t,(c+1)*32+28);u.setUint32(0,s),t.set(l,u.getUint32(0)+32),s+=l.length;break;default:throw new TypeError(`Expected param type to be ArgumentType, but received ${e.ty}`)}return t}switch(e.ty){case Q.uint8:case Q.int8:case Q.uint16:case Q.int16:case Q.uint24:case Q.int24:case Q.uint32:case Q.int32:case Q.uint40:case Q.int40:case Q.uint48:case Q.int48:case Q.uint56:case Q.int56:case Q.uint64:case Q.int64:case Q.uint72:case Q.int72:case Q.uint80:case Q.int80:case Q.uint88:case Q.int88:case Q.uint96:case Q.int96:case Q.uint104:case Q.int104:case Q.uint112:case Q.int112:case Q.uint120:case Q.int120:case Q.uint128:case Q.int128:case Q.uint136:case Q.int136:case Q.uint144:case Q.int144:case Q.uint152:case Q.int152:case Q.uint160:case Q.int160:case Q.uint168:case Q.int168:case Q.uint176:case Q.int176:case Q.uint184:case Q.int184:case Q.uint192:case Q.int192:case Q.uint200:case Q.int200:case Q.uint208:case Q.int208:case Q.uint216:case Q.int216:case Q.uint224:case Q.int224:case Q.uint232:case Q.int232:case Q.uint240:case Q.int240:case Q.uint248:case Q.int248:case Q.int256:case Q.uint256:{let a=r.toString(16);r>0||r==0?a="0x"+a:a=a.slice(0,1)+"0x"+a.slice(1);let o=D3e.defaultAbiCoder.encode([FB(e)],[a]);return(0,P3e.arrayify)(o)}case Q.address:return t.set(r,12),t;case Q.bool:return t[31]=r?1:0,t;case Q.func:return t.set(r,8),t;case Q.bytes32:return t.set(r,0),t;case Q.bytes:case Q.string:return i=r instanceof Uint8Array?r:n3(r),Math.floor(i.length/32)>=0?Math.floor(i.length%32)!==0?t=new Uint8Array((Math.floor(i.length/32)+1)*32+32):t=new Uint8Array(Math.floor(i.length/32)*32+32):t=new Uint8Array(64),t.set(i,32),n=lo(t,28),n.setUint32(0,i.length),t;default:throw new Error(`Unsupported argument type: ${e.toString()}`)}}var Z8=Ie(Yt(),1),M3e=Ie(vr(),1);var X8=class r extends xr{constructor(e={}){super(),this._contractId=null,e.contractId!=null&&this.setContractId(e.contractId),this._gas=null,e.gas!=null&&this.setGas(e.gas),this._functionParameters=null,e.functionParameters!=null&&(e.functionParameters instanceof Uint8Array?this.setFunctionParameters(e.functionParameters):this.setFunction(e.functionParameters.name,e.functionParameters.parameters)),this._maxResultSize=null,e.maxResultSize!=null&&this.setMaxResultSize(e.maxResultSize),this._senderAccountId=null,e.senderAccountId!=null&&this.setSenderAccountId(e.senderAccountId)}static _fromProtobuf(e){let t=e.contractCallLocal;return new r({contractId:t.contractID!=null?_t._fromProtobuf(t.contractID):void 0,gas:t.gas!=null?t.gas:void 0,functionParameters:t.functionParameters!=null?t.functionParameters:void 0,maxResultSize:t.maxResultSize!=null?t.maxResultSize:void 0})}get contractId(){return this._contractId}setContractId(e){return this._contractId=typeof e=="string"?_t.fromString(e):e.clone(),this}get gas(){return this._gas}setGas(e){return this._gas=e instanceof Z8.default?e:Z8.default.fromValue(e),this}get senderAccountId(){return this._senderAccountId}setSenderAccountId(e){return this._senderAccountId=typeof e=="string"?ne.fromString(e):e,this}get functionParameters(){return this._functionParameters}setFunctionParameters(e){return this._functionParameters=e,this}setFunction(e,t){return this._functionParameters=(t??new Au)._build(e),this}setMaxResultSize(e){return this._maxResultSize=e instanceof Z8.default?e:Z8.default.fromValue(e),this}_validateChecksums(e){this._contractId!=null&&this._contractId.validateChecksum(e)}_mapStatusError(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??M3e.proto.ResponseCodeEnum.OK);if(!t.contractCallLocal.functionResult)return new ns({status:i,transactionId:this._getTransactionId(),contractFunctionResult:null});let o=this._mapResponseSync(t);return new ns({status:i,transactionId:this._getTransactionId(),contractFunctionResult:o})}_execute(e,t){return e.smartContract.contractCallLocalMethod(t)}_mapResponseHeader(e){return e.contractCallLocal.header}_mapResponse(e){let t=e.contractCallLocal;return Promise.resolve(wu._fromProtobuf(t.functionResult,!1))}_mapResponseSync(e){let t=e.contractCallLocal;return wu._fromProtobuf(t.functionResult,!1)}_onMakeRequest(e){return{contractCallLocal:{header:e,contractID:this._contractId!=null?this._contractId._toProtobuf():null,gas:this._gas,maxResultSize:this._maxResultSize,functionParameters:this._functionParameters,senderId:this._senderAccountId!=null?this._senderAccountId._toProtobuf():null}}}_getLogId(){return`ContractCallQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("contractCallLocal",X8._fromProtobuf);var L3e=Ie(Yt(),1),p1=class r extends ke{constructor(e={}){super(),this._keys=null,this._expirationTime=new lt(0,0).plusNanos(L3e.default.fromNumber(Date.now()).mul(1e6).add(Eu.mul(1e9))),this._contents=null,this._fileMemo=null,this._defaultMaxTransactionFee=new ze(5),e.keys!=null&&this.setKeys(e.keys),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime),e.contents!=null&&this.setContents(e.contents),e.fileMemo!=null&&this.setFileMemo(e.fileMemo)}static _fromProtobuf(e,t,n,i,a){let s=a[0].fileCreate;return ke._fromProtobufTransactions(new r({keys:s.keys!=null&&s.keys.keys!=null?s.keys.keys.map(c=>rt._fromProtobufKey(c)):void 0,expirationTime:s.expirationTime!=null?lt._fromProtobuf(s.expirationTime):void 0,contents:s.contents!=null?s.contents:void 0,fileMemo:s.memo!=null?s.memo:void 0}),e,t,n,i,a)}get keys(){return this._keys}setKeys(e){if(this._requireNotFrozen(),e instanceof Ri&&e.threshold!=null)throw new Error("Cannot set threshold key as file key");return this._keys=e instanceof Ri?e.toArray():e,this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof lt?e:lt.fromDate(e),this}get contents(){return this._contents}setContents(e){return this._requireNotFrozen(),this._contents=e instanceof Uint8Array?e:n3(e),this}get fileMemo(){return this._fileMemo}setFileMemo(e){return this._requireNotFrozen(),this._fileMemo=e,this}_execute(e,t){return e.file.createFile(t)}_getTransactionDataCase(){return"fileCreate"}_makeTransactionData(){return{keys:this._keys!=null?{keys:this._keys.map(e=>e._toProtobufKey())}:null,expirationTime:this._expirationTime._toProtobuf(),contents:this._contents,memo:this._fileMemo}}_getLogId(){return`FileCreateTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("fileCreate",p1._fromProtobuf);var h1=class r extends ke{constructor(e={}){super(),this._fileId=null,this._contents=null,this._maxChunks=20,this._chunkSize=4096,this._defaultMaxTransactionFee=new ze(5),e.fileId!=null&&this.setFileId(e.fileId),e.contents!=null&&this.setContents(e.contents),e.maxChunks!=null&&this.setMaxChunks(e.maxChunks),e.chunkSize!=null&&this.setChunkSize(e.chunkSize),this._transactionIds=new rl}static _fromProtobuf(e,t,n,i,a){let s=a[0].fileAppend,c;for(let l=0;l<a.length;l+=i.length){let u=a[l].fileAppend;if(u.contents==null)break;if(c==null){c=new Uint8Array(u.contents);continue}let d=new Uint8Array(c.length+u.contents.length);d.set(c,0),d.set(u.contents,c.length),c=d}return ke._fromProtobufTransactions(new r({fileId:s.fileID!=null?zt._fromProtobuf(s.fileID):void 0,contents:c}),e,t,n,i,a)}get fileId(){return this._fileId}setFileId(e){return this._requireNotFrozen(),this._fileId=typeof e=="string"?zt.fromString(e):e.clone(),this}get contents(){return this._contents}setContents(e){return this._requireNotFrozen(),this._contents=e instanceof Uint8Array?e:n3(e),this}get maxChunks(){return this._maxChunks}setMaxChunks(e){return this._requireNotFrozen(),this._maxChunks=e,this}get chunkSize(){return this._chunkSize}setChunkSize(e){return this._chunkSize=e,this}freezeWith(e){if(super.freezeWith(e),this._contents==null)return this;let t=Math.floor((this._contents.length+(this._chunkSize-1))/this._chunkSize);if(t>this._maxChunks)throw new Error(`Contents with size ${this._contents.length} too long for ${this._maxChunks} chunks`);let n=this._getTransactionId();this._transactionIds.locked=!1,this._transactions.clear(),this._transactionIds.clear(),this._signedTransactions.clear();for(let i=0;i<t;i++){this._transactionIds.push(n),this._transactionIds.advance();for(let a of this._nodeAccountIds.list)this._signedTransactions.push(this._makeSignedTransaction(a));n=new Wr(n.accountId,new lt(n.validStart.seconds,n.validStart.nanos.add(1)))}return this._transactionIds.advance(),this._transactionIds.setLocked(),this}schedule(){if(this._requireNotFrozen(),this._contents!=null&&this._contents.length>this._chunkSize)throw new Error(`cannot schedule \`FileAppendTransaction\` with message over ${this._chunkSize} bytes`);return super.schedule()}async execute(e,t){return(await this.executeAll(e,t))[0]}async executeAll(e,t){super._isFrozen()||this.freezeWith(e);let n=this._getTransactionId(),i=e.operatorAccountId;i!=null&&i.equals(n.accountId)&&await super.signWithOperator(e);let a=[],o=t;for(let s=0;s<this._transactionIds.length;s++){let c=Date.now(),l=await super.execute(e,o);o!=null&&(o=Date.now()-c),await l.getReceipt(e),a.push(l)}return a}_validateChecksums(e){this._fileId!=null&&this._fileId.validateChecksum(e)}_execute(e,t){return e.file.appendContent(t)}_getTransactionDataCase(){return"fileAppend"}_makeTransactionData(){let e=this._contents!=null?this._contents.length:0,t=this._transactionIds.index*this._chunkSize,n=Math.min(t+this._chunkSize,e);return{fileID:this._fileId!=null?this._fileId._toProtobuf():null,contents:this._contents!=null?this._contents.slice(t,n):null}}_getLogId(){return`FileAppendTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("fileAppend",h1._fromProtobuf);var Im=class r extends ke{constructor(e={}){super(),this._fileId=null,e.fileId!=null&&this.setFileId(e.fileId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].fileDelete;return ke._fromProtobufTransactions(new r({fileId:s.fileID!=null?zt._fromProtobuf(s.fileID):void 0}),e,t,n,i,a)}get fileId(){return this._fileId}setFileId(e){return this._requireNotFrozen(),this._fileId=typeof e=="string"?zt.fromString(e):e.clone(),this}_validateChecksums(e){this._fileId!=null&&this._fileId.validateChecksum(e)}_execute(e,t){return e.file.deleteFile(t)}_getTransactionDataCase(){return"fileDelete"}_makeTransactionData(){return{fileID:this._fileId!=null?this._fileId._toProtobuf():null}}_getLogId(){return`FileDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("fileDelete",Im._fromProtobuf);var Fx=Ie(Yt(),1);var Cm=class r extends ke{constructor(e={}){super(),this._bytecodeFileId=null,this._bytecode=null,this._adminKey=null,this._gas=null,this._initialBalance=null,this._proxyAccountId=null,this._autoRenewPeriod=new fr(Eu),this._constructorParameters=null,this._contractMemo=null,this._maxAutomaticTokenAssociations=null,this._defaultMaxTransactionFee=new ze(20),this._stakedAccountId=null,this._stakedNodeId=null,this._declineStakingReward=!1,this._autoRenewAccountId=null,e.bytecodeFileId!=null&&this.setBytecodeFileId(e.bytecodeFileId),e.bytecode!=null&&this.setBytecode(e.bytecode),e.adminKey!=null&&this.setAdminKey(e.adminKey),e.gas!=null&&this.setGas(e.gas),e.initialBalance!=null&&this.setInitialBalance(e.initialBalance),e.proxyAccountId!=null&&this.setProxyAccountId(e.proxyAccountId),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.constructorParameters!=null&&this.setConstructorParameters(e.constructorParameters),e.contractMemo!=null&&this.setContractMemo(e.contractMemo),e.maxAutomaticTokenAssociations!=null&&this.setMaxAutomaticTokenAssociations(e.maxAutomaticTokenAssociations),e.stakedAccountId!=null&&this.setStakedAccountId(e.stakedAccountId),e.stakedNodeId!=null&&this.setStakedNodeId(e.stakedNodeId),e.declineStakingReward!=null&&this.setDeclineStakingReward(e.declineStakingReward),e.autoRenewAccountId!=null&&this.setAutoRenewAccountId(e.autoRenewAccountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].contractCreateInstance;return ke._fromProtobufTransactions(new r({bytecodeFileId:s.fileID!=null?zt._fromProtobuf(s.fileID):void 0,adminKey:s.adminKey!=null?rt._fromProtobufKey(s.adminKey):void 0,gas:s.gas!=null?s.gas:void 0,initialBalance:s.initialBalance!=null?s.initialBalance:void 0,proxyAccountId:s.proxyAccountID!=null?ne._fromProtobuf(s.proxyAccountID):void 0,autoRenewPeriod:s.autoRenewPeriod!=null&&s.autoRenewPeriod.seconds!=null?s.autoRenewPeriod.seconds:void 0,constructorParameters:s.constructorParameters!=null?s.constructorParameters:void 0,contractMemo:s.memo!=null?s.memo:void 0,maxAutomaticTokenAssociations:s.maxAutomaticTokenAssociations!=null?s.maxAutomaticTokenAssociations:void 0,stakedAccountId:s.stakedAccountId!=null?ne._fromProtobuf(s.stakedAccountId):void 0,stakedNodeId:s.stakedNodeId!=null?s.stakedNodeId:void 0,declineStakingReward:s.declineReward==!0,autoRenewAccountId:s.autoRenewAccountId!=null?ne._fromProtobuf(s.autoRenewAccountId):void 0}),e,t,n,i,a)}get bytecodeFileId(){return this._bytecodeFileId}setBytecodeFileId(e){return this._requireNotFrozen(),this._bytecodeFileId=typeof e=="string"?zt.fromString(e):e.clone(),this._bytecode=null,this}get bytecode(){return this._bytecode}setBytecode(e){return this._requireNotFrozen(),this._bytecode=e,this._bytecodeFileId=null,this}get adminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}get gas(){return this._gas}setGas(e){return this._requireNotFrozen(),this._gas=e instanceof Fx.default?e:Fx.default.fromValue(e),this}get initialBalance(){return this._initialBalance}setInitialBalance(e){return this._requireNotFrozen(),this._initialBalance=e instanceof ze?e:new ze(e),this}get proxyAccountId(){return this._proxyAccountId}setProxyAccountId(e){return this._requireNotFrozen(),this._proxyAccountId=e instanceof ne?e:ne.fromString(e),this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof fr?e:new fr(e),this}get constructorParameters(){return this._constructorParameters}setConstructorParameters(e){return this._requireNotFrozen(),this._constructorParameters=e instanceof Au?e._build():e,this}get contractMemo(){return this._contractMemo}setContractMemo(e){return this._requireNotFrozen(),this._contractMemo=e,this}get maxAutomaticTokenAssociations(){return this._maxAutomaticTokenAssociations}setMaxAutomaticTokenAssociations(e){return this._maxAutomaticTokenAssociations=e,this}get stakedAccountId(){return this._stakedAccountId}setStakedAccountId(e){return this._requireNotFrozen(),this._stakedAccountId=typeof e=="string"?ne.fromString(e):e,this}get stakedNodeId(){return this._stakedNodeId}setStakedNodeId(e){return this._requireNotFrozen(),this._stakedNodeId=Fx.default.fromValue(e),this}get declineStakingRewards(){return this._declineStakingReward}setDeclineStakingReward(e){return this._requireNotFrozen(),this._declineStakingReward=e,this}get autoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=typeof e=="string"?ne.fromString(e):e,this}_validateChecksums(e){this._bytecodeFileId!=null&&this._bytecodeFileId.validateChecksum(e),this._proxyAccountId!=null&&this._proxyAccountId.validateChecksum(e)}_execute(e,t){return e.smartContract.createContract(t)}_getTransactionDataCase(){return"contractCreateInstance"}_makeTransactionData(){return{fileID:this._bytecodeFileId!=null?this._bytecodeFileId._toProtobuf():null,initcode:this._bytecode,adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,gas:this._gas,initialBalance:this._initialBalance!=null?this._initialBalance.toTinybars():null,proxyAccountID:this._proxyAccountId!=null?this._proxyAccountId._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod._toProtobuf(),constructorParameters:this._constructorParameters,memo:this._contractMemo,maxAutomaticTokenAssociations:this._maxAutomaticTokenAssociations,stakedAccountId:this.stakedAccountId!=null?this.stakedAccountId._toProtobuf():null,stakedNodeId:this.stakedNodeId,declineReward:this.declineStakingRewards,autoRenewAccountId:this._autoRenewAccountId!=null?this._autoRenewAccountId._toProtobuf():null}}_getLogId(){return`ContractCreateTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("contractCreateInstance",Cm._fromProtobuf);var ev=class r extends ke{constructor(e={}){super(),this._contractId=null,this._transferAccountId=null,this._transferContractId=null,e.contractId!=null&&this.setContractId(e.contractId),e.transferAccountId!=null&&this.setTransferAccountId(e.transferAccountId),e.transferContractId!=null&&this.setTransferContractId(e.transferContractId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].contractDeleteInstance;return ke._fromProtobufTransactions(new r({contractId:s.contractID!=null?_t._fromProtobuf(s.contractID):void 0,transferAccountId:s.transferAccountID!=null?ne._fromProtobuf(s.transferAccountID):void 0,transferContractId:s.transferContractID!=null?_t._fromProtobuf(s.transferContractID):void 0}),e,t,n,i,a)}get contractId(){return this._contractId}setContractId(e){return this._requireNotFrozen(),this._contractId=typeof e=="string"?_t.fromString(e):e.clone(),this}get transferContractId(){return this._transferContractId}setTransferContractId(e){return this._requireNotFrozen(),this._transferContractId=e instanceof _t?e:_t.fromString(e),this}get transferAccountId(){return this._transferAccountId}setTransferAccountId(e){return this._requireNotFrozen(),this._transferAccountId=e instanceof ne?e:ne.fromString(e),this}_validateChecksums(e){this._contractId!=null&&this._contractId.validateChecksum(e),this._transferAccountId!=null&&this._transferAccountId.validateChecksum(e),this._transferContractId!=null&&this._transferContractId.validateChecksum(e)}_execute(e,t){return e.smartContract.deleteContract(t)}_getTransactionDataCase(){return"contractDeleteInstance"}_makeTransactionData(){return{contractID:this._contractId!=null?this._contractId._toProtobuf():null,transferAccountID:this._transferAccountId?this._transferAccountId._toProtobuf():null,transferContractID:this._transferContractId!=null?this._transferContractId._toProtobuf():null}}_getLogId(){return`ContractDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("contractDeleteInstance",ev._fromProtobuf);var UB=Ie(Yt(),1),tv=class r extends ke{constructor(e={}){super(),this._contractId=null,this._gas=null,this._amount=null,this._functionParameters=null,e.contractId!=null&&this.setContractId(e.contractId),e.gas!=null&&this.setGas(e.gas),e.amount!=null&&this.setPayableAmount(e.amount),e.functionParameters!=null?this.setFunctionParameters(e.functionParameters):e.function!=null&&this.setFunction(e.function.name,e.function.parameters)}static _fromProtobuf(e,t,n,i,a){let s=a[0].contractCall;return ke._fromProtobufTransactions(new r({contractId:s.contractID!=null?_t._fromProtobuf(s.contractID):void 0,gas:s.gas!=null?s.gas:void 0,amount:s.amount!=null?ze.fromTinybars(s.amount):void 0,functionParameters:s.functionParameters!=null?s.functionParameters:void 0}),e,t,n,i,a)}get contractId(){return this._contractId}setContractId(e){return this._requireNotFrozen(),this._contractId=typeof e=="string"?_t.fromString(e):e.clone(),this}get gas(){return this._gas}setGas(e){return this._requireNotFrozen(),this._gas=e instanceof UB.default?e:UB.default.fromValue(e),this}get payableAmount(){return this._amount}setPayableAmount(e){return this._requireNotFrozen(),this._amount=e instanceof ze?e:new ze(e),this}get functionParameters(){return this._functionParameters}setFunctionParameters(e){return this._requireNotFrozen(),this._functionParameters=e,this}setFunction(e,t){return this._requireNotFrozen(),this._functionParameters=t!=null?t._build(e):new Au()._build(e),this}_validateChecksums(e){this._contractId!=null&&this._contractId.validateChecksum(e)}_execute(e,t){return e.smartContract.contractCallMethod(t)}_getTransactionDataCase(){return"contractCall"}_makeTransactionData(){return{contractID:this._contractId!=null?this._contractId._toProtobuf():null,gas:this._gas,amount:this._amount!=null?this._amount.toTinybars():null,functionParameters:this._functionParameters}}_getLogId(){return`ContractExecuteTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("contractCall",tv._fromProtobuf);var Ux=Ie(Yt(),1),Xze=Ie(vr(),1);var{proto:F3e}=Xze,km=class r{constructor(e){this.contractId=e.contractId,this.accountId=e.accountId,this.contractAccountId=e.contractAccountId,this.adminKey=e.adminKey!=null?e.adminKey:null,this.expirationTime=e.expirationTime,this.autoRenewPeriod=e.autoRenewPeriod,this.autoRenewAccountId=e.autoRenewAccountId,this.storage=e.storage,this.contractMemo=e.contractMemo,this.balance=e.balance,this.isDeleted=e.isDeleted,this.tokenRelationships=e.tokenRelationships,this.ledgerId=e.ledgerId,this.stakingInfo=e.stakingInfo,Object.freeze(this)}static _fromProtobuf(e){let t=e.autoRenewPeriod.seconds;return new r({contractId:_t._fromProtobuf(e.contractID),accountId:ne._fromProtobuf(e.accountID),contractAccountId:e.contractAccountID!=null?e.contractAccountID:"",adminKey:e.adminKey!=null?rt._fromProtobufKey(e.adminKey):null,expirationTime:lt._fromProtobuf(e.expirationTime),autoRenewPeriod:new fr(t),autoRenewAccountId:e.autoRenewAccountId!=null?ne._fromProtobuf(e.autoRenewAccountId):null,storage:e.storage!=null?e.storage instanceof Ux.default?e.storage:Ux.default.fromValue(e.storage):Ux.default.ZERO,contractMemo:e.memo!=null?e.memo:"",balance:ze.fromTinybars(e.balance!=null?e.balance:0),isDeleted:e.deleted,tokenRelationships:u1._fromProtobuf(e.tokenRelationships!=null?e.tokenRelationships:[]),ledgerId:e.ledgerId!=null?mr.fromBytes(e.ledgerId):null,stakingInfo:e.stakingInfo!=null?l1._fromProtobuf(e.stakingInfo):null})}_toProtobuf(){return{contractID:this.contractId._toProtobuf(),accountID:this.accountId._toProtobuf(),contractAccountID:this.contractAccountId,adminKey:this.adminKey!=null?this.adminKey._toProtobufKey():null,expirationTime:this.expirationTime._toProtobuf(),autoRenewPeriod:this.autoRenewPeriod!=null?this.autoRenewPeriod._toProtobuf():null,autoRenewAccountId:this.autoRenewAccountId!=null?this.autoRenewAccountId._toProtobuf():null,storage:this.storage,memo:this.contractMemo,balance:this.balance.toTinybars(),deleted:this.isDeleted,tokenRelationships:this.tokenRelationships!=null?this.tokenRelationships._toProtobuf():null,ledgerId:this.ledgerId!=null?this.ledgerId.toBytes():null,stakingInfo:this.stakingInfo!=null?this.stakingInfo._toProtobuf():null}}static fromBytes(e){return r._fromProtobuf(F3e.ContractGetInfoResponse.ContractInfo.decode(e))}toBytes(){return F3e.ContractGetInfoResponse.ContractInfo.encode(this._toProtobuf()).finish()}};var rv=class r extends xr{constructor(e={}){super(),this._contractId=null,e.contractId!=null&&this.setContractId(e.contractId)}static _fromProtobuf(e){let t=e.contractGetInfo;return new r({contractId:t.contractID!=null?_t._fromProtobuf(t.contractID):void 0})}get contractId(){return this._contractId}setContractId(e){return this._contractId=typeof e=="string"?_t.fromString(e):e.clone(),this}_validateChecksums(e){this._contractId!=null&&this._contractId.validateChecksum(e)}_execute(e,t){return e.smartContract.getContractInfo(t)}async getCost(e){return super.getCost(e)}_mapResponseHeader(e){return e.contractGetInfo.header}_mapResponse(e,t,n){let i=e.contractGetInfo;return Promise.resolve(km._fromProtobuf(i.contractInfo))}_onMakeRequest(e){return{contractGetInfo:{header:e,contractID:this._contractId!=null?this._contractId._toProtobuf():null}}}_getLogId(){return`ContractInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("contractGetInfo",rv._fromProtobuf);var U3e=Ie(Yt(),1),nv=class r extends ke{constructor(e={}){super(),this._contractId=null,this._expirationTime=null,this._adminKey=null,this._proxyAccountId=null,this._autoRenewPeriod=null,this._bytecodeFileId=null,this._contractMemo=null,this._maxAutomaticTokenAssociations=null,this._stakedAccountId=null,this._stakedNodeId=null,this._declineStakingReward=null,this._autoRenewAccountId=null,e.contractId!=null&&this.setContractId(e.contractId),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime),e.adminKey!=null&&this.setAdminKey(e.adminKey),e.proxyAccountId!=null&&this.setProxyAccountId(e.proxyAccountId),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.bytecodeFileId!=null&&this.setBytecodeFileId(e.bytecodeFileId),e.contractMemo!=null&&this.setContractMemo(e.contractMemo),e.maxAutomaticTokenAssociations!=null&&this.setMaxAutomaticTokenAssociations(e.maxAutomaticTokenAssociations),e.stakedAccountId!=null&&this.setStakedAccountId(e.stakedAccountId),e.stakedNodeId!=null&&this.setStakedNodeId(e.stakedNodeId),e.declineStakingReward!=null&&this.setDeclineStakingReward(e.declineStakingReward),e.autoRenewAccountId!=null&&this.setAutoRenewAccountId(e.autoRenewAccountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].contractUpdateInstance,c;s.autoRenewPeriod!=null&&s.autoRenewPeriod.seconds!=null&&(c=s.autoRenewPeriod.seconds);let l;s.memoWrapper!=null&&s.memoWrapper.value!=null&&(l=s.memoWrapper.value);let u;return s.maxAutomaticTokenAssociations!=null&&s.maxAutomaticTokenAssociations.value!=null&&(u=s.maxAutomaticTokenAssociations.value),ke._fromProtobufTransactions(new r({contractId:s.contractID!=null?_t._fromProtobuf(s.contractID):void 0,bytecodeFileId:s.fileID!=null?zt._fromProtobuf(s.fileID):void 0,expirationTime:s.expirationTime!=null?lt._fromProtobuf(s.expirationTime):void 0,adminKey:s.adminKey!=null?rt._fromProtobufKey(s.adminKey):void 0,proxyAccountId:s.proxyAccountID!=null?ne._fromProtobuf(s.proxyAccountID):void 0,autoRenewPeriod:c,contractMemo:l,maxAutomaticTokenAssociations:u,stakedAccountId:s.stakedAccountId!=null?ne._fromProtobuf(s.stakedAccountId):void 0,stakedNodeId:s.stakedNodeId!=null?s.stakedNodeId:void 0,declineStakingReward:s.declineReward!=null&&!!s.declineReward,autoRenewAccountId:s.autoRenewAccountId!=null?ne._fromProtobuf(s.autoRenewAccountId):void 0}),e,t,n,i,a)}get contractId(){return this._contractId}setContractId(e){return this._requireNotFrozen(),this._contractId=typeof e=="string"?_t.fromString(e):e.clone(),this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof lt?e:lt.fromDate(e),this}get adminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}get proxyAccountId(){return this._proxyAccountId}setProxyAccountId(e){return this._requireNotFrozen(),this._proxyAccountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof fr?e:new fr(e),this}get bytecodeFileId(){return this._bytecodeFileId}setBytecodeFileId(e){return console.warn("Deprecated: there is no replacement"),this._requireNotFrozen(),this._bytecodeFileId=typeof e=="string"?zt.fromString(e):e.clone(),this}get contractMemo(){return this._contractMemo}setContractMemo(e){return this._requireNotFrozen(),this._contractMemo=e,this}clearContractMemo(){return this._requireNotFrozen(),this._contractMemo=null,this}get maxAutomaticTokenAssociations(){return this._maxAutomaticTokenAssociations}setMaxAutomaticTokenAssociations(e){return this._requireNotFrozen(),this._maxAutomaticTokenAssociations=e,this}get stakedAccountId(){return this._stakedAccountId}setStakedAccountId(e){return this._requireNotFrozen(),this._stakedAccountId=typeof e=="string"?ne.fromString(e):e,this}get stakedNodeId(){return this._stakedNodeId}setStakedNodeId(e){return this._requireNotFrozen(),this._stakedNodeId=U3e.default.fromValue(e),this}get declineStakingRewards(){return this._declineStakingReward}setDeclineStakingReward(e){return this._requireNotFrozen(),this._declineStakingReward=e,this}get autoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=typeof e=="string"?ne.fromString(e):e,this}clearAutoRenewAccountId(){return this._autoRenewAccountId=new ne(0),this}_validateChecksums(e){this._contractId!=null&&this._contractId.validateChecksum(e),this._bytecodeFileId!=null&&this._bytecodeFileId.validateChecksum(e),this._proxyAccountId!=null&&this._proxyAccountId.validateChecksum(e)}_execute(e,t){return e.smartContract.updateContract(t)}_getTransactionDataCase(){return"contractUpdateInstance"}_makeTransactionData(){return{contractID:this._contractId!=null?this._contractId._toProtobuf():null,expirationTime:this._expirationTime!=null?this._expirationTime._toProtobuf():null,adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,proxyAccountID:this._proxyAccountId!=null?this._proxyAccountId._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod!=null?this._autoRenewPeriod._toProtobuf():null,fileID:this._bytecodeFileId?this._bytecodeFileId._toProtobuf():null,memoWrapper:this._contractMemo!=null?{value:this._contractMemo}:null,maxAutomaticTokenAssociations:this._maxAutomaticTokenAssociations!=null?{value:this._maxAutomaticTokenAssociations}:null,stakedAccountId:this.stakedAccountId!=null?this.stakedAccountId._toProtobuf():null,stakedNodeId:this.stakedNodeId,declineReward:this.declineStakingRewards!=null?{value:this.declineStakingRewards}:null,autoRenewAccountId:this._autoRenewAccountId!=null?this._autoRenewAccountId._toProtobuf():null}}_getLogId(){return`ContractUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("contractUpdateInstance",nv._fromProtobuf);var Tu=class{constructor(e={}){this._feeCollectorAccountId=null,this._allCollectorsAreExempt=!1,e.feeCollectorAccountId!=null&&this.setFeeCollectorAccountId(e.feeCollectorAccountId),e.allCollectorsAreExempt!=null&&this.setAllCollectorsAreExempt(e.allCollectorsAreExempt)}get feeCollectorAccountId(){return this._feeCollectorAccountId}setFeeCollectorAccountId(e){return this._feeCollectorAccountId=typeof e=="string"?ne.fromString(e):e,this}get allCollectorsAreExempt(){return this._allCollectorsAreExempt}setAllCollectorsAreExempt(e){return this._allCollectorsAreExempt=e,this}static _fromProtobuf(e){throw new Error("not implemented")}_toProtobuf(){throw new Error("not implemented")}};var q3e=Ie(Yt(),1);var tc=class r extends Tu{constructor(e={}){super(e),this._denominatingTokenId=null,e.denominatingTokenId!=null&&this.setDenominatingTokenId(e.denominatingTokenId),this._amount=null,e.amount!=null&&this.setAmount(e.amount)}setHbarAmount(e){return this._amount=e.toTinybars(),this._denominatingTokenId=null,this}get hbarAmount(){return this._denominatingTokenId!=null?null:ze.fromTinybars(this._amount!=null?this._amount:0)}setDenominatingTokenToSameToken(){return this._denominatingTokenId=new Oe(0,0,0),this}get denominatingTokenId(){return this._denominatingTokenId}setDenominatingTokenId(e){return this._denominatingTokenId=typeof e=="string"?Oe.fromString(e):e,this}get amount(){return this._amount}setAmount(e){return this._amount=typeof e=="number"?q3e.default.fromNumber(e):e,this}static _fromProtobuf(e){let t=e.fixedFee;return new r({feeCollectorAccountId:e.feeCollectorAccountId!=null?ne._fromProtobuf(e.feeCollectorAccountId):void 0,allCollectorsAreExempt:e.allCollectorsAreExempt!=null?e.allCollectorsAreExempt:void 0,denominatingTokenId:t.denominatingTokenId!=null?Oe._fromProtobuf(t.denominatingTokenId):void 0,amount:t.amount!=null?t.amount:void 0})}_toProtobuf(){return{feeCollectorAccountId:this.feeCollectorAccountId!=null?this.feeCollectorAccountId._toProtobuf():null,allCollectorsAreExempt:this.allCollectorsAreExempt,fixedFee:{denominatingTokenId:this._denominatingTokenId!=null?this._denominatingTokenId._toProtobuf():null,amount:this._amount}}}};var Su=class r{constructor(e){this._value=e,Object.freeze(this)}toString(){switch(this){case r.Inclusive:return"INCLUSIVE";case r.Exclusive:return"EXCLUSIVE";default:return`UNKNOWN (${this._value.toString()})`}}static _fromValue(e){switch(e){case!1:return r.Inclusive;case!0:return r.Exclusive}}valueOf(){return this._value}};Su.Inclusive=new Su(!1);Su.Exclusive=new Su(!0);var iv=Ie(Yt(),1),Iu=class r extends Tu{constructor(e={}){super(e),this._numerator=null,e.numerator!=null&&this.setNumerator(e.numerator),this._denominator=null,e.denominator!=null&&this.setDenominator(e.denominator),this._min=null,e.min!=null&&this.setMin(e.min),this._max,e.max!=null&&this.setMax(e.max),this._assessmentMethod,e.assessmentMethod!=null&&this.setAssessmentMethod(e.assessmentMethod)}get numerator(){return this._numerator}setNumerator(e){return this._numerator=typeof e=="number"?iv.default.fromNumber(e):e,this}get denominator(){return this._denominator}setDenominator(e){return this._denominator=typeof e=="number"?iv.default.fromNumber(e):e,this}get min(){return this._min}setMin(e){return this._min=typeof e=="number"?iv.default.fromNumber(e):e,this}get max(){return this._max}setMax(e){return this._max=typeof e=="number"?iv.default.fromNumber(e):e,this}get assessmentMethod(){return this._assessmentMethod}setAssessmentMethod(e){return this._assessmentMethod=e,this}static _fromProtobuf(e){let t=e.fractionalFee,n=t.fractionalAmount;return new r({feeCollectorAccountId:e.feeCollectorAccountId!=null?ne._fromProtobuf(e.feeCollectorAccountId):void 0,allCollectorsAreExempt:e.allCollectorsAreExempt!=null?e.allCollectorsAreExempt:void 0,numerator:n.numerator!=null?n.numerator:void 0,denominator:n.denominator!=null?n.denominator:void 0,min:t.minimumAmount!=null?t.minimumAmount:void 0,max:t.maximumAmount!=null?t.maximumAmount:void 0,assessmentMethod:t.netOfTransfers!=null?new Su(t.netOfTransfers):void 0})}_toProtobuf(){return{feeCollectorAccountId:this.feeCollectorAccountId!=null?this.feeCollectorAccountId._toProtobuf():null,allCollectorsAreExempt:this.allCollectorsAreExempt,fractionalFee:{fractionalAmount:{numerator:this._numerator,denominator:this._denominator},minimumAmount:this._min,maximumAmount:this._max,netOfTransfers:this._assessmentMethod!=null?this._assessmentMethod.valueOf():!1}}}};var qB=Ie(Yt(),1);var Cu=class r extends Tu{constructor(e={}){super(e),this._fallbackFee=null,e.fallbackFee!=null&&this.setFallbackFee(e.fallbackFee),this._numerator=null,e.numerator!=null&&this.setNumerator(e.numerator),this._denominator=null,e.denominator!=null&&this.setDenominator(e.denominator)}get fallbackFee(){return this._fallbackFee}setFallbackFee(e){return this._fallbackFee=e,this}get numerator(){return this._numerator}setNumerator(e){return this._numerator=typeof e=="number"?qB.default.fromNumber(e):e,this}get denominator(){return this._denominator}setDenominator(e){return this._denominator=typeof e=="number"?qB.default.fromNumber(e):e,this}static _fromProtobuf(e){let t=e.royaltyFee,n=t.exchangeValueFraction;return new r({feeCollectorAccountId:e.feeCollectorAccountId!=null?ne._fromProtobuf(e.feeCollectorAccountId):void 0,allCollectorsAreExempt:e.allCollectorsAreExempt!=null?e.allCollectorsAreExempt:void 0,fallbackFee:t.fallbackFee!=null?tc._fromProtobuf({fixedFee:t.fallbackFee}):void 0,numerator:n.numerator!=null?n.numerator:void 0,denominator:n.denominator!=null?n.denominator:void 0})}_toProtobuf(){return{feeCollectorAccountId:this.feeCollectorAccountId!=null?this.feeCollectorAccountId._toProtobuf():null,allCollectorsAreExempt:this.allCollectorsAreExempt,royaltyFee:{exchangeValueFraction:{numerator:this._numerator,denominator:this._denominator},fallbackFee:this._fallbackFee!=null?this._fallbackFee._toProtobuf().fixedFee:null}}}};var av=class r extends _t{constructor(e,t,n,i){super(e,t,n,i)}static fromEvmAddress(e,t,n){return new r(e,t,0,et(n))}static fromString(e){return new r(_t.fromString(e))}static _fromProtobuf(e){return new r(_t._fromProtobuf(e))}static fromBytes(e){return new r(_t.fromBytes(e))}static fromSolidityAddress(e){return new r(_t.fromSolidityAddress(e))}clone(){let e=new r(this);return e._checksum=this._checksum,e}_toProtobufKey(){return{delegatableContractId:this._toProtobuf()}}static __fromProtobufKey(e){return r._fromProtobuf(e)}};ir.setDelegateContractId(r=>av.__fromProtobufKey(r));var Nm=class r extends ke{constructor(e={}){super(),this._ethereumData=null,this._callDataFileId=null,this._maxGasAllowance=null,e.ethereumData!=null&&this.setEthereumData(e.ethereumData),e.callData!=null&&this.setCallDataFileId(e.callData),e.callDataFileId!=null&&this.setCallDataFileId(e.callDataFileId),e.maxGasAllowance!=null&&this.setMaxGasAllowanceHbar(e.maxGasAllowance)}static _fromProtobuf(e,t,n,i,a){let s=a[0].ethereumTransaction;return ke._fromProtobufTransactions(new r({ethereumData:s.ethereumData!=null?s.ethereumData:void 0,callData:s.callData!=null?zt._fromProtobuf(s.callData):void 0,maxGasAllowance:s.maxGasAllowance!=null?ze.fromTinybars(s.maxGasAllowance):void 0}),e,t,n,i,a)}get ethereumData(){return this._ethereumData}setEthereumData(e){return this._requireNotFrozen(),this._ethereumData=e,this}get callData(){return this.callDataFileId}setCallData(e){return this.setCallDataFileId(e)}get callDataFileId(){return this._callDataFileId}setCallDataFileId(e){return this._requireNotFrozen(),this._callDataFileId=e,this}get maxGasAllowance(){return this._maxGasAllowance}setMaxGasAllowance(e){return this.setMaxGasAllowanceHbar(e)}setMaxGasAllowanceHbar(e){return this._requireNotFrozen(),this._maxGasAllowance=e instanceof ze?e:new ze(e),this}_validateChecksums(e){this._ethereumData!=null&&this._ethereumData instanceof zt&&this._ethereumData.validateChecksum(e)}_execute(e,t){return e.smartContract.callEthereum(t)}_getTransactionDataCase(){return"ethereumTransaction"}_makeTransactionData(){return{ethereumData:this._ethereumData,callData:this._callDataFileId!=null?this._callDataFileId._toProtobuf():null,maxGasAllowance:this._maxGasAllowance!=null?this._maxGasAllowance.toTinybars():null}}_getLogId(){return`EthereumTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("ethereumTransaction",Nm._fromProtobuf);var qx=Ie(em(),1);var cl=class{constructor(e){this.callData=e.callData}static fromBytes(e){if(e.length===0)throw new Error("empty bytes");switch(e[0]){case 1:return ir.ethereumTransactionDataEip2930FromBytes(e);case 2:return ir.ethereumTransactionDataEip1559FromBytes(e);default:return ir.ethereumTransactionDataLegacyFromBytes(e)}}toBytes(){throw new Error("not implemented")}toString(){throw new Error("not implemented")}toJSON(){throw new Error("not implemented")}};var ov=class r extends cl{constructor(e){super(e),this.nonce=e.nonce,this.gasPrice=e.gasPrice,this.gasLimit=e.gasLimit,this.to=e.to,this.value=e.value,this.v=e.v,this.r=e.r,this.s=e.s}static fromBytes(e){if(e.length===0)throw new Error("empty bytes");let t=qx.decode(e);if(t.length!=9)throw new Error("invalid ethereum transaction data");return new r({nonce:et(t[0]),gasPrice:et(t[1]),gasLimit:et(t[2]),to:et(t[3]),value:et(t[4]),callData:et(t[5]),v:et(t[6]),r:et(t[7]),s:et(t[8])})}toBytes(){return et(qx.encode([this.nonce,this.gasPrice,this.gasLimit,this.to,this.value,this.callData,this.v,this.r,this.s]))}toString(){return JSON.stringify(this.toJSON(),null,2)}toJSON(){return{nonce:He(this.nonce),gasPrice:He(this.gasPrice),gasLimit:He(this.gasLimit),to:He(this.to),value:He(this.value),callData:He(this.callData),v:He(this.v),r:He(this.r),s:He(this.s)}}};ir.setEthereumTransactionDataLegacyFromBytes(r=>ov.fromBytes(r));var jx=Ie(em(),1);var sv=class r extends cl{constructor(e){super(e),this.chainId=e.chainId,this.nonce=e.nonce,this.maxPriorityGas=e.maxPriorityGas,this.maxGas=e.maxGas,this.gasLimit=e.gasLimit,this.to=e.to,this.value=e.value,this.accessList=e.accessList,this.recId=e.recId,this.r=e.r,this.s=e.s}static fromBytes(e){if(e.length===0)throw new Error("empty bytes");let t=jx.decode(e.subarray(1));if(!Array.isArray(t))throw new Error("ethereum data is not a list");if(t.length!=12)throw new Error("invalid ethereum transaction data");return new r({chainId:et(t[0]),nonce:et(t[1]),maxPriorityGas:et(t[2]),maxGas:et(t[3]),gasLimit:et(t[4]),to:et(t[5]),value:et(t[6]),callData:et(t[7]),accessList:t[8].map(n=>et(n)),recId:et(t[9]),r:et(t[10]),s:et(t[11])})}toBytes(){let e=jx.encode([this.chainId,this.nonce,this.maxPriorityGas,this.maxGas,this.gasLimit,this.to,this.value,this.callData,this.accessList,this.recId,this.r,this.s]);return et("02"+e.substring(2))}toString(){return JSON.stringify(this.toJSON(),null,2)}toJSON(){return{chainId:He(this.chainId),nonce:He(this.nonce),maxPriorityGas:He(this.maxPriorityGas),maxGas:He(this.maxGas),gasLimit:He(this.gasLimit),to:He(this.to),value:He(this.value),callData:He(this.callData),accessList:this.accessList.map(e=>He(e)),recId:He(this.recId),r:He(this.r),s:He(this.s)}}};ir.setEthereumTransactionDataEip1559FromBytes(r=>sv.fromBytes(r));var Vx=Ie(em(),1);var cv=class r extends cl{constructor(e){super(e),this.chainId=e.chainId,this.nonce=e.nonce,this.gasPrice=e.gasPrice,this.gasLimit=e.gasLimit,this.to=e.to,this.value=e.value,this.accessList=e.accessList,this.recId=e.recId,this.r=e.r,this.s=e.s}static fromBytes(e){if(e.length===0)throw new Error("empty bytes");let t=Vx.decode(e.subarray(1));if(!Array.isArray(t))throw new Error("ethereum data is not a list");if(t.length!==11)throw new Error("invalid ethereum transaction data");return new r({chainId:et(t[0]),nonce:et(t[1]),gasPrice:et(t[2]),gasLimit:et(t[3]),to:et(t[4]),value:et(t[5]),callData:et(t[6]),accessList:t[7].map(n=>et(n)),recId:et(t[8]),r:et(t[9]),s:et(t[10])})}toBytes(){let e=Vx.encode([this.chainId,this.nonce,this.gasPrice,this.gasLimit,this.to,this.value,this.callData,this.accessList,this.recId,this.r,this.s]);return et("01"+e.substring(2))}toString(){return JSON.stringify(this.toJSON(),null,2)}toJSON(){return{chainId:He(this.chainId),nonce:He(this.nonce),gasPrice:He(this.gasPrice),gasLimit:He(this.gasLimit),to:He(this.to),value:He(this.value),callData:He(this.callData),accessList:this.accessList.map(e=>He(e)),recId:He(this.recId),r:He(this.r),s:He(this.s)}}};ir.setEthereumTransactionDataEip2930FromBytes(r=>cv.fromBytes(r));var eGe=Ie(vr(),1),{proto:wtr}=eGe;var tGe=Ie(vr(),1);var nGe=Ie(vr(),1);var _o=class r{constructor(e){this._code=e,Object.freeze(this)}toString(){switch(this){case r.Default:return"DEFAULT";case r.TokenFungibleCommon:return"TOKEN_FUNGIBLE_COMMON";case r.TokenNonFungibleUnique:return"TOKEN_NON_FUNGIBLE_UNIQUE";case r.TokenFungibleCommonWithCustomFees:return"TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES";case r.TokenNonFungibleUniqueWithCustomFees:return"TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES";case r.ScheduleCreateContractCall:return"SCHEDULE_CREATE_CONTRACT_CALL";default:return`UNKNOWN (${this._code})`}}static _fromCode(e){switch(e){case 0:return r.Default;case 1:return r.TokenFungibleCommon;case 2:return r.TokenNonFungibleUnique;case 3:return r.TokenFungibleCommonWithCustomFees;case 4:return r.TokenNonFungibleUniqueWithCustomFees;case 5:return r.ScheduleCreateContractCall}throw new Error(`(BUG) SubType.fromCode() does not handle code: ${e}`)}valueOf(){return this._code}};_o.Default=new _o(0);_o.TokenFungibleCommon=new _o(1);_o.TokenNonFungibleUnique=new _o(2);_o.TokenFungibleCommonWithCustomFees=new _o(3);_o.TokenNonFungibleUniqueWithCustomFees=new _o(4);_o.ScheduleCreateContractCall=new _o(5);var sGe=Ie(vr(),1);var aGe=Ie(vr(),1);var xe=class r{constructor(e){this._code=e,Object.freeze(this)}toString(){switch(this){case r.None:return"NONE";case r.CryptoTransfer:return"CryptoTransfer";case r.CryptoUpdate:return"CryptoUpdate";case r.CryptoDelete:return"CryptoDelete";case r.CryptoAddLiveHash:return"CryptoAddLiveHash";case r.CryptoDeleteLiveHash:return"CryptoDeleteLiveHash";case r.ContractCall:return"ContractCall";case r.ContractCreate:return"ContractCreate";case r.ContractUpdate:return"ContractUpdate";case r.FileCreate:return"FileCreate";case r.FileAppend:return"FileAppend";case r.FileUpdate:return"FileUpdate";case r.FileDelete:return"FileDelete";case r.CryptoGetAccountBalance:return"CryptoGetAccountBalance";case r.CryptoGetAccountRecords:return"CryptoGetAccountRecords";case r.CryptoGetInfo:return"CryptoGetInfo";case r.ContractCallLocal:return"ContractCallLocal";case r.ContractGetInfo:return"ContractGetInfo";case r.ContractGetBytecode:return"ContractGetBytecode";case r.GetBySolidityID:return"GetBySolidityID";case r.GetByKey:return"GetByKey";case r.CryptoGetLiveHash:return"CryptoGetLiveHash";case r.CryptoGetStakers:return"CryptoGetStakers";case r.FileGetContents:return"FileGetContents";case r.FileGetInfo:return"FileGetInfo";case r.TransactionGetRecord:return"TransactionGetRecord";case r.ContractGetRecords:return"ContractGetRecords";case r.CryptoCreate:return"CryptoCreate";case r.SystemDelete:return"SystemDelete";case r.SystemUndelete:return"SystemUndelete";case r.ContractDelete:return"ContractDelete";case r.Freeze:return"Freeze";case r.CreateTransactionRecord:return"CreateTransactionRecord";case r.CryptoAccountAutoRenew:return"CryptoAccountAutoRenew";case r.ContractAutoRenew:return"ContractAutoRenew";case r.GetVersionInfo:return"GetVersionInfo";case r.TransactionGetReceipt:return"TransactionGetReceipt";case r.ConsensusCreateTopic:return"ConsensusCreateTopic";case r.ConsensusUpdateTopic:return"ConsensusUpdateTopic";case r.ConsensusDeleteTopic:return"ConsensusDeleteTopic";case r.ConsensusGetTopicInfo:return"ConsensusGetTopicInfo";case r.ConsensusSubmitMessage:return"ConsensusSubmitMessage";case r.UncheckedSubmit:return"UncheckedSubmit";case r.TokenCreate:return"TokenCreate";case r.TokenGetInfo:return"TokenGetInfo";case r.TokenFreezeAccount:return"TokenFreezeAccount";case r.TokenUnfreezeAccount:return"TokenUnfreezeAccount";case r.TokenGrantKycToAccount:return"TokenGrantKycToAccount";case r.TokenRevokeKycFromAccount:return"TokenRevokeKycFromAccount";case r.TokenDelete:return"TokenDelete";case r.TokenUpdate:return"TokenUpdate";case r.TokenMint:return"TokenMint";case r.TokenBurn:return"TokenBurn";case r.TokenAccountWipe:return"TokenAccountWipe";case r.TokenAssociateToAccount:return"TokenAssociateToAccount";case r.TokenDissociateFromAccount:return"TokenDissociateFromAccount";case r.ScheduleCreate:return"ScheduleCreate";case r.ScheduleDelete:return"ScheduleDelete";case r.ScheduleSign:return"ScheduleSign";case r.ScheduleGetInfo:return"ScheduleGetInfo";case r.TokenGetAccountNftInfos:return"TokenGetAccountNftInfos";case r.TokenGetNftInfo:return"TokenGetNftInfo";case r.TokenGetNftInfos:return"TokenGetNftInfos";case r.TokenFeeScheduleUpdate:return"TokenFeeScheduleUpdate";case r.NetworkGetExecutionTime:return"NetworkGetExecutionTime";case r.TokenPause:return"TokenPause";case r.TokenUnpause:return"TokenUnpause";case r.CryptoApproveAllowance:return"CryptoApproveAllowance";case r.CryptoDeleteAllowance:return"CryptoDeleteAllowance";case r.GetAccountDetails:return"GetAccountDetails";case r.EthereumTransaction:return"EthereumTransaction";case r.NodeStakeUpdate:return"NodeStakeUpdate";case r.Prng:return"UtilPrng";default:return`UNKNOWN (${this._code})`}}static _fromCode(e){switch(e){case 0:return r.None;case 1:return r.CryptoTransfer;case 2:return r.CryptoUpdate;case 3:return r.CryptoDelete;case 4:return r.CryptoAddLiveHash;case 5:return r.CryptoDeleteLiveHash;case 6:return r.ContractCall;case 7:return r.ContractCreate;case 8:return r.ContractUpdate;case 9:return r.FileCreate;case 10:return r.FileAppend;case 11:return r.FileUpdate;case 12:return r.FileDelete;case 13:return r.CryptoGetAccountBalance;case 14:return r.CryptoGetAccountRecords;case 15:return r.CryptoGetInfo;case 16:return r.ContractCallLocal;case 17:return r.ContractGetInfo;case 18:return r.ContractGetBytecode;case 19:return r.GetBySolidityID;case 20:return r.GetByKey;case 21:return r.CryptoGetLiveHash;case 22:return r.CryptoGetStakers;case 23:return r.FileGetContents;case 24:return r.FileGetInfo;case 25:return r.TransactionGetRecord;case 26:return r.ContractGetRecords;case 27:return r.CryptoCreate;case 28:return r.SystemDelete;case 29:return r.SystemUndelete;case 30:return r.ContractDelete;case 31:return r.Freeze;case 32:return r.CreateTransactionRecord;case 33:return r.CryptoAccountAutoRenew;case 34:return r.ContractAutoRenew;case 35:return r.GetVersionInfo;case 36:return r.TransactionGetReceipt;case 50:return r.ConsensusCreateTopic;case 51:return r.ConsensusUpdateTopic;case 52:return r.ConsensusDeleteTopic;case 53:return r.ConsensusGetTopicInfo;case 54:return r.ConsensusSubmitMessage;case 55:return r.UncheckedSubmit;case 56:return r.TokenCreate;case 58:return r.TokenGetInfo;case 59:return r.TokenFreezeAccount;case 60:return r.TokenUnfreezeAccount;case 61:return r.TokenGrantKycToAccount;case 62:return r.TokenRevokeKycFromAccount;case 63:return r.TokenDelete;case 64:return r.TokenUpdate;case 65:return r.TokenMint;case 66:return r.TokenBurn;case 67:return r.TokenAccountWipe;case 68:return r.TokenAssociateToAccount;case 69:return r.TokenDissociateFromAccount;case 70:return r.ScheduleCreate;case 71:return r.ScheduleDelete;case 72:return r.ScheduleSign;case 73:return r.ScheduleGetInfo;case 74:return r.TokenGetAccountNftInfos;case 75:return r.TokenGetNftInfo;case 76:return r.TokenGetNftInfos;case 77:return r.TokenFeeScheduleUpdate;case 78:return r.NetworkGetExecutionTime;case 79:return r.TokenPause;case 80:return r.TokenUnpause;case 81:return r.CryptoApproveAllowance;case 82:return r.CryptoDeleteAllowance;case 83:return r.GetAccountDetails;case 84:return r.EthereumTransaction;case 85:return r.NodeStakeUpdate;case 86:return r.Prng}throw new Error(`(BUG) RequestType.fromCode() does not handle code: ${e}`)}valueOf(){return this._code}};xe.None=new xe(0);xe.CryptoTransfer=new xe(1);xe.CryptoUpdate=new xe(2);xe.CryptoDelete=new xe(3);xe.CryptoAddLiveHash=new xe(4);xe.CryptoDeleteLiveHash=new xe(5);xe.ContractCall=new xe(6);xe.ContractCreate=new xe(7);xe.ContractUpdate=new xe(8);xe.FileCreate=new xe(9);xe.FileAppend=new xe(10);xe.FileUpdate=new xe(11);xe.FileDelete=new xe(12);xe.CryptoGetAccountBalance=new xe(13);xe.CryptoGetAccountRecords=new xe(14);xe.CryptoGetInfo=new xe(15);xe.ContractCallLocal=new xe(16);xe.ContractGetInfo=new xe(17);xe.ContractGetBytecode=new xe(18);xe.GetBySolidityID=new xe(19);xe.GetByKey=new xe(20);xe.CryptoGetLiveHash=new xe(21);xe.CryptoGetStakers=new xe(22);xe.FileGetContents=new xe(23);xe.FileGetInfo=new xe(24);xe.TransactionGetRecord=new xe(25);xe.ContractGetRecords=new xe(26);xe.CryptoCreate=new xe(27);xe.SystemDelete=new xe(28);xe.SystemUndelete=new xe(29);xe.ContractDelete=new xe(30);xe.Freeze=new xe(31);xe.CreateTransactionRecord=new xe(32);xe.CryptoAccountAutoRenew=new xe(33);xe.ContractAutoRenew=new xe(34);xe.GetVersionInfo=new xe(35);xe.TransactionGetReceipt=new xe(36);xe.ConsensusCreateTopic=new xe(50);xe.ConsensusUpdateTopic=new xe(51);xe.ConsensusDeleteTopic=new xe(52);xe.ConsensusGetTopicInfo=new xe(53);xe.ConsensusSubmitMessage=new xe(54);xe.UncheckedSubmit=new xe(55);xe.TokenCreate=new xe(56);xe.TokenGetInfo=new xe(58);xe.TokenFreezeAccount=new xe(59);xe.TokenUnfreezeAccount=new xe(60);xe.TokenGrantKycToAccount=new xe(61);xe.TokenRevokeKycFromAccount=new xe(62);xe.TokenDelete=new xe(63);xe.TokenUpdate=new xe(64);xe.TokenMint=new xe(65);xe.TokenBurn=new xe(66);xe.TokenAccountWipe=new xe(67);xe.TokenAssociateToAccount=new xe(68);xe.TokenDissociateFromAccount=new xe(69);xe.ScheduleCreate=new xe(70);xe.ScheduleDelete=new xe(71);xe.ScheduleSign=new xe(72);xe.ScheduleGetInfo=new xe(73);xe.TokenGetAccountNftInfos=new xe(74);xe.TokenGetNftInfo=new xe(75);xe.TokenGetNftInfos=new xe(76);xe.TokenFeeScheduleUpdate=new xe(77);xe.NetworkGetExecutionTime=new xe(78);xe.TokenPause=new xe(79);xe.TokenUnpause=new xe(80);xe.CryptoApproveAllowance=new xe(81);xe.CryptoDeleteAllowance=new xe(82);xe.GetAccountDetails=new xe(83);xe.EthereumTransaction=new xe(84);xe.NodeStakeUpdate=new xe(85);xe.Prng=new xe(86);var lGe=Ie(vr(),1);var lv=class r extends xr{constructor(e={}){super(),this._fileId=null,e.fileId!=null&&this.setFileId(e.fileId)}static _fromProtobuf(e){let t=e.fileGetContents;return new r({fileId:t.fileID!=null?zt._fromProtobuf(t.fileID):void 0})}_validateChecksums(e){this._fileId!=null&&this._fileId.validateChecksum(e)}_execute(e,t){return e.file.getFileContent(t)}get fileId(){return this._fileId}setFileId(e){return this._fileId=typeof e=="string"?zt.fromString(e):e.clone(),this}_mapResponseHeader(e){return e.fileGetContents.header}_mapResponse(e){let i=e.fileGetContents.fileContents.contents;return Promise.resolve(i)}_onMakeRequest(e){return{fileGetContents:{header:e,fileID:this._fileId!=null?this._fileId._toProtobuf():null}}}_getLogId(){return`FileContentsQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("fileGetContents",lv._fromProtobuf);var jB=Ie(Yt(),1);var VB=Ie(vr(),1),{proto:uGe}=VB,Rm=class r{constructor(e){this.fileId=e.fileId,this.size=e.size,this.expirationTime=e.expirationTime,this.isDeleted=e.isDeleted,this.keys=e.keys,this.fileMemo=e.fileMemo,this.ledgerId=e.ledgerId,Object.freeze(this)}static _fromProtobuf(e){let t=e.size;return new r({fileId:zt._fromProtobuf(e.fileID),size:t instanceof jB.default?t:jB.default.fromValue(t),expirationTime:lt._fromProtobuf(e.expirationTime),isDeleted:e.deleted,keys:e.keys!=null?Ri.__fromProtobufKeyList(e.keys):new Ri,fileMemo:e.memo!=null?e.memo:"",ledgerId:e.ledgerId!=null?mr.fromBytes(e.ledgerId):null})}_toProtobuf(){return{fileID:this.fileId._toProtobuf(),size:this.size,expirationTime:this.expirationTime._toProtobuf(),deleted:this.isDeleted,keys:this.keys._toProtobufKey().keyList,memo:this.fileMemo,ledgerId:this.ledgerId!=null?this.ledgerId.toBytes():null}}static fromBytes(e){return r._fromProtobuf(VB.proto.FileGetInfoResponse.FileInfo.decode(e))}toBytes(){return uGe.FileGetInfoResponse.FileInfo.encode(this._toProtobuf()).finish()}};var uv=class r extends xr{constructor(e={}){super(),this._fileId=null,e.fileId!=null&&this.setFileId(e.fileId)}static _fromProtobuf(e){let t=e.fileGetInfo;return new r({fileId:t.fileID!=null?zt._fromProtobuf(t.fileID):void 0})}get fileId(){return this._fileId}setFileId(e){return this._fileId=typeof e=="string"?zt.fromString(e):e.clone(),this}async getCost(e){return super.getCost(e)}_validateChecksums(e){this._fileId!=null&&this._fileId.validateChecksum(e)}_execute(e,t){return e.file.getFileInfo(t)}_mapResponseHeader(e){return e.fileGetInfo.header}_mapResponse(e,t,n){let i=e.fileGetInfo;return Promise.resolve(Rm._fromProtobuf(i.fileInfo))}_onMakeRequest(e){return{fileGetInfo:{header:e,fileID:this._fileId!=null?this._fileId._toProtobuf():null}}}_getLogId(){return`FileInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("fileGetInfo",uv._fromProtobuf);var dv=class r extends ke{constructor(e={}){super(),this._fileId=null,this._keys=null,this._expirationTime=null,this._contents=null,this._fileMemo=null,e.fileId!=null&&this.setFileId(e.fileId),e.keys!=null&&this.setKeys(e.keys),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime),e.contents!=null&&this.setContents(e.contents),e.fileMemo!=null&&this.setFileMemo(e.fileMemo)}static _fromProtobuf(e,t,n,i,a){let s=a[0].fileUpdate;return ke._fromProtobufTransactions(new r({fileId:s.fileID!=null?zt._fromProtobuf(s.fileID):void 0,keys:s.keys!=null&&s.keys.keys!=null?s.keys.keys.map(c=>rt._fromProtobufKey(c)):void 0,expirationTime:s.expirationTime!=null?lt._fromProtobuf(s.expirationTime):void 0,contents:s.contents!=null?s.contents:void 0,fileMemo:s.memo!=null&&s.memo.value!=null?s.memo.value:void 0}),e,t,n,i,a)}get fileId(){return this._fileId}setFileId(e){return this._requireNotFrozen(),this._fileId=typeof e=="string"?zt.fromString(e):e.clone(),this}get keys(){return this._keys}setKeys(e){if(this._requireNotFrozen(),e instanceof Ri&&e.threshold!=null)throw new Error("Cannot set threshold key as file key");return this._keys=e instanceof Ri?e.toArray():e,this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof lt?e:lt.fromDate(e),this}get contents(){return this._contents}setContents(e){return this._requireNotFrozen(),this._contents=e instanceof Uint8Array?e:n3(e),this}get fileMemo(){return this._fileMemo}setFileMemo(e){return this._requireNotFrozen(),this._fileMemo=e,this}clearFileMemo(){return this._requireNotFrozen(),this._fileMemo=null,this}_validateChecksums(e){this._fileId!=null&&this._fileId.validateChecksum(e)}_execute(e,t){return e.file.updateFile(t)}_getTransactionDataCase(){return"fileUpdate"}_makeTransactionData(){return{fileID:this._fileId!=null?this._fileId._toProtobuf():null,keys:this._keys!=null?{keys:this._keys.map(e=>e._toProtobufKey())}:null,expirationTime:this._expirationTime!=null?this._expirationTime._toProtobuf():null,contents:this._contents,memo:this._fileMemo!=null?{value:this._fileMemo}:null}}_getLogId(){return`FileUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("fileUpdate",dv._fromProtobuf);var Eo=class r{constructor(e){this._code=e,Object.freeze(this)}toString(){switch(this){case r.UnknownFreezeType:return"UNKNOWN_FREEZE_TYPE";case r.FreezeOnly:return"FREEZE_ONLY";case r.PrepareUpgrade:return"PREPARE_UPGRADE";case r.FreezeUpgrade:return"FREEZE_UPGRADE";case r.FreezeAbort:return"FREEZE_ABORT";case r.TelemetryUpgrade:return"TELEMETRY_UPGRADE";default:return`UNKNOWN (${this._code})`}}static _fromCode(e){switch(e){case 0:return r.UnknownFreezeType;case 1:return r.FreezeOnly;case 2:return r.PrepareUpgrade;case 3:return r.FreezeUpgrade;case 4:return r.FreezeAbort;case 5:return r.TelemetryUpgrade;default:throw new Error(`(BUG) Status.fromCode() does not handle code: ${e}`)}}valueOf(){return this._code}};Eo.UnknownFreezeType=new Eo(0);Eo.FreezeOnly=new Eo(1);Eo.PrepareUpgrade=new Eo(2);Eo.FreezeUpgrade=new Eo(3);Eo.FreezeAbort=new Eo(4);Eo.TelemetryUpgrade=new Eo(5);var fv=class r extends ke{constructor(e={}){super(),this._startTime=null,this._startTimestamp=null,this._endTime=null,this._fileId=null,this._fileHash=null,this._freezeType=null,e.startTime!=null&&this.setStartTime(e.startTime.hour,e.startTime.minute),e.endTime!=null&&this.setEndTime(e.endTime.hour,e.endTime.minute),e.startTimestamp!=null&&this.setStartTimestamp(e.startTimestamp),e.updateFileId!=null&&this.setUpdateFileId(e.updateFileId),e.fileId!=null&&this.setFileId(e.fileId),e.fileHash!=null&&this.setFileHash(e.fileHash),e.freezeType!=null&&this.setFreezeType(e.freezeType)}static _fromProtobuf(e,t,n,i,a){let s=a[0].freeze;return ke._fromProtobufTransactions(new r({startTime:s.startHour!=null&&s.startMin!=null?{hour:s.startHour,minute:s.startMin}:void 0,endTime:s.endHour!=null&&s.endMin!=null?{hour:s.endHour,minute:s.endMin}:void 0,startTimestamp:s.startTime!=null?lt._fromProtobuf(s.startTime):void 0,updateFileId:s.updateFile!=null?zt._fromProtobuf(s.updateFile):void 0,fileHash:s.fileHash!=null?s.fileHash:void 0,freezeType:s.freezeType!=null?Eo._fromCode(s.freezeType):void 0}),e,t,n,i,a)}get startTime(){return null}setStartTime(e,t){if(this._requireNotFrozen(),typeof e=="string"){let n=e.split(":");this._startTime={hour:Number(n[0]),minute:Number(n[1])}}else this._startTime={hour:e,minute:t};return this}get startTimestamp(){return this._startTimestamp}setStartTimestamp(e){return this._requireNotFrozen(),this._startTimestamp=e,this}get endTime(){return console.warn("`FreezeTransaction.endTime` is deprecated"),this._endTime}setEndTime(e,t){if(console.warn("`FreezeTransaction.endTime` is deprecated"),this._requireNotFrozen(),typeof e=="string"){let n=e.split(":");this._endTime={hour:Number(n[0]),minute:Number(n[1])}}else this._endTime={hour:e,minute:t};return this}get updateFileId(){return this.fileId}setUpdateFileId(e){return this.setFileId(e)}get fileId(){return this._fileId}setFileId(e){return this._requireNotFrozen(),this._fileId=e,this}get fileHash(){return this._fileHash}setFileHash(e){return this._requireNotFrozen(),this._fileHash=typeof e=="string"?et(e):e,this}get freezeType(){return this._freezeType}setFreezeType(e){return this._requireNotFrozen(),this._freezeType=e,this}_getTransactionDataCase(){return"freeze"}_makeTransactionData(){return{startTime:this._startTimestamp!=null?this._startTimestamp._toProtobuf():null,updateFile:this._fileId!=null?this._fileId._toProtobuf():null,fileHash:this._fileHash,freezeType:this._freezeType!=null?this._freezeType.valueOf():null}}_getLogId(){return`FreezeTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("freeze",fv._fromProtobuf);var pv=class r extends ke{constructor(e={}){super(),this._hash=null,this._keys=null,this._duration=null,this._accountId=null,e.hash!=null&&this.setHash(e.hash),e.keys!=null&&this.setKeys(e.keys),e.duration!=null&&this.setDuration(e.duration),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let c=a[0].cryptoAddLiveHash.liveHash;return ke._fromProtobufTransactions(new r({hash:c.hash!=null?c.hash:void 0,keys:c.keys!=null&&c.keys.keys!=null?c.keys.keys.map(l=>rt._fromProtobufKey(l)):void 0,duration:c.duration!=null&&c.duration.seconds!=null?c.duration.seconds:void 0,accountId:c.accountId!=null?ne._fromProtobuf(c.accountId):void 0}),e,t,n,i,a)}get hash(){return this._hash}setHash(e){return this._requireNotFrozen(),this._hash=e,this}get keys(){return this._keys}setKeys(e){return this._requireNotFrozen(),this._keys=e instanceof Ri?e.toArray():e,this}get duration(){return this._duration}setDuration(e){return this._requireNotFrozen(),this._duration=e instanceof fr?e:new fr(e),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.crypto.addLiveHash(t)}_getTransactionDataCase(){return"cryptoAddLiveHash"}_makeTransactionData(){return{liveHash:{hash:this._hash,keys:this._keys!=null?{keys:this._keys.map(e=>e._toProtobufKey())}:void 0,duration:this._duration!=null?this._duration._toProtobuf():null,accountId:this._accountId!=null?this._accountId._toProtobuf():null}}}_getLogId(){return`LiveHashAddTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("cryptoAddLiveHash",pv._fromProtobuf);var hv=class r extends ke{constructor(e={}){super(),this._hash=null,this._accountId=null,e.hash!=null&&this.setHash(e.hash),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoDeleteLiveHash;return ke._fromProtobufTransactions(new r({hash:s.liveHashToDelete!=null?s.liveHashToDelete:void 0,accountId:s.accountOfLiveHash!=null?ne._fromProtobuf(s.accountOfLiveHash):void 0}),e,t,n,i,a)}get hash(){return this._hash}setHash(e){return this._requireNotFrozen(),this._hash=e,this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.crypto.deleteLiveHash(t)}_getTransactionDataCase(){return"cryptoDeleteLiveHash"}_makeTransactionData(){return{liveHashToDelete:this._hash,accountOfLiveHash:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`LiveHashDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("cryptoDeleteLiveHash",hv._fromProtobuf);var mv=class r extends xr{constructor(e={}){super(),this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId),this._hash=null,e.hash!=null&&this.setHash(e.hash)}static _fromProtobuf(e){let t=e.cryptoGetLiveHash;return new r({accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):void 0,hash:t.hash!=null?t.hash:void 0})}get accountId(){return this._accountId}setAccountId(e){return this._accountId=e instanceof ne?e:ne.fromString(e),this}get liveHash(){return this._hash}setHash(e){return this._hash=e,this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.crypto.getLiveHash(t)}_mapResponseHeader(e){return e.cryptoGetLiveHash.header}_mapResponse(e){let t=e.cryptoGetLiveHash;return Promise.resolve(Of._fromProtobuf(t.liveHash))}_onMakeRequest(e){return{cryptoGetLiveHash:{header:e,accountID:this._accountId!=null?this._accountId._toProtobuf():null,hash:this._hash}}}_getLogId(){return`LiveHashQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("cryptoGetLiveHash",mv._fromProtobuf);var HB=Ie(vr(),1),m1=class r{constructor(e){this.major=e.major,this.minor=e.minor,this.patch=e.patch,Object.freeze(this)}static _fromProtobuf(e){return new r({major:e.major,minor:e.minor,patch:e.patch})}_toProtobuf(){return{major:this.major,minor:this.minor,patch:this.patch}}static fromBytes(e){return r._fromProtobuf(HB.proto.SemanticVersion.decode(e))}toBytes(){return HB.proto.SemanticVersion.encode(this._toProtobuf()).finish()}};var KB=Ie(vr(),1),Om=class r{constructor(e){this.protobufVersion=e.protobufVersion,this.servicesVesion=e.servicesVesion,Object.freeze(this)}static _fromProtobuf(e){return new r({protobufVersion:m1._fromProtobuf(e.hapiProtoVersion),servicesVesion:m1._fromProtobuf(e.hederaServicesVersion)})}_toProtobuf(){return{hapiProtoVersion:this.protobufVersion._toProtobuf(),hederaServicesVersion:this.servicesVesion._toProtobuf()}}static fromBytes(e){return r._fromProtobuf(KB.proto.NetworkGetVersionInfoResponse.decode(e))}toBytes(){return KB.proto.NetworkGetVersionInfoResponse.encode(this._toProtobuf()).finish()}};var gv=class r extends xr{constructor(){super()}static _fromProtobuf(e){return new r}_execute(e,t){return e.network.getVersionInfo(t)}_mapResponseHeader(e){return e.networkGetVersionInfo.header}_mapResponse(e){let t=e.networkGetVersionInfo;return Promise.resolve(Om._fromProtobuf(t))}_onMakeRequest(e){return{networkGetVersionInfo:{header:e}}}_getLogId(){return`NetworkVersionInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("networkGetVersionInfo",gv._fromProtobuf);var yv=class r extends ke{constructor(e={}){super(),this._range=null,e.range!=null&&this.setRange(e.range)}setRange(e){return this._range=e,this}get range(){return this._range}_validateChecksums(e){this._range!=null&&Dw(this._range)&&this._validateChecksums(e)}_execute(e,t){return e.util.prng(t)}static _fromProtobuf(e,t,n,i,a){let s=a[0].utilPrng;return ke._fromProtobufTransactions(new r({range:s.range}),e,t,n,i,a)}_getTransactionDataCase(){return"utilPrng"}_makeTransactionData(){return{range:this.range}}_getLogId(){return`RandomGenerate:${this._transactionIds.current.validStart.toString()}`}};Ge.set("utilPrng",yv._fromProtobuf);var Hx=Ie(vr(),1),Dm=class r extends ke{constructor(e={}){super(),this._adminKey=null,this._scheduledTransaction=null,this._payerAccountId=null,this._scheduleMemo=null,this._scheduledSignerPublicKeys=new Set,this._expirationTime=null,this._waitForExpiry=null,e.adminKey!=null&&this.setAdminKey(e.adminKey),e.payerAccountID!=null&&this.setPayerAccountId(e.payerAccountID),e.scheduleMemo!=null&&this.setScheduleMemo(e.scheduleMemo),this._defaultMaxTransactionFee=new ze(5)}static _fromProtobuf(e,t,n,i,a){let o=a[0],s=o.scheduleCreate,c=new r({adminKey:s.adminKey!=null?rt._fromProtobufKey(s.adminKey):void 0,payerAccountID:s.payerAccountID!=null?ne._fromProtobuf(s.payerAccountID):void 0,scheduleMemo:s.memo!=null?s.memo:void 0,waitForExpiry:s.waitForExpiry!=null?s.waitForExpiry:void 0,expirationTime:s.expirationTime!=null?lt._fromProtobuf(s.expirationTime):void 0});if(o.scheduleCreate!=null){let l=o.scheduleCreate.scheduledTransactionBody,u=Hx.proto.TransactionBody.encode(l).finish(),h={signedTransactionBytes:Hx.proto.SignedTransaction.encode({bodyBytes:u}).finish()},g=Hx.proto.TransactionList.encode({transactionList:[h]}).finish(),m=ke.fromBytes(g);c._setScheduledTransaction(m)}return ke._fromProtobufTransactions(c,e,t,n,i,a)}_setScheduledTransaction(e){return this._scheduledTransaction=e,this}get adminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}get payerAccountId(){return this._payerAccountId}setPayerAccountId(e){return this._requireNotFrozen(),this._payerAccountId=e,this}setScheduleMemo(e){return this._requireNotFrozen(),this._scheduleMemo=e,this}get getScheduleMemo(){return this._requireNotFrozen(),this._scheduleMemo}setScheduledTransaction(e){return this._requireNotFrozen(),e._requireNotFrozen(),this._scheduledTransaction=e.schedule()._scheduledTransaction,this}_validateChecksums(e){this._payerAccountId!=null&&this._payerAccountId.validateChecksum(e)}_execute(e,t){return e.schedule.createSchedule(t)}_getTransactionDataCase(){return"scheduleCreate"}_makeTransactionData(){return{adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,payerAccountID:this._payerAccountId!=null?this._payerAccountId._toProtobuf():null,scheduledTransactionBody:this._scheduledTransaction!=null?this._scheduledTransaction._getScheduledTransactionBody():null,memo:this._scheduleMemo,waitForExpiry:this._waitForExpiry,expirationTime:this._expirationTime!=null?this._expirationTime._toProtobuf():null}}_getLogId(){return`ScheduleCreateTransaction:${this._transactionIds.current.validStart.toString()}`}setExpirationTime(e){return this._expirationTime=e,this}get expirationTime(){return this._requireNotFrozen(),this._expirationTime}setWaitForExpiry(e){return this._waitForExpiry=e,this}get waitForExpiry(){return this._requireNotFrozen(),this._waitForExpiry}};Ge.set("scheduleCreate",Dm._fromProtobuf);Bx.push(()=>new Dm);var vv=class r extends ke{constructor(e={}){super(),this._scheduleId=null,e.scheduleId!=null&&this.setScheduleId(e.scheduleId),this._defaultMaxTransactionFee=new ze(5)}static _fromProtobuf(e,t,n,i,a){let s=a[0].scheduleDelete;return ke._fromProtobufTransactions(new r({scheduleId:s.scheduleID!=null?Na._fromProtobuf(s.scheduleID):void 0}),e,t,n,i,a)}get scheduleId(){return this._scheduleId}setScheduleId(e){return this._requireNotFrozen(),this._scheduleId=typeof e=="string"?Na.fromString(e):e.clone(),this}_validateChecksums(e){this._scheduleId!=null&&this._scheduleId.validateChecksum(e)}_execute(e,t){return e.schedule.deleteSchedule(t)}_getTransactionDataCase(){return"scheduleDelete"}_makeTransactionData(){return{scheduleID:this._scheduleId!=null?this._scheduleId._toProtobuf():null}}_getLogId(){return`ScheduleDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("scheduleDelete",vv._fromProtobuf);var dGe=Ie(vr(),1);var{proto:Kx}=dGe,Pm=class r{constructor(e){this.scheduleId=e.scheduleId,this.creatorAccountId=e.creatorAccountID,this.payerAccountId=e.payerAccountID,this.schedulableTransactionBody=e.schedulableTransactionBody,this.signers=e.signers,this.scheduleMemo=e.scheduleMemo,this.adminKey=e.adminKey!=null?e.adminKey:null,this.expirationTime=e.expirationTime,this.executed=e.executed,this.deleted=e.deleted,this.scheduledTransactionId=e.scheduledTransactionId,this.waitForExpiry=e.waitForExpiry,Object.freeze(this)}static _fromProtobuf(e){return new r({scheduleId:Na._fromProtobuf(e.scheduleID),creatorAccountID:e.creatorAccountID!=null?ne._fromProtobuf(e.creatorAccountID):null,payerAccountID:e.payerAccountID!=null?ne._fromProtobuf(e.payerAccountID):null,schedulableTransactionBody:e.scheduledTransactionBody!=null?e.scheduledTransactionBody:null,adminKey:e.adminKey!=null?rt._fromProtobufKey(e.adminKey):null,signers:e.signers!=null?Ri.__fromProtobufKeyList(e.signers):null,scheduleMemo:e.memo!=null?e.memo:null,expirationTime:e.expirationTime!=null?lt._fromProtobuf(e.expirationTime):null,executed:e.executionTime!=null?lt._fromProtobuf(e.executionTime):null,deleted:e.deletionTime!=null?lt._fromProtobuf(e.deletionTime):null,scheduledTransactionId:e.scheduledTransactionID!=null?Wr._fromProtobuf(e.scheduledTransactionID):null,waitForExpiry:e.waitForExpiry!=null?e.waitForExpiry:!1})}_toProtobuf(){return{scheduleID:this.scheduleId!=null?this.scheduleId._toProtobuf():null,creatorAccountID:this.creatorAccountId!=null?this.creatorAccountId._toProtobuf():null,payerAccountID:this.payerAccountId!=null?this.payerAccountId._toProtobuf():null,scheduledTransactionBody:this.schedulableTransactionBody!=null?this.schedulableTransactionBody:null,adminKey:this.adminKey!=null?this.adminKey._toProtobufKey():null,signers:this.signers!=null?this.signers._toProtobufKey().keyList:null,memo:this.scheduleMemo!=null?this.scheduleMemo:"",expirationTime:this.expirationTime!=null?this.expirationTime._toProtobuf():null,scheduledTransactionID:this.scheduledTransactionId!=null?this.scheduledTransactionId._toProtobuf():null,waitForExpiry:this.waitForExpiry}}get scheduledTransaction(){if(this.schedulableTransactionBody==null)throw new Error("Scheduled transaction body is empty");let e=new Kx.SchedulableTransactionBody(this.schedulableTransactionBody),t=e.data;return ke.fromBytes(Kx.TransactionList.encode({transactionList:[{signedTransactionBytes:Kx.SignedTransaction.encode({bodyBytes:Kx.TransactionBody.encode({transactionFee:this.schedulableTransactionBody.transactionFee,memo:this.schedulableTransactionBody.memo,[t]:e[t]}).finish()}).finish()}]}).finish())}};var bv=class r extends xr{constructor(e={}){super(),this._scheduleId=null,e.scheduleId!=null&&this.setScheduleId(e.scheduleId)}static _fromProtobuf(e){let t=e.scheduleGetInfo;return new r({scheduleId:t.scheduleID!=null?Na._fromProtobuf(t.scheduleID):void 0})}get scheduleId(){return this._scheduleId}setScheduleId(e){return this._scheduleId=typeof e=="string"?Na.fromString(e):e.clone(),this}async getCost(e){return super.getCost(e)}_validateChecksums(e){this._scheduleId!=null&&this._scheduleId.validateChecksum(e)}_execute(e,t){return e.schedule.getScheduleInfo(t)}_mapResponseHeader(e){return e.scheduleGetInfo.header}_mapResponse(e,t,n){let i=e.scheduleGetInfo;return Promise.resolve(Pm._fromProtobuf(i.scheduleInfo))}_onMakeRequest(e){return{scheduleGetInfo:{header:e,scheduleID:this._scheduleId!=null?this._scheduleId._toProtobuf():null}}}_getLogId(){return`ScheduleInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("scheduleGetInfo",bv._fromProtobuf);var wv=class r extends ke{constructor(e={}){super(),this._scheduleId=null,e.scheduleId!=null&&this.setScheduleId(e.scheduleId),this._defaultMaxTransactionFee=new ze(5)}static _fromProtobuf(e,t,n,i,a){let s=a[0].scheduleSign;return ke._fromProtobufTransactions(new r({scheduleId:s.scheduleID!=null?Na._fromProtobuf(s.scheduleID):void 0}),e,t,n,i,a)}get scheduleId(){return this._scheduleId}setScheduleId(e){return this._requireNotFrozen(),this._scheduleId=typeof e=="string"?Na.fromString(e):e.clone(),this}_validateChecksums(e){this._scheduleId!=null&&this._scheduleId.validateChecksum(e)}_execute(e,t){return e.schedule.signSchedule(t)}_getTransactionDataCase(){return"scheduleSign"}_makeTransactionData(){return{scheduleID:this._scheduleId!=null?this._scheduleId._toProtobuf():null}}_getLogId(){return`ScheduleSignTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("scheduleSign",wv._fromProtobuf);var Bm=class{constructor(e){this.publicKey=e.publicKey,this.signature=e.signature,this.accountId=e.accountId}};var _v=class r extends ke{constructor(e={}){super(),this._fileId=null,this._contractId=null,this._expirationTime=null,e.fileId!=null&&this.setFileId(e.fileId),e.contractId!=null&&this.setContractId(e.contractId),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime)}static _fromProtobuf(e,t,n,i,a){let s=a[0].systemDelete;return ke._fromProtobufTransactions(new r({fileId:s.fileID!=null?zt._fromProtobuf(s.fileID):void 0,contractId:s.contractID!=null?_t._fromProtobuf(s.contractID):void 0,expirationTime:s.expirationTime!=null?lt._fromProtobuf(s.expirationTime):void 0}),e,t,n,i,a)}get fileId(){return this._fileId}setFileId(e){return this._requireNotFrozen(),this._fileId=e instanceof zt?e:zt.fromString(e),this}get contractId(){return this._contractId}setContractId(e){return this._requireNotFrozen(),this._contractId=e instanceof _t?e:_t.fromString(e),this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e,this}_execute(e,t){return this._fileId!=null?e.file.systemDelete(t):e.smartContract.systemDelete(t)}_getTransactionDataCase(){return"systemDelete"}_makeTransactionData(){return{fileID:this._fileId!=null?this._fileId._toProtobuf():null,contractID:this._contractId!=null?this._contractId._toProtobuf():null,expirationTime:this._expirationTime!=null?this._expirationTime._toProtobuf():null}}_getLogId(){return`SystemDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("systemDelete",_v._fromProtobuf);var Ev=class r extends ke{constructor(e={}){super(),this._fileId=null,this._contractId=null,e.fileId!=null&&this.setFileId(e.fileId),e.contractId!=null&&this.setContractId(e.contractId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].systemUndelete;return ke._fromProtobufTransactions(new r({fileId:s.fileID!=null?zt._fromProtobuf(s.fileID):void 0,contractId:s.contractID!=null?_t._fromProtobuf(s.contractID):void 0}),e,t,n,i,a)}get fileId(){return this._fileId}setFileId(e){return this._requireNotFrozen(),this._fileId=e instanceof zt?e:zt.fromString(e),this}get contractId(){return this._contractId}setContractId(e){return this._requireNotFrozen(),this._contractId=e instanceof _t?e:_t.fromString(e),this}_execute(e,t){return this._fileId!=null?e.file.systemUndelete(t):e.smartContract.systemUndelete(t)}_getTransactionDataCase(){return"systemUndelete"}_makeTransactionData(){return{fileID:this._fileId!=null?this._fileId._toProtobuf():null,contractID:this._contractId!=null?this._contractId._toProtobuf():null}}_getLogId(){return`SystemUndeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("systemUndelete",Ev._fromProtobuf);var xv=class r extends ke{constructor(e={}){super(),this._tokenIds=null,this._accountId=null,this._defaultMaxTransactionFee=new ze(5),e.tokenIds!=null&&this.setTokenIds(e.tokenIds),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenAssociate;return ke._fromProtobufTransactions(new r({tokenIds:s.tokens!=null?s.tokens.map(c=>Oe._fromProtobuf(c)):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0}),e,t,n,i,a)}get tokenIds(){return this._tokenIds}setTokenIds(e){return this._requireNotFrozen(),this._tokenIds=e.map(t=>typeof t=="string"?Oe.fromString(t):t.clone()),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e);for(let t of this._tokenIds!=null?this._tokenIds:[])t?.validateChecksum(e)}_execute(e,t){return e.token.associateTokens(t)}_getTransactionDataCase(){return"tokenAssociate"}_makeTransactionData(){return{tokens:this._tokenIds!=null?this._tokenIds.map(e=>e._toProtobuf()):null,account:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`TokenAssociateTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenAssociate",xv._fromProtobuf);var Av=Ie(Yt(),1),Tv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._amount=null,this._serials=[],e.tokenId!=null&&this.setTokenId(e.tokenId),e.amount!=null&&this.setAmount(e.amount),e.serials!=null&&this.setSerials(e.serials)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenBurn;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?Oe._fromProtobuf(s.token):void 0,amount:s.amount!=null?s.amount:void 0,serials:s.serialNumbers!=null?s.serialNumbers:void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?Oe.fromString(e):e.clone(),this}get amount(){return this._amount}setAmount(e){return this._requireNotFrozen(),this._amount=e instanceof Av.default?e:Av.default.fromValue(e),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e)}get serials(){return this._serials}setSerials(e){return this._requireNotFrozen(),this._serials=e.map(t=>t instanceof Av.default?t:Av.default.fromValue(t)),this}_execute(e,t){return e.token.burnToken(t)}_getTransactionDataCase(){return"tokenBurn"}_makeTransactionData(){return{amount:this._amount,serialNumbers:this._serials,token:this._tokenId!=null?this._tokenId._toProtobuf():null}}_getLogId(){return`TokenBurnTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenBurn",Tv._fromProtobuf);var Sv=Ie(Yt(),1);var rc=class r{constructor(e){this._code=e,Object.freeze(this)}toString(){switch(this){case r.FungibleCommon:return"FUNGIBLE_COMMON";case r.NonFungibleUnique:return"NON_FUNGIBLE_UNIQUE";default:return`UNKNOWN (${this._code})`}}static _fromCode(e){switch(e){case 0:return r.FungibleCommon;case 1:return r.NonFungibleUnique}throw new Error(`(BUG) TokenType.fromCode() does not handle code: ${e}`)}valueOf(){return this._code}};rc.FungibleCommon=new rc(0);rc.NonFungibleUnique=new rc(1);var nc=class r{constructor(e){this._code=e,Object.freeze(this)}toString(){switch(this){case r.Infinite:return"INFINITE";case r.Finite:return"FINITE";default:return`UNKNOWN (${this._code})`}}static _fromCode(e){switch(e){case 0:return r.Infinite;case 1:return r.Finite}throw new Error(`(BUG) TokenSupplyType.fromCode() does not handle code: ${e}`)}valueOf(){return this._code}};nc.Infinite=new nc(0);nc.Finite=new nc(1);var Iv=class r extends ke{constructor(e={}){super(),this._tokenName=null,this._tokenSymbol=null,this._decimals=null,this._initialSupply=null,this._treasuryAccountId=null,this._adminKey=null,this._kycKey=null,this._freezeKey=null,this._pauseKey=null,this._wipeKey=null,this._supplyKey=null,this._feeScheduleKey=null,this._freezeDefault=null,this._autoRenewAccountId=null,this._expirationTime=null,this._autoRenewPeriod=new fr(Eu),this._tokenMemo=null,this._customFees=[],this._tokenType=null,this._supplyType=null,this._maxSupply=null,this._defaultMaxTransactionFee=new ze(30),e.tokenName!=null&&this.setTokenName(e.tokenName),e.tokenSymbol!=null&&this.setTokenSymbol(e.tokenSymbol),e.decimals!=null&&this.setDecimals(e.decimals),e.initialSupply!=null&&this.setInitialSupply(e.initialSupply),e.treasuryAccountId!=null&&this.setTreasuryAccountId(e.treasuryAccountId),e.adminKey!=null&&this.setAdminKey(e.adminKey),e.kycKey!=null&&this.setKycKey(e.kycKey),e.freezeKey!=null&&this.setFreezeKey(e.freezeKey),e.pauseKey!=null&&this.setPauseKey(e.pauseKey),e.wipeKey!=null&&this.setWipeKey(e.wipeKey),e.supplyKey!=null&&this.setSupplyKey(e.supplyKey),e.feeScheduleKey!=null&&this.setFeeScheduleKey(e.feeScheduleKey),e.freezeDefault!=null&&this.setFreezeDefault(e.freezeDefault),e.autoRenewAccountId!=null&&this.setAutoRenewAccountId(e.autoRenewAccountId),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.tokenMemo!=null&&this.setTokenMemo(e.tokenMemo),e.customFees!=null&&this.setCustomFees(e.customFees),e.tokenType!=null&&this.setTokenType(e.tokenType),e.supplyType!=null&&this.setSupplyType(e.supplyType),e.maxSupply!=null&&this.setMaxSupply(e.maxSupply)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenCreation;return ke._fromProtobufTransactions(new r({tokenName:s.name!=null?s.name:void 0,tokenSymbol:s.symbol!=null?s.symbol:void 0,decimals:s.decimals!=null?s.decimals:void 0,initialSupply:s.initialSupply!=null?s.initialSupply:void 0,treasuryAccountId:s.treasury!=null?ne._fromProtobuf(s.treasury):void 0,adminKey:s.adminKey!=null?rt._fromProtobufKey(s.adminKey):void 0,kycKey:s.kycKey!=null?rt._fromProtobufKey(s.kycKey):void 0,freezeKey:s.freezeKey!=null?rt._fromProtobufKey(s.freezeKey):void 0,pauseKey:s.pauseKey!=null?rt._fromProtobufKey(s.pauseKey):void 0,wipeKey:s.wipeKey!=null?rt._fromProtobufKey(s.wipeKey):void 0,supplyKey:s.supplyKey!=null?rt._fromProtobufKey(s.supplyKey):void 0,feeScheduleKey:s.feeScheduleKey!=null?rt._fromProtobufKey(s.feeScheduleKey):void 0,freezeDefault:s.freezeDefault!=null?s.freezeDefault:void 0,autoRenewAccountId:s.autoRenewAccount!=null?ne._fromProtobuf(s.autoRenewAccount):void 0,expirationTime:s.expiry!=null?lt._fromProtobuf(s.expiry):void 0,autoRenewPeriod:s.autoRenewPeriod!=null?fr._fromProtobuf(s.autoRenewPeriod):void 0,tokenMemo:s.memo!=null?s.memo:void 0,customFees:s.customFees!=null?s.customFees.map(c=>c.fixedFee!=null?tc._fromProtobuf(c):c.fractionalFee!=null?Iu._fromProtobuf(c):Cu._fromProtobuf(c)):void 0,tokenType:s.tokenType!=null?rc._fromCode(s.tokenType):void 0,supplyType:s.supplyType!=null?nc._fromCode(s.supplyType):void 0,maxSupply:s.maxSupply!=null?s.maxSupply:void 0}),e,t,n,i,a)}get tokenName(){return this._tokenName}setTokenName(e){return this._requireNotFrozen(),this._tokenName=e,this}get tokenSymbol(){return this._tokenSymbol}setTokenSymbol(e){return this._requireNotFrozen(),this._tokenSymbol=e,this}get decimals(){return this._decimals}setDecimals(e){return this._requireNotFrozen(),this._decimals=e instanceof Sv.default?e:Sv.default.fromValue(e),this}get initialSupply(){return this._initialSupply}setInitialSupply(e){return this._requireNotFrozen(),this._initialSupply=Sv.default.fromValue(e),this}get treasuryAccountId(){return this._treasuryAccountId}setTreasuryAccountId(e){return this._requireNotFrozen(),this._treasuryAccountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get adminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}get kycKey(){return this._kycKey}setKycKey(e){return this._requireNotFrozen(),this._kycKey=e,this}get freezeKey(){return this._freezeKey}setFreezeKey(e){return this._requireNotFrozen(),this._freezeKey=e,this}get pauseKey(){return this._pauseKey}setPauseKey(e){return this._requireNotFrozen(),this._pauseKey=e,this}get wipeKey(){return this._wipeKey}setWipeKey(e){return this._requireNotFrozen(),this._wipeKey=e,this}get supplyKey(){return this._supplyKey}setSupplyKey(e){return this._requireNotFrozen(),this._supplyKey=e,this}get feeScheduleKey(){return this._feeScheduleKey}setFeeScheduleKey(e){return this._requireNotFrozen(),this._feeScheduleKey=e,this}get freezeDefault(){return this._freezeDefault}setFreezeDefault(e){return this._requireNotFrozen(),this._freezeDefault=e,this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._autoRenewPeriod=null,this._expirationTime=e instanceof lt?e:lt.fromDate(e),this}get autoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=e instanceof ne?e:ne.fromString(e),this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof fr?e:new fr(e),this}get tokenMemo(){return this._tokenMemo}setTokenMemo(e){return this._requireNotFrozen(),this._tokenMemo=e,this}get customFees(){return this._customFees}setCustomFees(e){return this._customFees=e,this}get tokenType(){return this._tokenType}setTokenType(e){return this._tokenType=e,this}get supplyType(){return this._supplyType}setSupplyType(e){return this._supplyType=e,this}get maxSupply(){return this._maxSupply}setMaxSupply(e){return this._maxSupply=typeof e=="number"?Sv.default.fromNumber(e):e,this}_freezeWithAccountId(e){super._freezeWithAccountId(e),this._autoRenewPeriod!=null&&e!=null&&(this._autoRenewAccountId=e)}freezeWith(e){return e!=null&&e.operatorAccountId!=null&&this._freezeWithAccountId(e.operatorAccountId),super.freezeWith(e)}_validateChecksums(e){this._treasuryAccountId!=null&&this._treasuryAccountId.validateChecksum(e),this._autoRenewAccountId!=null&&this._autoRenewAccountId.validateChecksum(e)}_execute(e,t){return e.token.createToken(t)}_getTransactionDataCase(){return"tokenCreation"}_makeTransactionData(){return{name:this._tokenName,symbol:this._tokenSymbol,decimals:this._decimals!=null?this._decimals.toInt():null,initialSupply:this._initialSupply,treasury:this._treasuryAccountId!=null?this._treasuryAccountId._toProtobuf():null,adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,kycKey:this._kycKey!=null?this._kycKey._toProtobufKey():null,freezeKey:this._freezeKey!=null?this._freezeKey._toProtobufKey():null,pauseKey:this._pauseKey!=null?this._pauseKey._toProtobufKey():null,wipeKey:this._wipeKey!=null?this._wipeKey._toProtobufKey():null,supplyKey:this._supplyKey!=null?this._supplyKey._toProtobufKey():null,feeScheduleKey:this._feeScheduleKey!=null?this._feeScheduleKey._toProtobufKey():null,freezeDefault:this._freezeDefault,autoRenewAccount:this._autoRenewAccountId!=null?this._autoRenewAccountId._toProtobuf():null,expiry:this._expirationTime!=null?this._expirationTime._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod!=null?this._autoRenewPeriod._toProtobuf():null,memo:this._tokenMemo,customFees:this.customFees.map(e=>e._toProtobuf()),tokenType:this._tokenType!=null?this._tokenType._code:null,supplyType:this._supplyType!=null?this._supplyType._code:null,maxSupply:this.maxSupply}}_getLogId(){return`TokenCreateTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenCreation",Iv._fromProtobuf);var Cv=class r extends ke{constructor(e={}){super(),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenDeletion;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?Oe._fromProtobuf(s.token):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?Oe.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e)}_execute(e,t){return e.token.deleteToken(t)}_getTransactionDataCase(){return"tokenDeletion"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null}}_getLogId(){return`TokenDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenDeletion",Cv._fromProtobuf);var kv=class r extends ke{constructor(e={}){super(),this._tokenIds=null,this._accountId=null,this._defaultMaxTransactionFee=new ze(5),e.tokenIds!=null&&this.setTokenIds(e.tokenIds),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenDissociate;return ke._fromProtobufTransactions(new r({tokenIds:s.tokens!=null?s.tokens.map(c=>Oe._fromProtobuf(c)):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0}),e,t,n,i,a)}get tokenIds(){return this._tokenIds}setTokenIds(e){return this._requireNotFrozen(),this._tokenIds=e.map(t=>typeof t=="string"?Oe.fromString(t):t.clone()),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e);for(let t of this._tokenIds!=null?this._tokenIds:[])t?.validateChecksum(e)}_execute(e,t){return e.token.dissociateTokens(t)}_getTransactionDataCase(){return"tokenDissociate"}_makeTransactionData(){return{tokens:this._tokenIds!=null?this._tokenIds.map(e=>e._toProtobuf()):null,account:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`TokenDissociateTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenDissociate",kv._fromProtobuf);var Nv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._customFees=[],e.tokenId!=null&&this.setTokenId(e.tokenId),e.customFees!=null&&this.setCustomFees(e.customFees)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenFeeScheduleUpdate;return ke._fromProtobufTransactions(new r({tokenId:s.tokenId!=null?Oe._fromProtobuf(s.tokenId):void 0,customFees:s.customFees!=null?s.customFees.map(c=>c.fixedFee!=null?tc._fromProtobuf(c):c.fractionalFee!=null?Iu._fromProtobuf(c):Cu._fromProtobuf(c)):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?Oe.fromString(e):Oe._fromProtobuf(e._toProtobuf()),this}get customFees(){return this._customFees}setCustomFees(e){return this._requireNotFrozen(),this._customFees=e,this}_execute(e,t){return e.token.updateTokenFeeSchedule(t)}_getTransactionDataCase(){return"tokenFeeScheduleUpdate"}_makeTransactionData(){return{tokenId:this._tokenId!=null?this._tokenId._toProtobuf():null,customFees:this._customFees.map(e=>e._toProtobuf())}}_getLogId(){return`TokenFeeScheduleUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenFeeScheduleUpdate",Nv._fromProtobuf);var Rv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._accountId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenFreeze;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?Oe._fromProtobuf(s.token):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?Oe.fromString(e):e.clone(),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e),this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.token.freezeTokenAccount(t)}_getTransactionDataCase(){return"tokenFreeze"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null,account:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`TokenFreezeTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenFreeze",Rv._fromProtobuf);var Ov=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._accountId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenGrantKyc;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?Oe._fromProtobuf(s.token):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?Oe.fromString(e):e.clone(),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e),this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.token.grantKycToTokenAccount(t)}_getTransactionDataCase(){return"tokenGrantKyc"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null,account:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`TokenGrantKycTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenGrantKyc",Ov._fromProtobuf);var j3e=Ie(Yt(),1),zB=Ie(vr(),1);var Mm=class r{constructor(e){this.tokenId=e.tokenId,this.name=e.name,this.symbol=e.symbol,this.decimals=e.decimals,this.totalSupply=e.totalSupply,this.treasuryAccountId=e.treasuryAccountId,this.adminKey=e.adminKey,this.kycKey=e.kycKey,this.freezeKey=e.freezeKey,this.pauseKey=e.pauseKey,this.wipeKey=e.wipeKey,this.supplyKey=e.supplyKey,this.feeScheduleKey=e.feeScheduleKey,this.defaultFreezeStatus=e.defaultFreezeStatus,this.defaultKycStatus=e.defaultKycStatus,this.pauseStatus=e.pauseStatus,this.isDeleted=e.isDeleted,this.autoRenewAccountId=e.autoRenewAccountId,this.autoRenewPeriod=e.autoRenewPeriod,this.expirationTime=e.expirationTime,this.tokenMemo=e.tokenMemo,this.customFees=e.customFees,this.tokenType=e.tokenType,this.supplyType=e.supplyType,this.maxSupply=e.maxSupply,this.ledgerId=e.ledgerId}static _fromProtobuf(e){let t=e.defaultFreezeStatus,n=e.defaultKycStatus,i=e.pauseStatus,a=e.autoRenewAccount!=null?ne._fromProtobuf(e.autoRenewAccount):new ne(0);return new r({tokenId:Oe._fromProtobuf(e.tokenId),name:e.name,symbol:e.symbol,decimals:e.decimals,totalSupply:j3e.default.fromValue(e.totalSupply),treasuryAccountId:e.treasury!=null?ne._fromProtobuf(e.treasury):null,adminKey:e.adminKey!=null?rt._fromProtobufKey(e.adminKey):null,kycKey:e.kycKey!=null?rt._fromProtobufKey(e.kycKey):null,freezeKey:e.freezeKey!=null?rt._fromProtobufKey(e.freezeKey):null,pauseKey:e.pauseKey!=null?rt._fromProtobufKey(e.pauseKey):null,wipeKey:e.wipeKey!=null?rt._fromProtobufKey(e.wipeKey):null,supplyKey:e.supplyKey!=null?rt._fromProtobufKey(e.supplyKey):null,feeScheduleKey:e.feeScheduleKey!=null?rt._fromProtobufKey(e.feeScheduleKey):null,defaultFreezeStatus:t===0?null:t==1,defaultKycStatus:n===0?null:n==1,pauseStatus:i===0?null:i==1,isDeleted:e.deleted,autoRenewAccountId:a.shard.toInt()==0&&a.realm.toInt()==0&&a.num.toInt()==0?null:a,autoRenewPeriod:e.autoRenewPeriod!=null?fr._fromProtobuf(e.autoRenewPeriod):null,expirationTime:e.expiry!=null?lt._fromProtobuf(e.expiry):null,tokenMemo:e.memo!=null?e.memo:"",customFees:e.customFees!=null?e.customFees.map(o=>o.fixedFee!=null?tc._fromProtobuf(o):o.fractionalFee!=null?Iu._fromProtobuf(o):Cu._fromProtobuf(o)):[],tokenType:e.tokenType!=null?rc._fromCode(e.tokenType):null,supplyType:e.supplyType!=null?nc._fromCode(e.supplyType):null,maxSupply:e.maxSupply!=null?e.maxSupply:null,ledgerId:e.ledgerId!=null?mr.fromBytes(e.ledgerId):null})}_toProtobuf(){return{tokenId:this.tokenId._toProtobuf(),name:this.name,symbol:this.symbol,decimals:this.decimals,totalSupply:this.totalSupply,treasury:this.treasuryAccountId!=null?this.treasuryAccountId._toProtobuf():null,adminKey:this.adminKey!=null?this.adminKey._toProtobufKey():null,kycKey:this.kycKey!=null?this.kycKey._toProtobufKey():null,freezeKey:this.freezeKey!=null?this.freezeKey._toProtobufKey():null,pauseKey:this.pauseKey!=null?this.pauseKey._toProtobufKey():null,wipeKey:this.wipeKey!=null?this.wipeKey._toProtobufKey():null,supplyKey:this.supplyKey!=null?this.supplyKey._toProtobufKey():null,feeScheduleKey:this.feeScheduleKey!=null?this.feeScheduleKey._toProtobufKey():null,defaultFreezeStatus:this.defaultFreezeStatus==null?0:this.defaultFreezeStatus?1:2,defaultKycStatus:this.defaultKycStatus==null?0:this.defaultKycStatus?1:2,pauseStatus:this.pauseStatus==null?0:this.pauseStatus?1:2,deleted:this.isDeleted,autoRenewAccount:this.autoRenewAccountId!=null?this.autoRenewAccountId._toProtobuf():void 0,autoRenewPeriod:this.autoRenewPeriod!=null?this.autoRenewPeriod._toProtobuf():null,expiry:this.expirationTime!=null?this.expirationTime._toProtobuf():null,memo:this.tokenMemo,customFees:this.customFees.map(e=>e._toProtobuf()),tokenType:this.tokenType!=null?this.tokenType._code:null,supplyType:this.supplyType!=null?this.supplyType._code:null,maxSupply:this.maxSupply,ledgerId:this.ledgerId!=null?this.ledgerId.toBytes():null}}static fromBytes(e){return r._fromProtobuf(zB.proto.TokenInfo.decode(e))}toBytes(){return zB.proto.TokenInfo.encode(this._toProtobuf()).finish()}};var Dv=class r extends xr{constructor(e={}){super(),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId)}static _fromProtobuf(e){let t=e.tokenGetInfo;return new r({tokenId:t.token!=null?Oe._fromProtobuf(t.token):void 0})}get tokenId(){return this._tokenId}setTokenId(e){return this._tokenId=typeof e=="string"?Oe.fromString(e):e.clone(),this}async getCost(e){return super.getCost(e)}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e)}_execute(e,t){return e.token.getTokenInfo(t)}_mapResponseHeader(e){return e.tokenGetInfo.header}_mapResponse(e,t,n){let i=e.tokenGetInfo;return Promise.resolve(Mm._fromProtobuf(i.tokenInfo))}_onMakeRequest(e){return{tokenGetInfo:{header:e,token:this._tokenId!=null?this._tokenId._toProtobuf():null}}}_getLogId(){return`TokenInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("tokenGetInfo",Dv._fromProtobuf);var GB=Ie(Yt(),1);var Pv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._amount=null,this._metadata=[],e.tokenId!=null&&this.setTokenId(e.tokenId),e.amount!=null&&this.setAmount(e.amount),e.metadata!=null&&this.setMetadata(e.metadata)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenMint;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?Oe._fromProtobuf(s.token):void 0,amount:s.amount!=null?s.amount:void 0,metadata:s.metadata!=null?s.metadata:void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?Oe.fromString(e):e.clone(),this}get amount(){return this._amount}setAmount(e){return this._requireNotFrozen(),this._amount=e instanceof GB.default?e:GB.default.fromValue(e),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e)}get metadata(){return this._metadata}addMetadata(e){return this._requireNotFrozen(),typeof e=="string"&&console.warn("Passing a `string` for token metadata is considered a bug, and has been removed. Please provide a `Uint8Array` instead."),this._metadata.push(typeof e=="string"?et(e):e),this}setMetadata(e){this._requireNotFrozen();for(let t of e)if(typeof t=="string"){console.warn("Passing a `string` for token metadata is considered a bug, and has been removed. Please provide a `Uint8Array` instead.");break}return this._metadata=e.map(t=>typeof t=="string"?et(t):t),this}_execute(e,t){return e.token.mintToken(t)}_getTransactionDataCase(){return"tokenMint"}_makeTransactionData(){return{amount:this._amount,token:this._tokenId!=null?this._tokenId._toProtobuf():null,metadata:this._metadata}}_getLogId(){return`TokenMintTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenMint",Pv._fromProtobuf);var Lm=class r{constructor(e){this.nftId=e.nftId,this.accountId=e.accountId,this.creationTime=e.creationTime,this.metadata=e.metadata,this.ledgerId=e.ledgerId,this.spenderId=e.spenderId,Object.freeze(this)}static _fromProtobuf(e){return new r({nftId:oa._fromProtobuf(e.nftID),accountId:ne._fromProtobuf(e.accountID),creationTime:lt._fromProtobuf(e.creationTime),metadata:e.metadata!==void 0?e.metadata:null,ledgerId:e.ledgerId!=null?mr.fromBytes(e.ledgerId):null,spenderId:e.spenderId!=null?ne._fromProtobuf(e.spenderId):null})}_toProtobuf(){return{nftID:this.nftId._toProtobuf(),accountID:this.accountId._toProtobuf(),creationTime:this.creationTime._toProtobuf(),metadata:this.metadata,ledgerId:this.ledgerId!=null?this.ledgerId.toBytes():null,spenderId:this.spenderId!=null?this.spenderId._toProtobuf():null}}toJson(){return{nftId:this.nftId.toString(),accountId:this.accountId.toString(),creationTime:this.creationTime.toString(),metadata:this.metadata!=null?He(this.metadata):null,ledgerId:this.ledgerId!=null?this.ledgerId.toString():null,spenderId:this.spenderId!=null?this.spenderId.toString():null}}toString(){return JSON.stringify(this.toJson())}};var WB=Ie(Yt(),1),Bv=class r extends xr{constructor(e={}){super(),this._nftId=null,e.nftId!=null&&this.setNftId(e.nftId),this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),this._start=null,e.start!=null&&this.setStart(e.start),this._end=null,e.end!=null&&this.setEnd(e.end)}static _fromProtobuf(e){if(e.tokenGetNftInfo!=null){let t=e.tokenGetNftInfo;return new r({nftId:t.nftID!=null?oa._fromProtobuf(t.nftID):void 0})}else if(e.tokenGetAccountNftInfos!=null){let t=e.tokenGetAccountNftInfos;return new r({accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):void 0,start:t.start!=null?t.start:void 0,end:t.end!=null?t.end:void 0})}else{let t=e.tokenGetNftInfos;return new r({tokenId:t.tokenID!=null?Oe._fromProtobuf(t.tokenID):void 0,start:t.start!=null?t.start:void 0,end:t.end!=null?t.end:void 0})}}get nftId(){return this._nftId}setNftId(e){return this._nftId=typeof e=="string"?oa.fromString(e):oa._fromProtobuf(e._toProtobuf()),this}get accountId(){return console.warn("`TokenNftInfoQuery.accountId` is deprecated with no replacement"),this._accountId}setAccountId(e){return console.warn("`TokenNftInfoQuery.setAccountId()` is deprecated with no replacement"),this._accountId=typeof e=="string"?ne.fromString(e):ne._fromProtobuf(e._toProtobuf()),this}get tokenId(){return console.warn("`TokenNftInfoQuery.tokenId` is deprecated with no replacement"),this._tokenId}setTokenId(e){return console.warn("`TokenNftInfoQuery.setTokenId()` is deprecated with no replacement"),this._tokenId=typeof e=="string"?Oe.fromString(e):Oe._fromProtobuf(e._toProtobuf()),this}get start(){return console.warn("`TokenNftInfoQuery.start` is deprecated with no replacement"),this._start}setStart(e){return console.warn("`TokenNftInfoQuery.setStart()` is deprecated with no replacement"),this._start=typeof e=="number"?WB.default.fromNumber(e):e,this}get end(){return console.warn("`TokenNftInfoQuery.end` is deprecated with no replacement"),this._end}setEnd(e){return console.warn("`TokenNftInfoQuery.setEnd()` is deprecated with no replacement"),this._end=typeof e=="number"?WB.default.fromNumber(e):e,this}async getCost(e){return super.getCost(e)}_execute(e,t){return e.token.getTokenNftInfo(t)}_mapResponseHeader(e){return e.tokenGetNftInfo.header}_mapResponse(e,t,n){let i=[e.tokenGetNftInfo.nft];return Promise.resolve(i.map(a=>Lm._fromProtobuf(a)))}_onMakeRequest(e){return{tokenGetNftInfo:{header:e,nftID:this._nftId!=null?this._nftId._toProtobuf():null}}}_getLogId(){return`TokenNftInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("tokenGetNftInfo",Bv._fromProtobuf);var Mv=class r extends ke{constructor(e={}){super(),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenPause;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?Oe._fromProtobuf(s.token):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?Oe.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e)}_execute(e,t){return e.token.pauseToken(t)}_getTransactionDataCase(){return"tokenPause"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null}}_getLogId(){return`TokenPauseTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenPause",Mv._fromProtobuf);var Lv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._accountId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenRevokeKyc;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?Oe._fromProtobuf(s.token):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?Oe.fromString(e):e.clone(),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e),this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.token.revokeKycFromTokenAccount(t)}_getTransactionDataCase(){return"tokenRevokeKyc"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null,account:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`TokenRevokeKycTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenRevokeKyc",Lv._fromProtobuf);var Fv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._accountId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenUnfreeze;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?Oe._fromProtobuf(s.token):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?Oe.fromString(e):e.clone(),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e),this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.token.unfreezeTokenAccount(t)}_getTransactionDataCase(){return"tokenUnfreeze"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null,account:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`TokenUnfreezeTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenUnfreeze",Fv._fromProtobuf);var Uv=class r extends ke{constructor(e={}){super(),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenUnpause;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?Oe._fromProtobuf(s.token):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?Oe.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e)}_execute(e,t){return e.token.unpauseToken(t)}_getTransactionDataCase(){return"tokenUnpause"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null}}_getLogId(){return`TokenUnpauseTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenUnpause",Uv._fromProtobuf);var qv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._tokenName=null,this._tokenSymbol=null,this._treasuryAccountId=null,this._adminKey=null,this._kycKey=null,this._freezeKey=null,this._wipeKey=null,this._supplyKey=null,this._autoRenewAccountId=null,this._expirationTime=null,this._autoRenewPeriod=null,this._tokenMemo=null,this._feeScheduleKey=null,this._pauseKey=null,e.tokenId!=null&&this.setTokenId(e.tokenId),e.tokenName!=null&&this.setTokenName(e.tokenName),e.tokenSymbol!=null&&this.setTokenSymbol(e.tokenSymbol),e.treasuryAccountId!=null&&this.setTreasuryAccountId(e.treasuryAccountId),e.adminKey!=null&&this.setAdminKey(e.adminKey),e.kycKey!=null&&this.setKycKey(e.kycKey),e.freezeKey!=null&&this.setFreezeKey(e.freezeKey),e.wipeKey!=null&&this.setWipeKey(e.wipeKey),e.supplyKey!=null&&this.setSupplyKey(e.supplyKey),e.autoRenewAccountId!=null&&this.setAutoRenewAccountId(e.autoRenewAccountId),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.tokenMemo!=null&&this.setTokenMemo(e.tokenMemo),e.feeScheduleKey!=null&&this.setFeeScheduleKey(e.feeScheduleKey),e.pauseKey!=null&&this.setPauseKey(e.pauseKey)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenUpdate;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?Oe._fromProtobuf(s.token):void 0,tokenName:s.name!=null?s.name:void 0,tokenSymbol:s.symbol!=null?s.symbol:void 0,treasuryAccountId:s.treasury!=null?ne._fromProtobuf(s.treasury):void 0,adminKey:s.adminKey!=null?rt._fromProtobufKey(s.adminKey):void 0,kycKey:s.kycKey!=null?rt._fromProtobufKey(s.kycKey):void 0,freezeKey:s.freezeKey!=null?rt._fromProtobufKey(s.freezeKey):void 0,wipeKey:s.wipeKey!=null?rt._fromProtobufKey(s.wipeKey):void 0,supplyKey:s.supplyKey!=null?rt._fromProtobufKey(s.supplyKey):void 0,autoRenewAccountId:s.autoRenewAccount!=null?ne._fromProtobuf(s.autoRenewAccount):void 0,expirationTime:s.expiry!=null?lt._fromProtobuf(s.expiry):void 0,autoRenewPeriod:s.autoRenewPeriod!=null?fr._fromProtobuf(s.autoRenewPeriod):void 0,tokenMemo:s.memo!=null&&s.memo.value!=null?s.memo.value:void 0,feeScheduleKey:s.feeScheduleKey!=null?rt._fromProtobufKey(s.feeScheduleKey):void 0,pauseKey:s.pauseKey!=null?rt._fromProtobufKey(s.pauseKey):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?Oe.fromString(e):e.clone(),this}get tokenName(){return this._tokenName}setTokenName(e){return this._requireNotFrozen(),this._tokenName=e,this}get tokenSymbol(){return this._tokenSymbol}setTokenSymbol(e){return this._requireNotFrozen(),this._tokenSymbol=e,this}get treasuryAccountId(){return this._treasuryAccountId}setTreasuryAccountId(e){return this._requireNotFrozen(),this._treasuryAccountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get adminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}get kycKey(){return this._kycKey}setKycKey(e){return this._requireNotFrozen(),this._kycKey=e,this}get freezeKey(){return this._freezeKey}setFreezeKey(e){return this._requireNotFrozen(),this._freezeKey=e,this}get wipeKey(){return this._wipeKey}setWipeKey(e){return this._requireNotFrozen(),this._wipeKey=e,this}get supplyKey(){return this._supplyKey}setSupplyKey(e){return this._requireNotFrozen(),this._supplyKey=e,this}setsupplyKey(e){return this._requireNotFrozen(),this._supplyKey=e,this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof lt?e:lt.fromDate(e),this}get autoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=e instanceof ne?e:ne.fromString(e),this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof fr?e:new fr(e),this}get tokenMemo(){return this._tokenMemo}setTokenMemo(e){return this._requireNotFrozen(),this._tokenMemo=e,this}get feeScheduleKey(){return this._feeScheduleKey}setFeeScheduleKey(e){return this._requireNotFrozen(),this._feeScheduleKey=e,this}get pauseKey(){return this._pauseKey}setPauseKey(e){return this._requireNotFrozen(),this._pauseKey=e,this}clearTokenMemo(){return this._requireNotFrozen(),this._tokenMemo=null,this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e),this._treasuryAccountId!=null&&this._treasuryAccountId.validateChecksum(e),this._autoRenewAccountId!=null&&this._autoRenewAccountId.validateChecksum(e)}_execute(e,t){return e.token.updateToken(t)}_getTransactionDataCase(){return"tokenUpdate"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null,name:this.tokenName,symbol:this.tokenSymbol,treasury:this._treasuryAccountId!=null?this._treasuryAccountId._toProtobuf():null,adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,kycKey:this._kycKey!=null?this._kycKey._toProtobufKey():null,freezeKey:this._freezeKey!=null?this._freezeKey._toProtobufKey():null,pauseKey:this._pauseKey!=null?this._pauseKey._toProtobufKey():null,wipeKey:this._wipeKey!=null?this._wipeKey._toProtobufKey():null,supplyKey:this._supplyKey!=null?this._supplyKey._toProtobufKey():null,autoRenewAccount:this._autoRenewAccountId!=null?this._autoRenewAccountId._toProtobuf():null,expiry:this._expirationTime!=null?this._expirationTime._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod!=null?this._autoRenewPeriod._toProtobuf():null,memo:this._tokenMemo!=null?{value:this._tokenMemo}:null,feeScheduleKey:this._feeScheduleKey!=null?this._feeScheduleKey._toProtobufKey():null}}_getLogId(){return`TokenUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenUpdate",qv._fromProtobuf);var zx=Ie(Yt(),1),jv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._accountId=null,this._serials=[],this._amount=null,e.tokenId!=null&&this.setTokenId(e.tokenId),e.accountId!=null&&this.setAccountId(e.accountId),e.amount!=null&&this.setAmount(e.amount),e.serials!=null&&this.setSerials(e.serials)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenWipe;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?Oe._fromProtobuf(s.token):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0,amount:s.amount!=null?s.amount:void 0,serials:s.serialNumbers!=null?s.serialNumbers:void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?Oe.fromString(e):e.clone(),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get amount(){return this._amount}setAmount(e){return this._requireNotFrozen(),this._amount=e instanceof zx.default?e:zx.default.fromValue(e),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e),this._accountId!=null&&this._accountId.validateChecksum(e)}get serials(){return this._serials}setSerials(e){return this._requireNotFrozen(),this._serials=e.map(t=>typeof t=="number"?zx.default.fromNumber(t):t),this}_execute(e,t){return e.token.wipeTokenAccount(t)}_getTransactionDataCase(){return"tokenWipe"}_makeTransactionData(){return{amount:this._amount,token:this._tokenId!=null?this._tokenId._toProtobuf():null,account:this._accountId!=null?this._accountId._toProtobuf():null,serialNumbers:this.serials}}_getLogId(){return`TokenWipeTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("tokenWipe",jv._fromProtobuf);var Vv=class r extends ke{constructor(e={}){super(),this._adminKey=null,this._submitKey=null,this._autoRenewAccountId=null,this._autoRenewPeriod=new fr(Eu),this._topicMemo=null,e.adminKey!=null&&this.setAdminKey(e.adminKey),e.submitKey!=null&&this.setSubmitKey(e.submitKey),e.autoRenewAccountId!=null&&this.setAutoRenewAccountId(e.autoRenewAccountId),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.topicMemo!=null&&this.setTopicMemo(e.topicMemo)}static _fromProtobuf(e,t,n,i,a){let s=a[0].consensusCreateTopic;return ke._fromProtobufTransactions(new r({adminKey:s.adminKey!=null?rt._fromProtobufKey(s.adminKey):void 0,submitKey:s.submitKey!=null?rt._fromProtobufKey(s.submitKey):void 0,autoRenewAccountId:s.autoRenewAccount!=null?ne._fromProtobuf(s.autoRenewAccount):void 0,autoRenewPeriod:s.autoRenewPeriod!=null&&s.autoRenewPeriod.seconds!=null?s.autoRenewPeriod.seconds:void 0,topicMemo:s.memo!=null?s.memo:void 0}),e,t,n,i,a)}get topicMemo(){return this._topicMemo}getTopicMemo(){return this._topicMemo}setTopicMemo(e){return this._requireNotFrozen(),this._topicMemo=e,this}get adminKey(){return this._adminKey}getAdminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}get submitKey(){return this._submitKey}getSubmitKey(){return this._submitKey}setSubmitKey(e){return this._requireNotFrozen(),this._submitKey=e,this}get autoRenewAccountId(){return this._autoRenewAccountId}getAutoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=e instanceof ne?e:ne.fromString(e),this}get autoRenewPeriod(){return this._autoRenewPeriod}getAutoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof fr?e:new fr(e),this}_validateChecksums(e){this._autoRenewAccountId!=null&&this._autoRenewAccountId.validateChecksum(e)}_execute(e,t){return e.consensus.createTopic(t)}_getTransactionDataCase(){return"consensusCreateTopic"}_makeTransactionData(){return{adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,submitKey:this._submitKey!=null?this._submitKey._toProtobufKey():null,autoRenewAccount:this._autoRenewAccountId!=null?this._autoRenewAccountId._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod._toProtobuf(),memo:this._topicMemo}}_getLogId(){return`TopicCreateTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("consensusCreateTopic",Vv._fromProtobuf);var Hv=class r extends ke{constructor(e={}){super(),this._topicId=null,e.topicId!=null&&this.setTopicId(e.topicId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].consensusDeleteTopic;return ke._fromProtobufTransactions(new r({topicId:s.topicID!=null?ia._fromProtobuf(s.topicID):void 0}),e,t,n,i,a)}get topicId(){return this._topicId}setTopicId(e){return this._requireNotFrozen(),this._topicId=typeof e=="string"?ia.fromString(e):e.clone(),this}_validateChecksums(e){this._topicId!=null&&this._topicId.validateChecksum(e)}_execute(e,t){return e.consensus.deleteTopic(t)}_getTransactionDataCase(){return"consensusDeleteTopic"}_makeTransactionData(){return{topicID:this._topicId!=null?this._topicId._toProtobuf():null}}_getLogId(){return`TopicDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("consensusDeleteTopic",Hv._fromProtobuf);var Gx=Ie(Yt(),1);var QB=Ie(vr(),1);var Fm=class r{constructor(e){this.topicId=e.topicId,this.topicMemo=e.topicMemo,this.runningHash=e.runningHash,this.sequenceNumber=e.sequenceNumber,this.expirationTime=e.expirationTime,this.adminKey=e.adminKey,this.submitKey=e.submitKey,this.autoRenewPeriod=e.autoRenewPeriod,this.autoRenewAccountId=e.autoRenewAccountId,this.ledgerId=e.ledgerId,Object.freeze(this)}static _fromProtobuf(e){let t=e.topicInfo;return new r({topicId:ia._fromProtobuf(e.topicID),topicMemo:t.memo!=null?t.memo:"",runningHash:t.runningHash!=null?t.runningHash:new Uint8Array,sequenceNumber:t.sequenceNumber!=null?t.sequenceNumber instanceof Gx.default?t.sequenceNumber:Gx.default.fromValue(t.sequenceNumber):Gx.default.ZERO,expirationTime:t.expirationTime!=null?lt._fromProtobuf(t.expirationTime):null,adminKey:t.adminKey!=null?rt._fromProtobufKey(t.adminKey):null,submitKey:t.submitKey!=null?rt._fromProtobufKey(t.submitKey):null,autoRenewPeriod:t.autoRenewPeriod!=null?new fr(t.autoRenewPeriod.seconds):null,autoRenewAccountId:t.autoRenewAccount!=null?ne._fromProtobuf(t.autoRenewAccount):null,ledgerId:t.ledgerId!=null?mr.fromBytes(t.ledgerId):null})}_toProtobuf(){return{topicID:this.topicId._toProtobuf(),topicInfo:{memo:this.topicMemo,runningHash:this.runningHash,sequenceNumber:this.sequenceNumber,expirationTime:this.expirationTime!=null?this.expirationTime._toProtobuf():null,adminKey:this.adminKey!=null?this.adminKey._toProtobufKey():null,submitKey:this.submitKey!=null?this.submitKey._toProtobufKey():null,autoRenewPeriod:this.autoRenewPeriod!=null?this.autoRenewPeriod._toProtobuf():null,autoRenewAccount:this.autoRenewAccountId!=null?this.autoRenewAccountId._toProtobuf():null}}}static fromBytes(e){return r._fromProtobuf({topicInfo:QB.proto.ConsensusTopicInfo.decode(e)})}toBytes(){return QB.proto.ConsensusTopicInfo.encode(this._toProtobuf().topicInfo).finish()}};var Kv=class r extends xr{constructor(e={}){super(),this._topicId=null,e.topicId!=null&&this.setTopicId(e.topicId)}static _fromProtobuf(e){let t=e.consensusGetTopicInfo;return new r({topicId:t.topicID!=null?ia._fromProtobuf(t.topicID):void 0})}get topicId(){return this._topicId}setTopicId(e){return this._topicId=typeof e=="string"?ia.fromString(e):e.clone(),this}async getCost(e){return super.getCost(e)}_validateChecksums(e){this._topicId!=null&&this._topicId.validateChecksum(e)}_execute(e,t){return e.consensus.getTopicInfo(t)}_mapResponseHeader(e){return e.consensusGetTopicInfo.header}_mapResponse(e,t,n){return Promise.resolve(Fm._fromProtobuf(e.consensusGetTopicInfo))}_onMakeRequest(e){return{consensusGetTopicInfo:{header:e,topicID:this._topicId!=null?this._topicId._toProtobuf():null}}}_getLogId(){return`TopicInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};Qr.set("consensusGetTopicInfo",Kv._fromProtobuf);var fGe=Ie(Yt(),1);var hGe=Ie(Yt(),1);var yGe=Ie(vr(),1);var vGe=Ie(Yt(),1);var zv=class r extends ke{constructor(e={}){super(),this._topicId=null,e.topicId!=null&&this.setTopicId(e.topicId),this._message=null,e.message!=null&&this.setMessage(e.message),this._maxChunks=20,this._chunkSize=k3e,e.maxChunks!=null&&this.setMaxChunks(e.maxChunks),e.chunkSize!=null&&this.setChunkSize(e.chunkSize),this._chunkInfo=null}static _fromProtobuf(e,t,n,i,a){let s=a[0].consensusSubmitMessage;return ke._fromProtobufTransactions(new r({topicId:s.topicID!=null?ia._fromProtobuf(s.topicID):void 0,message:s.message!=null?s.message:void 0}),e,t,n,i,a)}get topicId(){return this._topicId}setTopicId(e){return this._requireNotFrozen(),this._topicId=typeof e=="string"?ia.fromString(e):e.clone(),this}get message(){return this._message}getMessage(){return this._message}setMessage(e){return this._requireNotFrozen(),e=DJ(e),this._message=e instanceof Uint8Array?e:n3(e),this}get maxChunks(){return this._maxChunks}getMaxChunks(){return this._maxChunks}setMaxChunks(e){return this._requireNotFrozen(),this._maxChunks=e,this}get chunkSize(){return this._chunkSize}getChunkSize(){return this._chunkSize}setChunkSize(e){return this._chunkSize=e,this}freezeWith(e){if(super.freezeWith(e),this._message==null)return this;let t=Math.floor((this._message.length+(this._chunkSize-1))/this._chunkSize);if(t>this._maxChunks)throw new Error(`Message with size ${this._message.length} too long for ${this._maxChunks} chunks`);let n=this._getTransactionId()._toProtobuf(),i=this._getTransactionId();this._transactionIds.locked=!1,this._transactions.clear(),this._transactionIds.clear(),this._signedTransactions.clear();for(let a=0;a<t;a++){this._chunkInfo={initialTransactionID:n,total:t,number:a+1},this._transactionIds.push(i),this._transactionIds.advance();for(let o of this._nodeAccountIds.list)this._signedTransactions.push(this._makeSignedTransaction(o));i=new Wr(i.accountId,new lt(i.validStart.seconds,i.validStart.nanos.add(1)))}return this._transactionIds.advance(),this._chunkInfo=null,this}schedule(){if(this._requireNotFrozen(),this._message!=null&&this._message.length>this._chunkSize)throw new Error(`cannot schedule \`TopicMessageSubmitTransaction\` with message over ${this._chunkSize} bytes`);return super.schedule()}async execute(e,t){return(await this.executeAll(e,t))[0]}async executeAll(e,t){super._isFrozen()||this.freezeWith(e);let n=this._getTransactionId(),i=e.operatorAccountId;i!=null&&i.equals(n.accountId)&&await super.signWithOperator(e);let a=[],o=t;for(let s=0;s<this._transactionIds.length;s++){let c=Date.now();a.push(await super.execute(e,o)),o!=null&&(o=Date.now()-c)}return a}_execute(e,t){return e.consensus.submitMessage(t)}_getTransactionDataCase(){return"consensusSubmitMessage"}_makeTransactionData(){if(this._chunkInfo!=null&&this._message!=null){let t=(this._chunkInfo.number-1)*this._chunkSize,n=t+this._chunkSize;return n>this._message.length&&(n=this._message.length),{topicID:this._topicId!=null?this._topicId._toProtobuf():null,message:this._message.slice(t,n),chunkInfo:this._chunkInfo}}else return{topicID:this._topicId!=null?this._topicId._toProtobuf():null,message:this._message}}_getLogId(){return`TopicMessageSubmitTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("consensusSubmitMessage",zv._fromProtobuf);var Gv=class r extends ke{constructor(e={}){super(),this._topicId=null,e.topicId!=null&&this.setTopicId(e.topicId),this._topicMemo=null,e.topicMemo!=null&&this.setTopicMemo(e.topicMemo),this._submitKey=null,e.submitKey!=null&&this.setSubmitKey(e.submitKey),this._adminKey=null,e.adminKey!=null&&this.setAdminKey(e.adminKey),this._autoRenewAccountId=null,e.autoRenewAccountId!=null&&this.setAutoRenewAccountId(e.autoRenewAccountId),this._autoRenewPeriod=null,e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),this._expirationTime=null,e.expirationTime!=null&&this.setExpirationTime(e.expirationTime)}static _fromProtobuf(e,t,n,i,a){let s=a[0].consensusUpdateTopic;return ke._fromProtobufTransactions(new r({topicId:s.topicID!=null?ia._fromProtobuf(s.topicID):void 0,adminKey:s.adminKey!=null?rt._fromProtobufKey(s.adminKey):void 0,submitKey:s.submitKey!=null?rt._fromProtobufKey(s.submitKey):void 0,autoRenewAccountId:s.autoRenewAccount!=null?ne._fromProtobuf(s.autoRenewAccount):void 0,autoRenewPeriod:s.autoRenewPeriod!=null&&s.autoRenewPeriod.seconds!=null?s.autoRenewPeriod.seconds:void 0,topicMemo:s.memo!=null&&s.memo.value!=null?s.memo.value:void 0,expirationTime:s.expirationTime!=null?lt._fromProtobuf(s.expirationTime):void 0}),e,t,n,i,a)}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof Date?lt.fromDate(e):e,this}get topicId(){return this._topicId}setTopicId(e){return this._requireNotFrozen(),this._topicId=typeof e=="string"?ia.fromString(e):e.clone(),this}clearTopicId(){return this._requireNotFrozen(),this._topicId=null,this}get topicMemo(){return this._topicMemo}setTopicMemo(e){return this._requireNotFrozen(),this._topicMemo=e,this}clearTopicMemo(){return this._requireNotFrozen(),this._topicMemo=null,this}get adminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}clearAdminKey(){return this._requireNotFrozen(),this._adminKey=null,this}get submitKey(){return this._submitKey}setSubmitKey(e){return this._requireNotFrozen(),this._submitKey=e,this}clearSubmitKey(){return this._requireNotFrozen(),this._submitKey=null,this}get autoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=e instanceof ne?e:ne.fromString(e),this}clearAutoRenewAccountId(){return this._requireNotFrozen(),this._autoRenewAccountId=null,this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof fr?e:new fr(e),this}_validateChecksums(e){this._topicId!=null&&this._topicId.validateChecksum(e),this._autoRenewAccountId!=null&&this._autoRenewAccountId.validateChecksum(e)}_execute(e,t){return e.consensus.updateTopic(t)}_getTransactionDataCase(){return"consensusUpdateTopic"}_makeTransactionData(){return{topicID:this._topicId!=null?this._topicId._toProtobuf():null,adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,submitKey:this._submitKey!=null?this._submitKey._toProtobufKey():null,memo:this._topicMemo!=null?{value:this._topicMemo}:null,autoRenewAccount:this._autoRenewAccountId!=null?this._autoRenewAccountId._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod!=null?this._autoRenewPeriod._toProtobuf():null,expirationTime:this._expirationTime!=null?this._expirationTime._toProtobuf():null}}_getLogId(){return`TopicUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("consensusUpdateTopic",Gv._fromProtobuf);var $v=Ie(Yt(),1);var Wv=class extends di{constructor(){super(e=>Oe.fromString(e))}};var Qv=class r extends di{constructor(){super(e=>ne.fromString(e))}static _fromProtobuf(e){let t=new r;for(let n of e.accountAmounts!=null?e.accountAmounts:[]){let i=ne._fromProtobuf(n.accountID);t._set(i,ze.fromTinybars(n.amount))}return t}};var $B=Ie(Yt(),1);var Um=class r{constructor(e){this.tokenId=e.tokenId instanceof Oe?e.tokenId:Oe.fromString(e.tokenId),this.senderAccountId=e.senderAccountId instanceof ne?e.senderAccountId:ne.fromString(e.senderAccountId),this.receiverAccountId=e.receiverAccountId instanceof ne?e.receiverAccountId:ne.fromString(e.receiverAccountId),this.serialNumber=$B.default.fromValue(e.serialNumber),this.isApproved=e.isApproved}static _fromProtobuf(e){let t=[];for(let n of e){let i=Oe._fromProtobuf(n.token);for(let a of n.nftTransfers!=null?n.nftTransfers:[])t.push(new r({tokenId:i,senderAccountId:ne._fromProtobuf(a.senderAccountID),receiverAccountId:ne._fromProtobuf(a.receiverAccountID),serialNumber:a.serialNumber!=null?a.serialNumber:$B.default.ZERO,isApproved:a.isApproval==!0}))}return t}_toProtobuf(){return{senderAccountID:this.senderAccountId._toProtobuf(),receiverAccountID:this.receiverAccountId._toProtobuf(),serialNumber:this.serialNumber,isApproval:this.isApproved}}};var Yv=class r extends ke{constructor(e={}){super(),this._tokenTransfers=[],this._hbarTransfers=[],this._nftTransfers=[],this._defaultMaxTransactionFee=new ze(1);for(let t of e.tokenTransfers!=null?e.tokenTransfers:[])this.addTokenTransfer(t.tokenId,t.accountId,t.amount);for(let t of e.hbarTransfers!=null?e.hbarTransfers:[])this.addHbarTransfer(t.accountId,t.amount);for(let t of e.nftTransfers!=null?e.nftTransfers:[])this.addNftTransfer(t.tokenId,t.serial,t.sender,t.recipient)}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoTransfer,c=new r;return c._tokenTransfers=Wd._fromProtobuf(s.tokenTransfers!=null?s.tokenTransfers:[]),c._hbarTransfers=du._fromProtobuf(s.transfers!=null?s.transfers.accountAmounts!=null?s.transfers.accountAmounts:[]:[]),c._nftTransfers=Um._fromProtobuf(s.tokenTransfers!=null?s.tokenTransfers:[]),ke._fromProtobufTransactions(c,e,t,n,i,a)}get tokenTransfers(){let e=new a1;for(let t of this._tokenTransfers){let n=e.get(t.tokenId);n!=null?n._set(t.accountId,t.amount):(n=new i1,n._set(t.accountId,t.amount),e._set(t.tokenId,n))}return e}_addTokenTransfer(e,t,n,i){this._requireNotFrozen();let a=e instanceof Oe?e:Oe.fromString(e),o=t instanceof ne?t:ne.fromString(t),s=n instanceof $v.default?n:$v.default.fromNumber(n);for(let c of this._tokenTransfers)if(c.tokenId.compare(a)===0&&c.accountId.compare(o)===0)return c.amount=c.amount.add(s),c.expectedDecimals=null,this;return this._tokenTransfers.push(new Wd({tokenId:e,accountId:t,expectedDecimals:null,amount:n,isApproved:i})),this}addTokenTransfer(e,t,n){return this._addTokenTransfer(e,t,n,!1)}addApprovedTokenTransfer(e,t,n){return this._addTokenTransfer(e,t,n,!0)}addTokenTransferWithDecimals(e,t,n,i){this._requireNotFrozen();let a=e instanceof Oe?e:Oe.fromString(e),o=t instanceof ne?t:ne.fromString(t),s=n instanceof $v.default?n:$v.default.fromNumber(n),c=!1;for(let l of this._tokenTransfers)if(l.tokenId.compare(a)===0){if(l.expectedDecimals!=null&&l.expectedDecimals!==i)throw new Error("expected decimals mis-match");l.expectedDecimals=i,l.accountId.compare(o)===0&&(l.amount=l.amount.add(s),l.expectedDecimals=i,c=!0)}return c?this:(this._tokenTransfers.push(new Wd({tokenId:e,accountId:t,expectedDecimals:i,amount:n,isApproved:!1})),this)}get tokenIdDecimals(){let e=new Wv;for(let t of this._tokenTransfers)e._set(t.tokenId,t.expectedDecimals);return e}get hbarTransfers(){let e=new Qv;for(let t of this._hbarTransfers)e._set(t.accountId,t.amount);return e}_addHbarTransfer(e,t,n){this._requireNotFrozen();let i=e instanceof ne?e.clone():ne.fromString(e),a=t instanceof ze?t:new ze(t);for(let o of this._hbarTransfers)if(o.accountId.compare(i)===0)return o.amount=ze.fromTinybars(o.amount.toTinybars().add(a.toTinybars())),this;return this._hbarTransfers.push(new du({accountId:i,amount:a,isApproved:n})),this}addHbarTransfer(e,t){return this._addHbarTransfer(e,t,!1)}addApprovedHbarTransfer(e,t){return this._addHbarTransfer(e,t,!0)}_validateChecksums(e){for(let t of this._hbarTransfers)t.accountId.validateChecksum(e);for(let t of this._tokenTransfers)t.tokenId.validateChecksum(e),t.accountId.validateChecksum(e);for(let t of this._nftTransfers)t.tokenId.validateChecksum(e),t.senderAccountId.validateChecksum(e),t.receiverAccountId.validateChecksum(e)}get nftTransfers(){let e=new o1;for(let t of this._nftTransfers){let n=e.get(t.tokenId),i={sender:t.senderAccountId,recipient:t.receiverAccountId,serial:t.serialNumber,isApproved:t.isApproved};n!=null?n.push(i):e._set(t.tokenId,[i])}return e}_addNftTransfer(e,t,n,i,a){this._requireNotFrozen();let o,s,c;if(t instanceof oa)o=t,s=typeof n=="string"?ne.fromString(n):n,c=typeof i=="string"?ne.fromString(i):i;else if(t instanceof Oe)o=new oa(t,n),s=typeof i=="string"?ne.fromString(i):i,c=typeof a=="string"?ne.fromString(a):a;else try{o=oa.fromString(t),s=typeof n=="string"?ne.fromString(n):n,c=typeof i=="string"?ne.fromString(i):i}catch{let u=Oe.fromString(t);o=new oa(u,n),s=typeof i=="string"?ne.fromString(i):i,c=typeof a=="string"?ne.fromString(a):a}for(let l of this._nftTransfers)if(l.tokenId.compare(o.tokenId)===0&&l.serialNumber.compare(o.serial)===0)return l.senderAccountId=s,l.receiverAccountId=c,this;return this._nftTransfers.push(new Um({tokenId:o.tokenId,serialNumber:o.serial,senderAccountId:s,receiverAccountId:c,isApproved:e})),this}addNftTransfer(e,t,n,i){return this._addNftTransfer(!1,e,t,n,i)}addApprovedNftTransfer(e,t,n,i){return this._addNftTransfer(!0,e,t,n,i)}setHbarTransferApproval(e,t){let n=typeof e=="string"?ne.fromString(e):e;for(let i of this._hbarTransfers)i.accountId.compare(n)===0&&(i.isApproved=t);return this}setTokenTransferApproval(e,t,n){let i=typeof e=="string"?Oe.fromString(e):e,a=typeof t=="string"?ne.fromString(t):t;for(let o of this._tokenTransfers)o.tokenId.compare(i)===0&&o.accountId.compare(a)===0&&(o.isApproved=n);return this}setNftTransferApproval(e,t){let n=typeof e=="string"?oa.fromString(e):e;for(let i of this._nftTransfers)i.tokenId.compare(n.tokenId)===0&&i.serialNumber.compare(n.serial)===0&&(i.isApproved=t);return this}_execute(e,t){return e.crypto.cryptoTransfer(t)}_getTransactionDataCase(){return"cryptoTransfer"}_makeTransactionData(){let e=[];this._tokenTransfers.sort((i,a)=>{let o=i.tokenId.compare(a.tokenId);return o!==0?o:i.accountId.compare(a.accountId)}),this._nftTransfers.sort((i,a)=>{let o=i.senderAccountId.compare(a.senderAccountId);if(o!=0)return o;let s=i.receiverAccountId.compare(a.receiverAccountId);return s!=0?s:i.serialNumber.compare(a.serialNumber)});let t=0,n=0;for(;t<this._tokenTransfers.length||n<this._nftTransfers.length;)if(t<this._tokenTransfers.length&&n<this._nftTransfers.length){let i=this._tokenTransfers[t].tokenId,a=this._nftTransfers[n].tokenId,o=e.length>0?e[e.length-1]:null,s=o!=null?o.tokenId:null;if(o!=null&&s!=null&&s.compare(i)===0){o.transfers.push(this._tokenTransfers[t++]);continue}if(o!=null&&s!=null&&s.compare(a)===0){o.nftTransfers.push(this._nftTransfers[n++]);continue}let c=i.compare(a);c===0?e.push({tokenId:i,expectedDecimals:this._tokenTransfers[t].expectedDecimals,transfers:[this._tokenTransfers[t++]],nftTransfers:[this._nftTransfers[n++]]}):c<0?e.push({tokenId:i,expectedDecimals:this._tokenTransfers[t].expectedDecimals,transfers:[this._tokenTransfers[t++]],nftTransfers:[]}):e.push({tokenId:a,expectedDecimals:null,transfers:[],nftTransfers:[this._nftTransfers[n++]]})}else if(t<this._tokenTransfers.length){let i=this._tokenTransfers[t].tokenId,a;for(let s of e)s.tokenId.compare(i)===0&&(a=s);let o=a!=null?a.tokenId:null;if(a!=null&&o!=null&&o.compare(i)===0){a.transfers.push(this._tokenTransfers[t++]);continue}e.push({tokenId:i,expectedDecimals:this._tokenTransfers[t].expectedDecimals,transfers:[this._tokenTransfers[t++]],nftTransfers:[]})}else if(n<this._nftTransfers.length){let i=this._nftTransfers[n].tokenId,a;for(let s of e)s.tokenId.compare(i)===0&&(a=s);let o=a!=null?a.tokenId:null;if(a!=null&&o!=null&&o.compare(i)===0){a.nftTransfers.push(this._nftTransfers[n++]);continue}e.push({tokenId:i,expectedDecimals:null,transfers:[],nftTransfers:[this._nftTransfers[n++]]})}return this._hbarTransfers.sort((i,a)=>i.accountId.compare(a.accountId)),{transfers:{accountAmounts:this._hbarTransfers.map(i=>({accountID:i.accountId._toProtobuf(),amount:i.amount.toTinybars(),isApproval:i.isApproved}))},tokenTransfers:e.map(i=>({token:i.tokenId._toProtobuf(),expectedDecimals:i.expectedDecimals!=null?{value:i.expectedDecimals}:null,transfers:i.transfers.map(a=>a._toProtobuf()),nftTransfers:i.nftTransfers.map(a=>a._toProtobuf())}))}}_getLogId(){return`TransferTransaction:${this._transactionIds.current.validStart.toString()}`}};Ge.set("cryptoTransfer",Yv._fromProtobuf);var qm=class r{constructor(e,t,n){let i=typeof t=="string"?Zc.fromStringDer(t):t;this.publicKey=i.publicKey,this.signer=a=>Promise.resolve(i.sign(a)),this.provider=n,this.accountId=typeof e=="string"?ne.fromString(e):e}static createRandomED25519(){let e=Zc.generateED25519(),n=e.publicKey.toAccountId(0,0);return Promise.resolve(new r(n,e))}static createRandomECDSA(){let e=Zc.generateECDSA(),n=e.publicKey.toAccountId(0,0);return Promise.resolve(new r(n,e))}getProvider(){return this.provider}getAccountId(){return this.accountId}getAccountKey(){return this.publicKey}getLedgerId(){return this.provider==null?null:this.provider.getLedgerId()}getNetwork(){return this.provider==null?{}:this.provider.getNetwork()}getMirrorNetwork(){return this.provider==null?[]:this.provider.getMirrorNetwork()}async sign(e){let t=[];for(let n of e)t.push(new Bm({publicKey:this.publicKey,signature:await this.signer(n),accountId:this.accountId}));return t}getAccountBalance(){return this.call(new X3().setAccountId(this.accountId))}getAccountInfo(){return this.call(new ol().setAccountId(this.accountId))}getAccountRecords(){return this.call(new xu().setAccountId(this.accountId))}signTransaction(e){return e.signWith(this.publicKey,this.signer)}checkTransaction(e){let t=e.transactionId;if(t!=null&&t.accountId!=null&&t.accountId.compare(this.accountId)!=0)throw new Error("transaction's ID constructed with a different account ID");if(this.provider==null)return Promise.resolve(e);let n=(e.nodeAccountIds!=null?e.nodeAccountIds:[]).map(a=>a.toString()),i=Object.values(this.provider.getNetwork()).map(a=>a.toString());if(!n.reduce((a,o)=>a&&i.includes(o),!0))throw new Error("Transaction already set node account IDs to values not within the current network");return Promise.resolve(e)}populateTransaction(e){if(e._freezeWithAccountId(this.accountId),e.transactionId==null&&e.setTransactionId(Wr.generate(this.accountId)),e.nodeAccountIds!=null&&e.nodeAccountIds.length!=0)return Promise.resolve(e.freeze());if(this.provider==null)return Promise.resolve(e);let t=Object.values(this.provider.getNetwork()).map(n=>typeof n=="string"?ne.fromString(n):n);return Bw(t),e.setNodeAccountIds(t.slice(0,(t.length+3-1)/3)),Promise.resolve(e.freeze())}call(e){if(this.provider==null)throw new Error("cannot send request with an wallet that doesn't contain a provider");return this.provider.call(e._setOperatorWith(this.accountId,this.publicKey,this.signer))}};var ZYe=Ie(zle(),1);var Ra=class r{constructor(e){this._name=e,Object.freeze(this)}toString(){switch(this){case r.Silent:return"silent";case r.Trace:return"trace";case r.Debug:return"debug";case r.Info:return"info";case r.Warn:return"warn";case r.Error:return"error";case r.Fatal:return"fatal";default:return`Unknown log level (${this._name})`}}static _fromString(e){switch(e){case"silent":return r.Silent;case"trace":return r.Trace;case"debug":return r.Debug;case"info":return r.Info;case"warn":return r.Warn;case"error":return r.Error;case"fatal":return r.Fatal;default:throw new Error(`Unknown log level: ${e}`)}}};Ra.Silent=new Ra("silent");Ra.Trace=new Ra("trace");Ra.Debug=new Ra("debug");Ra.Info=new Ra("info");Ra.Warn=new Ra("warn");Ra.Error=new Ra("error");Ra.Fatal=new Ra("fatal");var Gle=Ie(vr(),1),fA=class extends lu{constructor(e){super(),this._query=e,this._grpcDeadline=e._grpcDeadline,this._requestTimeout=e._requestTimeout,this._nodeAccountIds=e._nodeAccountIds.clone(),this._operator=e._operator,this._header=null}_getTransactionId(){return this._query._getTransactionId()}_getLogId(){return`CostQuery:${this._query._getLogId()}`}async _beforeExecute(e){if(e==null)throw new Error("Cannot do CostQuery without Client");let t=this._operator!=null?this._operator:e._operator;if(t==null)throw new Error("`client` must have an `operator` or an explicit payment transaction must be provided");this._query._nodeAccountIds.isEmpty&&this._query._nodeAccountIds.setList(e._network.getNodeAccountIdsForExecute());let n=Wr.generate(t.accountId);this._query.paymentTransactionId==null&&this._query.setPaymentTransactionId(n);let i=this._getLogId(),a=new ne(0),o=Wr.generate(new ne(0)),s=new ze(0);this._logger&&this._logger.debug(`[${i}] making a payment transaction for node ${a.toString()} and transaction ID ${o.toString()} with amount ${s.toString()}`),this._header={payment:await KE(o,new ne(0),t,s),responseType:Gle.proto.ResponseType.COST_ANSWER}}_makeRequestAsync(){return Promise.resolve(this._query._onMakeRequest(this._header))}_shouldRetry(e,t){return this._query._shouldRetry(e,t)}_mapStatusError(e,t){return this._query._mapStatusError(e,t)}_mapResponse(e,t,n){let i=this._query._mapResponseHeader(e).cost;return Promise.resolve(ze.fromTinybars(i))}_execute(e,t){return this._query._execute(e,t)}_requestToBytes(e){return this._query._requestToBytes(e)}_responseToBytes(e){return this._query._responseToBytes(e)}};zE.push(r=>new fA(r));var Dfe=Ie(require("fs"),1),Pfe=Ie(require("util"),1);var XYe=/^(\S+):(\d+)$/,tb=class r{constructor(e={}){if(e.address!=null){let t=XYe.exec(e.address);if(t==null)throw new Error(`failed to parse address: ${e.address}`);this._address=t[1],this._port=t[2]!=null?parseInt(t[2]):null}else if(e.host!=null&&e.port!=null)this._address=e.host,this._port=e.port;else throw new Error(`failed to create a managed node address: ${JSON.stringify(e)}`);Object.freeze(this)}static fromString(e){return new r({address:e})}toInsecure(){let e=this.port===50212?50211:this.port;return new r({host:this.address,port:e})}toSecure(){let e=this.port===50211?50212:this.port;return new r({host:this.address,port:e})}get address(){return this._address}get port(){return this._port}isTransportSecurity(){return this._port==50212||this._port==443}toString(){return this.port==null?this.address:`${this.address}:${this.port}`}};var w1=class{constructor(e={}){if(e.newNode!=null)this._address=typeof e.newNode.address=="string"?tb.fromString(e.newNode.address):e.newNode.address,this._cert=void 0,this._channel=null,this._channelInitFunction=e.newNode.channelInitFunction,this._lastUsed=Date.now(),this._readmitTime=Date.now(),this._useCount=0,this._badGrpcStatusCount=0,this._minBackoff=8e3,this._maxBackoff=1e3*60*60,this._currentBackoff=this._minBackoff;else if(e.cloneNode!=null)this._address=e.cloneNode.address,this._cert=e.cloneNode.node._cert,this._channel=e.cloneNode.node._channel,this._channelInitFunction=e.cloneNode.node._channelInitFunction,this._currentBackoff=e.cloneNode.node._currentBackoff,this._lastUsed=e.cloneNode.node._lastUsed,this._readmitTime=e.cloneNode.node._readmitTime,this._useCount=e.cloneNode.node._useCount,this._badGrpcStatusCount=e.cloneNode.node._badGrpcStatusCount,this._minBackoff=e.cloneNode.node._minBackoff,this._maxBackoff=e.cloneNode.node._minBackoff;else throw new Error(`failed to create ManagedNode: ${JSON.stringify(e)}`)}getKey(){throw new Error("not implemented")}setCert(e){return this}get address(){return this._address}get attempts(){return this._badGrpcStatusCount}get minBackoff(){return this._minBackoff}setMinBackoff(e){return this._currentBackoff<=e&&(this._currentBackoff=e),this._minBackoff=e,this}get maxBackoff(){return this._maxBackoff}setMaxBackoff(e){return this._currentBackoff<=e&&(this._currentBackoff=e),this._maxBackoff=e,this}getChannel(){return this._useCount++,this.__lastUsed=Date.now(),this._channel!=null?this._channel:(this._channel=this._channelInitFunction(this.address.toString(),this._cert),this._channel)}isHealthy(){return this._readmitTime<=Date.now()}increaseBackoff(){this._currentBackoff=Math.min(this._currentBackoff*2,this._maxBackoff),this._readmitTime=Date.now()+this._currentBackoff}decreaseBackoff(){this._currentBackoff=Math.max(this._currentBackoff/2,this._minBackoff)}getRemainingTime(){return this._readmitTime-this._lastUsed}backoff(){return new Promise(e=>setTimeout(e,this.getRemainingTime()))}compare(e){let t=this.getRemainingTime()-e.getRemainingTime();return t!=0||(t=this._currentBackoff-e._currentBackoff,t!=0)||(t=this._badGrpcStatusCount-e._badGrpcStatusCount,t!=0)||(t=this._useCount-e._useCount,t!=0)?t:this._lastUsed-e._lastUsed}close(){this._channel!=null&&this._channel.close(),this._channel=null}};var Wle={"0.0.3":`-----BEGIN CERTIFICATE-----
10640
10641
  MIICnzCCAiWgAwIBAgIUenyqJ4UaFBbwokatcUqAwW3o3rswCgYIKoZIzj0EAwMw
10641
10642
  gYQxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJUWDETMBEGA1UEBwwKUmljaGFyZHNv
10642
10643
  bjEPMA0GA1UECgwGSGVkZXJhMQ8wDQYDVQQLDAZIZWRlcmExEDAOBgNVBAMMBzAw