droplinked-web3-ui 0.0.25 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -20,7 +20,7 @@ You may have forgotten to import it.`);if(hasProp$1(exceptionPropMap,t)){c.forwa
|
|
|
20
20
|
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
21
21
|
2. You might be breaking the Rules of Hooks
|
|
22
22
|
3. You might have more than one copy of React in the same app
|
|
23
|
-
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),c.useMemoCache(n)}})()),Ce}var Le;function Xe(){return Le||(Le=1,process.env.NODE_ENV==="production"?fe.exports=Ue():fe.exports=Ke()),fe.exports}var $$3=Xe();const Je=t=>{const n=$$3.c(5);let c;n[0]!==t?({...c}=t,n[0]=t,n[1]=c):c=n[1];let ie;n[2]===Symbol.for("react.memo_cache_sentinel")?(ie=jsxRuntimeExports.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),n[2]=ie):ie=n[2];let se;return n[3]!==c?(se=jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...c,children:ie}),n[3]=c,n[4]=se):se=n[4],se},Qe=t=>{const n=$$3.c(5);let c;n[0]!==t?({...c}=t,n[0]=t,n[1]=c):c=n[1];let ie;n[2]===Symbol.for("react.memo_cache_sentinel")?(ie=jsxRuntimeExports.jsx("path",{d:"M6 12L10 8L6 4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),n[2]=ie):ie=n[2];let se;return n[3]!==c?(se=jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...c,children:ie}),n[3]=c,n[4]=se):se=n[4],se},X$3={primary:{bg:"primary.main",borderColor:"primary.main",color:"text.inverse",_hover:{bg:"primary.hover"},_active:{bg:"primary.hover"}},outlined:{bg:"neutral.bgLight",borderColor:"neutral.30",color:"text.main",_hover:{bg:"neutral.10"},_active:{bg:"neutral.30"}},filled:{bg:"neutral.10",borderColor:"transparent",color:"text.main",_hover:{bg:"neutral.30"},_active:{bg:"neutral.50"}},muted:{bg:"primary.tint10",borderColor:"primary.tint10",color:"primary.main",_hover:{bg:"primary.tint20",borderColor:"primary.tint20"},_active:{bg:"primary.main"}},transparent:{bg:"transparent",borderColor:"transparent",color:"text.main",_hover:{bg:"neutral.10"},_active:{bg:"neutral.30"}},information:{bg:"state.info.tint10",borderColor:"state.info.tint10",color:"state.info.main",_hover:{bg:"state.info.tint20",borderColor:"state.info.tint20"},_active:{bg:"state.info.main"}},success:{bg:"state.success.tint10",borderColor:"state.success.tint10",color:"state.success.main",_hover:{bg:"state.success.tint20",borderColor:"state.success.tint20"},_active:{bg:"state.success.main"}},warning:{bg:"state.warning.tint10",borderColor:"state.warning.tint10",color:"state.warning.main",_hover:{bg:"state.warning.tint20",borderColor:"state.warning.tint20"},_active:{bg:"state.warning.main"}},error:{bg:"state.error.tint10",borderColor:"state.error.tint10",color:"state.error.main",_hover:{bg:"state.error.tint20",borderColor:"state.error.tint20"},_active:{bg:"state.error.main"}},disabled:{bg:"neutral.10",borderColor:"transparent",color:"text.disabled",_hover:{bg:"neutral.10"},_active:{bg:"neutral.10"}}};function et$2(t,n,c){return{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",borderRadius:"dynamic.xs",bg:c.bg,borderWidth:"1px",borderStyle:"solid",borderColor:c.borderColor,color:c.color,cursor:n?"pointer":t==="disabled"?"not-allowed":"default",opacity:t==="disabled"?.6:1,userSelect:"none",whiteSpace:"nowrap",fontFamily:"Inter, sans-serif",textStyle:"body3Regular",height:"24px"}}function oe$1(t){const n=$$3.c(26);let c,ie,se,ae,de,ue,pe,ge;n[0]!==t?({label:de,showLeftIcon:ue,showRightIcon:pe,leftIcon:c,rightIcon:ae,variant:ge,onClick:ie,...se}=t,n[0]=t,n[1]=c,n[2]=ie,n[3]=se,n[4]=ae,n[5]=de,n[6]=ue,n[7]=pe,n[8]=ge):(c=n[1],ie=n[2],se=n[3],ae=n[4],de=n[5],ue=n[6],pe=n[7],ge=n[8]);const be=de===void 0?"24":de,_e=ue===void 0?!1:ue,we=pe===void 0?!1:pe,qe=ge===void 0?"outlined":ge,Ye=X$3[qe];let Ge;n[9]!==ie||n[10]!==qe||n[11]!==Ye?(Ge=et$2(qe,ie,Ye),n[9]=ie,n[10]=qe,n[11]=Ye,n[12]=Ge):Ge=n[12];const Ze=Ge,He=qe!=="disabled"?ie:void 0;let Ht;n[13]!==c||n[14]!==_e?(Ht=_e&&jsxRuntimeExports.jsx(Box,{display:"flex",flexShrink:0,children:c||jsxRuntimeExports.jsx(Icon,{as:Je})}),n[13]=c,n[14]=_e,n[15]=Ht):Ht=n[15];let un;n[16]!==ae||n[17]!==we?(un=we&&jsxRuntimeExports.jsx(Box,{display:"flex",flexShrink:0,children:ae||jsxRuntimeExports.jsx(Icon,{as:Qe})}),n[16]=ae,n[17]=we,n[18]=un):un=n[18];let De;return n[19]!==Ze||n[20]!==be||n[21]!==se||n[22]!==He||n[23]!==Ht||n[24]!==un?(De=jsxRuntimeExports.jsxs(Box,{onClick:He,...Ze,...se,children:[Ht,be,un]}),n[19]=Ze,n[20]=be,n[21]=se,n[22]=He,n[23]=Ht,n[24]=un,n[25]=De):De=n[25],De}function tt$2({state:t}){return{container:{display:"flex",flexDirection:"column",alignItems:"flex-start",padding:"12px 16px",borderRadius:"dynamic.md",borderWidth:"1px",borderStyle:"solid",width:"full",maxWidth:"368px",...(()=>{switch(t){case"information":return{bg:"state.info.tint10",borderColor:"state.info.tint10",color:"state.info.main"};case"success":return{bg:"state.success.tint10",borderColor:"state.success.tint10",color:"state.success.main"};case"warning":return{bg:"state.warning.tint10",borderColor:"state.warning.tint10",color:"state.warning.main"};case"error":return{bg:"state.error.tint10",borderColor:"state.error.tint10",color:"state.error.main"};default:return{bg:"neutral.10",borderColor:"neutral.30",color:"text.main"}}})()},text:{textStyle:"body3Regular",color:"inherit"}}}function pn(t){const n=$$3.c(8),{state:c,message:ie}=t,se=c===void 0?"neutral":c;let ae;n[0]!==se?(ae=tt$2({state:se}),n[0]=se,n[1]=ae):ae=n[1];const de=ae;let ue;n[2]!==ie||n[3]!==de.text?(ue=jsxRuntimeExports.jsx(Text,{...de.text,children:ie}),n[2]=ie,n[3]=de.text,n[4]=ue):ue=n[4];let pe;return n[5]!==de.container||n[6]!==ue?(pe=jsxRuntimeExports.jsx(Box,{...de.container,children:ue}),n[5]=de.container,n[6]=ue,n[7]=pe):pe=n[7],pe}function nt$2(t,n,c,ie){return{padding:t==="text"?"8px 16px":"8px",gap:"8px",borderRadius:"dynamic.md",bg:c&&n==="transparent"?void 0:ie.bg,borderWidth:"1px",borderStyle:"solid",borderColor:ie.borderColor,textStyle:"body2Regular",color:ie.color,opacity:c||n==="disabled"?.6:1,cursor:c||n==="disabled"?"not-allowed":"pointer",width:t==="icon"?"40px":void 0,height:t==="icon"?"40px":void 0,minW:t==="text"?"96px":void 0,_hover:ie._hover,_active:ie._active}}function ee$1(t){const n=$$3.c(31);let c,ie,se,ae,de,ue,pe,ge;n[0]!==t?({children:c,leftIcon:se,rightIcon:de,icon:ie,variant:ue,buttonType:pe,disabled:ge,...ae}=t,n[0]=t,n[1]=c,n[2]=ie,n[3]=se,n[4]=ae,n[5]=de,n[6]=ue,n[7]=pe,n[8]=ge):(c=n[1],ie=n[2],se=n[3],ae=n[4],de=n[5],ue=n[6],pe=n[7],ge=n[8]);const be=ue===void 0?"outlined":ue,_e=pe===void 0?"text":pe,we=ge===void 0?!1:ge,qe=X$3[we?"disabled":be];let Ye;n[9]!==_e||n[10]!==we||n[11]!==be||n[12]!==qe?(Ye=nt$2(_e,be,we,qe),n[9]=_e,n[10]=we,n[11]=be,n[12]=qe,n[13]=Ye):Ye=n[13];const Ge=Ye,Ze=we||be==="disabled";let He;n[14]!==_e||n[15]!==se?(He=_e==="text"&&se&&jsxRuntimeExports.jsx(Icon,{as:se}),n[14]=_e,n[15]=se,n[16]=He):He=n[16];const Ht=_e==="text"&&c;let un;n[17]!==_e||n[18]!==ie?(un=_e==="icon"&&ie&&jsxRuntimeExports.jsx(Icon,{as:ie}),n[17]=_e,n[18]=ie,n[19]=un):un=n[19];let De;n[20]!==_e||n[21]!==de?(De=_e==="text"&&de&&jsxRuntimeExports.jsx(Icon,{as:de}),n[20]=_e,n[21]=de,n[22]=De):De=n[22];let $e;return n[23]!==Ge||n[24]!==ae||n[25]!==Ze||n[26]!==He||n[27]!==Ht||n[28]!==un||n[29]!==De?($e=jsxRuntimeExports.jsxs(Button$1,{disabled:Ze,...Ge,...ae,children:[He,Ht,un,De]}),n[23]=Ge,n[24]=ae,n[25]=Ze,n[26]=He,n[27]=Ht,n[28]=un,n[29]=De,n[30]=$e):$e=n[30],$e}const Re="outlined";function ot$2(t){return t?t==="secondary"?"filled":t==="image"?Re:t:Re}function it$2(t,n){const c=ot$2(n),ie=X$3[c],se=t==="image"||n==="image";return{container:{display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"dynamic.md",width:"40px",height:"40px",padding:se?0:"8px",bg:se?"neutral.bgLight":n==="outlined"?"transparent":ie.bg,borderWidth:"1px",borderStyle:"solid",borderColor:se?"neutral.30":ie.borderColor},icon:{color:ie.color,width:"24px",height:"24px"},text:{textStyle:"body2Regular",color:ie.color},image:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"dynamic.md"}}}function te$1(t){const n=$$3.c(21),{type:c,variant:ie,icon:se,text:ae,imageSrc:de,imageAlt:ue}=t,pe=c===void 0?"icon":c,ge=ie===void 0?"outlined":ie,be=ue===void 0?"":ue;let _e;n[0]!==pe||n[1]!==ge?(_e=it$2(pe,ge),n[0]=pe,n[1]=ge,n[2]=_e):_e=n[2];const we=_e;let qe;n[3]!==se||n[4]!==we.icon||n[5]!==pe?(qe=pe==="icon"&&se&&jsxRuntimeExports.jsx(Icon,{as:se,...we.icon}),n[3]=se,n[4]=we.icon,n[5]=pe,n[6]=qe):qe=n[6];let Ye;n[7]!==we.text||n[8]!==ae||n[9]!==pe?(Ye=pe==="text"&&ae&&jsxRuntimeExports.jsx(Box,{...we.text,children:ae}),n[7]=we.text,n[8]=ae,n[9]=pe,n[10]=Ye):Ye=n[10];let Ge;n[11]!==be||n[12]!==de||n[13]!==we.image||n[14]!==pe?(Ge=pe==="image"&&de&&jsxRuntimeExports.jsx(Image,{src:de,alt:be,...we.image}),n[11]=be,n[12]=de,n[13]=we.image,n[14]=pe,n[15]=Ge):Ge=n[15];let Ze;return n[16]!==we.container||n[17]!==qe||n[18]!==Ye||n[19]!==Ge?(Ze=jsxRuntimeExports.jsxs(Box,{...we.container,children:[qe,Ye,Ge]}),n[16]=we.container,n[17]=qe,n[18]=Ye,n[19]=Ge,n[20]=Ze):Ze=n[20],Ze}function fn(t){const n=$$3.c(24);let c,ie,se,ae,de,ue,pe;n[0]!==t?({title:ae,iconContainerProps:c,rightContent:se,showIcon:de,width:ue,gap:pe,...ie}=t,n[0]=t,n[1]=c,n[2]=ie,n[3]=se,n[4]=ae,n[5]=de,n[6]=ue,n[7]=pe):(c=n[1],ie=n[2],se=n[3],ae=n[4],de=n[5],ue=n[6],pe=n[7]);const ge=ae===void 0?"Title Here":ae,be=de===void 0?!0:de,_e=ue===void 0?"100%":ue,we=pe===void 0?"16px":pe;let qe;n[8]!==c||n[9]!==be?(qe=be&&jsxRuntimeExports.jsx(te$1,{...c}),n[8]=c,n[9]=be,n[10]=qe):qe=n[10];let Ye;n[11]!==ge?(Ye=jsxRuntimeExports.jsx(Text,{flex:"1",fontFamily:"Inter, sans-serif",textStyle:"body2Medium",color:"text.main",whiteSpace:"pre-wrap",width:"max-content",children:ge}),n[11]=ge,n[12]=Ye):Ye=n[12];let Ge;n[13]!==qe||n[14]!==Ye?(Ge=jsxRuntimeExports.jsxs(Flex,{flex:"1",gap:"12px",alignItems:"center",children:[qe,Ye]}),n[13]=qe,n[14]=Ye,n[15]=Ge):Ge=n[15];let Ze;n[16]!==se?(Ze=se&&jsxRuntimeExports.jsx(Flex,{gap:"12px",alignItems:"center",flexShrink:0,children:se}),n[16]=se,n[17]=Ze):Ze=n[17];let He;return n[18]!==we||n[19]!==ie||n[20]!==Ge||n[21]!==Ze||n[22]!==_e?(He=jsxRuntimeExports.jsxs(Flex,{width:_e,gap:we,alignItems:"flex-end",justifyContent:"start",...ie,children:[Ge,Ze]}),n[18]=we,n[19]=ie,n[20]=Ge,n[21]=Ze,n[22]=_e,n[23]=He):He=n[23],He}function he(t){const n=$$3.c(6);let c,ie;n[0]!==t?({children:c,...ie}=t,n[0]=t,n[1]=c,n[2]=ie):(c=n[1],ie=n[2]);let se;return n[3]!==c||n[4]!==ie?(se=jsxRuntimeExports.jsx(Flex,{flexDirection:"column",p:4,borderRadius:"dynamic.2xl",border:"1px solid",borderColor:"neutral.30",background:"neutral.bgLight",boxShadow:"0 4px 36px 0 rgba(0, 0, 0, 0.12)",...ie,children:c}),n[3]=c,n[4]=ie,n[5]=se):se=n[5],se}function rt$2({type:t="text",isSelected:n,isDisabled:c,isInvalid:ie}){const se=t==="icon";let ae=ie?"state.error.main":"text.main";n&&(ae=ie?"state.error.main":"primary.main"),c&&(ae="text.disabled");const de=ae;return{container:{display:"flex",alignItems:"center",gap:"8px",padding:se?"8px":"8px 12px",width:se?"auto":"100%",height:"40px",borderRadius:"dynamic.md",cursor:c?"not-allowed":"pointer",userSelect:"none",_hover:c?void 0:{bg:ie?"state.error.tint10":"primary.tint10"}},label:{flex:"1 0 0",textStyle:"body2Regular",color:ae,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},icon:{color:de,flexShrink:0},chips:{flexShrink:0},rightIcon:{color:de,flexShrink:0},checkbox:{flexShrink:0}}}function lt$2(t,n,c){return n?"disabled":c?"error":t?"muted":"outlined"}function st$2(t){const n=$$3.c(32),{leftIcon:c,type:ie,isSelected:se,isDisabled:ae,isInvalid:de,onClick:ue}=t,pe=ie===void 0?"text":ie,ge=se===void 0?!1:se,be=ae===void 0?!1:ae,_e=de===void 0?!1:de,we=pe!=="icon",qe=we?t:void 0,Ye=qe?.label,Ge=qe?.chipsLabel,Ze=qe?.rightContent;let He;n[0]!==be||n[1]!==_e||n[2]!==ge||n[3]!==pe?(He=rt$2({type:pe,isSelected:ge,isDisabled:be,isInvalid:_e}),n[0]=be,n[1]=_e,n[2]=ge,n[3]=pe,n[4]=He):He=n[4];const Ht=He;let un;n[5]!==be||n[6]!==_e||n[7]!==ge?(un=lt$2(ge,be,_e),n[5]=be,n[6]=_e,n[7]=ge,n[8]=un):un=n[8];const De=un,$e=we&&!!Ye,me=we&&!!Ge,Gt=be?void 0:ue;let mn;n[9]!==c||n[10]!==Ht.icon?(mn=c&&jsxRuntimeExports.jsx(Box,{...Ht.icon,children:jsxRuntimeExports.jsx(Icon,{as:c,boxSize:"24px",color:"currentColor"})}),n[9]=c,n[10]=Ht.icon,n[11]=mn):mn=n[11];let dn;n[12]!==Ye||n[13]!==$e||n[14]!==Ht.label?(dn=$e&&jsxRuntimeExports.jsx(Box,{...Ht.label,children:Ye}),n[12]=Ye,n[13]=$e,n[14]=Ht.label,n[15]=dn):dn=n[15];let jt;n[16]!==Ge||n[17]!==De||n[18]!==me||n[19]!==Ht.chips?(jt=me&&jsxRuntimeExports.jsx(Box,{...Ht.chips,children:jsxRuntimeExports.jsx(oe$1,{label:Ge,variant:De})}),n[16]=Ge,n[17]=De,n[18]=me,n[19]=Ht.chips,n[20]=jt):jt=n[20];let le;n[21]!==we||n[22]!==Ze||n[23]!==Ht.rightIcon?(le=we&&Ze&&jsxRuntimeExports.jsx(Box,{...Ht.rightIcon,color:"currentColor",children:Ze}),n[21]=we,n[22]=Ze,n[23]=Ht.rightIcon,n[24]=le):le=n[24];let Pe;return n[25]!==Ht.container||n[26]!==le||n[27]!==Gt||n[28]!==mn||n[29]!==dn||n[30]!==jt?(Pe=jsxRuntimeExports.jsxs(Box,{...Ht.container,onClick:Gt,children:[mn,dn,jt,le]}),n[25]=Ht.container,n[26]=le,n[27]=Gt,n[28]=mn,n[29]=dn,n[30]=jt,n[31]=Pe):Pe=n[31],Pe}const Se=t=>{const n=$$3.c(5);let c;n[0]!==t?({...c}=t,n[0]=t,n[1]=c):c=n[1];let ie;n[2]===Symbol.for("react.memo_cache_sentinel")?(ie=jsxRuntimeExports.jsx("path",{d:"M17 7L7 17M7 7L17 17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),n[2]=ie):ie=n[2];let se;return n[3]!==c?(se=jsxRuntimeExports.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...c,children:ie}),n[3]=c,n[4]=se):se=n[4],se};function at$2(t){const n=$$3.c(35),{open:c,onOpenChange:ie,headerContent:se,children:ae,footerContent:de,title:ue,icon:pe,iconType:ge,iconButton:be,showCloseButton:_e,hasBlurBg:we,size:qe,maxHeight:Ye,minHeight:Ge}=t,Ze=ge===void 0?"container":ge,He=_e===void 0?!0:_e,Ht=we===void 0?!1:we,un=qe===void 0?"md":qe,De=Ye===void 0?"560px":Ye;let $e;n[0]!==pe||n[1]!==be||n[2]!==Ze?($e=Ze==="button"?be:pe?jsxRuntimeExports.jsx(te$1,{type:"icon",variant:"secondary",icon:pe}):null,n[0]=pe,n[1]=be,n[2]=Ze,n[3]=$e):$e=n[3];const me=$e;let Gt;n[4]!==ie?(Gt=Me=>ie?.(Me.open),n[4]=ie,n[5]=Gt):Gt=n[5];const mn=Ht?"blur(100px)":void 0;let dn;n[6]!==mn?(dn=jsxRuntimeExports.jsx(DialogBackdrop,{bg:"rgba(0, 0, 0, 0.50)",backdropFilter:mn}),n[6]=mn,n[7]=dn):dn=n[7];let jt;n[8]!==ue?(jt=jsxRuntimeExports.jsx(DialogTitle$2,{flex:1,textAlign:"center",textStyle:"body2Medium",color:"text.main",children:ue}),n[8]=ue,n[9]=jt):jt=n[9];let le;n[10]!==He?(le=He&&jsxRuntimeExports.jsx(DialogCloseTrigger,{position:"unset",asChild:!0,children:jsxRuntimeExports.jsx(ee$1,{variant:"outlined",buttonType:"icon",icon:Se,"aria-label":"Close"})}),n[10]=He,n[11]=le):le=n[11];let Pe;n[12]!==me||n[13]!==le||n[14]!==jt?(Pe=jsxRuntimeExports.jsxs(Flex,{gap:4,alignItems:"center",width:"100%",children:[me,jt,le]}),n[12]=me,n[13]=le,n[14]=jt,n[15]=Pe):Pe=n[15];let xe;n[16]!==se||n[17]!==Pe?(xe=jsxRuntimeExports.jsxs(DialogHeader,{bg:"neutral.bgLight",borderBottom:"1px solid",borderColor:"neutral.30",p:4,flexDirection:"column",gap:4,children:[Pe,se]}),n[16]=se,n[17]=Pe,n[18]=xe):xe=n[18];let ze;n[19]!==ae?(ze=jsxRuntimeExports.jsx(DialogBody,{display:"flex",flexDirection:"column",flex:1,overflow:"auto",p:0,children:ae}),n[19]=ae,n[20]=ze):ze=n[20];let Ft;n[21]!==de?(Ft=de&&jsxRuntimeExports.jsx(DialogFooter,{bg:"neutral.bgLight",borderTop:"1px solid",borderColor:"neutral.30",p:4,gap:3,justifyContent:"flex-end",children:de}),n[21]=de,n[22]=Ft):Ft=n[22];let yn;n[23]!==De||n[24]!==Ge||n[25]!==xe||n[26]!==ze||n[27]!==Ft?(yn=jsxRuntimeExports.jsx(DialogPositioner,{children:jsxRuntimeExports.jsxs(DialogContent$2,{bg:"neutral.bgLight",border:"1px solid",borderColor:"neutral.30",borderRadius:"dynamic.2xl",maxH:De,minH:Ge,overflow:"hidden",boxShadow:"none",children:[xe,ze,Ft]})}),n[23]=De,n[24]=Ge,n[25]=xe,n[26]=ze,n[27]=Ft,n[28]=yn):yn=n[28];let Zt;return n[29]!==c||n[30]!==un||n[31]!==yn||n[32]!==Gt||n[33]!==dn?(Zt=jsxRuntimeExports.jsxs(DialogRoot,{open:c,onOpenChange:Gt,size:un,placement:"center",children:[dn,yn]}),n[29]=c,n[30]=un,n[31]=yn,n[32]=Gt,n[33]=dn,n[34]=Zt):Zt=n[34],Zt}function ct$2(t){const n=$$3.c(35),{open:c,onOpenChange:ie,headerContent:se,children:ae,footerContent:de,title:ue,icon:pe,iconType:ge,iconButton:be,showCloseButton:_e,hasBlurBg:we,size:qe,maxHeight:Ye,minHeight:Ge}=t,Ze=ge===void 0?"container":ge,He=_e===void 0?!0:_e,Ht=we===void 0?!1:we,un=qe===void 0?"md":qe,De=Ye===void 0?"calc(100vh - 56px)":Ye;let $e;n[0]!==pe||n[1]!==be||n[2]!==Ze?($e=Ze==="button"?be:pe?jsxRuntimeExports.jsx(te$1,{type:"icon",variant:"secondary",icon:pe}):null,n[0]=pe,n[1]=be,n[2]=Ze,n[3]=$e):$e=n[3];const me=$e;let Gt;n[4]!==ie?(Gt=Me=>ie?.(Me.open),n[4]=ie,n[5]=Gt):Gt=n[5];const mn=Ht?"blur(100px)":void 0;let dn;n[6]!==mn?(dn=jsxRuntimeExports.jsx(DrawerBackdrop,{bg:"rgba(0, 0, 0, 0.50)",backdropFilter:mn}),n[6]=mn,n[7]=dn):dn=n[7];let jt;n[8]!==ue?(jt=jsxRuntimeExports.jsx(DrawerTitle,{flex:1,textAlign:"center",textStyle:"body2Medium",color:"text.main",children:ue}),n[8]=ue,n[9]=jt):jt=n[9];let le;n[10]!==He?(le=He&&jsxRuntimeExports.jsx(DrawerCloseTrigger,{position:"unset",asChild:!0,children:jsxRuntimeExports.jsx(ee$1,{variant:"outlined",buttonType:"icon",icon:Se,"aria-label":"Close"})}),n[10]=He,n[11]=le):le=n[11];let Pe;n[12]!==me||n[13]!==le||n[14]!==jt?(Pe=jsxRuntimeExports.jsxs(Flex,{gap:4,alignItems:"center",width:"100%",children:[me,jt,le]}),n[12]=me,n[13]=le,n[14]=jt,n[15]=Pe):Pe=n[15];let xe;n[16]!==se||n[17]!==Pe?(xe=jsxRuntimeExports.jsxs(DrawerHeader,{bg:"neutral.bgLight",borderBottom:"1px solid",borderColor:"neutral.30",p:4,flexDirection:"column",gap:4,children:[Pe,se]}),n[16]=se,n[17]=Pe,n[18]=xe):xe=n[18];let ze;n[19]!==ae?(ze=jsxRuntimeExports.jsx(DrawerBody,{display:"flex",flexDirection:"column",flex:1,overflow:"auto",p:0,children:ae}),n[19]=ae,n[20]=ze):ze=n[20];let Ft;n[21]!==de?(Ft=de&&jsxRuntimeExports.jsx(DrawerFooter,{bg:"neutral.bgLight",borderTop:"1px solid",borderColor:"neutral.30",p:4,gap:3,justifyContent:"flex-end",children:de}),n[21]=de,n[22]=Ft):Ft=n[22];let yn;n[23]!==De||n[24]!==Ge||n[25]!==xe||n[26]!==ze||n[27]!==Ft?(yn=jsxRuntimeExports.jsx(DrawerPositioner,{children:jsxRuntimeExports.jsxs(DrawerContent,{bg:"neutral.bgLight",border:"1px solid",borderColor:"neutral.30",borderTopRadius:"dynamic.2xl",borderBottomRadius:0,overflow:"hidden",maxH:De,minH:Ge,children:[xe,ze,Ft]})}),n[23]=De,n[24]=Ge,n[25]=xe,n[26]=ze,n[27]=Ft,n[28]=yn):yn=n[28];let Zt;return n[29]!==c||n[30]!==un||n[31]!==yn||n[32]!==Gt||n[33]!==dn?(Zt=jsxRuntimeExports.jsxs(DrawerRoot,{open:c,onOpenChange:Gt,placement:"bottom",size:un,children:[dn,yn]}),n[29]=c,n[30]=un,n[31]=yn,n[32]=Gt,n[33]=dn,n[34]=Zt):Zt=n[34],Zt}function Oe(t){const n=$$3.c(5);let c;if(n[0]===Symbol.for("react.memo_cache_sentinel")?(c={base:!1,md:!0},n[0]=c):c=n[0],useBreakpointValue(c)){let se;return n[1]!==t?(se=jsxRuntimeExports.jsx(at$2,{...t}),n[1]=t,n[2]=se):se=n[2],se}let ie;return n[3]!==t?(ie=jsxRuntimeExports.jsx(ct$2,{...t}),n[3]=t,n[4]=ie):ie=n[4],ie}const dt$2=t=>{const n=$$3.c(5);let c;n[0]!==t?({...c}=t,n[0]=t,n[1]=c):c=n[1];let ie;n[2]===Symbol.for("react.memo_cache_sentinel")?(ie=jsxRuntimeExports.jsx("path",{d:"M9.99984 9.99996H10.0082M9.99984 4.99996H10.0082M9.99984 15H10.0082M10.8332 9.99996C10.8332 10.4602 10.4601 10.8333 9.99984 10.8333C9.53959 10.8333 9.1665 10.4602 9.1665 9.99996C9.1665 9.53971 9.53959 9.16663 9.99984 9.16663C10.4601 9.16663 10.8332 9.53971 10.8332 9.99996ZM10.8332 15C10.8332 15.4602 10.4601 15.8333 9.99984 15.8333C9.53959 15.8333 9.1665 15.4602 9.1665 15C9.1665 14.5397 9.53959 14.1666 9.99984 14.1666C10.4601 14.1666 10.8332 14.5397 10.8332 15ZM10.8332 4.99996C10.8332 5.46019 10.4601 5.83329 9.99984 5.83329C9.53959 5.83329 9.1665 5.46019 9.1665 4.99996C9.1665 4.53973 9.53959 4.16663 9.99984 4.16663C10.4601 4.16663 10.8332 4.53973 10.8332 4.99996Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),n[2]=ie):ie=n[2];let se;return n[3]!==c?(se=jsxRuntimeExports.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...c,children:ie}),n[3]=c,n[4]=se):se=n[4],se};function ut$2(){return{divider:{width:"100%",borderBottom:"1px solid",borderColor:"neutral.30",my:"8px"},list:{display:"flex",flexDirection:"column",gap:"4px",width:"100%"}}}function ht$2(t){return{isInvalid:t==="error",isDisabled:t==="disabled",isSelected:t==="selected"}}function pt$2(t){const n=$$3.c(34),{items:c,triggerIcon:ie,triggerAriaLabel:se,buttonVariant:ae,buttonProps:de,modalProps:ue,headerContent:pe,open:ge,defaultOpen:be,onOpenChange:_e,closeOnSelect:we,menuWidth:qe}=t,Ye=ie===void 0?dt$2:ie,Ge=se===void 0?"Open action menu":se,Ze=ae===void 0?"outlined":ae,He=be===void 0?!1:be,Ht=we===void 0?!0:we,un=qe===void 0?"240px":qe;let De;n[0]===Symbol.for("react.memo_cache_sentinel")?(De={base:!1,md:!0},n[0]=De):De=n[0];const $e=useBreakpointValue(De);let me;n[1]!==He?(me={defaultOpen:He},n[1]=He,n[2]=me):me=n[2];const{open:Gt,onOpen:mn,onClose:dn}=useDisclosure(me),jt=ge!==void 0,le=jt?ge:Gt,Pe=ue?.title;let xe;n[3]!==jt||n[4]!==dn||n[5]!==mn||n[6]!==_e?(xe=Qn=>{const En=typeof Qn=="boolean"?Qn:Qn.open;jt||(En?mn():dn()),_e?.(En)},n[3]=jt,n[4]=dn,n[5]=mn,n[6]=_e,n[7]=xe):xe=n[7];const ze=xe;let Ft;n[8]!==ze?(Ft=()=>ze(!1),n[8]=ze,n[9]=Ft):Ft=n[9];const yn=Ft;let Zt;n[10]===Symbol.for("react.memo_cache_sentinel")?(Zt=ut$2(),n[10]=Zt):Zt=n[10];const Me=Zt;let ce;n[11]!==yn||n[12]!==Ht?(ce=Qn=>{Qn.variant!=="disabled"&&(Qn.onClick?.(),Ht&&yn())},n[11]=yn,n[12]=Ht,n[13]=ce):ce=n[13];const Ne=ce,We=Me.list;let Vt;if(n[14]!==Ne||n[15]!==c){let Qn;n[17]!==Ne?(Qn=(En,In)=>{const Mn=ht$2(En.variant);return jsxRuntimeExports.jsxs(Box,{width:"100%",children:[jsxRuntimeExports.jsx(st$2,{label:En.title,leftIcon:En.icon,onClick:()=>Ne(En),...Mn}),En.hasBottomDivider&&jsxRuntimeExports.jsx(Box,{...Me.divider})]},`${En.title}-${In}`)},n[17]=Ne,n[18]=Qn):Qn=n[18],Vt=c.map(Qn),n[14]=Ne,n[15]=c,n[16]=Vt}else Vt=n[16];let Sn;n[19]!==Vt?(Sn=jsxRuntimeExports.jsx(Box,{...We,children:Vt}),n[19]=Vt,n[20]=Sn):Sn=n[20];const An=Sn;let Cn;return n[21]!==de||n[22]!==Ze||n[23]!==le||n[24]!==ze||n[25]!==pe||n[26]!==$e||n[27]!==An||n[28]!==un||n[29]!==ue||n[30]!==Pe||n[31]!==Ge||n[32]!==Ye?(Cn=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:$e?jsxRuntimeExports.jsxs(PopoverRoot,{positioning:{placement:"bottom-start"},open:le,onOpenChange:ze,children:[jsxRuntimeExports.jsx(PopoverTrigger,{asChild:!0,children:jsxRuntimeExports.jsx(ee$1,{"aria-label":Ge,buttonType:"icon",icon:Ye,variant:Ze,...de})}),jsxRuntimeExports.jsx(Portal$2,{children:jsxRuntimeExports.jsx(PopoverPositioner,{children:jsxRuntimeExports.jsx(PopoverContent,{width:"max-content",border:"none",background:"transparent",boxShadow:"none",p:0,children:jsxRuntimeExports.jsxs(he,{p:3,gap:"12px",width:un,maxH:"260px",overflow:"hidden",children:[pe&&jsxRuntimeExports.jsx(Box,{position:"sticky",top:0,zIndex:1,bg:"neutral.bgLight",children:pe}),jsxRuntimeExports.jsx(Box,{overflowY:"auto",width:"100%",className:"dropdown-scroll-hidden",children:An})]})})})})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ee$1,{"aria-label":Ge,buttonType:"icon",icon:Ye,variant:Ze,onClick:()=>ze(!0),...de}),jsxRuntimeExports.jsx(Oe,{open:le,onOpenChange:ze,...ue,title:Pe,headerContent:pe,children:jsxRuntimeExports.jsx(he,{gap:"12px",width:"100%",border:"none",boxShadow:"none",background:"transparent",borderRadius:0,p:4,children:jsxRuntimeExports.jsx(Box,{overflowY:"auto",width:"100%",className:"dropdown-scroll-hidden",children:An})})})]})}),n[21]=de,n[22]=Ze,n[23]=le,n[24]=ze,n[25]=pe,n[26]=$e,n[27]=An,n[28]=un,n[29]=ue,n[30]=Pe,n[31]=Ge,n[32]=Ye,n[33]=Cn):Cn=n[33],Cn}const Ee=t=>{const n=$$3.c(5);let c;n[0]!==t?({...c}=t,n[0]=t,n[1]=c):c=n[1];let ie;n[2]===Symbol.for("react.memo_cache_sentinel")?(ie=jsxRuntimeExports.jsx("path",{d:"M14 6L6 14M6 6L14 14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),n[2]=ie):ie=n[2];let se;return n[3]!==c?(se=jsxRuntimeExports.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...c,children:ie}),n[3]=c,n[4]=se):se=n[4],se},St$2=(t,n,c)=>({display:"flex",alignItems:"center",flex:1,minHeight:"40px",padding:`${c?"7px":"8px"} 12px`,gap:"8px",borderRadius:"dynamic.md",borderWidth:"1px",borderStyle:"solid",transition:"all 0.2s",bg:n.bg,borderColor:Be(t,n),color:n.color,cursor:t==="disabled"?"not-allowed":"text",_focusWithin:{borderColor:"primary.main !important"},_active:n._active,_hover:{...n._hover,borderColor:Be(t,n),background:n.bg??"transparent"}}),kt$1=()=>({flex:1,bg:"transparent",border:"none",outline:"none",width:"100%",height:"100%",padding:0,margin:0,textStyle:"body2Regular",color:"inherit",_placeholder:{color:"text.subtext"},_disabled:{cursor:"not-allowed"}}),Be=(t,n)=>{switch(t){case"disabled":return"neutral.30";case"outlined":return n.borderColor;default:return n.color}},Ve=t=>{const n=$$3.c(16),{title:c,subtitle:ie,required:se,secondaryText:ae,chipsLabel:de}=t,ue=c||"Title Here";let pe;n[0]!==ue?(pe=jsxRuntimeExports.jsx(Text,{textStyle:"body2Regular",color:"text.main",children:ue}),n[0]=ue,n[1]=pe):pe=n[1];let ge;n[2]!==se||n[3]!==ae?(ge=(se||ae)&&jsxRuntimeExports.jsx(Text,{textStyle:"body3Regular",color:"text.subtext",children:ae}),n[2]=se,n[3]=ae,n[4]=ge):ge=n[4];let be;n[5]!==de?(be=de&&jsxRuntimeExports.jsx(oe$1,{label:de,variant:"muted"}),n[5]=de,n[6]=be):be=n[6];let _e;n[7]!==pe||n[8]!==ge||n[9]!==be?(_e=jsxRuntimeExports.jsxs(Flex,{gap:"4px",alignItems:"center",width:"100%",children:[pe,ge,be]}),n[7]=pe,n[8]=ge,n[9]=be,n[10]=_e):_e=n[10];let we;n[11]!==ie?(we=ie&&jsxRuntimeExports.jsx(Text,{textStyle:"body3Regular",color:"text.subtext",children:ie}),n[11]=ie,n[12]=we):we=n[12];let qe;return n[13]!==_e||n[14]!==we?(qe=jsxRuntimeExports.jsxs(Flex,{direction:"column",gap:"4px",width:"100%",children:[_e,we]}),n[13]=_e,n[14]=we,n[15]=qe):qe=n[15],qe},It$2=React.forwardRef((t,n)=>{const c=$$3.c(38);let ie,se,ae,de,ue,pe,ge,be,_e,we,qe,Ye;c[0]!==t?({title:we,leftIcon:ue,rightIcon:_e,placeholder:ge,isDisabled:de,value:qe,defaultValue:ie,maxLength:pe,wrapperStyles:Ye,inputStyles:ae,handleChange:se,...be}=t,c[0]=t,c[1]=ie,c[2]=se,c[3]=ae,c[4]=de,c[5]=ue,c[6]=pe,c[7]=ge,c[8]=be,c[9]=_e,c[10]=we,c[11]=qe,c[12]=Ye):(ie=c[1],se=c[2],ae=c[3],de=c[4],ue=c[5],pe=c[6],ge=c[7],be=c[8],_e=c[9],we=c[10],qe=c[11],Ye=c[12]);let Ge;c[13]!==we?(Ge=()=>{const $e=document.getElementById(`input-${we}`);$e&&$e.focus()},c[13]=we,c[14]=Ge):Ge=c[14];let Ze;c[15]!==ae||c[16]!==ue?(Ze=ue&&jsxRuntimeExports.jsx(Box,{flexShrink:0,width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",color:ae.color,children:ue}),c[15]=ae,c[16]=ue,c[17]=Ze):Ze=c[17];const He=`input-${we}`;let Ht;c[18]!==ie||c[19]!==se||c[20]!==ae||c[21]!==de||c[22]!==pe||c[23]!==ge||c[24]!==n||c[25]!==be||c[26]!==He||c[27]!==qe?(Ht=jsxRuntimeExports.jsx(chakra.input,{ref:n,id:He,placeholder:ge,disabled:de,value:qe,defaultValue:ie,onChange:se,maxLength:pe,...ae,...be}),c[18]=ie,c[19]=se,c[20]=ae,c[21]=de,c[22]=pe,c[23]=ge,c[24]=n,c[25]=be,c[26]=He,c[27]=qe,c[28]=Ht):Ht=c[28];let un;c[29]!==ae||c[30]!==_e?(un=_e&&jsxRuntimeExports.jsx(Box,{flexShrink:0,width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",color:ae.color,children:_e}),c[29]=ae,c[30]=_e,c[31]=un):un=c[31];let De;return c[32]!==Ge||c[33]!==Ze||c[34]!==Ht||c[35]!==un||c[36]!==Ye?(De=jsxRuntimeExports.jsxs(Box,{...Ye,onClick:Ge,children:[Ze,Ht,un]}),c[32]=Ge,c[33]=Ze,c[34]=Ht,c[35]=un,c[36]=Ye,c[37]=De):De=c[37],De}),je=t=>{const n=$$3.c(10),{supportingMessage:c,charCount:ie,maxLength:se,effectiveVariant:ae}=t,de=!!se,ue=X$3[ae];if(!c&&!de)return null;const pe=ae==="outlined"?"text.subtext":ue.color;let ge;n[0]!==c?(ge=c&&jsxRuntimeExports.jsx(Text,{flex:"1",children:c}),n[0]=c,n[1]=ge):ge=n[1];let be;n[2]!==ie||n[3]!==de||n[4]!==se?(be=de&&jsxRuntimeExports.jsxs(Text,{children:[ie,se?`/${se}`:""]}),n[2]=ie,n[3]=de,n[4]=se,n[5]=be):be=n[5];let _e;return n[6]!==pe||n[7]!==ge||n[8]!==be?(_e=jsxRuntimeExports.jsxs(Flex,{width:"100%",paddingX:"12px",gap:"8px",justifyContent:"flex-end",textStyle:"body3Regular",color:pe,children:[ge,be]}),n[6]=pe,n[7]=ge,n[8]=be,n[9]=_e):_e=n[9],_e};React.forwardRef((t,n)=>{const c=$$3.c(59);let ie,se,ae,de,ue,pe,ge,be,_e,we,qe,Ye,Ge,Ze,He,Ht,un;c[0]!==t?({title:Ht,subtitle:Ge,supportingMessage:Ze,rightElement:we,leftIcon:de,rightIcon:qe,secondaryText:Ye,required:be,chipsLabel:ie,variant:He,isDisabled:ae,value:un,defaultValue:se,onChange:pe,placeholder:ge,maxLength:ue,..._e}=t,c[0]=t,c[1]=ie,c[2]=se,c[3]=ae,c[4]=de,c[5]=ue,c[6]=pe,c[7]=ge,c[8]=be,c[9]=_e,c[10]=we,c[11]=qe,c[12]=Ye,c[13]=Ge,c[14]=Ze,c[15]=He,c[16]=Ht,c[17]=un):(ie=c[1],se=c[2],ae=c[3],de=c[4],ue=c[5],pe=c[6],ge=c[7],be=c[8],_e=c[9],we=c[10],qe=c[11],Ye=c[12],Ge=c[13],Ze=c[14],He=c[15],Ht=c[16],un=c[17]);const De=He===void 0?"outlined":He,$e=un!==void 0;let me;c[18]!==se?(me=()=>se!==void 0?String(se).length:0,c[18]=se,c[19]=me):me=c[19];const[Gt,mn]=React.useState(me),dn=$e?String(un).length:Gt;let jt;c[20]!==$e||c[21]!==pe?(jt=An=>{$e||mn(An.target.value.length),pe?.(An)},c[20]=$e,c[21]=pe,c[22]=jt):jt=c[22];const le=jt,Pe=ae?"disabled":De,xe=X$3[Pe]||X$3.outlined,ze=!!(de||qe);let Ft;c[23]!==Pe||c[24]!==ze||c[25]!==xe?(Ft=St$2(Pe,xe,ze),c[23]=Pe,c[24]=ze,c[25]=xe,c[26]=Ft):Ft=c[26];const yn=Ft;let Zt;c[27]===Symbol.for("react.memo_cache_sentinel")?(Zt=kt$1(),c[27]=Zt):Zt=c[27];const Me=Zt;let ce;c[28]!==ie||c[29]!==be||c[30]!==Ye||c[31]!==Ge||c[32]!==Ht?(ce=Ht&&jsxRuntimeExports.jsx(Ve,{title:Ht,subtitle:Ge,required:be,secondaryText:Ye,chipsLabel:ie}),c[28]=ie,c[29]=be,c[30]=Ye,c[31]=Ge,c[32]=Ht,c[33]=ce):ce=c[33];let Ne;c[34]!==se||c[35]!==le||c[36]!==ae||c[37]!==de||c[38]!==ue||c[39]!==ge||c[40]!==n||c[41]!==_e||c[42]!==qe||c[43]!==Ht||c[44]!==un||c[45]!==yn?(Ne=jsxRuntimeExports.jsx(It$2,{ref:n,title:Ht,leftIcon:de,rightIcon:qe,isDisabled:ae,value:un,defaultValue:se,placeholder:ge,maxLength:ue,wrapperStyles:yn,inputStyles:Me,handleChange:le,..._e}),c[34]=se,c[35]=le,c[36]=ae,c[37]=de,c[38]=ue,c[39]=ge,c[40]=n,c[41]=_e,c[42]=qe,c[43]=Ht,c[44]=un,c[45]=yn,c[46]=Ne):Ne=c[46];let We;c[47]!==we||c[48]!==Ne?(We=jsxRuntimeExports.jsxs(Flex,{gap:"8px",width:"100%",alignItems:"center",children:[Ne,we]}),c[47]=we,c[48]=Ne,c[49]=We):We=c[49];let Vt;c[50]!==dn||c[51]!==Pe||c[52]!==ue||c[53]!==Ze?(Vt=jsxRuntimeExports.jsx(je,{supportingMessage:Ze,charCount:dn,maxLength:ue,effectiveVariant:Pe}),c[50]=dn,c[51]=Pe,c[52]=ue,c[53]=Ze,c[54]=Vt):Vt=c[54];let Sn;return c[55]!==ce||c[56]!==We||c[57]!==Vt?(Sn=jsxRuntimeExports.jsxs(Flex,{direction:"column",gap:"8px",width:"100%",alignItems:"flex-start",children:[ce,We,Vt]}),c[55]=ce,c[56]=We,c[57]=Vt,c[58]=Sn):Sn=c[58],Sn});const Lt$1=t=>{const n=$$3.c(16),{title:c,subtitle:ie,required:se,secondaryText:ae,chipsLabel:de}=t,ue=c||"Title Here";let pe;n[0]!==ue?(pe=jsxRuntimeExports.jsx(Text,{textStyle:"body2Regular",color:"text.main",children:ue}),n[0]=ue,n[1]=pe):pe=n[1];let ge;n[2]!==se||n[3]!==ae?(ge=se&&jsxRuntimeExports.jsx(Text,{textStyle:"body3Regular",color:"text.subtext",children:ae}),n[2]=se,n[3]=ae,n[4]=ge):ge=n[4];let be;n[5]!==de?(be=de&&jsxRuntimeExports.jsx(oe$1,{label:de,variant:"muted"}),n[5]=de,n[6]=be):be=n[6];let _e;n[7]!==pe||n[8]!==ge||n[9]!==be?(_e=jsxRuntimeExports.jsxs(Flex,{gap:"4px",alignItems:"center",width:"100%",children:[pe,ge,be]}),n[7]=pe,n[8]=ge,n[9]=be,n[10]=_e):_e=n[10];let we;n[11]!==ie?(we=ie&&jsxRuntimeExports.jsx(Text,{textStyle:"body3Regular",color:"text.subtext",children:ie}),n[11]=ie,n[12]=we):we=n[12];let qe;return n[13]!==_e||n[14]!==we?(qe=jsxRuntimeExports.jsxs(Flex,{direction:"column",gap:"4px",width:"100%",children:[_e,we]}),n[13]=_e,n[14]=we,n[15]=qe):qe=n[15],qe},Rt=t=>{const n=$$3.c(10),{supportingMessage:c,charCount:ie,maxLength:se,effectiveVariant:ae}=t,de=!!se,ue=X$3[ae];if(!c&&de)return null;const pe=ae==="outlined"?"text.subtext":ue.color;let ge;n[0]!==c?(ge=c&&jsxRuntimeExports.jsx(Text,{flex:"1",children:c}),n[0]=c,n[1]=ge):ge=n[1];let be;n[2]!==ie||n[3]!==de||n[4]!==se?(be=de&&jsxRuntimeExports.jsxs(Text,{children:[ie,se?`/${se}`:""]}),n[2]=ie,n[3]=de,n[4]=se,n[5]=be):be=n[5];let _e;return n[6]!==pe||n[7]!==ge||n[8]!==be?(_e=jsxRuntimeExports.jsxs(Flex,{width:"100%",paddingX:"12px",gap:"8px",justifyContent:"flex-end",textStyle:"body3Regular",color:pe,children:[ge,be]}),n[6]=pe,n[7]=ge,n[8]=be,n[9]=_e):_e=n[9],_e};function _t$1(t,n){return{display:"flex",flexDirection:"column",alignItems:"flex-start",flex:1,minHeight:"72px",padding:"8px 12px",gap:"8px",borderRadius:"dynamic.md",borderWidth:"1px",borderStyle:"solid",transition:"all 0.2s",bg:n.bg,borderColor:ve(t,n),color:n.color,width:"100%",cursor:t==="disabled"?"not-allowed":"text",_hover:{...n._hover,borderColor:ve(t,n)},_active:{bg:n.bg,borderColor:ve(t,n)},_focusWithin:{borderColor:"primary.main"}}}function Bt$2(){return{bg:"transparent",border:"none",outline:"none",width:"100%",alignSelf:"stretch",height:"auto",minHeight:"48px",padding:0,margin:0,textStyle:"body2Regular",color:"inherit",resize:"vertical",overflow:"auto",_placeholder:{color:"text.subtext"},_disabled:{cursor:"not-allowed",color:"text.disabled",_placeholder:{color:"text.disabled"}},_focusWithin:{bg:"transparent"}}}const ve=(t,n)=>{switch(t){case"disabled":return"neutral.30";case"outlined":return n.borderColor;default:return n.color}},Tt$1=React.forwardRef((t,n)=>{const c=$$3.c(34);let ie,se,ae,de,ue,pe,ge,be,_e,we,qe;c[0]!==t?({id:de,title:we,placeholder:ge,isDisabled:ue,value:qe,defaultValue:ie,maxLength:pe,rows:_e,effectiveVariant:se,handleChange:ae,...be}=t,c[0]=t,c[1]=ie,c[2]=se,c[3]=ae,c[4]=de,c[5]=ue,c[6]=pe,c[7]=ge,c[8]=be,c[9]=_e,c[10]=we,c[11]=qe):(ie=c[1],se=c[2],ae=c[3],de=c[4],ue=c[5],pe=c[6],ge=c[7],be=c[8],_e=c[9],we=c[10],qe=c[11]);const Ye=_e===void 0?3:_e,Ge=X$3[se]||X$3.outlined;let Ze;c[12]!==se||c[13]!==Ge?(Ze=_t$1(se,Ge),c[12]=se,c[13]=Ge,c[14]=Ze):Ze=c[14];const He=Ze;let Ht;c[15]===Symbol.for("react.memo_cache_sentinel")?(Ht=Bt$2(),c[15]=Ht):Ht=c[15];const un=Ht;let De;c[16]!==de||c[17]!==we?(De=()=>{const mn=document.getElementById(de||`textarea-${we}`);mn&&mn.focus()},c[16]=de,c[17]=we,c[18]=De):De=c[18];const $e=de||`textarea-${we}`;let me;c[19]!==ie||c[20]!==ae||c[21]!==ue||c[22]!==pe||c[23]!==ge||c[24]!==n||c[25]!==be||c[26]!==Ye||c[27]!==$e||c[28]!==qe?(me=jsxRuntimeExports.jsx(chakra.textarea,{ref:n,id:$e,placeholder:ge,disabled:ue,value:qe,defaultValue:ie,onChange:ae,maxLength:pe,rows:Ye,...un,...be}),c[19]=ie,c[20]=ae,c[21]=ue,c[22]=pe,c[23]=ge,c[24]=n,c[25]=be,c[26]=Ye,c[27]=$e,c[28]=qe,c[29]=me):me=c[29];let Gt;return c[30]!==De||c[31]!==me||c[32]!==He?(Gt=jsxRuntimeExports.jsx(Box,{...He,onClick:De,children:me}),c[30]=De,c[31]=me,c[32]=He,c[33]=Gt):Gt=c[33],Gt});React.forwardRef((t,n)=>{const c=$$3.c(49);let ie,se,ae,de,ue,pe,ge,be,_e,we,qe,Ye,Ge,Ze,He;c[0]!==t?({title:Ze,subtitle:_e,supportingMessage:we,secondaryText:qe,required:ge,chipsLabel:ie,variant:Ye,isDisabled:ae,value:He,defaultValue:se,onChange:ue,placeholder:pe,maxLength:de,rows:Ge,...be}=t,c[0]=t,c[1]=ie,c[2]=se,c[3]=ae,c[4]=de,c[5]=ue,c[6]=pe,c[7]=ge,c[8]=be,c[9]=_e,c[10]=we,c[11]=qe,c[12]=Ye,c[13]=Ge,c[14]=Ze,c[15]=He):(ie=c[1],se=c[2],ae=c[3],de=c[4],ue=c[5],pe=c[6],ge=c[7],be=c[8],_e=c[9],we=c[10],qe=c[11],Ye=c[12],Ge=c[13],Ze=c[14],He=c[15]);const Ht=qe===void 0?"(Required)":qe,un=Ye===void 0?"outlined":Ye,De=Ge===void 0?3:Ge,$e=React.useId(),me=He!==void 0;let Gt;c[16]!==se?(Gt=()=>se!==void 0?String(se).length:0,c[16]=se,c[17]=Gt):Gt=c[17];const[mn,dn]=React.useState(Gt),jt=me?String(He).length:mn;let le;c[18]!==me||c[19]!==ue?(le=ce=>{me||dn(ce.target.value.length),ue?.(ce)},c[18]=me,c[19]=ue,c[20]=le):le=c[20];const Pe=le,xe=ae?"disabled":un;let ze;c[21]!==ie||c[22]!==ge||c[23]!==Ht||c[24]!==_e||c[25]!==Ze?(ze=Ze&&jsxRuntimeExports.jsx(Lt$1,{title:Ze,subtitle:_e,required:ge,secondaryText:Ht,chipsLabel:ie}),c[21]=ie,c[22]=ge,c[23]=Ht,c[24]=_e,c[25]=Ze,c[26]=ze):ze=c[26];const Ft=`textarea-${$e}`;let yn;c[27]!==se||c[28]!==xe||c[29]!==Pe||c[30]!==ae||c[31]!==de||c[32]!==pe||c[33]!==n||c[34]!==be||c[35]!==De||c[36]!==Ft||c[37]!==Ze||c[38]!==He?(yn=jsxRuntimeExports.jsx(Tt$1,{ref:n,id:Ft,title:Ze,isDisabled:ae,value:He,defaultValue:se,placeholder:pe,maxLength:de,rows:De,effectiveVariant:xe,handleChange:Pe,...be}),c[27]=se,c[28]=xe,c[29]=Pe,c[30]=ae,c[31]=de,c[32]=pe,c[33]=n,c[34]=be,c[35]=De,c[36]=Ft,c[37]=Ze,c[38]=He,c[39]=yn):yn=c[39];let Zt;c[40]!==jt||c[41]!==xe||c[42]!==de||c[43]!==we?(Zt=jsxRuntimeExports.jsx(Rt,{supportingMessage:we,charCount:jt,maxLength:de,effectiveVariant:xe}),c[40]=jt,c[41]=xe,c[42]=de,c[43]=we,c[44]=Zt):Zt=c[44];let Me;return c[45]!==ze||c[46]!==yn||c[47]!==Zt?(Me=jsxRuntimeExports.jsxs(Flex,{direction:"column",gap:"8px",width:"100%",alignItems:"flex-start",children:[ze,yn,Zt]}),c[45]=ze,c[46]=yn,c[47]=Zt,c[48]=Me):Me=c[48],Me});function Wt({variant:t,isDisabled:n,hasValue:c,expanded:ie}){const se=t==="icon",ae=!!ie||!se;return{container:{display:"flex",alignItems:"center",gap:se&&!ae?"0px":"8px",width:se?ae?"100%":"40px":"100%",height:se&&!ae?"40px":void 0,padding:se&&!ae?"0px":"7px 12px",borderRadius:"dynamic.md",borderWidth:"1px",borderStyle:"solid",borderColor:"neutral.30",bg:"neutral.bgLight",transition:"border-color 0.2s, background-color 0.2s, width 0.25s ease",_hover:{borderColor:"neutral.50"},_focusWithin:{borderColor:"primary.main"},opacity:n?.6:1,cursor:n?"not-allowed":se&&!ae?"pointer":"text",overflow:"hidden",justifyContent:se&&!ae?"center":"flex-start",...se&&!ae?{padding:"8px",borderWidth:"0px",bg:"transparent",_hover:{bg:"neutral.10"}}:{}},input:{flex:ae?"1 0 0":"0 0 auto",border:"none",outline:"none",padding:0,height:ae?"24px":"0px",overflow:"hidden",minW:"0px",minInlineSize:"0px",textStyle:"body2Regular",color:c?"text.main":"text.subtext",_placeholder:{color:"text.subtext"},bg:"transparent",_focus:{boxShadow:"none"},opacity:ae?1:0,pointerEvents:ae?"auto":"none",width:ae?"auto":"0px",maxW:ae?"none":"0px",transition:"opacity 0.2s ease, width 0.2s ease"},searchIconColor:n?"text.disabled":se&&!ae||c?"text.main":"text.subtext",clearIconColor:n?"text.disabled":"text.subtext",clearButton:{display:"flex",alignItems:"center",justifyContent:"center",opacity:ae?1:0,pointerEvents:ae?"auto":"none",transition:"opacity 0.2s ease, width 0.2s ease",width:ae?"24px":"0px",height:ae?"24px":"0px",overflow:"hidden",minW:"0px",padding:0,borderRadius:"full",bg:"transparent",cursor:n?"not-allowed":"pointer",_hover:{bg:"neutral.10"}},iconButton:{display:"flex",alignItems:"center",justifyContent:"center",padding:"8px",borderRadius:"dynamic.md",bg:se?"transparent":"neutral.10",cursor:"pointer",_hover:{bg:"neutral.10"}}}}const Dt=t=>{const n=$$3.c(5);let c;n[0]!==t?({...c}=t,n[0]=t,n[1]=c):c=n[1];let ie;n[2]===Symbol.for("react.memo_cache_sentinel")?(ie=jsxRuntimeExports.jsx("path",{d:"M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),n[2]=ie):ie=n[2];let se;return n[3]!==c?(se=jsxRuntimeExports.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...c,children:ie}),n[3]=c,n[4]=se):se=n[4],se};function vn(t){const n=$$3.c(50);let c,ie,se,ae,de,ue,pe,ge,be,_e,we;n[0]!==t?({placeholder:ue,variant:pe,value:we,defaultValue:c,onChange:se,showClear:ge,isDisabled:be,isExpanded:ie,defaultExpanded:_e,onExpandedChange:ae,...de}=t,n[0]=t,n[1]=c,n[2]=ie,n[3]=se,n[4]=ae,n[5]=de,n[6]=ue,n[7]=pe,n[8]=ge,n[9]=be,n[10]=_e,n[11]=we):(c=n[1],ie=n[2],se=n[3],ae=n[4],de=n[5],ue=n[6],pe=n[7],ge=n[8],be=n[9],_e=n[10],we=n[11]);const qe=ue===void 0?"Search...":ue,Ye=pe===void 0?"maximized":pe,Ge=ge===void 0?!0:ge,Ze=be===void 0?!1:be,He=_e===void 0?!1:_e,Ht=we!==void 0,un=ie!==void 0,[De,$e]=React.useState(He),me=un?ie:De,[Gt,mn]=React.useState(c||""),dn=Ht?we:Gt;let jt;n[12]!==Ht||n[13]!==se?(jt=Sn=>{Ht||mn(Sn.target.value),se?.(Sn)},n[12]=Ht,n[13]=se,n[14]=jt):jt=n[14];const le=jt;let Pe;n[15]!==Ht||n[16]!==se?(Pe=()=>{if(!Ht){mn("");return}se?.({target:{value:""}})},n[15]=Ht,n[16]=se,n[17]=Pe):Pe=n[17];const xe=Pe;let ze;n[18]!==me||n[19]!==un||n[20]!==ae||n[21]!==Ye?(ze=()=>{Ye!=="icon"||me||(un||$e(!0),ae?.(!0))},n[18]=me,n[19]=un,n[20]=ae,n[21]=Ye,n[22]=ze):ze=n[22];const Ft=ze,yn=!!dn;let Zt;n[23]!==me||n[24]!==Ze||n[25]!==yn||n[26]!==Ye?(Zt=Wt({variant:Ye,isDisabled:Ze,hasValue:yn,expanded:me}),n[23]=me,n[24]=Ze,n[25]=yn,n[26]=Ye,n[27]=Zt):Zt=n[27];const Me=Zt;let ce;n[28]!==Me.searchIconColor?(ce=jsxRuntimeExports.jsx(Icon,{as:Dt,color:Me.searchIconColor,boxSize:"24px"}),n[28]=Me.searchIconColor,n[29]=ce):ce=n[29];let Ne;n[30]!==dn||n[31]!==le||n[32]!==Ze||n[33]!==qe||n[34]!==t.autoFocus||n[35]!==Me.input?(Ne=jsxRuntimeExports.jsx(Input,{value:dn,placeholder:qe,onChange:le,disabled:Ze,autoFocus:t.autoFocus,...Me.input}),n[30]=dn,n[31]=le,n[32]=Ze,n[33]=qe,n[34]=t.autoFocus,n[35]=Me.input,n[36]=Ne):Ne=n[36];let We;n[37]!==dn||n[38]!==xe||n[39]!==Ge||n[40]!==Me.clearButton||n[41]!==Me.clearIconColor?(We=Ge&&jsxRuntimeExports.jsx(Box,{visibility:dn?"visible":"hidden",as:"button",...Me.clearButton,onClick:xe,children:jsxRuntimeExports.jsx(Icon,{as:Ee,color:Me.clearIconColor,boxSize:"24px"})}),n[37]=dn,n[38]=xe,n[39]=Ge,n[40]=Me.clearButton,n[41]=Me.clearIconColor,n[42]=We):We=n[42];let Vt;return n[43]!==Ft||n[44]!==de||n[45]!==Me.container||n[46]!==ce||n[47]!==Ne||n[48]!==We?(Vt=jsxRuntimeExports.jsxs(Box,{...Me.container,...de,onClick:Ft,children:[ce,Ne,We]}),n[43]=Ft,n[44]=de,n[45]=Me.container,n[46]=ce,n[47]=Ne,n[48]=We,n[49]=Vt):Vt=n[49],Vt}function $t(t,n,c){return t?"disabled":n?"error":c?"success":"outlined"}function Mt(t){const n=X$3[t];return{display:"flex",alignItems:"center",flex:1,minHeight:"40px",padding:"7px 12px",gap:"8px",borderRadius:"dynamic.md",borderWidth:"1px",borderStyle:"solid",transition:"all 0.2s",bg:n.bg,borderColor:Te(t,n),color:n.color,cursor:t==="disabled"?"not-allowed":"pointer",_hover:{...n._hover,borderColor:Te(t,n)},_active:n._active,_focusWithin:{borderColor:"primary.main"}}}const Ot$2={flex:1,bg:"transparent",border:"none",outline:"none",width:"100%",height:"100%",padding:0,margin:0,textStyle:"body2Regular",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:"left"},Te=(t,n)=>{switch(t){case"disabled":return"neutral.30";case"outlined":return n.borderColor;default:return n.color}},Et$2=t=>{const n=$$3.c(5);let c;n[0]!==t?({...c}=t,n[0]=t,n[1]=c):c=n[1];let ie;n[2]===Symbol.for("react.memo_cache_sentinel")?(ie=jsxRuntimeExports.jsx("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),n[2]=ie):ie=n[2];let se;return n[3]!==c?(se=jsxRuntimeExports.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...c,children:ie}),n[3]=c,n[4]=se):se=n[4],se};function wn(t){const n=$$3.c(57),{triggerText:c,children:ie,open:se,defaultOpen:ae,onOpenChange:de,title:ue,subtitle:pe,secondaryText:ge,required:be,chipsLabel:_e,isDisabled:we,isError:qe,isSuccess:Ye,message:Ge,leftIcon:Ze,modalProps:He,headerContent:Ht}=t,un=c===void 0?"Select":c,De=ae===void 0?!1:ae;let $e;n[0]===Symbol.for("react.memo_cache_sentinel")?($e={base:!1,md:!0},n[0]=$e):$e=n[0];const me=useBreakpointValue($e);let Gt;n[1]!==De?(Gt={defaultOpen:De},n[1]=De,n[2]=Gt):Gt=n[2];const{open:mn,onOpen:dn,onClose:jt}=useDisclosure(Gt),le=se!==void 0,Pe=le?se:mn;let xe;n[3]!==le||n[4]!==we||n[5]!==jt||n[6]!==dn||n[7]!==de?(xe=Hn=>{const ti=typeof Hn=="boolean"?Hn:Hn.open;we&&ti||(le||(ti?dn():jt()),de?.(ti))},n[3]=le,n[4]=we,n[5]=jt,n[6]=dn,n[7]=de,n[8]=xe):xe=n[8];const ze=xe;let Ft;n[9]!==ze?(Ft=()=>ze(!1),n[9]=ze,n[10]=Ft):Ft=n[10];const yn=Ft;let Zt;n[11]!==ie||n[12]!==yn||n[13]!==Pe?(Zt=typeof ie=="function"?ie({open:Pe,close:yn}):ie,n[11]=ie,n[12]=yn,n[13]=Pe,n[14]=Zt):Zt=n[14];const Me=Zt;let ce,Ne;n[15]!==we||n[16]!==qe||n[17]!==Ye?(Ne=$t(we,qe,Ye),ce=Mt(Ne),n[15]=we,n[16]=qe,n[17]=Ye,n[18]=ce,n[19]=Ne):(ce=n[18],Ne=n[19]);const We=ce,Vt=He?.title??ue;let Sn;n[20]!==ze||n[21]!==we?(Sn=we?void 0:()=>ze(!0),n[20]=ze,n[21]=we,n[22]=Sn):Sn=n[22];const An=Sn;let Cn;n[23]!==Ze?(Cn=Ze&&jsxRuntimeExports.jsx(Icon,{as:Ze,boxSize:"24px",color:"text.subtext"}),n[23]=Ze,n[24]=Cn):Cn=n[24];let Qn;n[25]!==We.color||n[26]!==un?(Qn=jsxRuntimeExports.jsx(Box,{...Ot$2,color:We.color,children:un}),n[25]=We.color,n[26]=un,n[27]=Qn):Qn=n[27];let En;n[28]===Symbol.for("react.memo_cache_sentinel")?(En=jsxRuntimeExports.jsx(Icon,{as:Et$2,boxSize:"24px",color:"text.subtext"}),n[28]=En):En=n[28];let In;n[29]!==we||n[30]!==Qn||n[31]!==Cn||n[32]!==We?(In=jsxRuntimeExports.jsxs(chakra.button,{...We,width:"100%",alignItems:"center",type:"button",disabled:we,"aria-disabled":we,children:[Cn,Qn,En]}),n[29]=we,n[30]=Qn,n[31]=Cn,n[32]=We,n[33]=In):In=n[33];const Mn=In;let zn;n[34]!==_e||n[35]!==be||n[36]!==ge||n[37]!==pe||n[38]!==ue?(zn=ue&&jsxRuntimeExports.jsx(Ve,{title:ue,subtitle:pe,required:be,secondaryText:ge,chipsLabel:_e}),n[34]=_e,n[35]=be,n[36]=ge,n[37]=pe,n[38]=ue,n[39]=zn):zn=n[39];let Jn;n[40]!==Pe||n[41]!==ze||n[42]!==An||n[43]!==Ht||n[44]!==me||n[45]!==He||n[46]!==Vt||n[47]!==Me||n[48]!==Mn?(Jn=me?jsxRuntimeExports.jsxs(PopoverRoot,{positioning:{placement:"bottom-start",sameWidth:!0},open:Pe,onOpenChange:ze,children:[jsxRuntimeExports.jsx(PopoverTrigger,{asChild:!0,children:Mn}),jsxRuntimeExports.jsx(Portal$2,{children:jsxRuntimeExports.jsx(PopoverPositioner,{width:"100%",children:jsxRuntimeExports.jsx(PopoverContent,{border:"none",background:"transparent",boxShadow:"none",p:0,width:"100%",children:jsxRuntimeExports.jsxs(he,{p:3,gap:"12px",width:"100%",maxH:"304px",overflow:"hidden",children:[Ht&&jsxRuntimeExports.jsx(Box,{position:"sticky",top:0,zIndex:1,bg:"neutral.bgLight",children:Ht}),jsxRuntimeExports.jsx(Box,{overflowY:"auto",width:"100%",className:"dropdown-scroll-hidden",children:Me})]})})})})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box,{onClick:An,width:"100%",children:Mn}),jsxRuntimeExports.jsx(Oe,{open:Pe,onOpenChange:ze,...He,title:Vt,headerContent:Ht,children:jsxRuntimeExports.jsx(he,{gap:"12px",width:"100%",border:"none",boxShadow:"none",background:"transparent",borderRadius:0,p:4,children:Me})})]}),n[40]=Pe,n[41]=ze,n[42]=An,n[43]=Ht,n[44]=me,n[45]=He,n[46]=Vt,n[47]=Me,n[48]=Mn,n[49]=Jn):Jn=n[49];let hn;n[50]!==Ge||n[51]!==Ne?(hn=jsxRuntimeExports.jsx(je,{supportingMessage:Ge,charCount:0,maxLength:0,effectiveVariant:Ne}),n[50]=Ge,n[51]=Ne,n[52]=hn):hn=n[52];let xn;return n[53]!==zn||n[54]!==Jn||n[55]!==hn?(xn=jsxRuntimeExports.jsxs(Box,{display:"flex",flexDirection:"column",gap:"8px",width:"100%",alignItems:"flex-start",children:[zn,Jn,hn]}),n[53]=zn,n[54]=Jn,n[55]=hn,n[56]=xn):xn=n[56],xn}chakra("input");function Nt$1({orientation:t="horizontal",length:n="100%",thickness:c="1px",colorToken:ie="neutral.30"}){const se=t==="horizontal";return{container:{width:se?n:c,height:se?c:n,bg:ie,flexShrink:0}}}function kn(t){const n=$$3.c(15);let c,ie,se,ae,de;n[0]!==t?({orientation:ie,length:se,thickness:ae,colorToken:de,...c}=t,n[0]=t,n[1]=c,n[2]=ie,n[3]=se,n[4]=ae,n[5]=de):(c=n[1],ie=n[2],se=n[3],ae=n[4],de=n[5]);const ue=ie===void 0?"horizontal":ie,pe=se===void 0?"100%":se,ge=ae===void 0?"1px":ae,be=de===void 0?"neutral.30":de;let _e;n[6]!==be||n[7]!==pe||n[8]!==ue||n[9]!==ge?(_e=Nt$1({orientation:ue,length:pe,thickness:ge,colorToken:be}),n[6]=be,n[7]=pe,n[8]=ue,n[9]=ge,n[10]=_e):_e=n[10];const we=_e;let qe;return n[11]!==ue||n[12]!==c||n[13]!==we.container?(qe=jsxRuntimeExports.jsx(Box,{role:"separator","aria-orientation":ue,...we.container,...c}),n[11]=ue,n[12]=c,n[13]=we.container,n[14]=qe):qe=n[14],qe}function zt$1({variant:t="text",contentAlign:n="end"}){return{container:{display:"flex",alignItems:"center",justifyContent:n==="end"?"flex-end":"flex-start",gap:t==="text"||t==="subtext"?"8px":"0px"},text:{textStyle:"body2Regular",color:"text.main",textAlign:n==="end"?"right":"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},subtextGroup:{display:"flex",alignItems:"center",gap:"4px",whiteSpace:"nowrap"},subtextMain:{textStyle:"body2Regular",color:"text.main"},subtext:{textStyle:"body2Regular",color:"text.subtext"},icon:{width:"24px",height:"24px"}}}function qt$1(t){const n=$$3.c(43);let c,ie,se,ae,de,ue,pe,ge;n[0]!==t?({variant:de,text:ge,subtext:ae,chipsLabel:c,chipsVariant:ue,icon:ie,contentAlign:pe,...se}=t,n[0]=t,n[1]=c,n[2]=ie,n[3]=se,n[4]=ae,n[5]=de,n[6]=ue,n[7]=pe,n[8]=ge):(c=n[1],ie=n[2],se=n[3],ae=n[4],de=n[5],ue=n[6],pe=n[7],ge=n[8]);const be=de===void 0?"text":de,_e=ue===void 0?"success":ue,we=pe===void 0?"end":pe;let qe;n[9]!==we||n[10]!==be?(qe=zt$1({variant:be,contentAlign:we}),n[9]=we,n[10]=be,n[11]=qe):qe=n[11];const Ye=qe,Ge=be==="text",Ze=be==="subtext",He=be==="icon",Ht=be==="chips",un=Ge||Ze;let De;n[12]!==c||n[13]!==_e||n[14]!==un?(De=un&&c&&jsxRuntimeExports.jsx(oe$1,{label:c,variant:_e}),n[12]=c,n[13]=_e,n[14]=un,n[15]=De):De=n[15];let $e;n[16]!==Ge||n[17]!==Ye.text||n[18]!==ge?($e=Ge&&jsxRuntimeExports.jsx(Text,{...Ye.text,children:ge}),n[16]=Ge,n[17]=Ye.text,n[18]=ge,n[19]=$e):$e=n[19];let me;n[20]!==Ze||n[21]!==Ye.subtext||n[22]!==Ye.subtextGroup||n[23]!==Ye.subtextMain||n[24]!==ae||n[25]!==ge?(me=Ze&&jsxRuntimeExports.jsxs(Box,{...Ye.subtextGroup,children:[jsxRuntimeExports.jsx(Text,{...Ye.subtextMain,children:ge}),jsxRuntimeExports.jsx(Text,{...Ye.subtext,children:ae})]}),n[20]=Ze,n[21]=Ye.subtext,n[22]=Ye.subtextGroup,n[23]=Ye.subtextMain,n[24]=ae,n[25]=ge,n[26]=me):me=n[26];let Gt;n[27]!==ie||n[28]!==He||n[29]!==Ye.icon?(Gt=He&&ie&&jsxRuntimeExports.jsx(Icon,{as:ie,...Ye.icon}),n[27]=ie,n[28]=He,n[29]=Ye.icon,n[30]=Gt):Gt=n[30];let mn;n[31]!==c||n[32]!==_e||n[33]!==Ht?(mn=Ht&&c&&jsxRuntimeExports.jsx(oe$1,{label:c,variant:_e}),n[31]=c,n[32]=_e,n[33]=Ht,n[34]=mn):mn=n[34];let dn;return n[35]!==se||n[36]!==Ye.container||n[37]!==De||n[38]!==$e||n[39]!==me||n[40]!==Gt||n[41]!==mn?(dn=jsxRuntimeExports.jsxs(Box,{...Ye.container,...se,children:[De,$e,me,Gt,mn]}),n[35]=se,n[36]=Ye.container,n[37]=De,n[38]=$e,n[39]=me,n[40]=Gt,n[41]=mn,n[42]=dn):dn=n[42],dn}function Yt({nested:t,borderColor:n,borderRadius:c}){return{container:{borderWidth:t?"0":"1px",borderStyle:"solid",borderColor:n,borderRadius:t?void 0:c,overflow:"hidden"}}}function Ut$2({borderColor:t,isLastColumn:n,isLastRow:c}){return{borderInlineEndWidth:n?"0":"1px",borderInlineEndStyle:"solid",borderInlineEndColor:t,borderBottomWidth:c?"0":"1px",borderBottomStyle:"solid",borderBottomColor:t}}function Rn(t){const n=$$3.c(12);let c,ie,se,ae,de;if(n[0]!==t){const{columns:pe,nested:ge,children:be,..._e}=t,we=ge===void 0?!1:ge,qe=React.Children.toArray(be),Ye=_e.borderColor??"neutral.30",Ge=_e.borderRadius??"dynamic.md",Ze=Yt({nested:we,borderColor:Ye,borderRadius:Ge});c=Grid,ie=`repeat(${pe}, 1fr)`,se=Ze.container,ae=_e,de=qe.map((He,Ht)=>{const un=Ht%pe===pe-1,De=Ht>=qe.length-pe,$e=Ut$2({borderColor:Ye,isLastColumn:un,isLastRow:De});return jsxRuntimeExports.jsx(Box,{...$e,children:He},Ht)}),n[0]=t,n[1]=c,n[2]=ie,n[3]=se,n[4]=ae,n[5]=de}else c=n[1],ie=n[2],se=n[3],ae=n[4],de=n[5];let ue;return n[6]!==c||n[7]!==ie||n[8]!==se||n[9]!==ae||n[10]!==de?(ue=jsxRuntimeExports.jsx(c,{templateColumns:ie,...se,...ae,children:de}),n[6]=c,n[7]=ie,n[8]=se,n[9]=ae,n[10]=de,n[11]=ue):ue=n[11],ue}function Kt({isDisabled:t}){return{container:{position:"relative",width:"40px",height:"40px",display:"inline-flex",alignItems:"center",justifyContent:"center"},networkContainer:{position:"absolute",top:"23px",left:"23px",display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",borderRadius:"full",bg:"neutral.10",borderWidth:"1px",borderStyle:"solid",borderColor:"neutral.30",opacity:t?.5:1}}}const Xt=t=>{const n=$$3.c(8);let c;n[0]!==t?({...c}=t,n[0]=t,n[1]=c):c=n[1];let ie,se,ae,de;n[2]===Symbol.for("react.memo_cache_sentinel")?(ie=jsxRuntimeExports.jsx("path",{d:"M13.9996 7.00003L16.828 9.82846M19.5162 3.74615L20.0819 4.31183C20.4779 4.70785 20.6759 4.90586 20.7501 5.13419C20.8154 5.33503 20.8154 5.55138 20.7501 5.75222C20.6759 5.98055 20.4779 6.17856 20.0819 6.57457L6.52508 20.1314C6.12906 20.5274 5.93105 20.7254 5.70272 20.7996C5.50188 20.8649 5.28553 20.8649 5.08469 20.7996C4.85636 20.7254 4.65835 20.5274 4.26234 20.1314L3.69665 19.5657C3.30063 19.1697 3.10262 18.9717 3.02844 18.7433C2.96318 18.5425 2.96318 18.3262 3.02844 18.1253C3.10262 17.897 3.30063 17.699 3.69665 17.303L17.2535 3.74615C17.6495 3.35013 17.8475 3.15212 18.0758 3.07793C18.2767 3.01268 18.493 3.01268 18.6939 3.07793C18.9222 3.15212 19.1202 3.35013 19.5162 3.74615Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),se=jsxRuntimeExports.jsx("path",{d:"M7.5 2L6.975 3.33115C6.90789 3.50131 6.87434 3.58639 6.82295 3.65814C6.77741 3.72173 6.72173 3.77741 6.65814 3.82296C6.58639 3.87432 6.50131 3.90789 6.33115 3.975L5 4.5L6.33115 5.025C6.50131 5.09211 6.58639 5.12568 6.65814 5.17704C6.72173 5.22261 6.77741 5.27829 6.82295 5.34186C6.87434 5.41361 6.90789 5.49868 6.975 5.66886L7.5 7L8.025 5.66886C8.09211 5.49868 8.12568 5.41361 8.17704 5.34186C8.22261 5.27829 8.27829 5.22261 8.34186 5.17704C8.41361 5.12568 8.49868 5.09211 8.66886 5.025L10 4.5L8.66886 3.975C8.49868 3.90789 8.41361 3.87432 8.34186 3.82296C8.27829 3.77741 8.22261 3.72173 8.17704 3.65814C8.12568 3.58639 8.09211 3.50131 8.025 3.33115L7.5 2Z",stroke:"currentColor",strokeWidth:"0.75",strokeLinecap:"round",strokeLinejoin:"round"}),ae=jsxRuntimeExports.jsx("path",{d:"M14 1L13.79 1.53246C13.7632 1.60052 13.7497 1.63456 13.7292 1.66325C13.711 1.68869 13.6887 1.71096 13.6633 1.72919C13.6346 1.74973 13.6005 1.76316 13.5325 1.79L13 2L13.5325 2.21C13.6005 2.23684 13.6346 2.25027 13.6633 2.27081C13.6887 2.28904 13.711 2.31131 13.7292 2.33674C13.7497 2.36544 13.7632 2.39947 13.79 2.46754L14 3L14.21 2.46754C14.2368 2.39947 14.2503 2.36544 14.2708 2.33674C14.289 2.31131 14.3113 2.28904 14.3367 2.27081C14.3654 2.25027 14.3995 2.23684 14.4675 2.21L15 2L14.4675 1.79C14.3995 1.76316 14.3654 1.74973 14.3367 1.72919C14.3113 1.71096 14.289 1.68869 14.2708 1.66325C14.2503 1.63456 14.2368 1.60052 14.21 1.53246L14 1Z",stroke:"currentColor",strokeWidth:"0.5",strokeLinecap:"round",strokeLinejoin:"round"}),de=jsxRuntimeExports.jsx("path",{d:"M15.5 16L15.185 16.7987C15.1447 16.9008 15.1246 16.9518 15.0938 16.9949C15.0664 17.033 15.033 17.0664 14.9949 17.0938C14.9518 17.1246 14.9008 17.1447 14.7987 17.185L14 17.5L14.7987 17.815C14.9008 17.8553 14.9518 17.8754 14.9949 17.9062C15.033 17.9336 15.0664 17.967 15.0938 18.0051C15.1246 18.0482 15.1447 18.0992 15.185 18.2013L15.5 19L15.815 18.2013C15.8553 18.0992 15.8754 18.0482 15.9062 18.0051C15.9336 17.967 15.967 17.9336 16.0051 17.9062C16.0482 17.8754 16.0992 17.8553 16.2013 17.815L17 17.5L16.2013 17.185C16.0992 17.1447 16.0482 17.1246 16.0051 17.0938C15.967 17.0664 15.9336 17.033 15.9062 16.9949C15.8754 16.9518 15.8553 16.9008 15.815 16.7987L15.5 16Z",stroke:"currentColor",strokeWidth:"0.5",strokeLinecap:"round",strokeLinejoin:"round"}),n[2]=ie,n[3]=se,n[4]=ae,n[5]=de):(ie=n[2],se=n[3],ae=n[4],de=n[5]);let ue;return n[6]!==c?(ue=jsxRuntimeExports.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...c,children:[ie,se,ae,de]}),n[6]=c,n[7]=ue):ue=n[7],ue};function Fe(t){const n=$$3.c(14),{icon:c,showNetwork:ie,isDisabled:se,networkIcon:ae}=t,de=c===void 0?Xt:c,ue=se===void 0?!1:se;let pe;n[0]!==ue?(pe=Kt({isDisabled:ue}),n[0]=ue,n[1]=pe):pe=n[1];const ge=pe,be=ue?"disabled":"outlined";let _e;n[2]!==de||n[3]!==be?(_e=jsxRuntimeExports.jsx(te$1,{type:"icon",variant:be,icon:de}),n[2]=de,n[3]=be,n[4]=_e):_e=n[4];let we;n[5]!==ae||n[6]!==ie||n[7]!==ge.networkContainer?(we=ie&&ae&&jsxRuntimeExports.jsx(Box,{...ge.networkContainer,children:jsxRuntimeExports.jsx(Icon,{as:ae,boxSize:"12px"})}),n[5]=ae,n[6]=ie,n[7]=ge.networkContainer,n[8]=we):we=n[8];let qe;return n[9]!==ue||n[10]!==ge.container||n[11]!==_e||n[12]!==we?(qe=jsxRuntimeExports.jsxs(Box,{...ge.container,"aria-disabled":ue,children:[_e,we]}),n[9]=ue,n[10]=ge.container,n[11]=_e,n[12]=we,n[13]=qe):qe=n[13],qe}function Jt({isSelected:t,isDisabled:n,isInteractive:c}){return{container:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",borderRadius:"dynamic.2xl",borderWidth:"1px",borderStyle:"solid",borderColor:t?"state.success.main":"transparent",bg:t?"state.success.tint10":"neutral.10",width:"100%",cursor:n?"not-allowed":c?"pointer":"default",opacity:n?.6:1,_hover:!c||t||n?void 0:{borderColor:"neutral.30"}},content:{display:"flex",flexDirection:"column",flex:"1 0 0",minWidth:0},title:{textStyle:"body2Regular",color:n?"text.disabled":"text.main"},subtitle:{textStyle:"captionRegular",color:n?"text.disabled":"text.subtext"},actions:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0}}}function _n(t){const n=$$3.c(33),{isDisabled:c,chipsVariant:ie,chipsLabel:se,title:ae,subtitle:de,rightContent:ue,icon:pe,networkIcon:ge,isSelected:be,onClick:_e}=t,we=c===void 0?!1:c,qe=ie===void 0?"information":ie,Ye=be===void 0?!1:be,Ge=!!_e;let Ze;n[0]!==we||n[1]!==Ye||n[2]!==Ge?(Ze=Jt({isSelected:Ye,isDisabled:we,isInteractive:Ge}),n[0]=we,n[1]=Ye,n[2]=Ge,n[3]=Ze):Ze=n[3];const He=Ze,Ht=we?"disabled":qe,un=He.container,De=_e?"button":void 0,$e=_e&&!we?0:void 0,me=we?void 0:_e,Gt=!!ge;let mn;n[4]!==pe||n[5]!==we||n[6]!==ge||n[7]!==Gt?(mn=jsxRuntimeExports.jsx(Fe,{icon:pe,networkIcon:ge,showNetwork:Gt,isDisabled:we}),n[4]=pe,n[5]=we,n[6]=ge,n[7]=Gt,n[8]=mn):mn=n[8];let dn;n[9]!==He.title||n[10]!==ae?(dn=jsxRuntimeExports.jsx(Box,{...He.title,children:ae}),n[9]=He.title,n[10]=ae,n[11]=dn):dn=n[11];let jt;n[12]!==He.subtitle||n[13]!==de?(jt=de&&jsxRuntimeExports.jsx(Box,{...He.subtitle,children:de}),n[12]=He.subtitle,n[13]=de,n[14]=jt):jt=n[14];let le;n[15]!==He.content||n[16]!==dn||n[17]!==jt?(le=jsxRuntimeExports.jsxs(Box,{...He.content,children:[dn,jt]}),n[15]=He.content,n[16]=dn,n[17]=jt,n[18]=le):le=n[18];let Pe;n[19]!==se||n[20]!==Ht||n[21]!==ue||n[22]!==He.actions?(Pe=(se||ue)&&jsxRuntimeExports.jsxs(Box,{...He.actions,children:[se&&jsxRuntimeExports.jsx(oe$1,{label:se,variant:Ht}),ue&&ue]}),n[19]=se,n[20]=Ht,n[21]=ue,n[22]=He.actions,n[23]=Pe):Pe=n[23];let xe;return n[24]!==we||n[25]!==He.container||n[26]!==mn||n[27]!==le||n[28]!==Pe||n[29]!==De||n[30]!==$e||n[31]!==me?(xe=jsxRuntimeExports.jsxs(Box,{...un,role:De,tabIndex:$e,"aria-disabled":we,onClick:me,children:[mn,le,Pe]}),n[24]=we,n[25]=He.container,n[26]=mn,n[27]=le,n[28]=Pe,n[29]=De,n[30]=$e,n[31]=me,n[32]=xe):xe=n[32],xe}function Qt({isSelected:t,isDisabled:n,isInteractive:c}){return{container:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",borderRadius:"dynamic.2xl",borderWidth:"1px",borderStyle:"solid",borderColor:t?"state.info.main":"transparent",bg:t?"state.info.tint10":"neutral.10",width:"100%",cursor:n?"not-allowed":c?"pointer":"default",opacity:n?.6:1,_hover:!c||t||n?void 0:{borderColor:"neutral.30"}},content:{display:"flex",flexDirection:"column",flex:"1 0 0",minWidth:0},title:{textStyle:"body2Regular",color:n?"text.disabled":"text.main"},subtitle:{textStyle:"captionRegular",color:n?"text.disabled":"text.subtext"},actions:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0}}}function Bn(t){const n=$$3.c(33),{isDisabled:c,chipsVariant:ie,chipsLabel:se,title:ae,subtitle:de,rightContent:ue,icon:pe,networkIcon:ge,isSelected:be,onClick:_e}=t,we=c===void 0?!1:c,qe=ie===void 0?"information":ie,Ye=be===void 0?!1:be,Ge=!!_e;let Ze;n[0]!==we||n[1]!==Ye||n[2]!==Ge?(Ze=Qt({isSelected:Ye,isDisabled:we,isInteractive:Ge}),n[0]=we,n[1]=Ye,n[2]=Ge,n[3]=Ze):Ze=n[3];const He=Ze,Ht=we?"disabled":qe,un=He.container,De=_e?"button":void 0,$e=_e&&!we?0:void 0,me=we?void 0:_e,Gt=!!ge;let mn;n[4]!==pe||n[5]!==we||n[6]!==ge||n[7]!==Gt?(mn=jsxRuntimeExports.jsx(Fe,{icon:pe,networkIcon:ge,showNetwork:Gt,isDisabled:we}),n[4]=pe,n[5]=we,n[6]=ge,n[7]=Gt,n[8]=mn):mn=n[8];let dn;n[9]!==He.title||n[10]!==ae?(dn=jsxRuntimeExports.jsx(Box,{...He.title,children:ae}),n[9]=He.title,n[10]=ae,n[11]=dn):dn=n[11];let jt;n[12]!==He.subtitle||n[13]!==de?(jt=de&&jsxRuntimeExports.jsx(Box,{...He.subtitle,children:de}),n[12]=He.subtitle,n[13]=de,n[14]=jt):jt=n[14];let le;n[15]!==He.content||n[16]!==dn||n[17]!==jt?(le=jsxRuntimeExports.jsxs(Box,{...He.content,children:[dn,jt]}),n[15]=He.content,n[16]=dn,n[17]=jt,n[18]=le):le=n[18];let Pe;n[19]!==se||n[20]!==Ht||n[21]!==ue||n[22]!==He.actions?(Pe=(se||ue)&&jsxRuntimeExports.jsxs(Box,{...He.actions,children:[se&&jsxRuntimeExports.jsx(oe$1,{label:se,variant:Ht}),ue&&ue]}),n[19]=se,n[20]=Ht,n[21]=ue,n[22]=He.actions,n[23]=Pe):Pe=n[23];let xe;return n[24]!==we||n[25]!==He.container||n[26]!==mn||n[27]!==le||n[28]!==Pe||n[29]!==De||n[30]!==$e||n[31]!==me?(xe=jsxRuntimeExports.jsxs(Box,{...un,role:De,tabIndex:$e,"aria-disabled":we,onClick:me,children:[mn,le,Pe]}),n[24]=we,n[25]=He.container,n[26]=mn,n[27]=le,n[28]=Pe,n[29]=De,n[30]=$e,n[31]=me,n[32]=xe):xe=n[32],xe}function en({status:t}){return{container:{position:"relative",display:"inline-flex",alignItems:"center",gap:"12px",padding:"8px",borderRadius:"20px",borderWidth:"1px",borderStyle:"solid",borderColor:t==="success"?"state.success.main":t==="error"?"state.error.main":"neutral.30",bg:"transparent",justifyContent:"center"},spinner:{position:"absolute",inset:"-1px",width:"calc(100% + 2px)",height:"calc(100% + 2px)",animation:"walletTransferSpin",pointerEvents:"none"},centerIcon:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",color:t==="success"?"state.success.main":t==="error"?"state.error.main":"text.main",flexShrink:0}}}function tn(t){let n=getComputedStyle(document.documentElement).getPropertyValue(t);for(;n.startsWith("var(");){const c=n.slice(4,n.length-1);n=getComputedStyle(document.documentElement).getPropertyValue(c)}return n.trim()}function Tn(t){const n=$$3.c(22),{leftIcon:c,centerIcon:ie,rightIcon:se,status:ae}=t,de=ae===void 0?"loading":ae;let ue;n[0]===Symbol.for("react.memo_cache_sentinel")?(ue=tn("--chakra-colors-primary.main"),n[0]=ue):ue=n[0];const pe=ue;let ge;n[1]!==de?(ge=en({status:de}),n[1]=de,n[2]=ge):ge=n[2];const be=ge,_e=de==="loading",we=de==="loading";let qe;n[3]!==_e||n[4]!==be.spinner?(qe=_e&&jsxRuntimeExports.jsx(Box,{...be.spinner,children:jsxRuntimeExports.jsx("svg",{viewBox:"0 0 200 80",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{width:"100%",height:"100%"},children:jsxRuntimeExports.jsx("rect",{x:"1",y:"1",width:"198",height:"78",rx:"20",stroke:pe,strokeWidth:"2",pathLength:"100",strokeDasharray:"15 85",strokeLinecap:"round"})})}),n[3]=_e,n[4]=be.spinner,n[5]=qe):qe=n[5];let Ye;n[6]!==c?(Ye=jsxRuntimeExports.jsx(te$1,{type:"icon",variant:"secondary",icon:c}),n[6]=c,n[7]=Ye):Ye=n[7];let Ge;n[8]!==ie?(Ge=jsxRuntimeExports.jsx(Icon,{as:ie,boxSize:"24px"}),n[8]=ie,n[9]=Ge):Ge=n[9];let Ze;n[10]!==be.centerIcon||n[11]!==Ge?(Ze=jsxRuntimeExports.jsx(Box,{...be.centerIcon,children:Ge}),n[10]=be.centerIcon,n[11]=Ge,n[12]=Ze):Ze=n[12];let He;n[13]!==se?(He=jsxRuntimeExports.jsx(te$1,{type:"icon",variant:"secondary",icon:se}),n[13]=se,n[14]=He):He=n[14];let Ht;return n[15]!==be.container||n[16]!==we||n[17]!==qe||n[18]!==Ye||n[19]!==Ze||n[20]!==He?(Ht=jsxRuntimeExports.jsxs(Box,{...be.container,"aria-busy":we,children:[qe,Ye,Ze,He]}),n[15]=be.container,n[16]=we,n[17]=qe,n[18]=Ye,n[19]=Ze,n[20]=He,n[21]=Ht):Ht=n[21],Ht}const nn={isDarkTheme:!1,themeName:"Default Light",primary:{main:"#3963F8",hover:"#2D4EC6",tint10:"rgba(57, 99, 248, 0.1)",tint20:"rgba(57, 99, 248, 0.2)"},neutral:{bgDark:"#171A1C",bgLight:"#FFFFFF",neutral10:"#F1F2F4",neutral30:"#D8DBDF",neutral50:"#B3BAC1"},text:{main:"#171A1C",inverse:"#FFFFFF",subtext:"#6B7280",disabled:"#B3BAC1"},state:{success:{main:"#07C067",tint10:"rgba(7, 192, 103, 0.1)",tint20:"rgba(7, 192, 103, 0.2)"},error:{main:"#FF2244",tint10:"rgba(255, 34, 68, 0.1)",tint20:"rgba(255, 34, 68, 0.2)"},warning:{main:"#EA8E16",tint10:"rgba(234, 142, 22, 0.1)",tint20:"rgba(234, 142, 22, 0.2)"},info:{main:"#179EF8",tint10:"rgba(23, 158, 248, 0.1)",tint20:"rgba(23, 158, 248, 0.2)"}}},on$1={fontFamily:"Inter, sans-serif",fontSizes:{h1:"48px",h2:"40px",h3:"36px",h4:"32px",h5:"28px",h6:"24px",subtitle:"20px",body1:"18px",body2:"16px",body3:"14px",caption:"12px"}},Ae={option1:{xs:"4px",sm:"4px",md:"8px",lg:"12px",xl:"16px","2xl":"20px"},option2:{xs:"6px",sm:"8px",md:"12px",lg:"16px",xl:"20px","2xl":"24px"},option3:{xs:"8px",sm:"12px",md:"16px",lg:"20px",xl:"24px","2xl":"28px"},option4:{xs:"12px",sm:"16px",md:"20px",lg:"24px",xl:"28px","2xl":"32px"}};function rn(t,n){const c={colors:{"primary.main":{value:t.primary.main},"primary.hover":{value:t.primary.hover},"primary.tint10":{value:t.primary.tint10},"primary.tint20":{value:t.primary.tint20},"neutral.bgDark":{value:t.neutral.bgDark},"neutral.bgLight":{value:t.neutral.bgLight},"neutral.10":{value:t.neutral.neutral10},"neutral.30":{value:t.neutral.neutral30},"neutral.50":{value:t.neutral.neutral50},"text.main":{value:t.text.main},"text.inverse":{value:t.text.inverse},"text.subtext":{value:t.text.subtext},"text.disabled":{value:t.text.disabled},"state.success.main":{value:t.state.success.main},"state.success.tint10":{value:t.state.success.tint10},"state.success.tint20":{value:t.state.success.tint20},"state.error.main":{value:t.state.error.main},"state.error.tint10":{value:t.state.error.tint10},"state.error.tint20":{value:t.state.error.tint20},"state.warning.main":{value:t.state.warning.main},"state.warning.tint10":{value:t.state.warning.tint10},"state.warning.tint20":{value:t.state.warning.tint20},"state.info.main":{value:t.state.info.main},"state.info.tint10":{value:t.state.info.tint10},"state.info.tint20":{value:t.state.info.tint20}}};return n&&(c.radii={"dynamic.xs":{value:n.xs},"dynamic.sm":{value:n.sm},"dynamic.md":{value:n.md},"dynamic.lg":{value:n.lg},"dynamic.xl":{value:n.xl},"dynamic.2xl":{value:n["2xl"]}}),c}function ln(t){const n=t.fontSizes||{},c=t.fontFamily,ie={Regular:400,Medium:500,Bold:700},se={h1:"64px",h2:"56px",h3:"52px",h4:"48px",h5:"40px",h6:"36px",subtitle:"32px",body1:"28px",body2:"24px",body3:"20px",caption:"16px"},ae={};return Object.entries(n).forEach(([de,ue])=>{Object.entries(ie).forEach(([pe,ge])=>{const be=`${de}${pe}`;ae[be]={value:{fontFamily:c,fontSize:ue,fontWeight:ge,lineHeight:se[de]}}})}),ae}function sn(t=nn,n=on$1,c="option2"){const ie=Ae[c],se=rn(t,ie),ae=ln(n),de=defineConfig({theme:{semanticTokens:se,textStyles:ae,keyframes:{walletTransferSpin:{from:{strokeDashoffset:"0"},to:{strokeDashoffset:"-100"}}},tokens:{animations:{walletTransferSpin:{value:"walletTransferSpin 2s linear infinite"}}},breakpoints:{sm:"390px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1440px","3xl":"1920px"}}});return createSystem(defaultConfig,de)}const an=sn();function Dn(t){const n=$$3.c(5),{children:c,system:ie}=t,se=ie===void 0?an:ie;let ae;n[0]!==c?(ae=jsxRuntimeExports.jsx(J$3,{attribute:"class",disableTransitionOnChange:!0,children:c}),n[0]=c,n[1]=ae):ae=n[1];let de;return n[2]!==se||n[3]!==ae?(de=jsxRuntimeExports.jsx(ChakraProvider,{value:se,children:ae}),n[2]=se,n[3]=ae,n[4]=de):de=n[4],de}var si=Object.defineProperty,ni=t=>{throw TypeError(t)},fi=(t,n,c)=>n in t?si(t,n,{enumerable:!0,configurable:!0,writable:!0,value:c}):t[n]=c,Xn=(t,n,c)=>fi(t,typeof n!="symbol"?n+"":n,c),ui=(t,n,c)=>n.has(t)||ni("Cannot "+c),ii=(t,n,c)=>n.has(t)?ni("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,c),ai=(t,n,c)=>(ui(t,n,"access private method"),c);class WalletException extends Error{constructor(n,c){const ie=`<${n}> ${c}`;console.log(ie),super(c),this.name=new.target.name}}class WalletNotFoundException extends WalletException{constructor(n,c=""){const ie=`Wallet Not found ${c}`;super(n,ie)}}class UserDeniedException extends WalletException{constructor(n){super(n,"User denied the request")}}class NotSupportedException extends WalletException{constructor(n,c){super(n,`${c} networks are not supported by this wallet.`)}}class WalletNotInstalledException extends WalletException{constructor(n){super(n,"Not Installed.")}}class TokenNotSupportedException extends WalletException{constructor(n,c){super(n,`${c} token is not supported by this wallet.`)}}class ChainNotSupportedException extends WalletException{constructor(n,c){super(n,`${c} is not supported by this wallet.`)}}class ProviderException extends WalletException{constructor(n){super(n,"Provider could not be initialized.")}}class ChainException extends Error{constructor(n,c){const ie=`<${n}> ${c}`;console.log(ie),super(c),this.name=new.target.name}}class ChainNotImplementedException extends ChainException{constructor(n){super(n,"Not Implemented!")}}class InvalidParametersException extends ChainException{constructor(n,c){super(n,`Invalid parameters: ${c}`)}}class Unauthorized extends ChainException{constructor(n,c,ie,se){super(n,`Unauthorized access to ${c} from ${ie} to ${se}`),this.method=c,this.from=ie,this.to=se}}class ActionExceptions extends Error{constructor(n,c){super(`${n}: ${c}`),this.name=new.target.name}}class ActionNotImplementedException extends ActionExceptions{constructor(n){super(n,"Not Implemented!")}}class Web3CallbackFailedException extends ActionExceptions{constructor(n){super(n,"Something went wrong during web3 callback process!")}}class InitializationException extends ActionExceptions{constructor(){super("","Provider not initialized.")}}class InsufficientBalanceException extends ActionExceptions{constructor(){super("Payment","Insufficient Funds")}}var Actions$1=(t=>(t.Payment="Payment",t.ClaimNFT="ClaimNFT",t.Record="Record",t.Auth="Aut",t.Login="Login",t))(Actions$1||{}),Groups=(t=>(t.EVM="EVM",t.SOL="SOL",t.BTC="BTC",t.XION="XION",t.UD="UD",t))(Groups||{}),Network=(t=>(t.TESTNET="TESTNET",t.MAINNET="MAINNET",t))(Network||{}),Chains=(t=>(t.POLYGON="POLYGON",t.BINANCE="BINANCE",t.SKALE="SKALE",t.BASE="BASE",t.LINEA="LINEA",t.ETH="ETH",t.SOLANA="SOLANA",t.REDBELLY="REDBELLY",t.UNSTOPPABLE="UNSTOPPABLE",t.BITLAYER="BITLAYER",t.XION="XION",t))(Chains||{});const chains=[{name:"BINANCE",group:Groups.EVM,TESTNET:{chainName:"Smart Chain - Testnet",chainId:"0x61",nativeCurrency:{name:"BNB",decimals:18,symbol:"BNB"},rpcUrls:["https://bsc-testnet-dataseed.bnbchain.org/"]},MAINNET:{chainName:"Smart Chain",chainId:"0x38",nativeCurrency:{name:"BNB",decimals:18,symbol:"BNB"},rpcUrls:["https://bsc-dataseed.binance.org/"]}},{name:"POLYGON",group:Groups.EVM,TESTNET:{chainName:"Polygon Amoy Testnet",chainId:"0x13882",nativeCurrency:{name:"MATIC",decimals:18,symbol:"MATIC"},rpcUrls:["https://rpc-amoy.polygon.technology"]},MAINNET:{chainName:"Polygon Mainnet",chainId:"0x89",nativeCurrency:{name:"MATIC",decimals:18,symbol:"MATIC"},rpcUrls:["https://polygon-rpc.com/"]}},{name:"SKALE",group:Groups.EVM,TESTNET:{chainName:"SKALE Testnet Calypso Hub",chainId:"0x3A14269B",nativeCurrency:{name:"sFUEL",decimals:18,symbol:"sFUEL"},rpcUrls:["https://testnet.skalenodes.com/v1/giant-half-dual-testnet"]},MAINNET:{chainName:"SKALE Calypso Hub",chainId:"0x5D456C62",nativeCurrency:{name:"sFUEL",decimals:18,symbol:"sFUEL"},rpcUrls:["https://mainnet.skalenodes.com/v1/honorable-steel-rasalhague"]}},{name:"BASE",group:Groups.EVM,TESTNET:{chainName:"Base Sepolia",chainId:"0x14a34",nativeCurrency:{name:"ETH",decimals:18,symbol:"ETH"},rpcUrls:["https://sepolia.base.org"]},MAINNET:{chainName:"Base Mainnet",chainId:"0x2105",nativeCurrency:{name:"ETH",decimals:18,symbol:"ETH"},rpcUrls:["https://mainnet.base.org/"]}},{name:"LINEA",group:Groups.EVM,MAINNET:{chainName:"Linea",chainId:"0xe708",nativeCurrency:{name:"ETH",decimals:18,symbol:"LineaETH"},rpcUrls:["https://rpc.linea.build"]},TESTNET:{chainName:"Linea",chainId:"0xe705",nativeCurrency:{name:"ETH",decimals:18,symbol:"LineaETH"},rpcUrls:["https://rpc.sepolia.linea.build"]}},{name:"ETH",group:Groups.EVM,MAINNET:{chainName:"Ethereum",chainId:"0x1",nativeCurrency:{name:"ETH",decimals:18,symbol:"ETH"},rpcUrls:["https://mainnet.infura.io/v3/"]},TESTNET:{chainName:"Sepolia",chainId:"0xaa36a7",nativeCurrency:{name:"ETH",decimals:18,symbol:"ETH"},rpcUrls:["https://eth-sepolia.public.blastapi.io/"]}},{name:"REDBELLY",group:Groups.EVM,TESTNET:{chainName:"Redbelly Network Testnet",chainId:"0x99",nativeCurrency:{name:"RBNT",decimals:18,symbol:"RBNT"},rpcUrls:["https://governors.testnet.redbelly.network"]},MAINNET:{chainName:"Redbelly Network Mainnet",chainId:"0x97",nativeCurrency:{name:"RBNT",decimals:18,symbol:"RBNT"},rpcUrls:["https://governors.mainnet.redbelly.network"]}},{name:"BITLAYER",group:Groups.EVM,MAINNET:{chainName:"Bitlayer Mainnet",chainId:"0x310C5",nativeCurrency:{name:"BTC",decimals:18,symbol:"BTC"},rpcUrls:["https://rpc.bitlayer.org"]},TESTNET:{chainName:"Bitlayer Testnet",chainId:"0x3106A",nativeCurrency:{name:"BTC",decimals:18,symbol:"BTC"},rpcUrls:["https://testnet-rpc.bitlayer.org"]}},{name:"SOLANA",group:Groups.SOL,MAINNET:{chainName:"Solana Mainnet",chainId:"0x1",nativeCurrency:{name:"SOL",decimals:9,symbol:"SOL"},rpcUrls:[]},TESTNET:{chainName:"Solana Testnet",chainId:"0x01",nativeCurrency:{name:"SOL",decimals:9,symbol:"SOL"},rpcUrls:[]}},{name:"XION",group:Groups.XION,MAINNET:{chainName:"Xion Mainnet",chainId:"0x1",nativeCurrency:{name:"XION",decimals:6,symbol:"XION"},rpcUrls:[]},TESTNET:{chainName:"Xion Testnet",chainId:"0x01",nativeCurrency:{name:"XION",decimals:6,symbol:"XION"},rpcUrls:[]}},{name:"UNSTOPPABLE",group:Groups.UD,MAINNET:{chainName:"Unstoppable Domains Mainnet",chainId:"0x1",nativeCurrency:{name:"UD",decimals:18,symbol:"UD"},rpcUrls:[]},TESTNET:{chainName:"Unstoppable Domains Testnet",chainId:"0x01",nativeCurrency:{name:"UD",decimals:18,symbol:"UD"},rpcUrls:[]}}];function getChainByName(t){const n=chains.find(c=>c.name.toLowerCase()===t.toLowerCase());if(!n)throw new ChainNotImplementedException(t);return n}function getGroupOfChain(t){return getChainByName(t).group}function isChainInGroup(t,n){return getGroupOfChain(t)===n}class Web3Wallet{constructor(n,c,ie){this.name=n,this.group=c,this.stepizer=ie}}async function getEvmProviderByWalletName(t,n=500){return new Promise(c=>{const ie=[];function se(ae){const de=ae.detail;!(de!=null&&de.provider)||!(de!=null&&de.info)||ie.push(de)}window.addEventListener("eip6963:announceProvider",se),window.dispatchEvent(new Event("eip6963:requestProvider")),setTimeout(()=>{window.removeEventListener("eip6963:announceProvider",se),console.log("EIP-6963 providers announced:",ie.map(ue=>ue.info.name));const ae=ie.find(({info:ue})=>ue.name===t||ue.name.toLowerCase()===t.toLowerCase());if(ae){c(ae.provider);return}const de=window.ethereum;if(t.toLowerCase()==="metamask"&&de!=null&&de.isMetaMask){c(de);return}c(null)},n)})}var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};function getDefaultExportFromCjs$2(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function getAugmentedNamespace(t){if(t.__esModule)return t;var n=t.default;if(typeof n=="function"){var c=function ie(){return this instanceof ie?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};c.prototype=n.prototype}else c={};return Object.defineProperty(c,"__esModule",{value:!0}),Object.keys(t).forEach(function(ie){var se=Object.getOwnPropertyDescriptor(t,ie);Object.defineProperty(c,ie,se.get?se:{enumerable:!0,get:function(){return t[ie]}})}),c}var bn$8={exports:{}},buffer$1={},base64Js$1={};base64Js$1.byteLength=byteLength;base64Js$1.toByteArray=toByteArray;base64Js$1.fromByteArray=fromByteArray;var lookup=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i$3=0,len=code.length;i$3<len;++i$3)lookup[i$3]=code[i$3],revLookup[code.charCodeAt(i$3)]=i$3;revLookup[45]=62;revLookup[95]=63;function getLens(t){var n=t.length;if(n%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var c=t.indexOf("=");c===-1&&(c=n);var ie=c===n?0:4-c%4;return[c,ie]}function byteLength(t){var n=getLens(t),c=n[0],ie=n[1];return(c+ie)*3/4-ie}function _byteLength(t,n,c){return(n+c)*3/4-c}function toByteArray(t){var n,c=getLens(t),ie=c[0],se=c[1],ae=new Arr(_byteLength(t,ie,se)),de=0,ue=se>0?ie-4:ie,pe;for(pe=0;pe<ue;pe+=4)n=revLookup[t.charCodeAt(pe)]<<18|revLookup[t.charCodeAt(pe+1)]<<12|revLookup[t.charCodeAt(pe+2)]<<6|revLookup[t.charCodeAt(pe+3)],ae[de++]=n>>16&255,ae[de++]=n>>8&255,ae[de++]=n&255;return se===2&&(n=revLookup[t.charCodeAt(pe)]<<2|revLookup[t.charCodeAt(pe+1)]>>4,ae[de++]=n&255),se===1&&(n=revLookup[t.charCodeAt(pe)]<<10|revLookup[t.charCodeAt(pe+1)]<<4|revLookup[t.charCodeAt(pe+2)]>>2,ae[de++]=n>>8&255,ae[de++]=n&255),ae}function tripletToBase64(t){return lookup[t>>18&63]+lookup[t>>12&63]+lookup[t>>6&63]+lookup[t&63]}function encodeChunk(t,n,c){for(var ie,se=[],ae=n;ae<c;ae+=3)ie=(t[ae]<<16&16711680)+(t[ae+1]<<8&65280)+(t[ae+2]&255),se.push(tripletToBase64(ie));return se.join("")}function fromByteArray(t){for(var n,c=t.length,ie=c%3,se=[],ae=16383,de=0,ue=c-ie;de<ue;de+=ae)se.push(encodeChunk(t,de,de+ae>ue?ue:de+ae));return ie===1?(n=t[c-1],se.push(lookup[n>>2]+lookup[n<<4&63]+"==")):ie===2&&(n=(t[c-2]<<8)+t[c-1],se.push(lookup[n>>10]+lookup[n>>4&63]+lookup[n<<2&63]+"=")),se.join("")}var ieee754$1={};ieee754$1.read=function(t,n,c,ie,se){var ae,de,ue=se*8-ie-1,pe=(1<<ue)-1,ge=pe>>1,be=-7,_e=c?se-1:0,we=c?-1:1,qe=t[n+_e];for(_e+=we,ae=qe&(1<<-be)-1,qe>>=-be,be+=ue;be>0;ae=ae*256+t[n+_e],_e+=we,be-=8);for(de=ae&(1<<-be)-1,ae>>=-be,be+=ie;be>0;de=de*256+t[n+_e],_e+=we,be-=8);if(ae===0)ae=1-ge;else{if(ae===pe)return de?NaN:(qe?-1:1)*(1/0);de=de+Math.pow(2,ie),ae=ae-ge}return(qe?-1:1)*de*Math.pow(2,ae-ie)};ieee754$1.write=function(t,n,c,ie,se,ae){var de,ue,pe,ge=ae*8-se-1,be=(1<<ge)-1,_e=be>>1,we=se===23?Math.pow(2,-24)-Math.pow(2,-77):0,qe=ie?0:ae-1,Ye=ie?1:-1,Ge=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(ue=isNaN(n)?1:0,de=be):(de=Math.floor(Math.log(n)/Math.LN2),n*(pe=Math.pow(2,-de))<1&&(de--,pe*=2),de+_e>=1?n+=we/pe:n+=we*Math.pow(2,1-_e),n*pe>=2&&(de++,pe/=2),de+_e>=be?(ue=0,de=be):de+_e>=1?(ue=(n*pe-1)*Math.pow(2,se),de=de+_e):(ue=n*Math.pow(2,_e-1)*Math.pow(2,se),de=0));se>=8;t[c+qe]=ue&255,qe+=Ye,ue/=256,se-=8);for(de=de<<se|ue,ge+=se;ge>0;t[c+qe]=de&255,qe+=Ye,de/=256,ge-=8);t[c+qe-Ye]|=Ge*128};(function(t){const n=base64Js$1,c=ieee754$1,ie=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=be,t.SlowBuffer=$e,t.INSPECT_MAX_BYTES=50;const se=2147483647;t.kMaxLength=se;const{Uint8Array:ae,ArrayBuffer:de,SharedArrayBuffer:ue}=globalThis;be.TYPED_ARRAY_SUPPORT=pe(),!be.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function pe(){try{const Un=new ae(1),Ln={foo:function(){return 42}};return Object.setPrototypeOf(Ln,ae.prototype),Object.setPrototypeOf(Un,Ln),Un.foo()===42}catch{return!1}}Object.defineProperty(be.prototype,"parent",{enumerable:!0,get:function(){if(be.isBuffer(this))return this.buffer}}),Object.defineProperty(be.prototype,"offset",{enumerable:!0,get:function(){if(be.isBuffer(this))return this.byteOffset}});function ge(Un){if(Un>se)throw new RangeError('The value "'+Un+'" is invalid for option "size"');const Ln=new ae(Un);return Object.setPrototypeOf(Ln,be.prototype),Ln}function be(Un,Ln,$n){if(typeof Un=="number"){if(typeof Ln=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Ye(Un)}return _e(Un,Ln,$n)}be.poolSize=8192;function _e(Un,Ln,$n){if(typeof Un=="string")return Ge(Un,Ln);if(de.isView(Un))return He(Un);if(Un==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Un);if(di(Un,de)||Un&&di(Un.buffer,de)||typeof ue<"u"&&(di(Un,ue)||Un&&di(Un.buffer,ue)))return Ht(Un,Ln,$n);if(typeof Un=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const jn=Un.valueOf&&Un.valueOf();if(jn!=null&&jn!==Un)return be.from(jn,Ln,$n);const Pn=un(Un);if(Pn)return Pn;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Un[Symbol.toPrimitive]=="function")return be.from(Un[Symbol.toPrimitive]("string"),Ln,$n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Un)}be.from=function(Un,Ln,$n){return _e(Un,Ln,$n)},Object.setPrototypeOf(be.prototype,ae.prototype),Object.setPrototypeOf(be,ae);function we(Un){if(typeof Un!="number")throw new TypeError('"size" argument must be of type number');if(Un<0)throw new RangeError('The value "'+Un+'" is invalid for option "size"')}function qe(Un,Ln,$n){return we(Un),Un<=0?ge(Un):Ln!==void 0?typeof $n=="string"?ge(Un).fill(Ln,$n):ge(Un).fill(Ln):ge(Un)}be.alloc=function(Un,Ln,$n){return qe(Un,Ln,$n)};function Ye(Un){return we(Un),ge(Un<0?0:De(Un)|0)}be.allocUnsafe=function(Un){return Ye(Un)},be.allocUnsafeSlow=function(Un){return Ye(Un)};function Ge(Un,Ln){if((typeof Ln!="string"||Ln==="")&&(Ln="utf8"),!be.isEncoding(Ln))throw new TypeError("Unknown encoding: "+Ln);const $n=me(Un,Ln)|0;let jn=ge($n);const Pn=jn.write(Un,Ln);return Pn!==$n&&(jn=jn.slice(0,Pn)),jn}function Ze(Un){const Ln=Un.length<0?0:De(Un.length)|0,$n=ge(Ln);for(let jn=0;jn<Ln;jn+=1)$n[jn]=Un[jn]&255;return $n}function He(Un){if(di(Un,ae)){const Ln=new ae(Un);return Ht(Ln.buffer,Ln.byteOffset,Ln.byteLength)}return Ze(Un)}function Ht(Un,Ln,$n){if(Ln<0||Un.byteLength<Ln)throw new RangeError('"offset" is outside of buffer bounds');if(Un.byteLength<Ln+($n||0))throw new RangeError('"length" is outside of buffer bounds');let jn;return Ln===void 0&&$n===void 0?jn=new ae(Un):$n===void 0?jn=new ae(Un,Ln):jn=new ae(Un,Ln,$n),Object.setPrototypeOf(jn,be.prototype),jn}function un(Un){if(be.isBuffer(Un)){const Ln=De(Un.length)|0,$n=ge(Ln);return $n.length===0||Un.copy($n,0,0,Ln),$n}if(Un.length!==void 0)return typeof Un.length!="number"||li(Un.length)?ge(0):Ze(Un);if(Un.type==="Buffer"&&Array.isArray(Un.data))return Ze(Un.data)}function De(Un){if(Un>=se)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+se.toString(16)+" bytes");return Un|0}function $e(Un){return+Un!=Un&&(Un=0),be.alloc(+Un)}be.isBuffer=function(Un){return Un!=null&&Un._isBuffer===!0&&Un!==be.prototype},be.compare=function(Un,Ln){if(di(Un,ae)&&(Un=be.from(Un,Un.offset,Un.byteLength)),di(Ln,ae)&&(Ln=be.from(Ln,Ln.offset,Ln.byteLength)),!be.isBuffer(Un)||!be.isBuffer(Ln))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Un===Ln)return 0;let $n=Un.length,jn=Ln.length;for(let Pn=0,On=Math.min($n,jn);Pn<On;++Pn)if(Un[Pn]!==Ln[Pn]){$n=Un[Pn],jn=Ln[Pn];break}return $n<jn?-1:jn<$n?1:0},be.isEncoding=function(Un){switch(String(Un).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},be.concat=function(Un,Ln){if(!Array.isArray(Un))throw new TypeError('"list" argument must be an Array of Buffers');if(Un.length===0)return be.alloc(0);let $n;if(Ln===void 0)for(Ln=0,$n=0;$n<Un.length;++$n)Ln+=Un[$n].length;const jn=be.allocUnsafe(Ln);let Pn=0;for($n=0;$n<Un.length;++$n){let On=Un[$n];if(di(On,ae))Pn+On.length>jn.length?(be.isBuffer(On)||(On=be.from(On)),On.copy(jn,Pn)):ae.prototype.set.call(jn,On,Pn);else if(be.isBuffer(On))On.copy(jn,Pn);else throw new TypeError('"list" argument must be an Array of Buffers');Pn+=On.length}return jn};function me(Un,Ln){if(be.isBuffer(Un))return Un.length;if(de.isView(Un)||di(Un,de))return Un.byteLength;if(typeof Un!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Un);const $n=Un.length,jn=arguments.length>2&&arguments[2]===!0;if(!jn&&$n===0)return 0;let Pn=!1;for(;;)switch(Ln){case"ascii":case"latin1":case"binary":return $n;case"utf8":case"utf-8":return Ai(Un).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $n*2;case"hex":return $n>>>1;case"base64":return yi(Un).length;default:if(Pn)return jn?-1:Ai(Un).length;Ln=(""+Ln).toLowerCase(),Pn=!0}}be.byteLength=me;function Gt(Un,Ln,$n){let jn=!1;if((Ln===void 0||Ln<0)&&(Ln=0),Ln>this.length||(($n===void 0||$n>this.length)&&($n=this.length),$n<=0)||($n>>>=0,Ln>>>=0,$n<=Ln))return"";for(Un||(Un="utf8");;)switch(Un){case"hex":return Vt(this,Ln,$n);case"utf8":case"utf-8":return Zt(this,Ln,$n);case"ascii":return Ne(this,Ln,$n);case"latin1":case"binary":return We(this,Ln,$n);case"base64":return yn(this,Ln,$n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Sn(this,Ln,$n);default:if(jn)throw new TypeError("Unknown encoding: "+Un);Un=(Un+"").toLowerCase(),jn=!0}}be.prototype._isBuffer=!0;function mn(Un,Ln,$n){const jn=Un[Ln];Un[Ln]=Un[$n],Un[$n]=jn}be.prototype.swap16=function(){const Un=this.length;if(Un%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Ln=0;Ln<Un;Ln+=2)mn(this,Ln,Ln+1);return this},be.prototype.swap32=function(){const Un=this.length;if(Un%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let Ln=0;Ln<Un;Ln+=4)mn(this,Ln,Ln+3),mn(this,Ln+1,Ln+2);return this},be.prototype.swap64=function(){const Un=this.length;if(Un%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let Ln=0;Ln<Un;Ln+=8)mn(this,Ln,Ln+7),mn(this,Ln+1,Ln+6),mn(this,Ln+2,Ln+5),mn(this,Ln+3,Ln+4);return this},be.prototype.toString=function(){const Un=this.length;return Un===0?"":arguments.length===0?Zt(this,0,Un):Gt.apply(this,arguments)},be.prototype.toLocaleString=be.prototype.toString,be.prototype.equals=function(Un){if(!be.isBuffer(Un))throw new TypeError("Argument must be a Buffer");return this===Un?!0:be.compare(this,Un)===0},be.prototype.inspect=function(){let Un="";const Ln=t.INSPECT_MAX_BYTES;return Un=this.toString("hex",0,Ln).replace(/(.{2})/g,"$1 ").trim(),this.length>Ln&&(Un+=" ... "),"<Buffer "+Un+">"},ie&&(be.prototype[ie]=be.prototype.inspect),be.prototype.compare=function(Un,Ln,$n,jn,Pn){if(di(Un,ae)&&(Un=be.from(Un,Un.offset,Un.byteLength)),!be.isBuffer(Un))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Un);if(Ln===void 0&&(Ln=0),$n===void 0&&($n=Un?Un.length:0),jn===void 0&&(jn=0),Pn===void 0&&(Pn=this.length),Ln<0||$n>Un.length||jn<0||Pn>this.length)throw new RangeError("out of range index");if(jn>=Pn&&Ln>=$n)return 0;if(jn>=Pn)return-1;if(Ln>=$n)return 1;if(Ln>>>=0,$n>>>=0,jn>>>=0,Pn>>>=0,this===Un)return 0;let On=Pn-jn,Fn=$n-Ln;const Pt=Math.min(On,Fn),gn=this.slice(jn,Pn),Nn=Un.slice(Ln,$n);for(let mi=0;mi<Pt;++mi)if(gn[mi]!==Nn[mi]){On=gn[mi],Fn=Nn[mi];break}return On<Fn?-1:Fn<On?1:0};function dn(Un,Ln,$n,jn,Pn){if(Un.length===0)return-1;if(typeof $n=="string"?(jn=$n,$n=0):$n>2147483647?$n=2147483647:$n<-2147483648&&($n=-2147483648),$n=+$n,li($n)&&($n=Pn?0:Un.length-1),$n<0&&($n=Un.length+$n),$n>=Un.length){if(Pn)return-1;$n=Un.length-1}else if($n<0)if(Pn)$n=0;else return-1;if(typeof Ln=="string"&&(Ln=be.from(Ln,jn)),be.isBuffer(Ln))return Ln.length===0?-1:jt(Un,Ln,$n,jn,Pn);if(typeof Ln=="number")return Ln=Ln&255,typeof ae.prototype.indexOf=="function"?Pn?ae.prototype.indexOf.call(Un,Ln,$n):ae.prototype.lastIndexOf.call(Un,Ln,$n):jt(Un,[Ln],$n,jn,Pn);throw new TypeError("val must be string, number or Buffer")}function jt(Un,Ln,$n,jn,Pn){let On=1,Fn=Un.length,Pt=Ln.length;if(jn!==void 0&&(jn=String(jn).toLowerCase(),jn==="ucs2"||jn==="ucs-2"||jn==="utf16le"||jn==="utf-16le")){if(Un.length<2||Ln.length<2)return-1;On=2,Fn/=2,Pt/=2,$n/=2}function gn(mi,Wn){return On===1?mi[Wn]:mi.readUInt16BE(Wn*On)}let Nn;if(Pn){let mi=-1;for(Nn=$n;Nn<Fn;Nn++)if(gn(Un,Nn)===gn(Ln,mi===-1?0:Nn-mi)){if(mi===-1&&(mi=Nn),Nn-mi+1===Pt)return mi*On}else mi!==-1&&(Nn-=Nn-mi),mi=-1}else for($n+Pt>Fn&&($n=Fn-Pt),Nn=$n;Nn>=0;Nn--){let mi=!0;for(let Wn=0;Wn<Pt;Wn++)if(gn(Un,Nn+Wn)!==gn(Ln,Wn)){mi=!1;break}if(mi)return Nn}return-1}be.prototype.includes=function(Un,Ln,$n){return this.indexOf(Un,Ln,$n)!==-1},be.prototype.indexOf=function(Un,Ln,$n){return dn(this,Un,Ln,$n,!0)},be.prototype.lastIndexOf=function(Un,Ln,$n){return dn(this,Un,Ln,$n,!1)};function le(Un,Ln,$n,jn){$n=Number($n)||0;const Pn=Un.length-$n;jn?(jn=Number(jn),jn>Pn&&(jn=Pn)):jn=Pn;const On=Ln.length;jn>On/2&&(jn=On/2);let Fn;for(Fn=0;Fn<jn;++Fn){const Pt=parseInt(Ln.substr(Fn*2,2),16);if(li(Pt))return Fn;Un[$n+Fn]=Pt}return Fn}function Pe(Un,Ln,$n,jn){return Zn(Ai(Ln,Un.length-$n),Un,$n,jn)}function xe(Un,Ln,$n,jn){return Zn(Ii(Ln),Un,$n,jn)}function ze(Un,Ln,$n,jn){return Zn(yi(Ln),Un,$n,jn)}function Ft(Un,Ln,$n,jn){return Zn(Ei(Ln,Un.length-$n),Un,$n,jn)}be.prototype.write=function(Un,Ln,$n,jn){if(Ln===void 0)jn="utf8",$n=this.length,Ln=0;else if($n===void 0&&typeof Ln=="string")jn=Ln,$n=this.length,Ln=0;else if(isFinite(Ln))Ln=Ln>>>0,isFinite($n)?($n=$n>>>0,jn===void 0&&(jn="utf8")):(jn=$n,$n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Pn=this.length-Ln;if(($n===void 0||$n>Pn)&&($n=Pn),Un.length>0&&($n<0||Ln<0)||Ln>this.length)throw new RangeError("Attempt to write outside buffer bounds");jn||(jn="utf8");let On=!1;for(;;)switch(jn){case"hex":return le(this,Un,Ln,$n);case"utf8":case"utf-8":return Pe(this,Un,Ln,$n);case"ascii":case"latin1":case"binary":return xe(this,Un,Ln,$n);case"base64":return ze(this,Un,Ln,$n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ft(this,Un,Ln,$n);default:if(On)throw new TypeError("Unknown encoding: "+jn);jn=(""+jn).toLowerCase(),On=!0}},be.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function yn(Un,Ln,$n){return Ln===0&&$n===Un.length?n.fromByteArray(Un):n.fromByteArray(Un.slice(Ln,$n))}function Zt(Un,Ln,$n){$n=Math.min(Un.length,$n);const jn=[];let Pn=Ln;for(;Pn<$n;){const On=Un[Pn];let Fn=null,Pt=On>239?4:On>223?3:On>191?2:1;if(Pn+Pt<=$n){let gn,Nn,mi,Wn;switch(Pt){case 1:On<128&&(Fn=On);break;case 2:gn=Un[Pn+1],(gn&192)===128&&(Wn=(On&31)<<6|gn&63,Wn>127&&(Fn=Wn));break;case 3:gn=Un[Pn+1],Nn=Un[Pn+2],(gn&192)===128&&(Nn&192)===128&&(Wn=(On&15)<<12|(gn&63)<<6|Nn&63,Wn>2047&&(Wn<55296||Wn>57343)&&(Fn=Wn));break;case 4:gn=Un[Pn+1],Nn=Un[Pn+2],mi=Un[Pn+3],(gn&192)===128&&(Nn&192)===128&&(mi&192)===128&&(Wn=(On&15)<<18|(gn&63)<<12|(Nn&63)<<6|mi&63,Wn>65535&&Wn<1114112&&(Fn=Wn))}}Fn===null?(Fn=65533,Pt=1):Fn>65535&&(Fn-=65536,jn.push(Fn>>>10&1023|55296),Fn=56320|Fn&1023),jn.push(Fn),Pn+=Pt}return ce(jn)}const Me=4096;function ce(Un){const Ln=Un.length;if(Ln<=Me)return String.fromCharCode.apply(String,Un);let $n="",jn=0;for(;jn<Ln;)$n+=String.fromCharCode.apply(String,Un.slice(jn,jn+=Me));return $n}function Ne(Un,Ln,$n){let jn="";$n=Math.min(Un.length,$n);for(let Pn=Ln;Pn<$n;++Pn)jn+=String.fromCharCode(Un[Pn]&127);return jn}function We(Un,Ln,$n){let jn="";$n=Math.min(Un.length,$n);for(let Pn=Ln;Pn<$n;++Pn)jn+=String.fromCharCode(Un[Pn]);return jn}function Vt(Un,Ln,$n){const jn=Un.length;(!Ln||Ln<0)&&(Ln=0),(!$n||$n<0||$n>jn)&&($n=jn);let Pn="";for(let On=Ln;On<$n;++On)Pn+=Kn[Un[On]];return Pn}function Sn(Un,Ln,$n){const jn=Un.slice(Ln,$n);let Pn="";for(let On=0;On<jn.length-1;On+=2)Pn+=String.fromCharCode(jn[On]+jn[On+1]*256);return Pn}be.prototype.slice=function(Un,Ln){const $n=this.length;Un=~~Un,Ln=Ln===void 0?$n:~~Ln,Un<0?(Un+=$n,Un<0&&(Un=0)):Un>$n&&(Un=$n),Ln<0?(Ln+=$n,Ln<0&&(Ln=0)):Ln>$n&&(Ln=$n),Ln<Un&&(Ln=Un);const jn=this.subarray(Un,Ln);return Object.setPrototypeOf(jn,be.prototype),jn};function An(Un,Ln,$n){if(Un%1!==0||Un<0)throw new RangeError("offset is not uint");if(Un+Ln>$n)throw new RangeError("Trying to access beyond buffer length")}be.prototype.readUintLE=be.prototype.readUIntLE=function(Un,Ln,$n){Un=Un>>>0,Ln=Ln>>>0,$n||An(Un,Ln,this.length);let jn=this[Un],Pn=1,On=0;for(;++On<Ln&&(Pn*=256);)jn+=this[Un+On]*Pn;return jn},be.prototype.readUintBE=be.prototype.readUIntBE=function(Un,Ln,$n){Un=Un>>>0,Ln=Ln>>>0,$n||An(Un,Ln,this.length);let jn=this[Un+--Ln],Pn=1;for(;Ln>0&&(Pn*=256);)jn+=this[Un+--Ln]*Pn;return jn},be.prototype.readUint8=be.prototype.readUInt8=function(Un,Ln){return Un=Un>>>0,Ln||An(Un,1,this.length),this[Un]},be.prototype.readUint16LE=be.prototype.readUInt16LE=function(Un,Ln){return Un=Un>>>0,Ln||An(Un,2,this.length),this[Un]|this[Un+1]<<8},be.prototype.readUint16BE=be.prototype.readUInt16BE=function(Un,Ln){return Un=Un>>>0,Ln||An(Un,2,this.length),this[Un]<<8|this[Un+1]},be.prototype.readUint32LE=be.prototype.readUInt32LE=function(Un,Ln){return Un=Un>>>0,Ln||An(Un,4,this.length),(this[Un]|this[Un+1]<<8|this[Un+2]<<16)+this[Un+3]*16777216},be.prototype.readUint32BE=be.prototype.readUInt32BE=function(Un,Ln){return Un=Un>>>0,Ln||An(Un,4,this.length),this[Un]*16777216+(this[Un+1]<<16|this[Un+2]<<8|this[Un+3])},be.prototype.readBigUInt64LE=Vn(function(Un){Un=Un>>>0,ri(Un,"offset");const Ln=this[Un],$n=this[Un+7];(Ln===void 0||$n===void 0)&&hi(Un,this.length-8);const jn=Ln+this[++Un]*2**8+this[++Un]*2**16+this[++Un]*2**24,Pn=this[++Un]+this[++Un]*2**8+this[++Un]*2**16+$n*2**24;return BigInt(jn)+(BigInt(Pn)<<BigInt(32))}),be.prototype.readBigUInt64BE=Vn(function(Un){Un=Un>>>0,ri(Un,"offset");const Ln=this[Un],$n=this[Un+7];(Ln===void 0||$n===void 0)&&hi(Un,this.length-8);const jn=Ln*2**24+this[++Un]*2**16+this[++Un]*2**8+this[++Un],Pn=this[++Un]*2**24+this[++Un]*2**16+this[++Un]*2**8+$n;return(BigInt(jn)<<BigInt(32))+BigInt(Pn)}),be.prototype.readIntLE=function(Un,Ln,$n){Un=Un>>>0,Ln=Ln>>>0,$n||An(Un,Ln,this.length);let jn=this[Un],Pn=1,On=0;for(;++On<Ln&&(Pn*=256);)jn+=this[Un+On]*Pn;return Pn*=128,jn>=Pn&&(jn-=Math.pow(2,8*Ln)),jn},be.prototype.readIntBE=function(Un,Ln,$n){Un=Un>>>0,Ln=Ln>>>0,$n||An(Un,Ln,this.length);let jn=Ln,Pn=1,On=this[Un+--jn];for(;jn>0&&(Pn*=256);)On+=this[Un+--jn]*Pn;return Pn*=128,On>=Pn&&(On-=Math.pow(2,8*Ln)),On},be.prototype.readInt8=function(Un,Ln){return Un=Un>>>0,Ln||An(Un,1,this.length),this[Un]&128?(255-this[Un]+1)*-1:this[Un]},be.prototype.readInt16LE=function(Un,Ln){Un=Un>>>0,Ln||An(Un,2,this.length);const $n=this[Un]|this[Un+1]<<8;return $n&32768?$n|4294901760:$n},be.prototype.readInt16BE=function(Un,Ln){Un=Un>>>0,Ln||An(Un,2,this.length);const $n=this[Un+1]|this[Un]<<8;return $n&32768?$n|4294901760:$n},be.prototype.readInt32LE=function(Un,Ln){return Un=Un>>>0,Ln||An(Un,4,this.length),this[Un]|this[Un+1]<<8|this[Un+2]<<16|this[Un+3]<<24},be.prototype.readInt32BE=function(Un,Ln){return Un=Un>>>0,Ln||An(Un,4,this.length),this[Un]<<24|this[Un+1]<<16|this[Un+2]<<8|this[Un+3]},be.prototype.readBigInt64LE=Vn(function(Un){Un=Un>>>0,ri(Un,"offset");const Ln=this[Un],$n=this[Un+7];(Ln===void 0||$n===void 0)&&hi(Un,this.length-8);const jn=this[Un+4]+this[Un+5]*2**8+this[Un+6]*2**16+($n<<24);return(BigInt(jn)<<BigInt(32))+BigInt(Ln+this[++Un]*2**8+this[++Un]*2**16+this[++Un]*2**24)}),be.prototype.readBigInt64BE=Vn(function(Un){Un=Un>>>0,ri(Un,"offset");const Ln=this[Un],$n=this[Un+7];(Ln===void 0||$n===void 0)&&hi(Un,this.length-8);const jn=(Ln<<24)+this[++Un]*2**16+this[++Un]*2**8+this[++Un];return(BigInt(jn)<<BigInt(32))+BigInt(this[++Un]*2**24+this[++Un]*2**16+this[++Un]*2**8+$n)}),be.prototype.readFloatLE=function(Un,Ln){return Un=Un>>>0,Ln||An(Un,4,this.length),c.read(this,Un,!0,23,4)},be.prototype.readFloatBE=function(Un,Ln){return Un=Un>>>0,Ln||An(Un,4,this.length),c.read(this,Un,!1,23,4)},be.prototype.readDoubleLE=function(Un,Ln){return Un=Un>>>0,Ln||An(Un,8,this.length),c.read(this,Un,!0,52,8)},be.prototype.readDoubleBE=function(Un,Ln){return Un=Un>>>0,Ln||An(Un,8,this.length),c.read(this,Un,!1,52,8)};function Cn(Un,Ln,$n,jn,Pn,On){if(!be.isBuffer(Un))throw new TypeError('"buffer" argument must be a Buffer instance');if(Ln>Pn||Ln<On)throw new RangeError('"value" argument is out of bounds');if($n+jn>Un.length)throw new RangeError("Index out of range")}be.prototype.writeUintLE=be.prototype.writeUIntLE=function(Un,Ln,$n,jn){if(Un=+Un,Ln=Ln>>>0,$n=$n>>>0,!jn){const Fn=Math.pow(2,8*$n)-1;Cn(this,Un,Ln,$n,Fn,0)}let Pn=1,On=0;for(this[Ln]=Un&255;++On<$n&&(Pn*=256);)this[Ln+On]=Un/Pn&255;return Ln+$n},be.prototype.writeUintBE=be.prototype.writeUIntBE=function(Un,Ln,$n,jn){if(Un=+Un,Ln=Ln>>>0,$n=$n>>>0,!jn){const Fn=Math.pow(2,8*$n)-1;Cn(this,Un,Ln,$n,Fn,0)}let Pn=$n-1,On=1;for(this[Ln+Pn]=Un&255;--Pn>=0&&(On*=256);)this[Ln+Pn]=Un/On&255;return Ln+$n},be.prototype.writeUint8=be.prototype.writeUInt8=function(Un,Ln,$n){return Un=+Un,Ln=Ln>>>0,$n||Cn(this,Un,Ln,1,255,0),this[Ln]=Un&255,Ln+1},be.prototype.writeUint16LE=be.prototype.writeUInt16LE=function(Un,Ln,$n){return Un=+Un,Ln=Ln>>>0,$n||Cn(this,Un,Ln,2,65535,0),this[Ln]=Un&255,this[Ln+1]=Un>>>8,Ln+2},be.prototype.writeUint16BE=be.prototype.writeUInt16BE=function(Un,Ln,$n){return Un=+Un,Ln=Ln>>>0,$n||Cn(this,Un,Ln,2,65535,0),this[Ln]=Un>>>8,this[Ln+1]=Un&255,Ln+2},be.prototype.writeUint32LE=be.prototype.writeUInt32LE=function(Un,Ln,$n){return Un=+Un,Ln=Ln>>>0,$n||Cn(this,Un,Ln,4,4294967295,0),this[Ln+3]=Un>>>24,this[Ln+2]=Un>>>16,this[Ln+1]=Un>>>8,this[Ln]=Un&255,Ln+4},be.prototype.writeUint32BE=be.prototype.writeUInt32BE=function(Un,Ln,$n){return Un=+Un,Ln=Ln>>>0,$n||Cn(this,Un,Ln,4,4294967295,0),this[Ln]=Un>>>24,this[Ln+1]=Un>>>16,this[Ln+2]=Un>>>8,this[Ln+3]=Un&255,Ln+4};function Qn(Un,Ln,$n,jn,Pn){ti(Ln,jn,Pn,Un,$n,7);let On=Number(Ln&BigInt(4294967295));Un[$n++]=On,On=On>>8,Un[$n++]=On,On=On>>8,Un[$n++]=On,On=On>>8,Un[$n++]=On;let Fn=Number(Ln>>BigInt(32)&BigInt(4294967295));return Un[$n++]=Fn,Fn=Fn>>8,Un[$n++]=Fn,Fn=Fn>>8,Un[$n++]=Fn,Fn=Fn>>8,Un[$n++]=Fn,$n}function En(Un,Ln,$n,jn,Pn){ti(Ln,jn,Pn,Un,$n,7);let On=Number(Ln&BigInt(4294967295));Un[$n+7]=On,On=On>>8,Un[$n+6]=On,On=On>>8,Un[$n+5]=On,On=On>>8,Un[$n+4]=On;let Fn=Number(Ln>>BigInt(32)&BigInt(4294967295));return Un[$n+3]=Fn,Fn=Fn>>8,Un[$n+2]=Fn,Fn=Fn>>8,Un[$n+1]=Fn,Fn=Fn>>8,Un[$n]=Fn,$n+8}be.prototype.writeBigUInt64LE=Vn(function(Un,Ln=0){return Qn(this,Un,Ln,BigInt(0),BigInt("0xffffffffffffffff"))}),be.prototype.writeBigUInt64BE=Vn(function(Un,Ln=0){return En(this,Un,Ln,BigInt(0),BigInt("0xffffffffffffffff"))}),be.prototype.writeIntLE=function(Un,Ln,$n,jn){if(Un=+Un,Ln=Ln>>>0,!jn){const Pt=Math.pow(2,8*$n-1);Cn(this,Un,Ln,$n,Pt-1,-Pt)}let Pn=0,On=1,Fn=0;for(this[Ln]=Un&255;++Pn<$n&&(On*=256);)Un<0&&Fn===0&&this[Ln+Pn-1]!==0&&(Fn=1),this[Ln+Pn]=(Un/On>>0)-Fn&255;return Ln+$n},be.prototype.writeIntBE=function(Un,Ln,$n,jn){if(Un=+Un,Ln=Ln>>>0,!jn){const Pt=Math.pow(2,8*$n-1);Cn(this,Un,Ln,$n,Pt-1,-Pt)}let Pn=$n-1,On=1,Fn=0;for(this[Ln+Pn]=Un&255;--Pn>=0&&(On*=256);)Un<0&&Fn===0&&this[Ln+Pn+1]!==0&&(Fn=1),this[Ln+Pn]=(Un/On>>0)-Fn&255;return Ln+$n},be.prototype.writeInt8=function(Un,Ln,$n){return Un=+Un,Ln=Ln>>>0,$n||Cn(this,Un,Ln,1,127,-128),Un<0&&(Un=255+Un+1),this[Ln]=Un&255,Ln+1},be.prototype.writeInt16LE=function(Un,Ln,$n){return Un=+Un,Ln=Ln>>>0,$n||Cn(this,Un,Ln,2,32767,-32768),this[Ln]=Un&255,this[Ln+1]=Un>>>8,Ln+2},be.prototype.writeInt16BE=function(Un,Ln,$n){return Un=+Un,Ln=Ln>>>0,$n||Cn(this,Un,Ln,2,32767,-32768),this[Ln]=Un>>>8,this[Ln+1]=Un&255,Ln+2},be.prototype.writeInt32LE=function(Un,Ln,$n){return Un=+Un,Ln=Ln>>>0,$n||Cn(this,Un,Ln,4,2147483647,-2147483648),this[Ln]=Un&255,this[Ln+1]=Un>>>8,this[Ln+2]=Un>>>16,this[Ln+3]=Un>>>24,Ln+4},be.prototype.writeInt32BE=function(Un,Ln,$n){return Un=+Un,Ln=Ln>>>0,$n||Cn(this,Un,Ln,4,2147483647,-2147483648),Un<0&&(Un=4294967295+Un+1),this[Ln]=Un>>>24,this[Ln+1]=Un>>>16,this[Ln+2]=Un>>>8,this[Ln+3]=Un&255,Ln+4},be.prototype.writeBigInt64LE=Vn(function(Un,Ln=0){return Qn(this,Un,Ln,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),be.prototype.writeBigInt64BE=Vn(function(Un,Ln=0){return En(this,Un,Ln,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function In(Un,Ln,$n,jn,Pn,On){if($n+jn>Un.length)throw new RangeError("Index out of range");if($n<0)throw new RangeError("Index out of range")}function Mn(Un,Ln,$n,jn,Pn){return Ln=+Ln,$n=$n>>>0,Pn||In(Un,Ln,$n,4),c.write(Un,Ln,$n,jn,23,4),$n+4}be.prototype.writeFloatLE=function(Un,Ln,$n){return Mn(this,Un,Ln,!0,$n)},be.prototype.writeFloatBE=function(Un,Ln,$n){return Mn(this,Un,Ln,!1,$n)};function zn(Un,Ln,$n,jn,Pn){return Ln=+Ln,$n=$n>>>0,Pn||In(Un,Ln,$n,8),c.write(Un,Ln,$n,jn,52,8),$n+8}be.prototype.writeDoubleLE=function(Un,Ln,$n){return zn(this,Un,Ln,!0,$n)},be.prototype.writeDoubleBE=function(Un,Ln,$n){return zn(this,Un,Ln,!1,$n)},be.prototype.copy=function(Un,Ln,$n,jn){if(!be.isBuffer(Un))throw new TypeError("argument should be a Buffer");if($n||($n=0),!jn&&jn!==0&&(jn=this.length),Ln>=Un.length&&(Ln=Un.length),Ln||(Ln=0),jn>0&&jn<$n&&(jn=$n),jn===$n||Un.length===0||this.length===0)return 0;if(Ln<0)throw new RangeError("targetStart out of bounds");if($n<0||$n>=this.length)throw new RangeError("Index out of range");if(jn<0)throw new RangeError("sourceEnd out of bounds");jn>this.length&&(jn=this.length),Un.length-Ln<jn-$n&&(jn=Un.length-Ln+$n);const Pn=jn-$n;return this===Un&&typeof ae.prototype.copyWithin=="function"?this.copyWithin(Ln,$n,jn):ae.prototype.set.call(Un,this.subarray($n,jn),Ln),Pn},be.prototype.fill=function(Un,Ln,$n,jn){if(typeof Un=="string"){if(typeof Ln=="string"?(jn=Ln,Ln=0,$n=this.length):typeof $n=="string"&&(jn=$n,$n=this.length),jn!==void 0&&typeof jn!="string")throw new TypeError("encoding must be a string");if(typeof jn=="string"&&!be.isEncoding(jn))throw new TypeError("Unknown encoding: "+jn);if(Un.length===1){const On=Un.charCodeAt(0);(jn==="utf8"&&On<128||jn==="latin1")&&(Un=On)}}else typeof Un=="number"?Un=Un&255:typeof Un=="boolean"&&(Un=Number(Un));if(Ln<0||this.length<Ln||this.length<$n)throw new RangeError("Out of range index");if($n<=Ln)return this;Ln=Ln>>>0,$n=$n===void 0?this.length:$n>>>0,Un||(Un=0);let Pn;if(typeof Un=="number")for(Pn=Ln;Pn<$n;++Pn)this[Pn]=Un;else{const On=be.isBuffer(Un)?Un:be.from(Un,jn),Fn=On.length;if(Fn===0)throw new TypeError('The value "'+Un+'" is invalid for argument "value"');for(Pn=0;Pn<$n-Ln;++Pn)this[Pn+Ln]=On[Pn%Fn]}return this};const Jn={};function hn(Un,Ln,$n){Jn[Un]=class extends $n{constructor(){super(),Object.defineProperty(this,"message",{value:Ln.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${Un}]`,this.stack,delete this.name}get code(){return Un}set code(jn){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:jn,writable:!0})}toString(){return`${this.name} [${Un}]: ${this.message}`}}}hn("ERR_BUFFER_OUT_OF_BOUNDS",function(Un){return Un?`${Un} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),hn("ERR_INVALID_ARG_TYPE",function(Un,Ln){return`The "${Un}" argument must be of type number. Received type ${typeof Ln}`},TypeError),hn("ERR_OUT_OF_RANGE",function(Un,Ln,$n){let jn=`The value of "${Un}" is out of range.`,Pn=$n;return Number.isInteger($n)&&Math.abs($n)>2**32?Pn=xn(String($n)):typeof $n=="bigint"&&(Pn=String($n),($n>BigInt(2)**BigInt(32)||$n<-(BigInt(2)**BigInt(32)))&&(Pn=xn(Pn)),Pn+="n"),jn+=` It must be ${Ln}. Received ${Pn}`,jn},RangeError);function xn(Un){let Ln="",$n=Un.length;const jn=Un[0]==="-"?1:0;for(;$n>=jn+4;$n-=3)Ln=`_${Un.slice($n-3,$n)}${Ln}`;return`${Un.slice(0,$n)}${Ln}`}function Hn(Un,Ln,$n){ri(Ln,"offset"),(Un[Ln]===void 0||Un[Ln+$n]===void 0)&&hi(Ln,Un.length-($n+1))}function ti(Un,Ln,$n,jn,Pn,On){if(Un>$n||Un<Ln){const Fn=typeof Ln=="bigint"?"n":"";let Pt;throw Ln===0||Ln===BigInt(0)?Pt=`>= 0${Fn} and < 2${Fn} ** ${(On+1)*8}${Fn}`:Pt=`>= -(2${Fn} ** ${(On+1)*8-1}${Fn}) and < 2 ** ${(On+1)*8-1}${Fn}`,new Jn.ERR_OUT_OF_RANGE("value",Pt,Un)}Hn(jn,Pn,On)}function ri(Un,Ln){if(typeof Un!="number")throw new Jn.ERR_INVALID_ARG_TYPE(Ln,"number",Un)}function hi(Un,Ln,$n){throw Math.floor(Un)!==Un?(ri(Un,$n),new Jn.ERR_OUT_OF_RANGE("offset","an integer",Un)):Ln<0?new Jn.ERR_BUFFER_OUT_OF_BOUNDS:new Jn.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Ln}`,Un)}const gi=/[^+/0-9A-Za-z-_]/g;function vi(Un){if(Un=Un.split("=")[0],Un=Un.trim().replace(gi,""),Un.length<2)return"";for(;Un.length%4!==0;)Un=Un+"=";return Un}function Ai(Un,Ln){Ln=Ln||1/0;let $n;const jn=Un.length;let Pn=null;const On=[];for(let Fn=0;Fn<jn;++Fn){if($n=Un.charCodeAt(Fn),$n>55295&&$n<57344){if(!Pn){if($n>56319){(Ln-=3)>-1&&On.push(239,191,189);continue}else if(Fn+1===jn){(Ln-=3)>-1&&On.push(239,191,189);continue}Pn=$n;continue}if($n<56320){(Ln-=3)>-1&&On.push(239,191,189),Pn=$n;continue}$n=(Pn-55296<<10|$n-56320)+65536}else Pn&&(Ln-=3)>-1&&On.push(239,191,189);if(Pn=null,$n<128){if((Ln-=1)<0)break;On.push($n)}else if($n<2048){if((Ln-=2)<0)break;On.push($n>>6|192,$n&63|128)}else if($n<65536){if((Ln-=3)<0)break;On.push($n>>12|224,$n>>6&63|128,$n&63|128)}else if($n<1114112){if((Ln-=4)<0)break;On.push($n>>18|240,$n>>12&63|128,$n>>6&63|128,$n&63|128)}else throw new Error("Invalid code point")}return On}function Ii(Un){const Ln=[];for(let $n=0;$n<Un.length;++$n)Ln.push(Un.charCodeAt($n)&255);return Ln}function Ei(Un,Ln){let $n,jn,Pn;const On=[];for(let Fn=0;Fn<Un.length&&!((Ln-=2)<0);++Fn)$n=Un.charCodeAt(Fn),jn=$n>>8,Pn=$n%256,On.push(Pn),On.push(jn);return On}function yi(Un){return n.toByteArray(vi(Un))}function Zn(Un,Ln,$n,jn){let Pn;for(Pn=0;Pn<jn&&!(Pn+$n>=Ln.length||Pn>=Un.length);++Pn)Ln[Pn+$n]=Un[Pn];return Pn}function di(Un,Ln){return Un instanceof Ln||Un!=null&&Un.constructor!=null&&Un.constructor.name!=null&&Un.constructor.name===Ln.name}function li(Un){return Un!==Un}const Kn=(function(){const Un="0123456789abcdef",Ln=new Array(256);for(let $n=0;$n<16;++$n){const jn=$n*16;for(let Pn=0;Pn<16;++Pn)Ln[jn+Pn]=Un[$n]+Un[Pn]}return Ln})();function Vn(Un){return typeof BigInt>"u"?qn:Un}function qn(){throw new Error("BigInt not supported")}})(buffer$1);const Buffer$7=buffer$1.Buffer,Blob$2=buffer$1.Blob,BlobOptions=buffer$1.BlobOptions,Buffer$1$1=buffer$1.Buffer,File=buffer$1.File,FileOptions=buffer$1.FileOptions,INSPECT_MAX_BYTES=buffer$1.INSPECT_MAX_BYTES,SlowBuffer=buffer$1.SlowBuffer,TranscodeEncoding=buffer$1.TranscodeEncoding,atob$1=buffer$1.atob,btoa$1=buffer$1.btoa,constants$4=buffer$1.constants,isAscii=buffer$1.isAscii,isUtf8=buffer$1.isUtf8,kMaxLength=buffer$1.kMaxLength,kStringMaxLength=buffer$1.kStringMaxLength,resolveObjectURL=buffer$1.resolveObjectURL,transcode=buffer$1.transcode,dist$1=Object.freeze(Object.defineProperty({__proto__:null,Blob:Blob$2,BlobOptions,Buffer:Buffer$1$1,File,FileOptions,INSPECT_MAX_BYTES,SlowBuffer,TranscodeEncoding,atob:atob$1,btoa:btoa$1,constants:constants$4,default:Buffer$7,isAscii,isUtf8,kMaxLength,kStringMaxLength,resolveObjectURL,transcode},Symbol.toStringTag,{value:"Module"})),require$$0$4=getAugmentedNamespace(dist$1);(function(t){(function(n,c){function ie(xe,ze){if(!xe)throw new Error(ze||"Assertion failed")}function se(xe,ze){xe.super_=ze;var Ft=function(){};Ft.prototype=ze.prototype,xe.prototype=new Ft,xe.prototype.constructor=xe}function ae(xe,ze,Ft){if(ae.isBN(xe))return xe;this.negative=0,this.words=null,this.length=0,this.red=null,xe!==null&&((ze==="le"||ze==="be")&&(Ft=ze,ze=10),this._init(xe||0,ze||10,Ft||"be"))}typeof n=="object"?n.exports=ae:c.BN=ae,ae.BN=ae,ae.wordSize=26;var de;try{typeof window<"u"&&typeof window.Buffer<"u"?de=window.Buffer:de=require$$0$4.Buffer}catch{}ae.isBN=function(xe){return xe instanceof ae?!0:xe!==null&&typeof xe=="object"&&xe.constructor.wordSize===ae.wordSize&&Array.isArray(xe.words)},ae.max=function(xe,ze){return xe.cmp(ze)>0?xe:ze},ae.min=function(xe,ze){return xe.cmp(ze)<0?xe:ze},ae.prototype._init=function(xe,ze,Ft){if(typeof xe=="number")return this._initNumber(xe,ze,Ft);if(typeof xe=="object")return this._initArray(xe,ze,Ft);ze==="hex"&&(ze=16),ie(ze===(ze|0)&&ze>=2&&ze<=36),xe=xe.toString().replace(/\s+/g,"");var yn=0;xe[0]==="-"&&(yn++,this.negative=1),yn<xe.length&&(ze===16?this._parseHex(xe,yn,Ft):(this._parseBase(xe,ze,yn),Ft==="le"&&this._initArray(this.toArray(),ze,Ft)))},ae.prototype._initNumber=function(xe,ze,Ft){xe<0&&(this.negative=1,xe=-xe),xe<67108864?(this.words=[xe&67108863],this.length=1):xe<4503599627370496?(this.words=[xe&67108863,xe/67108864&67108863],this.length=2):(ie(xe<9007199254740992),this.words=[xe&67108863,xe/67108864&67108863,1],this.length=3),Ft==="le"&&this._initArray(this.toArray(),ze,Ft)},ae.prototype._initArray=function(xe,ze,Ft){if(ie(typeof xe.length=="number"),xe.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(xe.length/3),this.words=new Array(this.length);for(var yn=0;yn<this.length;yn++)this.words[yn]=0;var Zt,Me,ce=0;if(Ft==="be")for(yn=xe.length-1,Zt=0;yn>=0;yn-=3)Me=xe[yn]|xe[yn-1]<<8|xe[yn-2]<<16,this.words[Zt]|=Me<<ce&67108863,this.words[Zt+1]=Me>>>26-ce&67108863,ce+=24,ce>=26&&(ce-=26,Zt++);else if(Ft==="le")for(yn=0,Zt=0;yn<xe.length;yn+=3)Me=xe[yn]|xe[yn+1]<<8|xe[yn+2]<<16,this.words[Zt]|=Me<<ce&67108863,this.words[Zt+1]=Me>>>26-ce&67108863,ce+=24,ce>=26&&(ce-=26,Zt++);return this._strip()};function ue(xe,ze){var Ft=xe.charCodeAt(ze);if(Ft>=48&&Ft<=57)return Ft-48;if(Ft>=65&&Ft<=70)return Ft-55;if(Ft>=97&&Ft<=102)return Ft-87;ie(!1,"Invalid character in "+xe)}function pe(xe,ze,Ft){var yn=ue(xe,Ft);return Ft-1>=ze&&(yn|=ue(xe,Ft-1)<<4),yn}ae.prototype._parseHex=function(xe,ze,Ft){this.length=Math.ceil((xe.length-ze)/6),this.words=new Array(this.length);for(var yn=0;yn<this.length;yn++)this.words[yn]=0;var Zt=0,Me=0,ce;if(Ft==="be")for(yn=xe.length-1;yn>=ze;yn-=2)ce=pe(xe,ze,yn)<<Zt,this.words[Me]|=ce&67108863,Zt>=18?(Zt-=18,Me+=1,this.words[Me]|=ce>>>26):Zt+=8;else{var Ne=xe.length-ze;for(yn=Ne%2===0?ze+1:ze;yn<xe.length;yn+=2)ce=pe(xe,ze,yn)<<Zt,this.words[Me]|=ce&67108863,Zt>=18?(Zt-=18,Me+=1,this.words[Me]|=ce>>>26):Zt+=8}this._strip()};function ge(xe,ze,Ft,yn){for(var Zt=0,Me=0,ce=Math.min(xe.length,Ft),Ne=ze;Ne<ce;Ne++){var We=xe.charCodeAt(Ne)-48;Zt*=yn,We>=49?Me=We-49+10:We>=17?Me=We-17+10:Me=We,ie(We>=0&&Me<yn,"Invalid character"),Zt+=Me}return Zt}ae.prototype._parseBase=function(xe,ze,Ft){this.words=[0],this.length=1;for(var yn=0,Zt=1;Zt<=67108863;Zt*=ze)yn++;yn--,Zt=Zt/ze|0;for(var Me=xe.length-Ft,ce=Me%yn,Ne=Math.min(Me,Me-ce)+Ft,We=0,Vt=Ft;Vt<Ne;Vt+=yn)We=ge(xe,Vt,Vt+yn,ze),this.imuln(Zt),this.words[0]+We<67108864?this.words[0]+=We:this._iaddn(We);if(ce!==0){var Sn=1;for(We=ge(xe,Vt,xe.length,ze),Vt=0;Vt<ce;Vt++)Sn*=ze;this.imuln(Sn),this.words[0]+We<67108864?this.words[0]+=We:this._iaddn(We)}this._strip()},ae.prototype.copy=function(xe){xe.words=new Array(this.length);for(var ze=0;ze<this.length;ze++)xe.words[ze]=this.words[ze];xe.length=this.length,xe.negative=this.negative,xe.red=this.red};function be(xe,ze){xe.words=ze.words,xe.length=ze.length,xe.negative=ze.negative,xe.red=ze.red}if(ae.prototype._move=function(xe){be(xe,this)},ae.prototype.clone=function(){var xe=new ae(null);return this.copy(xe),xe},ae.prototype._expand=function(xe){for(;this.length<xe;)this.words[this.length++]=0;return this},ae.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},ae.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{ae.prototype[Symbol.for("nodejs.util.inspect.custom")]=_e}catch{ae.prototype.inspect=_e}else ae.prototype.inspect=_e;function _e(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var we=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],qe=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],Ye=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];ae.prototype.toString=function(xe,ze){xe=xe||10,ze=ze|0||1;var Ft;if(xe===16||xe==="hex"){Ft="";for(var yn=0,Zt=0,Me=0;Me<this.length;Me++){var ce=this.words[Me],Ne=((ce<<yn|Zt)&16777215).toString(16);Zt=ce>>>24-yn&16777215,yn+=2,yn>=26&&(yn-=26,Me--),Zt!==0||Me!==this.length-1?Ft=we[6-Ne.length]+Ne+Ft:Ft=Ne+Ft}for(Zt!==0&&(Ft=Zt.toString(16)+Ft);Ft.length%ze!==0;)Ft="0"+Ft;return this.negative!==0&&(Ft="-"+Ft),Ft}if(xe===(xe|0)&&xe>=2&&xe<=36){var We=qe[xe],Vt=Ye[xe];Ft="";var Sn=this.clone();for(Sn.negative=0;!Sn.isZero();){var An=Sn.modrn(Vt).toString(xe);Sn=Sn.idivn(Vt),Sn.isZero()?Ft=An+Ft:Ft=we[We-An.length]+An+Ft}for(this.isZero()&&(Ft="0"+Ft);Ft.length%ze!==0;)Ft="0"+Ft;return this.negative!==0&&(Ft="-"+Ft),Ft}ie(!1,"Base should be between 2 and 36")},ae.prototype.toNumber=function(){var xe=this.words[0];return this.length===2?xe+=this.words[1]*67108864:this.length===3&&this.words[2]===1?xe+=4503599627370496+this.words[1]*67108864:this.length>2&&ie(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-xe:xe},ae.prototype.toJSON=function(){return this.toString(16,2)},de&&(ae.prototype.toBuffer=function(xe,ze){return this.toArrayLike(de,xe,ze)}),ae.prototype.toArray=function(xe,ze){return this.toArrayLike(Array,xe,ze)};var Ge=function(xe,ze){return xe.allocUnsafe?xe.allocUnsafe(ze):new xe(ze)};ae.prototype.toArrayLike=function(xe,ze,Ft){this._strip();var yn=this.byteLength(),Zt=Ft||Math.max(1,yn);ie(yn<=Zt,"byte array longer than desired length"),ie(Zt>0,"Requested array length <= 0");var Me=Ge(xe,Zt),ce=ze==="le"?"LE":"BE";return this["_toArrayLike"+ce](Me,yn),Me},ae.prototype._toArrayLikeLE=function(xe,ze){for(var Ft=0,yn=0,Zt=0,Me=0;Zt<this.length;Zt++){var ce=this.words[Zt]<<Me|yn;xe[Ft++]=ce&255,Ft<xe.length&&(xe[Ft++]=ce>>8&255),Ft<xe.length&&(xe[Ft++]=ce>>16&255),Me===6?(Ft<xe.length&&(xe[Ft++]=ce>>24&255),yn=0,Me=0):(yn=ce>>>24,Me+=2)}if(Ft<xe.length)for(xe[Ft++]=yn;Ft<xe.length;)xe[Ft++]=0},ae.prototype._toArrayLikeBE=function(xe,ze){for(var Ft=xe.length-1,yn=0,Zt=0,Me=0;Zt<this.length;Zt++){var ce=this.words[Zt]<<Me|yn;xe[Ft--]=ce&255,Ft>=0&&(xe[Ft--]=ce>>8&255),Ft>=0&&(xe[Ft--]=ce>>16&255),Me===6?(Ft>=0&&(xe[Ft--]=ce>>24&255),yn=0,Me=0):(yn=ce>>>24,Me+=2)}if(Ft>=0)for(xe[Ft--]=yn;Ft>=0;)xe[Ft--]=0},Math.clz32?ae.prototype._countBits=function(xe){return 32-Math.clz32(xe)}:ae.prototype._countBits=function(xe){var ze=xe,Ft=0;return ze>=4096&&(Ft+=13,ze>>>=13),ze>=64&&(Ft+=7,ze>>>=7),ze>=8&&(Ft+=4,ze>>>=4),ze>=2&&(Ft+=2,ze>>>=2),Ft+ze},ae.prototype._zeroBits=function(xe){if(xe===0)return 26;var ze=xe,Ft=0;return ze&8191||(Ft+=13,ze>>>=13),ze&127||(Ft+=7,ze>>>=7),ze&15||(Ft+=4,ze>>>=4),ze&3||(Ft+=2,ze>>>=2),ze&1||Ft++,Ft},ae.prototype.bitLength=function(){var xe=this.words[this.length-1],ze=this._countBits(xe);return(this.length-1)*26+ze};function Ze(xe){for(var ze=new Array(xe.bitLength()),Ft=0;Ft<ze.length;Ft++){var yn=Ft/26|0,Zt=Ft%26;ze[Ft]=xe.words[yn]>>>Zt&1}return ze}ae.prototype.zeroBits=function(){if(this.isZero())return 0;for(var xe=0,ze=0;ze<this.length;ze++){var Ft=this._zeroBits(this.words[ze]);if(xe+=Ft,Ft!==26)break}return xe},ae.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},ae.prototype.toTwos=function(xe){return this.negative!==0?this.abs().inotn(xe).iaddn(1):this.clone()},ae.prototype.fromTwos=function(xe){return this.testn(xe-1)?this.notn(xe).iaddn(1).ineg():this.clone()},ae.prototype.isNeg=function(){return this.negative!==0},ae.prototype.neg=function(){return this.clone().ineg()},ae.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},ae.prototype.iuor=function(xe){for(;this.length<xe.length;)this.words[this.length++]=0;for(var ze=0;ze<xe.length;ze++)this.words[ze]=this.words[ze]|xe.words[ze];return this._strip()},ae.prototype.ior=function(xe){return ie((this.negative|xe.negative)===0),this.iuor(xe)},ae.prototype.or=function(xe){return this.length>xe.length?this.clone().ior(xe):xe.clone().ior(this)},ae.prototype.uor=function(xe){return this.length>xe.length?this.clone().iuor(xe):xe.clone().iuor(this)},ae.prototype.iuand=function(xe){var ze;this.length>xe.length?ze=xe:ze=this;for(var Ft=0;Ft<ze.length;Ft++)this.words[Ft]=this.words[Ft]&xe.words[Ft];return this.length=ze.length,this._strip()},ae.prototype.iand=function(xe){return ie((this.negative|xe.negative)===0),this.iuand(xe)},ae.prototype.and=function(xe){return this.length>xe.length?this.clone().iand(xe):xe.clone().iand(this)},ae.prototype.uand=function(xe){return this.length>xe.length?this.clone().iuand(xe):xe.clone().iuand(this)},ae.prototype.iuxor=function(xe){var ze,Ft;this.length>xe.length?(ze=this,Ft=xe):(ze=xe,Ft=this);for(var yn=0;yn<Ft.length;yn++)this.words[yn]=ze.words[yn]^Ft.words[yn];if(this!==ze)for(;yn<ze.length;yn++)this.words[yn]=ze.words[yn];return this.length=ze.length,this._strip()},ae.prototype.ixor=function(xe){return ie((this.negative|xe.negative)===0),this.iuxor(xe)},ae.prototype.xor=function(xe){return this.length>xe.length?this.clone().ixor(xe):xe.clone().ixor(this)},ae.prototype.uxor=function(xe){return this.length>xe.length?this.clone().iuxor(xe):xe.clone().iuxor(this)},ae.prototype.inotn=function(xe){ie(typeof xe=="number"&&xe>=0);var ze=Math.ceil(xe/26)|0,Ft=xe%26;this._expand(ze),Ft>0&&ze--;for(var yn=0;yn<ze;yn++)this.words[yn]=~this.words[yn]&67108863;return Ft>0&&(this.words[yn]=~this.words[yn]&67108863>>26-Ft),this._strip()},ae.prototype.notn=function(xe){return this.clone().inotn(xe)},ae.prototype.setn=function(xe,ze){ie(typeof xe=="number"&&xe>=0);var Ft=xe/26|0,yn=xe%26;return this._expand(Ft+1),ze?this.words[Ft]=this.words[Ft]|1<<yn:this.words[Ft]=this.words[Ft]&~(1<<yn),this._strip()},ae.prototype.iadd=function(xe){var ze;if(this.negative!==0&&xe.negative===0)return this.negative=0,ze=this.isub(xe),this.negative^=1,this._normSign();if(this.negative===0&&xe.negative!==0)return xe.negative=0,ze=this.isub(xe),xe.negative=1,ze._normSign();var Ft,yn;this.length>xe.length?(Ft=this,yn=xe):(Ft=xe,yn=this);for(var Zt=0,Me=0;Me<yn.length;Me++)ze=(Ft.words[Me]|0)+(yn.words[Me]|0)+Zt,this.words[Me]=ze&67108863,Zt=ze>>>26;for(;Zt!==0&&Me<Ft.length;Me++)ze=(Ft.words[Me]|0)+Zt,this.words[Me]=ze&67108863,Zt=ze>>>26;if(this.length=Ft.length,Zt!==0)this.words[this.length]=Zt,this.length++;else if(Ft!==this)for(;Me<Ft.length;Me++)this.words[Me]=Ft.words[Me];return this},ae.prototype.add=function(xe){var ze;return xe.negative!==0&&this.negative===0?(xe.negative=0,ze=this.sub(xe),xe.negative^=1,ze):xe.negative===0&&this.negative!==0?(this.negative=0,ze=xe.sub(this),this.negative=1,ze):this.length>xe.length?this.clone().iadd(xe):xe.clone().iadd(this)},ae.prototype.isub=function(xe){if(xe.negative!==0){xe.negative=0;var ze=this.iadd(xe);return xe.negative=1,ze._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(xe),this.negative=1,this._normSign();var Ft=this.cmp(xe);if(Ft===0)return this.negative=0,this.length=1,this.words[0]=0,this;var yn,Zt;Ft>0?(yn=this,Zt=xe):(yn=xe,Zt=this);for(var Me=0,ce=0;ce<Zt.length;ce++)ze=(yn.words[ce]|0)-(Zt.words[ce]|0)+Me,Me=ze>>26,this.words[ce]=ze&67108863;for(;Me!==0&&ce<yn.length;ce++)ze=(yn.words[ce]|0)+Me,Me=ze>>26,this.words[ce]=ze&67108863;if(Me===0&&ce<yn.length&&yn!==this)for(;ce<yn.length;ce++)this.words[ce]=yn.words[ce];return this.length=Math.max(this.length,ce),yn!==this&&(this.negative=1),this._strip()},ae.prototype.sub=function(xe){return this.clone().isub(xe)};function He(xe,ze,Ft){Ft.negative=ze.negative^xe.negative;var yn=xe.length+ze.length|0;Ft.length=yn,yn=yn-1|0;var Zt=xe.words[0]|0,Me=ze.words[0]|0,ce=Zt*Me,Ne=ce&67108863,We=ce/67108864|0;Ft.words[0]=Ne;for(var Vt=1;Vt<yn;Vt++){for(var Sn=We>>>26,An=We&67108863,Cn=Math.min(Vt,ze.length-1),Qn=Math.max(0,Vt-xe.length+1);Qn<=Cn;Qn++){var En=Vt-Qn|0;Zt=xe.words[En]|0,Me=ze.words[Qn]|0,ce=Zt*Me+An,Sn+=ce/67108864|0,An=ce&67108863}Ft.words[Vt]=An|0,We=Sn|0}return We!==0?Ft.words[Vt]=We|0:Ft.length--,Ft._strip()}var Ht=function(xe,ze,Ft){var yn=xe.words,Zt=ze.words,Me=Ft.words,ce=0,Ne,We,Vt,Sn=yn[0]|0,An=Sn&8191,Cn=Sn>>>13,Qn=yn[1]|0,En=Qn&8191,In=Qn>>>13,Mn=yn[2]|0,zn=Mn&8191,Jn=Mn>>>13,hn=yn[3]|0,xn=hn&8191,Hn=hn>>>13,ti=yn[4]|0,ri=ti&8191,hi=ti>>>13,gi=yn[5]|0,vi=gi&8191,Ai=gi>>>13,Ii=yn[6]|0,Ei=Ii&8191,yi=Ii>>>13,Zn=yn[7]|0,di=Zn&8191,li=Zn>>>13,Kn=yn[8]|0,Vn=Kn&8191,qn=Kn>>>13,Un=yn[9]|0,Ln=Un&8191,$n=Un>>>13,jn=Zt[0]|0,Pn=jn&8191,On=jn>>>13,Fn=Zt[1]|0,Pt=Fn&8191,gn=Fn>>>13,Nn=Zt[2]|0,mi=Nn&8191,Wn=Nn>>>13,ci=Zt[3]|0,Mi=ci&8191,Si=ci>>>13,Bi=Zt[4]|0,Fi=Bi&8191,ki=Bi>>>13,Gn=Zt[5]|0,Oi=Gn&8191,pi=Gn>>>13,bi=Zt[6]|0,xi=bi&8191,wi=bi>>>13,Ci=Zt[7]|0,Ti=Ci&8191,Ri=Ci>>>13,_i=Zt[8]|0,Ui=_i&8191,Pi=_i>>>13,Ni=Zt[9]|0,Qi=Ni&8191,Di=Ni>>>13;Ft.negative=xe.negative^ze.negative,Ft.length=19,Ne=Math.imul(An,Pn),We=Math.imul(An,On),We=We+Math.imul(Cn,Pn)|0,Vt=Math.imul(Cn,On);var qi=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(qi>>>26)|0,qi&=67108863,Ne=Math.imul(En,Pn),We=Math.imul(En,On),We=We+Math.imul(In,Pn)|0,Vt=Math.imul(In,On),Ne=Ne+Math.imul(An,Pt)|0,We=We+Math.imul(An,gn)|0,We=We+Math.imul(Cn,Pt)|0,Vt=Vt+Math.imul(Cn,gn)|0;var Hi=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(Hi>>>26)|0,Hi&=67108863,Ne=Math.imul(zn,Pn),We=Math.imul(zn,On),We=We+Math.imul(Jn,Pn)|0,Vt=Math.imul(Jn,On),Ne=Ne+Math.imul(En,Pt)|0,We=We+Math.imul(En,gn)|0,We=We+Math.imul(In,Pt)|0,Vt=Vt+Math.imul(In,gn)|0,Ne=Ne+Math.imul(An,mi)|0,We=We+Math.imul(An,Wn)|0,We=We+Math.imul(Cn,mi)|0,Vt=Vt+Math.imul(Cn,Wn)|0;var Ji=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(Ji>>>26)|0,Ji&=67108863,Ne=Math.imul(xn,Pn),We=Math.imul(xn,On),We=We+Math.imul(Hn,Pn)|0,Vt=Math.imul(Hn,On),Ne=Ne+Math.imul(zn,Pt)|0,We=We+Math.imul(zn,gn)|0,We=We+Math.imul(Jn,Pt)|0,Vt=Vt+Math.imul(Jn,gn)|0,Ne=Ne+Math.imul(En,mi)|0,We=We+Math.imul(En,Wn)|0,We=We+Math.imul(In,mi)|0,Vt=Vt+Math.imul(In,Wn)|0,Ne=Ne+Math.imul(An,Mi)|0,We=We+Math.imul(An,Si)|0,We=We+Math.imul(Cn,Mi)|0,Vt=Vt+Math.imul(Cn,Si)|0;var Li=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(Li>>>26)|0,Li&=67108863,Ne=Math.imul(ri,Pn),We=Math.imul(ri,On),We=We+Math.imul(hi,Pn)|0,Vt=Math.imul(hi,On),Ne=Ne+Math.imul(xn,Pt)|0,We=We+Math.imul(xn,gn)|0,We=We+Math.imul(Hn,Pt)|0,Vt=Vt+Math.imul(Hn,gn)|0,Ne=Ne+Math.imul(zn,mi)|0,We=We+Math.imul(zn,Wn)|0,We=We+Math.imul(Jn,mi)|0,Vt=Vt+Math.imul(Jn,Wn)|0,Ne=Ne+Math.imul(En,Mi)|0,We=We+Math.imul(En,Si)|0,We=We+Math.imul(In,Mi)|0,Vt=Vt+Math.imul(In,Si)|0,Ne=Ne+Math.imul(An,Fi)|0,We=We+Math.imul(An,ki)|0,We=We+Math.imul(Cn,Fi)|0,Vt=Vt+Math.imul(Cn,ki)|0;var $i=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+($i>>>26)|0,$i&=67108863,Ne=Math.imul(vi,Pn),We=Math.imul(vi,On),We=We+Math.imul(Ai,Pn)|0,Vt=Math.imul(Ai,On),Ne=Ne+Math.imul(ri,Pt)|0,We=We+Math.imul(ri,gn)|0,We=We+Math.imul(hi,Pt)|0,Vt=Vt+Math.imul(hi,gn)|0,Ne=Ne+Math.imul(xn,mi)|0,We=We+Math.imul(xn,Wn)|0,We=We+Math.imul(Hn,mi)|0,Vt=Vt+Math.imul(Hn,Wn)|0,Ne=Ne+Math.imul(zn,Mi)|0,We=We+Math.imul(zn,Si)|0,We=We+Math.imul(Jn,Mi)|0,Vt=Vt+Math.imul(Jn,Si)|0,Ne=Ne+Math.imul(En,Fi)|0,We=We+Math.imul(En,ki)|0,We=We+Math.imul(In,Fi)|0,Vt=Vt+Math.imul(In,ki)|0,Ne=Ne+Math.imul(An,Oi)|0,We=We+Math.imul(An,pi)|0,We=We+Math.imul(Cn,Oi)|0,Vt=Vt+Math.imul(Cn,pi)|0;var Vi=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(Vi>>>26)|0,Vi&=67108863,Ne=Math.imul(Ei,Pn),We=Math.imul(Ei,On),We=We+Math.imul(yi,Pn)|0,Vt=Math.imul(yi,On),Ne=Ne+Math.imul(vi,Pt)|0,We=We+Math.imul(vi,gn)|0,We=We+Math.imul(Ai,Pt)|0,Vt=Vt+Math.imul(Ai,gn)|0,Ne=Ne+Math.imul(ri,mi)|0,We=We+Math.imul(ri,Wn)|0,We=We+Math.imul(hi,mi)|0,Vt=Vt+Math.imul(hi,Wn)|0,Ne=Ne+Math.imul(xn,Mi)|0,We=We+Math.imul(xn,Si)|0,We=We+Math.imul(Hn,Mi)|0,Vt=Vt+Math.imul(Hn,Si)|0,Ne=Ne+Math.imul(zn,Fi)|0,We=We+Math.imul(zn,ki)|0,We=We+Math.imul(Jn,Fi)|0,Vt=Vt+Math.imul(Jn,ki)|0,Ne=Ne+Math.imul(En,Oi)|0,We=We+Math.imul(En,pi)|0,We=We+Math.imul(In,Oi)|0,Vt=Vt+Math.imul(In,pi)|0,Ne=Ne+Math.imul(An,xi)|0,We=We+Math.imul(An,wi)|0,We=We+Math.imul(Cn,xi)|0,Vt=Vt+Math.imul(Cn,wi)|0;var Gi=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(Gi>>>26)|0,Gi&=67108863,Ne=Math.imul(di,Pn),We=Math.imul(di,On),We=We+Math.imul(li,Pn)|0,Vt=Math.imul(li,On),Ne=Ne+Math.imul(Ei,Pt)|0,We=We+Math.imul(Ei,gn)|0,We=We+Math.imul(yi,Pt)|0,Vt=Vt+Math.imul(yi,gn)|0,Ne=Ne+Math.imul(vi,mi)|0,We=We+Math.imul(vi,Wn)|0,We=We+Math.imul(Ai,mi)|0,Vt=Vt+Math.imul(Ai,Wn)|0,Ne=Ne+Math.imul(ri,Mi)|0,We=We+Math.imul(ri,Si)|0,We=We+Math.imul(hi,Mi)|0,Vt=Vt+Math.imul(hi,Si)|0,Ne=Ne+Math.imul(xn,Fi)|0,We=We+Math.imul(xn,ki)|0,We=We+Math.imul(Hn,Fi)|0,Vt=Vt+Math.imul(Hn,ki)|0,Ne=Ne+Math.imul(zn,Oi)|0,We=We+Math.imul(zn,pi)|0,We=We+Math.imul(Jn,Oi)|0,Vt=Vt+Math.imul(Jn,pi)|0,Ne=Ne+Math.imul(En,xi)|0,We=We+Math.imul(En,wi)|0,We=We+Math.imul(In,xi)|0,Vt=Vt+Math.imul(In,wi)|0,Ne=Ne+Math.imul(An,Ti)|0,We=We+Math.imul(An,Ri)|0,We=We+Math.imul(Cn,Ti)|0,Vt=Vt+Math.imul(Cn,Ri)|0;var Wi=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(Wi>>>26)|0,Wi&=67108863,Ne=Math.imul(Vn,Pn),We=Math.imul(Vn,On),We=We+Math.imul(qn,Pn)|0,Vt=Math.imul(qn,On),Ne=Ne+Math.imul(di,Pt)|0,We=We+Math.imul(di,gn)|0,We=We+Math.imul(li,Pt)|0,Vt=Vt+Math.imul(li,gn)|0,Ne=Ne+Math.imul(Ei,mi)|0,We=We+Math.imul(Ei,Wn)|0,We=We+Math.imul(yi,mi)|0,Vt=Vt+Math.imul(yi,Wn)|0,Ne=Ne+Math.imul(vi,Mi)|0,We=We+Math.imul(vi,Si)|0,We=We+Math.imul(Ai,Mi)|0,Vt=Vt+Math.imul(Ai,Si)|0,Ne=Ne+Math.imul(ri,Fi)|0,We=We+Math.imul(ri,ki)|0,We=We+Math.imul(hi,Fi)|0,Vt=Vt+Math.imul(hi,ki)|0,Ne=Ne+Math.imul(xn,Oi)|0,We=We+Math.imul(xn,pi)|0,We=We+Math.imul(Hn,Oi)|0,Vt=Vt+Math.imul(Hn,pi)|0,Ne=Ne+Math.imul(zn,xi)|0,We=We+Math.imul(zn,wi)|0,We=We+Math.imul(Jn,xi)|0,Vt=Vt+Math.imul(Jn,wi)|0,Ne=Ne+Math.imul(En,Ti)|0,We=We+Math.imul(En,Ri)|0,We=We+Math.imul(In,Ti)|0,Vt=Vt+Math.imul(In,Ri)|0,Ne=Ne+Math.imul(An,Ui)|0,We=We+Math.imul(An,Pi)|0,We=We+Math.imul(Cn,Ui)|0,Vt=Vt+Math.imul(Cn,Pi)|0;var Ki=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(Ki>>>26)|0,Ki&=67108863,Ne=Math.imul(Ln,Pn),We=Math.imul(Ln,On),We=We+Math.imul($n,Pn)|0,Vt=Math.imul($n,On),Ne=Ne+Math.imul(Vn,Pt)|0,We=We+Math.imul(Vn,gn)|0,We=We+Math.imul(qn,Pt)|0,Vt=Vt+Math.imul(qn,gn)|0,Ne=Ne+Math.imul(di,mi)|0,We=We+Math.imul(di,Wn)|0,We=We+Math.imul(li,mi)|0,Vt=Vt+Math.imul(li,Wn)|0,Ne=Ne+Math.imul(Ei,Mi)|0,We=We+Math.imul(Ei,Si)|0,We=We+Math.imul(yi,Mi)|0,Vt=Vt+Math.imul(yi,Si)|0,Ne=Ne+Math.imul(vi,Fi)|0,We=We+Math.imul(vi,ki)|0,We=We+Math.imul(Ai,Fi)|0,Vt=Vt+Math.imul(Ai,ki)|0,Ne=Ne+Math.imul(ri,Oi)|0,We=We+Math.imul(ri,pi)|0,We=We+Math.imul(hi,Oi)|0,Vt=Vt+Math.imul(hi,pi)|0,Ne=Ne+Math.imul(xn,xi)|0,We=We+Math.imul(xn,wi)|0,We=We+Math.imul(Hn,xi)|0,Vt=Vt+Math.imul(Hn,wi)|0,Ne=Ne+Math.imul(zn,Ti)|0,We=We+Math.imul(zn,Ri)|0,We=We+Math.imul(Jn,Ti)|0,Vt=Vt+Math.imul(Jn,Ri)|0,Ne=Ne+Math.imul(En,Ui)|0,We=We+Math.imul(En,Pi)|0,We=We+Math.imul(In,Ui)|0,Vt=Vt+Math.imul(In,Pi)|0,Ne=Ne+Math.imul(An,Qi)|0,We=We+Math.imul(An,Di)|0,We=We+Math.imul(Cn,Qi)|0,Vt=Vt+Math.imul(Cn,Di)|0;var zi=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(zi>>>26)|0,zi&=67108863,Ne=Math.imul(Ln,Pt),We=Math.imul(Ln,gn),We=We+Math.imul($n,Pt)|0,Vt=Math.imul($n,gn),Ne=Ne+Math.imul(Vn,mi)|0,We=We+Math.imul(Vn,Wn)|0,We=We+Math.imul(qn,mi)|0,Vt=Vt+Math.imul(qn,Wn)|0,Ne=Ne+Math.imul(di,Mi)|0,We=We+Math.imul(di,Si)|0,We=We+Math.imul(li,Mi)|0,Vt=Vt+Math.imul(li,Si)|0,Ne=Ne+Math.imul(Ei,Fi)|0,We=We+Math.imul(Ei,ki)|0,We=We+Math.imul(yi,Fi)|0,Vt=Vt+Math.imul(yi,ki)|0,Ne=Ne+Math.imul(vi,Oi)|0,We=We+Math.imul(vi,pi)|0,We=We+Math.imul(Ai,Oi)|0,Vt=Vt+Math.imul(Ai,pi)|0,Ne=Ne+Math.imul(ri,xi)|0,We=We+Math.imul(ri,wi)|0,We=We+Math.imul(hi,xi)|0,Vt=Vt+Math.imul(hi,wi)|0,Ne=Ne+Math.imul(xn,Ti)|0,We=We+Math.imul(xn,Ri)|0,We=We+Math.imul(Hn,Ti)|0,Vt=Vt+Math.imul(Hn,Ri)|0,Ne=Ne+Math.imul(zn,Ui)|0,We=We+Math.imul(zn,Pi)|0,We=We+Math.imul(Jn,Ui)|0,Vt=Vt+Math.imul(Jn,Pi)|0,Ne=Ne+Math.imul(En,Qi)|0,We=We+Math.imul(En,Di)|0,We=We+Math.imul(In,Qi)|0,Vt=Vt+Math.imul(In,Di)|0;var Yi=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(Yi>>>26)|0,Yi&=67108863,Ne=Math.imul(Ln,mi),We=Math.imul(Ln,Wn),We=We+Math.imul($n,mi)|0,Vt=Math.imul($n,Wn),Ne=Ne+Math.imul(Vn,Mi)|0,We=We+Math.imul(Vn,Si)|0,We=We+Math.imul(qn,Mi)|0,Vt=Vt+Math.imul(qn,Si)|0,Ne=Ne+Math.imul(di,Fi)|0,We=We+Math.imul(di,ki)|0,We=We+Math.imul(li,Fi)|0,Vt=Vt+Math.imul(li,ki)|0,Ne=Ne+Math.imul(Ei,Oi)|0,We=We+Math.imul(Ei,pi)|0,We=We+Math.imul(yi,Oi)|0,Vt=Vt+Math.imul(yi,pi)|0,Ne=Ne+Math.imul(vi,xi)|0,We=We+Math.imul(vi,wi)|0,We=We+Math.imul(Ai,xi)|0,Vt=Vt+Math.imul(Ai,wi)|0,Ne=Ne+Math.imul(ri,Ti)|0,We=We+Math.imul(ri,Ri)|0,We=We+Math.imul(hi,Ti)|0,Vt=Vt+Math.imul(hi,Ri)|0,Ne=Ne+Math.imul(xn,Ui)|0,We=We+Math.imul(xn,Pi)|0,We=We+Math.imul(Hn,Ui)|0,Vt=Vt+Math.imul(Hn,Pi)|0,Ne=Ne+Math.imul(zn,Qi)|0,We=We+Math.imul(zn,Di)|0,We=We+Math.imul(Jn,Qi)|0,Vt=Vt+Math.imul(Jn,Di)|0;var Zi=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(Zi>>>26)|0,Zi&=67108863,Ne=Math.imul(Ln,Mi),We=Math.imul(Ln,Si),We=We+Math.imul($n,Mi)|0,Vt=Math.imul($n,Si),Ne=Ne+Math.imul(Vn,Fi)|0,We=We+Math.imul(Vn,ki)|0,We=We+Math.imul(qn,Fi)|0,Vt=Vt+Math.imul(qn,ki)|0,Ne=Ne+Math.imul(di,Oi)|0,We=We+Math.imul(di,pi)|0,We=We+Math.imul(li,Oi)|0,Vt=Vt+Math.imul(li,pi)|0,Ne=Ne+Math.imul(Ei,xi)|0,We=We+Math.imul(Ei,wi)|0,We=We+Math.imul(yi,xi)|0,Vt=Vt+Math.imul(yi,wi)|0,Ne=Ne+Math.imul(vi,Ti)|0,We=We+Math.imul(vi,Ri)|0,We=We+Math.imul(Ai,Ti)|0,Vt=Vt+Math.imul(Ai,Ri)|0,Ne=Ne+Math.imul(ri,Ui)|0,We=We+Math.imul(ri,Pi)|0,We=We+Math.imul(hi,Ui)|0,Vt=Vt+Math.imul(hi,Pi)|0,Ne=Ne+Math.imul(xn,Qi)|0,We=We+Math.imul(xn,Di)|0,We=We+Math.imul(Hn,Qi)|0,Vt=Vt+Math.imul(Hn,Di)|0;var Xi=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(Xi>>>26)|0,Xi&=67108863,Ne=Math.imul(Ln,Fi),We=Math.imul(Ln,ki),We=We+Math.imul($n,Fi)|0,Vt=Math.imul($n,ki),Ne=Ne+Math.imul(Vn,Oi)|0,We=We+Math.imul(Vn,pi)|0,We=We+Math.imul(qn,Oi)|0,Vt=Vt+Math.imul(qn,pi)|0,Ne=Ne+Math.imul(di,xi)|0,We=We+Math.imul(di,wi)|0,We=We+Math.imul(li,xi)|0,Vt=Vt+Math.imul(li,wi)|0,Ne=Ne+Math.imul(Ei,Ti)|0,We=We+Math.imul(Ei,Ri)|0,We=We+Math.imul(yi,Ti)|0,Vt=Vt+Math.imul(yi,Ri)|0,Ne=Ne+Math.imul(vi,Ui)|0,We=We+Math.imul(vi,Pi)|0,We=We+Math.imul(Ai,Ui)|0,Vt=Vt+Math.imul(Ai,Pi)|0,Ne=Ne+Math.imul(ri,Qi)|0,We=We+Math.imul(ri,Di)|0,We=We+Math.imul(hi,Qi)|0,Vt=Vt+Math.imul(hi,Di)|0;var ji=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(ji>>>26)|0,ji&=67108863,Ne=Math.imul(Ln,Oi),We=Math.imul(Ln,pi),We=We+Math.imul($n,Oi)|0,Vt=Math.imul($n,pi),Ne=Ne+Math.imul(Vn,xi)|0,We=We+Math.imul(Vn,wi)|0,We=We+Math.imul(qn,xi)|0,Vt=Vt+Math.imul(qn,wi)|0,Ne=Ne+Math.imul(di,Ti)|0,We=We+Math.imul(di,Ri)|0,We=We+Math.imul(li,Ti)|0,Vt=Vt+Math.imul(li,Ri)|0,Ne=Ne+Math.imul(Ei,Ui)|0,We=We+Math.imul(Ei,Pi)|0,We=We+Math.imul(yi,Ui)|0,Vt=Vt+Math.imul(yi,Pi)|0,Ne=Ne+Math.imul(vi,Qi)|0,We=We+Math.imul(vi,Di)|0,We=We+Math.imul(Ai,Qi)|0,Vt=Vt+Math.imul(Ai,Di)|0;var eo=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(eo>>>26)|0,eo&=67108863,Ne=Math.imul(Ln,xi),We=Math.imul(Ln,wi),We=We+Math.imul($n,xi)|0,Vt=Math.imul($n,wi),Ne=Ne+Math.imul(Vn,Ti)|0,We=We+Math.imul(Vn,Ri)|0,We=We+Math.imul(qn,Ti)|0,Vt=Vt+Math.imul(qn,Ri)|0,Ne=Ne+Math.imul(di,Ui)|0,We=We+Math.imul(di,Pi)|0,We=We+Math.imul(li,Ui)|0,Vt=Vt+Math.imul(li,Pi)|0,Ne=Ne+Math.imul(Ei,Qi)|0,We=We+Math.imul(Ei,Di)|0,We=We+Math.imul(yi,Qi)|0,Vt=Vt+Math.imul(yi,Di)|0;var to=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(to>>>26)|0,to&=67108863,Ne=Math.imul(Ln,Ti),We=Math.imul(Ln,Ri),We=We+Math.imul($n,Ti)|0,Vt=Math.imul($n,Ri),Ne=Ne+Math.imul(Vn,Ui)|0,We=We+Math.imul(Vn,Pi)|0,We=We+Math.imul(qn,Ui)|0,Vt=Vt+Math.imul(qn,Pi)|0,Ne=Ne+Math.imul(di,Qi)|0,We=We+Math.imul(di,Di)|0,We=We+Math.imul(li,Qi)|0,Vt=Vt+Math.imul(li,Di)|0;var no=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(no>>>26)|0,no&=67108863,Ne=Math.imul(Ln,Ui),We=Math.imul(Ln,Pi),We=We+Math.imul($n,Ui)|0,Vt=Math.imul($n,Pi),Ne=Ne+Math.imul(Vn,Qi)|0,We=We+Math.imul(Vn,Di)|0,We=We+Math.imul(qn,Qi)|0,Vt=Vt+Math.imul(qn,Di)|0;var oo=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(oo>>>26)|0,oo&=67108863,Ne=Math.imul(Ln,Qi),We=Math.imul(Ln,Di),We=We+Math.imul($n,Qi)|0,Vt=Math.imul($n,Di);var ao=(ce+Ne|0)+((We&8191)<<13)|0;return ce=(Vt+(We>>>13)|0)+(ao>>>26)|0,ao&=67108863,Me[0]=qi,Me[1]=Hi,Me[2]=Ji,Me[3]=Li,Me[4]=$i,Me[5]=Vi,Me[6]=Gi,Me[7]=Wi,Me[8]=Ki,Me[9]=zi,Me[10]=Yi,Me[11]=Zi,Me[12]=Xi,Me[13]=ji,Me[14]=eo,Me[15]=to,Me[16]=no,Me[17]=oo,Me[18]=ao,ce!==0&&(Me[19]=ce,Ft.length++),Ft};Math.imul||(Ht=He);function un(xe,ze,Ft){Ft.negative=ze.negative^xe.negative,Ft.length=xe.length+ze.length;for(var yn=0,Zt=0,Me=0;Me<Ft.length-1;Me++){var ce=Zt;Zt=0;for(var Ne=yn&67108863,We=Math.min(Me,ze.length-1),Vt=Math.max(0,Me-xe.length+1);Vt<=We;Vt++){var Sn=Me-Vt,An=xe.words[Sn]|0,Cn=ze.words[Vt]|0,Qn=An*Cn,En=Qn&67108863;ce=ce+(Qn/67108864|0)|0,En=En+Ne|0,Ne=En&67108863,ce=ce+(En>>>26)|0,Zt+=ce>>>26,ce&=67108863}Ft.words[Me]=Ne,yn=ce,ce=Zt}return yn!==0?Ft.words[Me]=yn:Ft.length--,Ft._strip()}function De(xe,ze,Ft){return un(xe,ze,Ft)}ae.prototype.mulTo=function(xe,ze){var Ft,yn=this.length+xe.length;return this.length===10&&xe.length===10?Ft=Ht(this,xe,ze):yn<63?Ft=He(this,xe,ze):yn<1024?Ft=un(this,xe,ze):Ft=De(this,xe,ze),Ft},ae.prototype.mul=function(xe){var ze=new ae(null);return ze.words=new Array(this.length+xe.length),this.mulTo(xe,ze)},ae.prototype.mulf=function(xe){var ze=new ae(null);return ze.words=new Array(this.length+xe.length),De(this,xe,ze)},ae.prototype.imul=function(xe){return this.clone().mulTo(xe,this)},ae.prototype.imuln=function(xe){var ze=xe<0;ze&&(xe=-xe),ie(typeof xe=="number"),ie(xe<67108864);for(var Ft=0,yn=0;yn<this.length;yn++){var Zt=(this.words[yn]|0)*xe,Me=(Zt&67108863)+(Ft&67108863);Ft>>=26,Ft+=Zt/67108864|0,Ft+=Me>>>26,this.words[yn]=Me&67108863}return Ft!==0&&(this.words[yn]=Ft,this.length++),this.length=xe===0?1:this.length,ze?this.ineg():this},ae.prototype.muln=function(xe){return this.clone().imuln(xe)},ae.prototype.sqr=function(){return this.mul(this)},ae.prototype.isqr=function(){return this.imul(this.clone())},ae.prototype.pow=function(xe){var ze=Ze(xe);if(ze.length===0)return new ae(1);for(var Ft=this,yn=0;yn<ze.length&&ze[yn]===0;yn++,Ft=Ft.sqr());if(++yn<ze.length)for(var Zt=Ft.sqr();yn<ze.length;yn++,Zt=Zt.sqr())ze[yn]!==0&&(Ft=Ft.mul(Zt));return Ft},ae.prototype.iushln=function(xe){ie(typeof xe=="number"&&xe>=0);var ze=xe%26,Ft=(xe-ze)/26,yn=67108863>>>26-ze<<26-ze,Zt;if(ze!==0){var Me=0;for(Zt=0;Zt<this.length;Zt++){var ce=this.words[Zt]&yn,Ne=(this.words[Zt]|0)-ce<<ze;this.words[Zt]=Ne|Me,Me=ce>>>26-ze}Me&&(this.words[Zt]=Me,this.length++)}if(Ft!==0){for(Zt=this.length-1;Zt>=0;Zt--)this.words[Zt+Ft]=this.words[Zt];for(Zt=0;Zt<Ft;Zt++)this.words[Zt]=0;this.length+=Ft}return this._strip()},ae.prototype.ishln=function(xe){return ie(this.negative===0),this.iushln(xe)},ae.prototype.iushrn=function(xe,ze,Ft){ie(typeof xe=="number"&&xe>=0);var yn;ze?yn=(ze-ze%26)/26:yn=0;var Zt=xe%26,Me=Math.min((xe-Zt)/26,this.length),ce=67108863^67108863>>>Zt<<Zt,Ne=Ft;if(yn-=Me,yn=Math.max(0,yn),Ne){for(var We=0;We<Me;We++)Ne.words[We]=this.words[We];Ne.length=Me}if(Me!==0)if(this.length>Me)for(this.length-=Me,We=0;We<this.length;We++)this.words[We]=this.words[We+Me];else this.words[0]=0,this.length=1;var Vt=0;for(We=this.length-1;We>=0&&(Vt!==0||We>=yn);We--){var Sn=this.words[We]|0;this.words[We]=Vt<<26-Zt|Sn>>>Zt,Vt=Sn&ce}return Ne&&Vt!==0&&(Ne.words[Ne.length++]=Vt),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},ae.prototype.ishrn=function(xe,ze,Ft){return ie(this.negative===0),this.iushrn(xe,ze,Ft)},ae.prototype.shln=function(xe){return this.clone().ishln(xe)},ae.prototype.ushln=function(xe){return this.clone().iushln(xe)},ae.prototype.shrn=function(xe){return this.clone().ishrn(xe)},ae.prototype.ushrn=function(xe){return this.clone().iushrn(xe)},ae.prototype.testn=function(xe){ie(typeof xe=="number"&&xe>=0);var ze=xe%26,Ft=(xe-ze)/26,yn=1<<ze;if(this.length<=Ft)return!1;var Zt=this.words[Ft];return!!(Zt&yn)},ae.prototype.imaskn=function(xe){ie(typeof xe=="number"&&xe>=0);var ze=xe%26,Ft=(xe-ze)/26;if(ie(this.negative===0,"imaskn works only with positive numbers"),this.length<=Ft)return this;if(ze!==0&&Ft++,this.length=Math.min(Ft,this.length),ze!==0){var yn=67108863^67108863>>>ze<<ze;this.words[this.length-1]&=yn}return this._strip()},ae.prototype.maskn=function(xe){return this.clone().imaskn(xe)},ae.prototype.iaddn=function(xe){return ie(typeof xe=="number"),ie(xe<67108864),xe<0?this.isubn(-xe):this.negative!==0?this.length===1&&(this.words[0]|0)<=xe?(this.words[0]=xe-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(xe),this.negative=1,this):this._iaddn(xe)},ae.prototype._iaddn=function(xe){this.words[0]+=xe;for(var ze=0;ze<this.length&&this.words[ze]>=67108864;ze++)this.words[ze]-=67108864,ze===this.length-1?this.words[ze+1]=1:this.words[ze+1]++;return this.length=Math.max(this.length,ze+1),this},ae.prototype.isubn=function(xe){if(ie(typeof xe=="number"),ie(xe<67108864),xe<0)return this.iaddn(-xe);if(this.negative!==0)return this.negative=0,this.iaddn(xe),this.negative=1,this;if(this.words[0]-=xe,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var ze=0;ze<this.length&&this.words[ze]<0;ze++)this.words[ze]+=67108864,this.words[ze+1]-=1;return this._strip()},ae.prototype.addn=function(xe){return this.clone().iaddn(xe)},ae.prototype.subn=function(xe){return this.clone().isubn(xe)},ae.prototype.iabs=function(){return this.negative=0,this},ae.prototype.abs=function(){return this.clone().iabs()},ae.prototype._ishlnsubmul=function(xe,ze,Ft){var yn=xe.length+Ft,Zt;this._expand(yn);var Me,ce=0;for(Zt=0;Zt<xe.length;Zt++){Me=(this.words[Zt+Ft]|0)+ce;var Ne=(xe.words[Zt]|0)*ze;Me-=Ne&67108863,ce=(Me>>26)-(Ne/67108864|0),this.words[Zt+Ft]=Me&67108863}for(;Zt<this.length-Ft;Zt++)Me=(this.words[Zt+Ft]|0)+ce,ce=Me>>26,this.words[Zt+Ft]=Me&67108863;if(ce===0)return this._strip();for(ie(ce===-1),ce=0,Zt=0;Zt<this.length;Zt++)Me=-(this.words[Zt]|0)+ce,ce=Me>>26,this.words[Zt]=Me&67108863;return this.negative=1,this._strip()},ae.prototype._wordDiv=function(xe,ze){var Ft=this.length-xe.length,yn=this.clone(),Zt=xe,Me=Zt.words[Zt.length-1]|0,ce=this._countBits(Me);Ft=26-ce,Ft!==0&&(Zt=Zt.ushln(Ft),yn.iushln(Ft),Me=Zt.words[Zt.length-1]|0);var Ne=yn.length-Zt.length,We;if(ze!=="mod"){We=new ae(null),We.length=Ne+1,We.words=new Array(We.length);for(var Vt=0;Vt<We.length;Vt++)We.words[Vt]=0}var Sn=yn.clone()._ishlnsubmul(Zt,1,Ne);Sn.negative===0&&(yn=Sn,We&&(We.words[Ne]=1));for(var An=Ne-1;An>=0;An--){var Cn=(yn.words[Zt.length+An]|0)*67108864+(yn.words[Zt.length+An-1]|0);for(Cn=Math.min(Cn/Me|0,67108863),yn._ishlnsubmul(Zt,Cn,An);yn.negative!==0;)Cn--,yn.negative=0,yn._ishlnsubmul(Zt,1,An),yn.isZero()||(yn.negative^=1);We&&(We.words[An]=Cn)}return We&&We._strip(),yn._strip(),ze!=="div"&&Ft!==0&&yn.iushrn(Ft),{div:We||null,mod:yn}},ae.prototype.divmod=function(xe,ze,Ft){if(ie(!xe.isZero()),this.isZero())return{div:new ae(0),mod:new ae(0)};var yn,Zt,Me;return this.negative!==0&&xe.negative===0?(Me=this.neg().divmod(xe,ze),ze!=="mod"&&(yn=Me.div.neg()),ze!=="div"&&(Zt=Me.mod.neg(),Ft&&Zt.negative!==0&&Zt.iadd(xe)),{div:yn,mod:Zt}):this.negative===0&&xe.negative!==0?(Me=this.divmod(xe.neg(),ze),ze!=="mod"&&(yn=Me.div.neg()),{div:yn,mod:Me.mod}):this.negative&xe.negative?(Me=this.neg().divmod(xe.neg(),ze),ze!=="div"&&(Zt=Me.mod.neg(),Ft&&Zt.negative!==0&&Zt.isub(xe)),{div:Me.div,mod:Zt}):xe.length>this.length||this.cmp(xe)<0?{div:new ae(0),mod:this}:xe.length===1?ze==="div"?{div:this.divn(xe.words[0]),mod:null}:ze==="mod"?{div:null,mod:new ae(this.modrn(xe.words[0]))}:{div:this.divn(xe.words[0]),mod:new ae(this.modrn(xe.words[0]))}:this._wordDiv(xe,ze)},ae.prototype.div=function(xe){return this.divmod(xe,"div",!1).div},ae.prototype.mod=function(xe){return this.divmod(xe,"mod",!1).mod},ae.prototype.umod=function(xe){return this.divmod(xe,"mod",!0).mod},ae.prototype.divRound=function(xe){var ze=this.divmod(xe);if(ze.mod.isZero())return ze.div;var Ft=ze.div.negative!==0?ze.mod.isub(xe):ze.mod,yn=xe.ushrn(1),Zt=xe.andln(1),Me=Ft.cmp(yn);return Me<0||Zt===1&&Me===0?ze.div:ze.div.negative!==0?ze.div.isubn(1):ze.div.iaddn(1)},ae.prototype.modrn=function(xe){var ze=xe<0;ze&&(xe=-xe),ie(xe<=67108863);for(var Ft=(1<<26)%xe,yn=0,Zt=this.length-1;Zt>=0;Zt--)yn=(Ft*yn+(this.words[Zt]|0))%xe;return ze?-yn:yn},ae.prototype.modn=function(xe){return this.modrn(xe)},ae.prototype.idivn=function(xe){var ze=xe<0;ze&&(xe=-xe),ie(xe<=67108863);for(var Ft=0,yn=this.length-1;yn>=0;yn--){var Zt=(this.words[yn]|0)+Ft*67108864;this.words[yn]=Zt/xe|0,Ft=Zt%xe}return this._strip(),ze?this.ineg():this},ae.prototype.divn=function(xe){return this.clone().idivn(xe)},ae.prototype.egcd=function(xe){ie(xe.negative===0),ie(!xe.isZero());var ze=this,Ft=xe.clone();ze.negative!==0?ze=ze.umod(xe):ze=ze.clone();for(var yn=new ae(1),Zt=new ae(0),Me=new ae(0),ce=new ae(1),Ne=0;ze.isEven()&&Ft.isEven();)ze.iushrn(1),Ft.iushrn(1),++Ne;for(var We=Ft.clone(),Vt=ze.clone();!ze.isZero();){for(var Sn=0,An=1;!(ze.words[0]&An)&&Sn<26;++Sn,An<<=1);if(Sn>0)for(ze.iushrn(Sn);Sn-- >0;)(yn.isOdd()||Zt.isOdd())&&(yn.iadd(We),Zt.isub(Vt)),yn.iushrn(1),Zt.iushrn(1);for(var Cn=0,Qn=1;!(Ft.words[0]&Qn)&&Cn<26;++Cn,Qn<<=1);if(Cn>0)for(Ft.iushrn(Cn);Cn-- >0;)(Me.isOdd()||ce.isOdd())&&(Me.iadd(We),ce.isub(Vt)),Me.iushrn(1),ce.iushrn(1);ze.cmp(Ft)>=0?(ze.isub(Ft),yn.isub(Me),Zt.isub(ce)):(Ft.isub(ze),Me.isub(yn),ce.isub(Zt))}return{a:Me,b:ce,gcd:Ft.iushln(Ne)}},ae.prototype._invmp=function(xe){ie(xe.negative===0),ie(!xe.isZero());var ze=this,Ft=xe.clone();ze.negative!==0?ze=ze.umod(xe):ze=ze.clone();for(var yn=new ae(1),Zt=new ae(0),Me=Ft.clone();ze.cmpn(1)>0&&Ft.cmpn(1)>0;){for(var ce=0,Ne=1;!(ze.words[0]&Ne)&&ce<26;++ce,Ne<<=1);if(ce>0)for(ze.iushrn(ce);ce-- >0;)yn.isOdd()&&yn.iadd(Me),yn.iushrn(1);for(var We=0,Vt=1;!(Ft.words[0]&Vt)&&We<26;++We,Vt<<=1);if(We>0)for(Ft.iushrn(We);We-- >0;)Zt.isOdd()&&Zt.iadd(Me),Zt.iushrn(1);ze.cmp(Ft)>=0?(ze.isub(Ft),yn.isub(Zt)):(Ft.isub(ze),Zt.isub(yn))}var Sn;return ze.cmpn(1)===0?Sn=yn:Sn=Zt,Sn.cmpn(0)<0&&Sn.iadd(xe),Sn},ae.prototype.gcd=function(xe){if(this.isZero())return xe.abs();if(xe.isZero())return this.abs();var ze=this.clone(),Ft=xe.clone();ze.negative=0,Ft.negative=0;for(var yn=0;ze.isEven()&&Ft.isEven();yn++)ze.iushrn(1),Ft.iushrn(1);do{for(;ze.isEven();)ze.iushrn(1);for(;Ft.isEven();)Ft.iushrn(1);var Zt=ze.cmp(Ft);if(Zt<0){var Me=ze;ze=Ft,Ft=Me}else if(Zt===0||Ft.cmpn(1)===0)break;ze.isub(Ft)}while(!0);return Ft.iushln(yn)},ae.prototype.invm=function(xe){return this.egcd(xe).a.umod(xe)},ae.prototype.isEven=function(){return(this.words[0]&1)===0},ae.prototype.isOdd=function(){return(this.words[0]&1)===1},ae.prototype.andln=function(xe){return this.words[0]&xe},ae.prototype.bincn=function(xe){ie(typeof xe=="number");var ze=xe%26,Ft=(xe-ze)/26,yn=1<<ze;if(this.length<=Ft)return this._expand(Ft+1),this.words[Ft]|=yn,this;for(var Zt=yn,Me=Ft;Zt!==0&&Me<this.length;Me++){var ce=this.words[Me]|0;ce+=Zt,Zt=ce>>>26,ce&=67108863,this.words[Me]=ce}return Zt!==0&&(this.words[Me]=Zt,this.length++),this},ae.prototype.isZero=function(){return this.length===1&&this.words[0]===0},ae.prototype.cmpn=function(xe){var ze=xe<0;if(this.negative!==0&&!ze)return-1;if(this.negative===0&&ze)return 1;this._strip();var Ft;if(this.length>1)Ft=1;else{ze&&(xe=-xe),ie(xe<=67108863,"Number is too big");var yn=this.words[0]|0;Ft=yn===xe?0:yn<xe?-1:1}return this.negative!==0?-Ft|0:Ft},ae.prototype.cmp=function(xe){if(this.negative!==0&&xe.negative===0)return-1;if(this.negative===0&&xe.negative!==0)return 1;var ze=this.ucmp(xe);return this.negative!==0?-ze|0:ze},ae.prototype.ucmp=function(xe){if(this.length>xe.length)return 1;if(this.length<xe.length)return-1;for(var ze=0,Ft=this.length-1;Ft>=0;Ft--){var yn=this.words[Ft]|0,Zt=xe.words[Ft]|0;if(yn!==Zt){yn<Zt?ze=-1:yn>Zt&&(ze=1);break}}return ze},ae.prototype.gtn=function(xe){return this.cmpn(xe)===1},ae.prototype.gt=function(xe){return this.cmp(xe)===1},ae.prototype.gten=function(xe){return this.cmpn(xe)>=0},ae.prototype.gte=function(xe){return this.cmp(xe)>=0},ae.prototype.ltn=function(xe){return this.cmpn(xe)===-1},ae.prototype.lt=function(xe){return this.cmp(xe)===-1},ae.prototype.lten=function(xe){return this.cmpn(xe)<=0},ae.prototype.lte=function(xe){return this.cmp(xe)<=0},ae.prototype.eqn=function(xe){return this.cmpn(xe)===0},ae.prototype.eq=function(xe){return this.cmp(xe)===0},ae.red=function(xe){return new le(xe)},ae.prototype.toRed=function(xe){return ie(!this.red,"Already a number in reduction context"),ie(this.negative===0,"red works only with positives"),xe.convertTo(this)._forceRed(xe)},ae.prototype.fromRed=function(){return ie(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},ae.prototype._forceRed=function(xe){return this.red=xe,this},ae.prototype.forceRed=function(xe){return ie(!this.red,"Already a number in reduction context"),this._forceRed(xe)},ae.prototype.redAdd=function(xe){return ie(this.red,"redAdd works only with red numbers"),this.red.add(this,xe)},ae.prototype.redIAdd=function(xe){return ie(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,xe)},ae.prototype.redSub=function(xe){return ie(this.red,"redSub works only with red numbers"),this.red.sub(this,xe)},ae.prototype.redISub=function(xe){return ie(this.red,"redISub works only with red numbers"),this.red.isub(this,xe)},ae.prototype.redShl=function(xe){return ie(this.red,"redShl works only with red numbers"),this.red.shl(this,xe)},ae.prototype.redMul=function(xe){return ie(this.red,"redMul works only with red numbers"),this.red._verify2(this,xe),this.red.mul(this,xe)},ae.prototype.redIMul=function(xe){return ie(this.red,"redMul works only with red numbers"),this.red._verify2(this,xe),this.red.imul(this,xe)},ae.prototype.redSqr=function(){return ie(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},ae.prototype.redISqr=function(){return ie(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},ae.prototype.redSqrt=function(){return ie(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},ae.prototype.redInvm=function(){return ie(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},ae.prototype.redNeg=function(){return ie(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},ae.prototype.redPow=function(xe){return ie(this.red&&!xe.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,xe)};var $e={k256:null,p224:null,p192:null,p25519:null};function me(xe,ze){this.name=xe,this.p=new ae(ze,16),this.n=this.p.bitLength(),this.k=new ae(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}me.prototype._tmp=function(){var xe=new ae(null);return xe.words=new Array(Math.ceil(this.n/13)),xe},me.prototype.ireduce=function(xe){var ze=xe,Ft;do this.split(ze,this.tmp),ze=this.imulK(ze),ze=ze.iadd(this.tmp),Ft=ze.bitLength();while(Ft>this.n);var yn=Ft<this.n?-1:ze.ucmp(this.p);return yn===0?(ze.words[0]=0,ze.length=1):yn>0?ze.isub(this.p):ze.strip!==void 0?ze.strip():ze._strip(),ze},me.prototype.split=function(xe,ze){xe.iushrn(this.n,0,ze)},me.prototype.imulK=function(xe){return xe.imul(this.k)};function Gt(){me.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}se(Gt,me),Gt.prototype.split=function(xe,ze){for(var Ft=4194303,yn=Math.min(xe.length,9),Zt=0;Zt<yn;Zt++)ze.words[Zt]=xe.words[Zt];if(ze.length=yn,xe.length<=9){xe.words[0]=0,xe.length=1;return}var Me=xe.words[9];for(ze.words[ze.length++]=Me&Ft,Zt=10;Zt<xe.length;Zt++){var ce=xe.words[Zt]|0;xe.words[Zt-10]=(ce&Ft)<<4|Me>>>22,Me=ce}Me>>>=22,xe.words[Zt-10]=Me,Me===0&&xe.length>10?xe.length-=10:xe.length-=9},Gt.prototype.imulK=function(xe){xe.words[xe.length]=0,xe.words[xe.length+1]=0,xe.length+=2;for(var ze=0,Ft=0;Ft<xe.length;Ft++){var yn=xe.words[Ft]|0;ze+=yn*977,xe.words[Ft]=ze&67108863,ze=yn*64+(ze/67108864|0)}return xe.words[xe.length-1]===0&&(xe.length--,xe.words[xe.length-1]===0&&xe.length--),xe};function mn(){me.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}se(mn,me);function dn(){me.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}se(dn,me);function jt(){me.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}se(jt,me),jt.prototype.imulK=function(xe){for(var ze=0,Ft=0;Ft<xe.length;Ft++){var yn=(xe.words[Ft]|0)*19+ze,Zt=yn&67108863;yn>>>=26,xe.words[Ft]=Zt,ze=yn}return ze!==0&&(xe.words[xe.length++]=ze),xe},ae._prime=function(xe){if($e[xe])return $e[xe];var ze;if(xe==="k256")ze=new Gt;else if(xe==="p224")ze=new mn;else if(xe==="p192")ze=new dn;else if(xe==="p25519")ze=new jt;else throw new Error("Unknown prime "+xe);return $e[xe]=ze,ze};function le(xe){if(typeof xe=="string"){var ze=ae._prime(xe);this.m=ze.p,this.prime=ze}else ie(xe.gtn(1),"modulus must be greater than 1"),this.m=xe,this.prime=null}le.prototype._verify1=function(xe){ie(xe.negative===0,"red works only with positives"),ie(xe.red,"red works only with red numbers")},le.prototype._verify2=function(xe,ze){ie((xe.negative|ze.negative)===0,"red works only with positives"),ie(xe.red&&xe.red===ze.red,"red works only with red numbers")},le.prototype.imod=function(xe){return this.prime?this.prime.ireduce(xe)._forceRed(this):(be(xe,xe.umod(this.m)._forceRed(this)),xe)},le.prototype.neg=function(xe){return xe.isZero()?xe.clone():this.m.sub(xe)._forceRed(this)},le.prototype.add=function(xe,ze){this._verify2(xe,ze);var Ft=xe.add(ze);return Ft.cmp(this.m)>=0&&Ft.isub(this.m),Ft._forceRed(this)},le.prototype.iadd=function(xe,ze){this._verify2(xe,ze);var Ft=xe.iadd(ze);return Ft.cmp(this.m)>=0&&Ft.isub(this.m),Ft},le.prototype.sub=function(xe,ze){this._verify2(xe,ze);var Ft=xe.sub(ze);return Ft.cmpn(0)<0&&Ft.iadd(this.m),Ft._forceRed(this)},le.prototype.isub=function(xe,ze){this._verify2(xe,ze);var Ft=xe.isub(ze);return Ft.cmpn(0)<0&&Ft.iadd(this.m),Ft},le.prototype.shl=function(xe,ze){return this._verify1(xe),this.imod(xe.ushln(ze))},le.prototype.imul=function(xe,ze){return this._verify2(xe,ze),this.imod(xe.imul(ze))},le.prototype.mul=function(xe,ze){return this._verify2(xe,ze),this.imod(xe.mul(ze))},le.prototype.isqr=function(xe){return this.imul(xe,xe.clone())},le.prototype.sqr=function(xe){return this.mul(xe,xe)},le.prototype.sqrt=function(xe){if(xe.isZero())return xe.clone();var ze=this.m.andln(3);if(ie(ze%2===1),ze===3){var Ft=this.m.add(new ae(1)).iushrn(2);return this.pow(xe,Ft)}for(var yn=this.m.subn(1),Zt=0;!yn.isZero()&&yn.andln(1)===0;)Zt++,yn.iushrn(1);ie(!yn.isZero());var Me=new ae(1).toRed(this),ce=Me.redNeg(),Ne=this.m.subn(1).iushrn(1),We=this.m.bitLength();for(We=new ae(2*We*We).toRed(this);this.pow(We,Ne).cmp(ce)!==0;)We.redIAdd(ce);for(var Vt=this.pow(We,yn),Sn=this.pow(xe,yn.addn(1).iushrn(1)),An=this.pow(xe,yn),Cn=Zt;An.cmp(Me)!==0;){for(var Qn=An,En=0;Qn.cmp(Me)!==0;En++)Qn=Qn.redSqr();ie(En<Cn);var In=this.pow(Vt,new ae(1).iushln(Cn-En-1));Sn=Sn.redMul(In),Vt=In.redSqr(),An=An.redMul(Vt),Cn=En}return Sn},le.prototype.invm=function(xe){var ze=xe._invmp(this.m);return ze.negative!==0?(ze.negative=0,this.imod(ze).redNeg()):this.imod(ze)},le.prototype.pow=function(xe,ze){if(ze.isZero())return new ae(1).toRed(this);if(ze.cmpn(1)===0)return xe.clone();var Ft=4,yn=new Array(1<<Ft);yn[0]=new ae(1).toRed(this),yn[1]=xe;for(var Zt=2;Zt<yn.length;Zt++)yn[Zt]=this.mul(yn[Zt-1],xe);var Me=yn[0],ce=0,Ne=0,We=ze.bitLength()%26;for(We===0&&(We=26),Zt=ze.length-1;Zt>=0;Zt--){for(var Vt=ze.words[Zt],Sn=We-1;Sn>=0;Sn--){var An=Vt>>Sn&1;if(Me!==yn[0]&&(Me=this.sqr(Me)),An===0&&ce===0){Ne=0;continue}ce<<=1,ce|=An,Ne++,!(Ne!==Ft&&(Zt!==0||Sn!==0))&&(Me=this.mul(Me,yn[ce]),Ne=0,ce=0)}We=26}return Me},le.prototype.convertTo=function(xe){var ze=xe.umod(this.m);return ze===xe?ze.clone():ze},le.prototype.convertFrom=function(xe){var ze=xe.clone();return ze.red=null,ze},ae.mont=function(xe){return new Pe(xe)};function Pe(xe){le.call(this,xe),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new ae(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}se(Pe,le),Pe.prototype.convertTo=function(xe){return this.imod(xe.ushln(this.shift))},Pe.prototype.convertFrom=function(xe){var ze=this.imod(xe.mul(this.rinv));return ze.red=null,ze},Pe.prototype.imul=function(xe,ze){if(xe.isZero()||ze.isZero())return xe.words[0]=0,xe.length=1,xe;var Ft=xe.imul(ze),yn=Ft.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Zt=Ft.isub(yn).iushrn(this.shift),Me=Zt;return Zt.cmp(this.m)>=0?Me=Zt.isub(this.m):Zt.cmpn(0)<0&&(Me=Zt.iadd(this.m)),Me._forceRed(this)},Pe.prototype.mul=function(xe,ze){if(xe.isZero()||ze.isZero())return new ae(0)._forceRed(this);var Ft=xe.mul(ze),yn=Ft.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Zt=Ft.isub(yn).iushrn(this.shift),Me=Zt;return Zt.cmp(this.m)>=0?Me=Zt.isub(this.m):Zt.cmpn(0)<0&&(Me=Zt.iadd(this.m)),Me._forceRed(this)},Pe.prototype.invm=function(xe){var ze=this.imod(xe._invmp(this.m).mul(this.r2));return ze._forceRed(this)}})(t,commonjsGlobal)})(bn$8);var bnExports$3=bn$8.exports;const BN$8=getDefaultExportFromCjs$2(bnExports$3),version$u="logger/5.8.0";let _permanentCensorErrors$1=!1,_censorErrors$1=!1;const LogLevels$1={debug:1,default:2,info:2,warning:3,error:4,off:5};let _logLevel$1=LogLevels$1.default,_globalLogger$1=null;function _checkNormalize$1(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(n=>{try{if("test".normalize(n)!=="test")throw new Error("bad normalize")}catch{t.push(n)}}),t.length)throw new Error("missing "+t.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(t){return t.message}return null}const _normalizeError$1=_checkNormalize$1();var LogLevel$1;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(LogLevel$1||(LogLevel$1={}));var ErrorCode$1;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(ErrorCode$1||(ErrorCode$1={}));const HEX$1="0123456789abcdef";let Logger$1=class ro{constructor(n){Object.defineProperty(this,"version",{enumerable:!0,value:n,writable:!1})}_log(n,c){const ie=n.toLowerCase();LogLevels$1[ie]==null&&this.throwArgumentError("invalid log level name","logLevel",n),!(_logLevel$1>LogLevels$1[ie])&&console.log.apply(console,c)}debug(...n){this._log(ro.levels.DEBUG,n)}info(...n){this._log(ro.levels.INFO,n)}warn(...n){this._log(ro.levels.WARNING,n)}makeError(n,c,ie){if(_censorErrors$1)return this.makeError("censored error",c,{});c||(c=ro.errors.UNKNOWN_ERROR),ie||(ie={});const se=[];Object.keys(ie).forEach(pe=>{const ge=ie[pe];try{if(ge instanceof Uint8Array){let be="";for(let _e=0;_e<ge.length;_e++)be+=HEX$1[ge[_e]>>4],be+=HEX$1[ge[_e]&15];se.push(pe+"=Uint8Array(0x"+be+")")}else se.push(pe+"="+JSON.stringify(ge))}catch{se.push(pe+"="+JSON.stringify(ie[pe].toString()))}}),se.push(`code=${c}`),se.push(`version=${this.version}`);const ae=n;let de="";switch(c){case ErrorCode$1.NUMERIC_FAULT:{de="NUMERIC_FAULT";const pe=n;switch(pe){case"overflow":case"underflow":case"division-by-zero":de+="-"+pe;break;case"negative-power":case"negative-width":de+="-unsupported";break;case"unbound-bitwise-result":de+="-unbound-result";break}break}case ErrorCode$1.CALL_EXCEPTION:case ErrorCode$1.INSUFFICIENT_FUNDS:case ErrorCode$1.MISSING_NEW:case ErrorCode$1.NONCE_EXPIRED:case ErrorCode$1.REPLACEMENT_UNDERPRICED:case ErrorCode$1.TRANSACTION_REPLACED:case ErrorCode$1.UNPREDICTABLE_GAS_LIMIT:de=c;break}de&&(n+=" [ See: https://links.ethers.org/v5-errors-"+de+" ]"),se.length&&(n+=" ("+se.join(", ")+")");const ue=new Error(n);return ue.reason=ae,ue.code=c,Object.keys(ie).forEach(function(pe){ue[pe]=ie[pe]}),ue}throwError(n,c,ie){throw this.makeError(n,c,ie)}throwArgumentError(n,c,ie){return this.throwError(n,ro.errors.INVALID_ARGUMENT,{argument:c,value:ie})}assert(n,c,ie,se){n||this.throwError(c,ie,se)}assertArgument(n,c,ie,se){n||this.throwArgumentError(c,ie,se)}checkNormalize(n){_normalizeError$1&&this.throwError("platform missing String.prototype.normalize",ro.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:_normalizeError$1})}checkSafeUint53(n,c){typeof n=="number"&&(c==null&&(c="value not safe"),(n<0||n>=9007199254740991)&&this.throwError(c,ro.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:n}),n%1&&this.throwError(c,ro.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:n}))}checkArgumentCount(n,c,ie){ie?ie=": "+ie:ie="",n<c&&this.throwError("missing argument"+ie,ro.errors.MISSING_ARGUMENT,{count:n,expectedCount:c}),n>c&&this.throwError("too many arguments"+ie,ro.errors.UNEXPECTED_ARGUMENT,{count:n,expectedCount:c})}checkNew(n,c){(n===Object||n==null)&&this.throwError("missing new",ro.errors.MISSING_NEW,{name:c.name})}checkAbstract(n,c){n===c?this.throwError("cannot instantiate abstract class "+JSON.stringify(c.name)+" directly; use a sub-class",ro.errors.UNSUPPORTED_OPERATION,{name:n.name,operation:"new"}):(n===Object||n==null)&&this.throwError("missing new",ro.errors.MISSING_NEW,{name:c.name})}static globalLogger(){return _globalLogger$1||(_globalLogger$1=new ro(version$u)),_globalLogger$1}static setCensorship(n,c){if(!n&&c&&this.globalLogger().throwError("cannot permanently disable censorship",ro.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),_permanentCensorErrors$1){if(!n)return;this.globalLogger().throwError("error censorship permanent",ro.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}_censorErrors$1=!!n,_permanentCensorErrors$1=!!c}static setLogLevel(n){const c=LogLevels$1[n.toLowerCase()];if(c==null){ro.globalLogger().warn("invalid log level - "+n);return}_logLevel$1=c}static from(n){return new ro(n)}};Logger$1.errors=ErrorCode$1;Logger$1.levels=LogLevel$1;const lib_esm$k=Object.freeze(Object.defineProperty({__proto__:null,get ErrorCode(){return ErrorCode$1},get LogLevel(){return LogLevel$1},Logger:Logger$1},Symbol.toStringTag,{value:"Module"})),version$t="bytes/5.8.0",logger$x=new Logger$1(version$t);function isHexable$1(t){return!!t.toHexString}function addSlice(t){return t.slice||(t.slice=function(){const n=Array.prototype.slice.call(arguments);return addSlice(new Uint8Array(Array.prototype.slice.apply(t,n)))}),t}function isBytesLike(t){return isHexString$1(t)&&!(t.length%2)||isBytes$1(t)}function isInteger$2(t){return typeof t=="number"&&t==t&&t%1===0}function isBytes$1(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!isInteger$2(t.length)||t.length<0)return!1;for(let n=0;n<t.length;n++){const c=t[n];if(!isInteger$2(c)||c<0||c>=256)return!1}return!0}function arrayify(t,n){if(n||(n={}),typeof t=="number"){logger$x.checkSafeUint53(t,"invalid arrayify value");const c=[];for(;t;)c.unshift(t&255),t=parseInt(String(t/256));return c.length===0&&c.push(0),addSlice(new Uint8Array(c))}if(n.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),isHexable$1(t)&&(t=t.toHexString()),isHexString$1(t)){let c=t.substring(2);c.length%2&&(n.hexPad==="left"?c="0"+c:n.hexPad==="right"?c+="0":logger$x.throwArgumentError("hex data is odd-length","value",t));const ie=[];for(let se=0;se<c.length;se+=2)ie.push(parseInt(c.substring(se,se+2),16));return addSlice(new Uint8Array(ie))}return isBytes$1(t)?addSlice(new Uint8Array(t)):logger$x.throwArgumentError("invalid arrayify value","value",t)}function concat$1(t){const n=t.map(se=>arrayify(se)),c=n.reduce((se,ae)=>se+ae.length,0),ie=new Uint8Array(c);return n.reduce((se,ae)=>(ie.set(ae,se),se+ae.length),0),addSlice(ie)}function stripZeros(t){let n=arrayify(t);if(n.length===0)return n;let c=0;for(;c<n.length&&n[c]===0;)c++;return c&&(n=n.slice(c)),n}function zeroPad(t,n){t=arrayify(t),t.length>n&&logger$x.throwArgumentError("value out of range","value",arguments[0]);const c=new Uint8Array(n);return c.set(t,n-t.length),addSlice(c)}function isHexString$1(t,n){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||n&&t.length!==2+2*n)}const HexCharacters$1="0123456789abcdef";function hexlify$1(t,n){if(n||(n={}),typeof t=="number"){logger$x.checkSafeUint53(t,"invalid hexlify value");let c="";for(;t;)c=HexCharacters$1[t&15]+c,t=Math.floor(t/16);return c.length?(c.length%2&&(c="0"+c),"0x"+c):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(n.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),isHexable$1(t))return t.toHexString();if(isHexString$1(t))return t.length%2&&(n.hexPad==="left"?t="0x0"+t.substring(2):n.hexPad==="right"?t+="0":logger$x.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(isBytes$1(t)){let c="0x";for(let ie=0;ie<t.length;ie++){let se=t[ie];c+=HexCharacters$1[(se&240)>>4]+HexCharacters$1[se&15]}return c}return logger$x.throwArgumentError("invalid hexlify value","value",t)}function hexDataLength(t){if(typeof t!="string")t=hexlify$1(t);else if(!isHexString$1(t)||t.length%2)return null;return(t.length-2)/2}function hexDataSlice(t,n,c){return typeof t!="string"?t=hexlify$1(t):(!isHexString$1(t)||t.length%2)&&logger$x.throwArgumentError("invalid hexData","value",t),n=2+2*n,c!=null?"0x"+t.substring(n,2+2*c):"0x"+t.substring(n)}function hexConcat(t){let n="0x";return t.forEach(c=>{n+=hexlify$1(c).substring(2)}),n}function hexValue(t){const n=hexStripZeros(hexlify$1(t,{hexPad:"left"}));return n==="0x"?"0x0":n}function hexStripZeros(t){typeof t!="string"&&(t=hexlify$1(t)),isHexString$1(t)||logger$x.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let n=0;for(;n<t.length&&t[n]==="0";)n++;return"0x"+t.substring(n)}function hexZeroPad(t,n){for(typeof t!="string"?t=hexlify$1(t):isHexString$1(t)||logger$x.throwArgumentError("invalid hex string","value",t),t.length>2*n+2&&logger$x.throwArgumentError("value out of range","value",arguments[1]);t.length<2*n+2;)t="0x0"+t.substring(2);return t}function splitSignature(t){const n={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(isBytesLike(t)){let c=arrayify(t);c.length===64?(n.v=27+(c[32]>>7),c[32]&=127,n.r=hexlify$1(c.slice(0,32)),n.s=hexlify$1(c.slice(32,64))):c.length===65?(n.r=hexlify$1(c.slice(0,32)),n.s=hexlify$1(c.slice(32,64)),n.v=c[64]):logger$x.throwArgumentError("invalid signature string","signature",t),n.v<27&&(n.v===0||n.v===1?n.v+=27:logger$x.throwArgumentError("signature invalid v byte","signature",t)),n.recoveryParam=1-n.v%2,n.recoveryParam&&(c[32]|=128),n._vs=hexlify$1(c.slice(32,64))}else{if(n.r=t.r,n.s=t.s,n.v=t.v,n.recoveryParam=t.recoveryParam,n._vs=t._vs,n._vs!=null){const se=zeroPad(arrayify(n._vs),32);n._vs=hexlify$1(se);const ae=se[0]>=128?1:0;n.recoveryParam==null?n.recoveryParam=ae:n.recoveryParam!==ae&&logger$x.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),se[0]&=127;const de=hexlify$1(se);n.s==null?n.s=de:n.s!==de&&logger$x.throwArgumentError("signature v mismatch _vs","signature",t)}if(n.recoveryParam==null)n.v==null?logger$x.throwArgumentError("signature missing v and recoveryParam","signature",t):n.v===0||n.v===1?n.recoveryParam=n.v:n.recoveryParam=1-n.v%2;else if(n.v==null)n.v=27+n.recoveryParam;else{const se=n.v===0||n.v===1?n.v:1-n.v%2;n.recoveryParam!==se&&logger$x.throwArgumentError("signature recoveryParam mismatch v","signature",t)}n.r==null||!isHexString$1(n.r)?logger$x.throwArgumentError("signature missing or invalid r","signature",t):n.r=hexZeroPad(n.r,32),n.s==null||!isHexString$1(n.s)?logger$x.throwArgumentError("signature missing or invalid s","signature",t):n.s=hexZeroPad(n.s,32);const c=arrayify(n.s);c[0]>=128&&logger$x.throwArgumentError("signature s out of range","signature",t),n.recoveryParam&&(c[0]|=128);const ie=hexlify$1(c);n._vs&&(isHexString$1(n._vs)||logger$x.throwArgumentError("signature invalid _vs","signature",t),n._vs=hexZeroPad(n._vs,32)),n._vs==null?n._vs=ie:n._vs!==ie&&logger$x.throwArgumentError("signature _vs mismatch v and s","signature",t)}return n.yParityAndS=n._vs,n.compact=n.r+n.yParityAndS.substring(2),n}function joinSignature(t){return t=splitSignature(t),hexlify$1(concat$1([t.r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}const lib_esm$j=Object.freeze(Object.defineProperty({__proto__:null,arrayify,concat:concat$1,hexConcat,hexDataLength,hexDataSlice,hexStripZeros,hexValue,hexZeroPad,hexlify:hexlify$1,isBytes:isBytes$1,isBytesLike,isHexString:isHexString$1,joinSignature,splitSignature,stripZeros,zeroPad},Symbol.toStringTag,{value:"Module"})),version$s="bignumber/5.8.0";var BN$7=BN$8.BN;const logger$w=new Logger$1(version$s),_constructorGuard$4={},MAX_SAFE$1=9007199254740991;function isBigNumberish(t){return t!=null&&(BigNumber$1.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||isHexString$1(t)||typeof t=="bigint"||isBytes$1(t))}let _warnedToStringRadix$1=!1,BigNumber$1=class io{constructor(n,c){n!==_constructorGuard$4&&logger$w.throwError("cannot call constructor directly; use BigNumber.from",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=c,this._isBigNumber=!0,Object.freeze(this)}fromTwos(n){return toBigNumber$1(toBN$1(this).fromTwos(n))}toTwos(n){return toBigNumber$1(toBN$1(this).toTwos(n))}abs(){return this._hex[0]==="-"?io.from(this._hex.substring(1)):this}add(n){return toBigNumber$1(toBN$1(this).add(toBN$1(n)))}sub(n){return toBigNumber$1(toBN$1(this).sub(toBN$1(n)))}div(n){return io.from(n).isZero()&&throwFault$1("division-by-zero","div"),toBigNumber$1(toBN$1(this).div(toBN$1(n)))}mul(n){return toBigNumber$1(toBN$1(this).mul(toBN$1(n)))}mod(n){const c=toBN$1(n);return c.isNeg()&&throwFault$1("division-by-zero","mod"),toBigNumber$1(toBN$1(this).umod(c))}pow(n){const c=toBN$1(n);return c.isNeg()&&throwFault$1("negative-power","pow"),toBigNumber$1(toBN$1(this).pow(c))}and(n){const c=toBN$1(n);return(this.isNegative()||c.isNeg())&&throwFault$1("unbound-bitwise-result","and"),toBigNumber$1(toBN$1(this).and(c))}or(n){const c=toBN$1(n);return(this.isNegative()||c.isNeg())&&throwFault$1("unbound-bitwise-result","or"),toBigNumber$1(toBN$1(this).or(c))}xor(n){const c=toBN$1(n);return(this.isNegative()||c.isNeg())&&throwFault$1("unbound-bitwise-result","xor"),toBigNumber$1(toBN$1(this).xor(c))}mask(n){return(this.isNegative()||n<0)&&throwFault$1("negative-width","mask"),toBigNumber$1(toBN$1(this).maskn(n))}shl(n){return(this.isNegative()||n<0)&&throwFault$1("negative-width","shl"),toBigNumber$1(toBN$1(this).shln(n))}shr(n){return(this.isNegative()||n<0)&&throwFault$1("negative-width","shr"),toBigNumber$1(toBN$1(this).shrn(n))}eq(n){return toBN$1(this).eq(toBN$1(n))}lt(n){return toBN$1(this).lt(toBN$1(n))}lte(n){return toBN$1(this).lte(toBN$1(n))}gt(n){return toBN$1(this).gt(toBN$1(n))}gte(n){return toBN$1(this).gte(toBN$1(n))}isNegative(){return this._hex[0]==="-"}isZero(){return toBN$1(this).isZero()}toNumber(){try{return toBN$1(this).toNumber()}catch{throwFault$1("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return logger$w.throwError("this platform does not support BigInt",Logger$1.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?_warnedToStringRadix$1||(_warnedToStringRadix$1=!0,logger$w.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?logger$w.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Logger$1.errors.UNEXPECTED_ARGUMENT,{}):logger$w.throwError("BigNumber.toString does not accept parameters",Logger$1.errors.UNEXPECTED_ARGUMENT,{})),toBN$1(this).toString(10)}toHexString(){return this._hex}toJSON(n){return{type:"BigNumber",hex:this.toHexString()}}static from(n){if(n instanceof io)return n;if(typeof n=="string")return n.match(/^-?0x[0-9a-f]+$/i)?new io(_constructorGuard$4,toHex$2(n)):n.match(/^-?[0-9]+$/)?new io(_constructorGuard$4,toHex$2(new BN$7(n))):logger$w.throwArgumentError("invalid BigNumber string","value",n);if(typeof n=="number")return n%1&&throwFault$1("underflow","BigNumber.from",n),(n>=MAX_SAFE$1||n<=-MAX_SAFE$1)&&throwFault$1("overflow","BigNumber.from",n),io.from(String(n));const c=n;if(typeof c=="bigint")return io.from(c.toString());if(isBytes$1(c))return io.from(hexlify$1(c));if(c)if(c.toHexString){const ie=c.toHexString();if(typeof ie=="string")return io.from(ie)}else{let ie=c._hex;if(ie==null&&c.type==="BigNumber"&&(ie=c.hex),typeof ie=="string"&&(isHexString$1(ie)||ie[0]==="-"&&isHexString$1(ie.substring(1))))return io.from(ie)}return logger$w.throwArgumentError("invalid BigNumber value","value",n)}static isBigNumber(n){return!!(n&&n._isBigNumber)}};function toHex$2(t){if(typeof t!="string")return toHex$2(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&logger$w.throwArgumentError("invalid hex","value",t),t=toHex$2(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function toBigNumber$1(t){return BigNumber$1.from(toHex$2(t))}function toBN$1(t){const n=BigNumber$1.from(t).toHexString();return n[0]==="-"?new BN$7("-"+n.substring(3),16):new BN$7(n.substring(2),16)}function throwFault$1(t,n,c){const ie={fault:t,operation:n};return c!=null&&(ie.value=c),logger$w.throwError(t,Logger$1.errors.NUMERIC_FAULT,ie)}function _base36To16(t){return new BN$7(t,36).toString(16)}function _base16To36(t){return new BN$7(t,16).toString(36)}const logger$v=new Logger$1(version$s),_constructorGuard$3={},Zero$2=BigNumber$1.from(0),NegativeOne$2=BigNumber$1.from(-1);function throwFault$2(t,n,c,ie){const se={fault:n,operation:c};return ie!==void 0&&(se.value=ie),logger$v.throwError(t,Logger$1.errors.NUMERIC_FAULT,se)}let zeros="0";for(;zeros.length<256;)zeros+=zeros;function getMultiplier(t){if(typeof t!="number")try{t=BigNumber$1.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+zeros.substring(0,t):logger$v.throwArgumentError("invalid decimal size","decimals",t)}function formatFixed(t,n){n==null&&(n=0);const c=getMultiplier(n);t=BigNumber$1.from(t);const ie=t.lt(Zero$2);ie&&(t=t.mul(NegativeOne$2));let se=t.mod(c).toString();for(;se.length<c.length-1;)se="0"+se;se=se.match(/^([0-9]*[1-9]|0)(0*)/)[1];const ae=t.div(c).toString();return c.length===1?t=ae:t=ae+"."+se,ie&&(t="-"+t),t}function parseFixed(t,n){n==null&&(n=0);const c=getMultiplier(n);(typeof t!="string"||!t.match(/^-?[0-9.]+$/))&&logger$v.throwArgumentError("invalid decimal value","value",t);const ie=t.substring(0,1)==="-";ie&&(t=t.substring(1)),t==="."&&logger$v.throwArgumentError("missing value","value",t);const se=t.split(".");se.length>2&&logger$v.throwArgumentError("too many decimal points","value",t);let ae=se[0],de=se[1];for(ae||(ae="0"),de||(de="0");de[de.length-1]==="0";)de=de.substring(0,de.length-1);for(de.length>c.length-1&&throwFault$2("fractional component exceeds decimals","underflow","parseFixed"),de===""&&(de="0");de.length<c.length-1;)de+="0";const ue=BigNumber$1.from(ae),pe=BigNumber$1.from(de);let ge=ue.mul(c).add(pe);return ie&&(ge=ge.mul(NegativeOne$2)),ge}class FixedFormat{constructor(n,c,ie,se){n!==_constructorGuard$3&&logger$v.throwError("cannot use FixedFormat constructor; use FixedFormat.from",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=c,this.width=ie,this.decimals=se,this.name=(c?"":"u")+"fixed"+String(ie)+"x"+String(se),this._multiplier=getMultiplier(se),Object.freeze(this)}static from(n){if(n instanceof FixedFormat)return n;typeof n=="number"&&(n=`fixed128x${n}`);let c=!0,ie=128,se=18;if(typeof n=="string"){if(n!=="fixed")if(n==="ufixed")c=!1;else{const ae=n.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);ae||logger$v.throwArgumentError("invalid fixed format","format",n),c=ae[1]!=="u",ie=parseInt(ae[2]),se=parseInt(ae[3])}}else if(n){const ae=(de,ue,pe)=>n[de]==null?pe:(typeof n[de]!==ue&&logger$v.throwArgumentError("invalid fixed format ("+de+" not "+ue+")","format."+de,n[de]),n[de]);c=ae("signed","boolean",c),ie=ae("width","number",ie),se=ae("decimals","number",se)}return ie%8&&logger$v.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",ie),se>80&&logger$v.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",se),new FixedFormat(_constructorGuard$3,c,ie,se)}}class FixedNumber{constructor(n,c,ie,se){n!==_constructorGuard$3&&logger$v.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=se,this._hex=c,this._value=ie,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(n){this.format.name!==n.format.name&&logger$v.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",n)}addUnsafe(n){this._checkFormat(n);const c=parseFixed(this._value,this.format.decimals),ie=parseFixed(n._value,n.format.decimals);return FixedNumber.fromValue(c.add(ie),this.format.decimals,this.format)}subUnsafe(n){this._checkFormat(n);const c=parseFixed(this._value,this.format.decimals),ie=parseFixed(n._value,n.format.decimals);return FixedNumber.fromValue(c.sub(ie),this.format.decimals,this.format)}mulUnsafe(n){this._checkFormat(n);const c=parseFixed(this._value,this.format.decimals),ie=parseFixed(n._value,n.format.decimals);return FixedNumber.fromValue(c.mul(ie).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(n){this._checkFormat(n);const c=parseFixed(this._value,this.format.decimals),ie=parseFixed(n._value,n.format.decimals);return FixedNumber.fromValue(c.mul(this.format._multiplier).div(ie),this.format.decimals,this.format)}floor(){const n=this.toString().split(".");n.length===1&&n.push("0");let c=FixedNumber.from(n[0],this.format);const ie=!n[1].match(/^(0*)$/);return this.isNegative()&&ie&&(c=c.subUnsafe(ONE.toFormat(c.format))),c}ceiling(){const n=this.toString().split(".");n.length===1&&n.push("0");let c=FixedNumber.from(n[0],this.format);const ie=!n[1].match(/^(0*)$/);return!this.isNegative()&&ie&&(c=c.addUnsafe(ONE.toFormat(c.format))),c}round(n){n==null&&(n=0);const c=this.toString().split(".");if(c.length===1&&c.push("0"),(n<0||n>80||n%1)&&logger$v.throwArgumentError("invalid decimal count","decimals",n),c[1].length<=n)return this;const ie=FixedNumber.from("1"+zeros.substring(0,n),this.format),se=BUMP.toFormat(this.format);return this.mulUnsafe(ie).addUnsafe(se).floor().divUnsafe(ie)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(n){if(n==null)return this._hex;n%8&&logger$v.throwArgumentError("invalid byte width","width",n);const c=BigNumber$1.from(this._hex).fromTwos(this.format.width).toTwos(n).toHexString();return hexZeroPad(c,n/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(n){return FixedNumber.fromString(this._value,n)}static fromValue(n,c,ie){return ie==null&&c!=null&&!isBigNumberish(c)&&(ie=c,c=null),c==null&&(c=0),ie==null&&(ie="fixed"),FixedNumber.fromString(formatFixed(n,c),FixedFormat.from(ie))}static fromString(n,c){c==null&&(c="fixed");const ie=FixedFormat.from(c),se=parseFixed(n,ie.decimals);!ie.signed&&se.lt(Zero$2)&&throwFault$2("unsigned value cannot be negative","overflow","value",n);let ae=null;ie.signed?ae=se.toTwos(ie.width).toHexString():(ae=se.toHexString(),ae=hexZeroPad(ae,ie.width/8));const de=formatFixed(se,ie.decimals);return new FixedNumber(_constructorGuard$3,ae,de,ie)}static fromBytes(n,c){c==null&&(c="fixed");const ie=FixedFormat.from(c);if(arrayify(n).length>ie.width/8)throw new Error("overflow");let se=BigNumber$1.from(n);ie.signed&&(se=se.fromTwos(ie.width));const ae=se.toTwos((ie.signed?0:1)+ie.width).toHexString(),de=formatFixed(se,ie.decimals);return new FixedNumber(_constructorGuard$3,ae,de,ie)}static from(n,c){if(typeof n=="string")return FixedNumber.fromString(n,c);if(isBytes$1(n))return FixedNumber.fromBytes(n,c);try{return FixedNumber.fromValue(n,0,c)}catch(ie){if(ie.code!==Logger$1.errors.INVALID_ARGUMENT)throw ie}return logger$v.throwArgumentError("invalid FixedNumber value","value",n)}static isFixedNumber(n){return!!(n&&n._isFixedNumber)}}const ONE=FixedNumber.from(1),BUMP=FixedNumber.from("0.5"),version$r="properties/5.8.0";var __awaiter$l=function(t,n,c,ie){function se(ae){return ae instanceof c?ae:new c(function(de){de(ae)})}return new(c||(c=Promise))(function(ae,de){function ue(be){try{ge(ie.next(be))}catch(_e){de(_e)}}function pe(be){try{ge(ie.throw(be))}catch(_e){de(_e)}}function ge(be){be.done?ae(be.value):se(be.value).then(ue,pe)}ge((ie=ie.apply(t,[])).next())})};const logger$u=new Logger$1(version$r);function defineReadOnly(t,n,c){Object.defineProperty(t,n,{enumerable:!0,value:c,writable:!1})}function getStatic(t,n){for(let c=0;c<32;c++){if(t[n])return t[n];if(!t.prototype||typeof t.prototype!="object")break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function resolveProperties(t){return __awaiter$l(this,void 0,void 0,function*(){const n=Object.keys(t).map(c=>{const ie=t[c];return Promise.resolve(ie).then(se=>({key:c,value:se}))});return(yield Promise.all(n)).reduce((c,ie)=>(c[ie.key]=ie.value,c),{})})}function checkProperties(t,n){(!t||typeof t!="object")&&logger$u.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(c=>{n[c]||logger$u.throwArgumentError("invalid object key - "+c,"transaction:"+c,t)})}function shallowCopy(t){const n={};for(const c in t)n[c]=t[c];return n}const opaque={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function _isFrozen(t){if(t==null||opaque[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;const n=Object.keys(t);for(let c=0;c<n.length;c++){let ie=null;try{ie=t[n[c]]}catch{continue}if(!_isFrozen(ie))return!1}return!0}return logger$u.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function _deepCopy(t){if(_isFrozen(t))return t;if(Array.isArray(t))return Object.freeze(t.map(n=>deepCopy(n)));if(typeof t=="object"){const n={};for(const c in t){const ie=t[c];ie!==void 0&&defineReadOnly(n,c,deepCopy(ie))}return n}return logger$u.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function deepCopy(t){return _deepCopy(t)}let Description$1=class{constructor(n){for(const c in n)this[c]=deepCopy(n[c])}};const lib_esm$i=Object.freeze(Object.defineProperty({__proto__:null,Description:Description$1,checkProperties,deepCopy,defineReadOnly,getStatic,resolveProperties,shallowCopy},Symbol.toStringTag,{value:"Module"})),version$q="abi/5.8.0",logger$t=new Logger$1(version$q),_constructorGuard$2={};let ModifiersBytes={calldata:!0,memory:!0,storage:!0},ModifiersNest={calldata:!0,memory:!0};function checkModifier(t,n){if(t==="bytes"||t==="string"){if(ModifiersBytes[n])return!0}else if(t==="address"){if(n==="payable")return!0}else if((t.indexOf("[")>=0||t==="tuple")&&ModifiersNest[n])return!0;return(ModifiersBytes[n]||n==="payable")&&logger$t.throwArgumentError("invalid modifier","name",n),!1}function parseParamType(t,n){let c=t;function ie(ue){logger$t.throwArgumentError(`unexpected character at position ${ue}`,"param",t)}t=t.replace(/\s/g," ");function se(ue){let pe={type:"",name:"",parent:ue,state:{allowType:!0}};return n&&(pe.indexed=!1),pe}let ae={type:"",name:"",state:{allowType:!0}},de=ae;for(let ue=0;ue<t.length;ue++){let pe=t[ue];switch(pe){case"(":de.state.allowType&&de.type===""?de.type="tuple":de.state.allowParams||ie(ue),de.state.allowType=!1,de.type=verifyType(de.type),de.components=[se(de)],de=de.components[0];break;case")":delete de.state,de.name==="indexed"&&(n||ie(ue),de.indexed=!0,de.name=""),checkModifier(de.type,de.name)&&(de.name=""),de.type=verifyType(de.type);let ge=de;de=de.parent,de||ie(ue),delete ge.parent,de.state.allowParams=!1,de.state.allowName=!0,de.state.allowArray=!0;break;case",":delete de.state,de.name==="indexed"&&(n||ie(ue),de.indexed=!0,de.name=""),checkModifier(de.type,de.name)&&(de.name=""),de.type=verifyType(de.type);let be=se(de.parent);de.parent.components.push(be),delete de.parent,de=be;break;case" ":de.state.allowType&&de.type!==""&&(de.type=verifyType(de.type),delete de.state.allowType,de.state.allowName=!0,de.state.allowParams=!0),de.state.allowName&&de.name!==""&&(de.name==="indexed"?(n||ie(ue),de.indexed&&ie(ue),de.indexed=!0,de.name=""):checkModifier(de.type,de.name)?de.name="":de.state.allowName=!1);break;case"[":de.state.allowArray||ie(ue),de.type+=pe,de.state.allowArray=!1,de.state.allowName=!1,de.state.readArray=!0;break;case"]":de.state.readArray||ie(ue),de.type+=pe,de.state.readArray=!1,de.state.allowArray=!0,de.state.allowName=!0;break;default:de.state.allowType?(de.type+=pe,de.state.allowParams=!0,de.state.allowArray=!0):de.state.allowName?(de.name+=pe,delete de.state.allowArray):de.state.readArray?de.type+=pe:ie(ue)}}return de.parent&&logger$t.throwArgumentError("unexpected eof","param",t),delete ae.state,de.name==="indexed"?(n||ie(c.length-7),de.indexed&&ie(c.length-7),de.indexed=!0,de.name=""):checkModifier(de.type,de.name)&&(de.name=""),ae.type=verifyType(ae.type),ae}function populate(t,n){for(let c in n)defineReadOnly(t,c,n[c])}const FormatTypes=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),paramTypeArray=new RegExp(/^(.*)\[([0-9]*)\]$/);class ParamType{constructor(n,c){n!==_constructorGuard$2&&logger$t.throwError("use fromString",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),populate(this,c);let ie=this.type.match(paramTypeArray);ie?populate(this,{arrayLength:parseInt(ie[2]||"-1"),arrayChildren:ParamType.fromObject({type:ie[1],components:this.components}),baseType:"array"}):populate(this,{arrayLength:null,arrayChildren:null,baseType:this.components!=null?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(n){if(n||(n=FormatTypes.sighash),FormatTypes[n]||logger$t.throwArgumentError("invalid format type","format",n),n===FormatTypes.json){let ie={type:this.baseType==="tuple"?"tuple":this.type,name:this.name||void 0};return typeof this.indexed=="boolean"&&(ie.indexed=this.indexed),this.components&&(ie.components=this.components.map(se=>JSON.parse(se.format(n)))),JSON.stringify(ie)}let c="";return this.baseType==="array"?(c+=this.arrayChildren.format(n),c+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(n!==FormatTypes.sighash&&(c+=this.type),c+="("+this.components.map(ie=>ie.format(n)).join(n===FormatTypes.full?", ":",")+")"):c+=this.type,n!==FormatTypes.sighash&&(this.indexed===!0&&(c+=" indexed"),n===FormatTypes.full&&this.name&&(c+=" "+this.name)),c}static from(n,c){return typeof n=="string"?ParamType.fromString(n,c):ParamType.fromObject(n)}static fromObject(n){return ParamType.isParamType(n)?n:new ParamType(_constructorGuard$2,{name:n.name||null,type:verifyType(n.type),indexed:n.indexed==null?null:!!n.indexed,components:n.components?n.components.map(ParamType.fromObject):null})}static fromString(n,c){function ie(se){return ParamType.fromObject({name:se.name,type:se.type,indexed:se.indexed,components:se.components})}return ie(parseParamType(n,!!c))}static isParamType(n){return!!(n!=null&&n._isParamType)}}function parseParams(t,n){return splitNesting(t).map(c=>ParamType.fromString(c,n))}class Fragment{constructor(n,c){n!==_constructorGuard$2&&logger$t.throwError("use a static from method",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),populate(this,c),this._isFragment=!0,Object.freeze(this)}static from(n){return Fragment.isFragment(n)?n:typeof n=="string"?Fragment.fromString(n):Fragment.fromObject(n)}static fromObject(n){if(Fragment.isFragment(n))return n;switch(n.type){case"function":return FunctionFragment.fromObject(n);case"event":return EventFragment.fromObject(n);case"constructor":return ConstructorFragment.fromObject(n);case"error":return ErrorFragment.fromObject(n);case"fallback":case"receive":return null}return logger$t.throwArgumentError("invalid fragment object","value",n)}static fromString(n){return n=n.replace(/\s/g," "),n=n.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),n=n.trim(),n.split(" ")[0]==="event"?EventFragment.fromString(n.substring(5).trim()):n.split(" ")[0]==="function"?FunctionFragment.fromString(n.substring(8).trim()):n.split("(")[0].trim()==="constructor"?ConstructorFragment.fromString(n.trim()):n.split(" ")[0]==="error"?ErrorFragment.fromString(n.substring(5).trim()):logger$t.throwArgumentError("unsupported fragment","value",n)}static isFragment(n){return!!(n&&n._isFragment)}}class EventFragment extends Fragment{format(n){if(n||(n=FormatTypes.sighash),FormatTypes[n]||logger$t.throwArgumentError("invalid format type","format",n),n===FormatTypes.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(ie=>JSON.parse(ie.format(n)))});let c="";return n!==FormatTypes.sighash&&(c+="event "),c+=this.name+"("+this.inputs.map(ie=>ie.format(n)).join(n===FormatTypes.full?", ":",")+") ",n!==FormatTypes.sighash&&this.anonymous&&(c+="anonymous "),c.trim()}static from(n){return typeof n=="string"?EventFragment.fromString(n):EventFragment.fromObject(n)}static fromObject(n){if(EventFragment.isEventFragment(n))return n;n.type!=="event"&&logger$t.throwArgumentError("invalid event object","value",n);const c={name:verifyIdentifier(n.name),anonymous:n.anonymous,inputs:n.inputs?n.inputs.map(ParamType.fromObject):[],type:"event"};return new EventFragment(_constructorGuard$2,c)}static fromString(n){let c=n.match(regexParen);c||logger$t.throwArgumentError("invalid event string","value",n);let ie=!1;return c[3].split(" ").forEach(se=>{switch(se.trim()){case"anonymous":ie=!0;break;case"":break;default:logger$t.warn("unknown modifier: "+se)}}),EventFragment.fromObject({name:c[1].trim(),anonymous:ie,inputs:parseParams(c[2],!0),type:"event"})}static isEventFragment(n){return n&&n._isFragment&&n.type==="event"}}function parseGas(t,n){n.gas=null;let c=t.split("@");return c.length!==1?(c.length>2&&logger$t.throwArgumentError("invalid human-readable ABI signature","value",t),c[1].match(/^[0-9]+$/)||logger$t.throwArgumentError("invalid human-readable ABI signature gas","value",t),n.gas=BigNumber$1.from(c[1]),c[0]):t}function parseModifiers(t,n){n.constant=!1,n.payable=!1,n.stateMutability="nonpayable",t.split(" ").forEach(c=>{switch(c.trim()){case"constant":n.constant=!0;break;case"payable":n.payable=!0,n.stateMutability="payable";break;case"nonpayable":n.payable=!1,n.stateMutability="nonpayable";break;case"pure":n.constant=!0,n.stateMutability="pure";break;case"view":n.constant=!0,n.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+c)}})}function verifyState(t){let n={constant:!1,payable:!0,stateMutability:"payable"};return t.stateMutability!=null?(n.stateMutability=t.stateMutability,n.constant=n.stateMutability==="view"||n.stateMutability==="pure",t.constant!=null&&!!t.constant!==n.constant&&logger$t.throwArgumentError("cannot have constant function with mutability "+n.stateMutability,"value",t),n.payable=n.stateMutability==="payable",t.payable!=null&&!!t.payable!==n.payable&&logger$t.throwArgumentError("cannot have payable function with mutability "+n.stateMutability,"value",t)):t.payable!=null?(n.payable=!!t.payable,t.constant==null&&!n.payable&&t.type!=="constructor"&&logger$t.throwArgumentError("unable to determine stateMutability","value",t),n.constant=!!t.constant,n.constant?n.stateMutability="view":n.stateMutability=n.payable?"payable":"nonpayable",n.payable&&n.constant&&logger$t.throwArgumentError("cannot have constant payable function","value",t)):t.constant!=null?(n.constant=!!t.constant,n.payable=!n.constant,n.stateMutability=n.constant?"view":"payable"):t.type!=="constructor"&&logger$t.throwArgumentError("unable to determine stateMutability","value",t),n}class ConstructorFragment extends Fragment{format(n){if(n||(n=FormatTypes.sighash),FormatTypes[n]||logger$t.throwArgumentError("invalid format type","format",n),n===FormatTypes.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(ie=>JSON.parse(ie.format(n)))});n===FormatTypes.sighash&&logger$t.throwError("cannot format a constructor for sighash",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let c="constructor("+this.inputs.map(ie=>ie.format(n)).join(n===FormatTypes.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(c+=this.stateMutability+" "),c.trim()}static from(n){return typeof n=="string"?ConstructorFragment.fromString(n):ConstructorFragment.fromObject(n)}static fromObject(n){if(ConstructorFragment.isConstructorFragment(n))return n;n.type!=="constructor"&&logger$t.throwArgumentError("invalid constructor object","value",n);let c=verifyState(n);c.constant&&logger$t.throwArgumentError("constructor cannot be constant","value",n);const ie={name:null,type:n.type,inputs:n.inputs?n.inputs.map(ParamType.fromObject):[],payable:c.payable,stateMutability:c.stateMutability,gas:n.gas?BigNumber$1.from(n.gas):null};return new ConstructorFragment(_constructorGuard$2,ie)}static fromString(n){let c={type:"constructor"};n=parseGas(n,c);let ie=n.match(regexParen);return(!ie||ie[1].trim()!=="constructor")&&logger$t.throwArgumentError("invalid constructor string","value",n),c.inputs=parseParams(ie[2].trim(),!1),parseModifiers(ie[3].trim(),c),ConstructorFragment.fromObject(c)}static isConstructorFragment(n){return n&&n._isFragment&&n.type==="constructor"}}class FunctionFragment extends ConstructorFragment{format(n){if(n||(n=FormatTypes.sighash),FormatTypes[n]||logger$t.throwArgumentError("invalid format type","format",n),n===FormatTypes.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(ie=>JSON.parse(ie.format(n))),outputs:this.outputs.map(ie=>JSON.parse(ie.format(n)))});let c="";return n!==FormatTypes.sighash&&(c+="function "),c+=this.name+"("+this.inputs.map(ie=>ie.format(n)).join(n===FormatTypes.full?", ":",")+") ",n!==FormatTypes.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(c+=this.stateMutability+" "):this.constant&&(c+="view "),this.outputs&&this.outputs.length&&(c+="returns ("+this.outputs.map(ie=>ie.format(n)).join(", ")+") "),this.gas!=null&&(c+="@"+this.gas.toString()+" ")),c.trim()}static from(n){return typeof n=="string"?FunctionFragment.fromString(n):FunctionFragment.fromObject(n)}static fromObject(n){if(FunctionFragment.isFunctionFragment(n))return n;n.type!=="function"&&logger$t.throwArgumentError("invalid function object","value",n);let c=verifyState(n);const ie={type:n.type,name:verifyIdentifier(n.name),constant:c.constant,inputs:n.inputs?n.inputs.map(ParamType.fromObject):[],outputs:n.outputs?n.outputs.map(ParamType.fromObject):[],payable:c.payable,stateMutability:c.stateMutability,gas:n.gas?BigNumber$1.from(n.gas):null};return new FunctionFragment(_constructorGuard$2,ie)}static fromString(n){let c={type:"function"};n=parseGas(n,c);let ie=n.split(" returns ");ie.length>2&&logger$t.throwArgumentError("invalid function string","value",n);let se=ie[0].match(regexParen);if(se||logger$t.throwArgumentError("invalid function signature","value",n),c.name=se[1].trim(),c.name&&verifyIdentifier(c.name),c.inputs=parseParams(se[2],!1),parseModifiers(se[3].trim(),c),ie.length>1){let ae=ie[1].match(regexParen);(ae[1].trim()!=""||ae[3].trim()!="")&&logger$t.throwArgumentError("unexpected tokens","value",n),c.outputs=parseParams(ae[2],!1)}else c.outputs=[];return FunctionFragment.fromObject(c)}static isFunctionFragment(n){return n&&n._isFragment&&n.type==="function"}}function checkForbidden(t){const n=t.format();return(n==="Error(string)"||n==="Panic(uint256)")&&logger$t.throwArgumentError(`cannot specify user defined ${n} error`,"fragment",t),t}class ErrorFragment extends Fragment{format(n){if(n||(n=FormatTypes.sighash),FormatTypes[n]||logger$t.throwArgumentError("invalid format type","format",n),n===FormatTypes.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(ie=>JSON.parse(ie.format(n)))});let c="";return n!==FormatTypes.sighash&&(c+="error "),c+=this.name+"("+this.inputs.map(ie=>ie.format(n)).join(n===FormatTypes.full?", ":",")+") ",c.trim()}static from(n){return typeof n=="string"?ErrorFragment.fromString(n):ErrorFragment.fromObject(n)}static fromObject(n){if(ErrorFragment.isErrorFragment(n))return n;n.type!=="error"&&logger$t.throwArgumentError("invalid error object","value",n);const c={type:n.type,name:verifyIdentifier(n.name),inputs:n.inputs?n.inputs.map(ParamType.fromObject):[]};return checkForbidden(new ErrorFragment(_constructorGuard$2,c))}static fromString(n){let c={type:"error"},ie=n.match(regexParen);return ie||logger$t.throwArgumentError("invalid error signature","value",n),c.name=ie[1].trim(),c.name&&verifyIdentifier(c.name),c.inputs=parseParams(ie[2],!1),checkForbidden(ErrorFragment.fromObject(c))}static isErrorFragment(n){return n&&n._isFragment&&n.type==="error"}}function verifyType(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const regexIdentifier=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function verifyIdentifier(t){return(!t||!t.match(regexIdentifier))&&logger$t.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const regexParen=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function splitNesting(t){t=t.trim();let n=[],c="",ie=0;for(let se=0;se<t.length;se++){let ae=t[se];ae===","&&ie===0?(n.push(c),c=""):(c+=ae,ae==="("?ie++:ae===")"&&(ie--,ie===-1&&logger$t.throwArgumentError("unbalanced parenthesis","value",t)))}return c&&n.push(c),n}const logger$s=new Logger$1(version$q);function checkResultErrors(t){const n=[],c=function(ie,se){if(Array.isArray(se))for(let ae in se){const de=ie.slice();de.push(ae);try{c(de,se[ae])}catch(ue){n.push({path:de,error:ue})}}};return c([],t),n}class Coder{constructor(n,c,ie,se){this.name=n,this.type=c,this.localName=ie,this.dynamic=se}_throwError(n,c){logger$s.throwArgumentError(n,this.localName,c)}}class Writer{constructor(n){defineReadOnly(this,"wordSize",n||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(n)}get data(){return hexConcat(this._data)}get length(){return this._dataLength}_writeData(n){return this._data.push(n),this._dataLength+=n.length,n.length}appendWriter(n){return this._writeData(concat$1(n._data))}writeBytes(n){let c=arrayify(n);const ie=c.length%this.wordSize;return ie&&(c=concat$1([c,this._padding.slice(ie)])),this._writeData(c)}_getValue(n){let c=arrayify(BigNumber$1.from(n));return c.length>this.wordSize&&logger$s.throwError("value out-of-bounds",Logger$1.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:c.length}),c.length%this.wordSize&&(c=concat$1([this._padding.slice(c.length%this.wordSize),c])),c}writeValue(n){return this._writeData(this._getValue(n))}writeUpdatableValue(){const n=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,c=>{this._data[n]=this._getValue(c)}}}class Reader{constructor(n,c,ie,se){defineReadOnly(this,"_data",arrayify(n)),defineReadOnly(this,"wordSize",c||32),defineReadOnly(this,"_coerceFunc",ie),defineReadOnly(this,"allowLoose",se),this._offset=0}get data(){return hexlify$1(this._data)}get consumed(){return this._offset}static coerce(n,c){let ie=n.match("^u?int([0-9]+)$");return ie&&parseInt(ie[1])<=48&&(c=c.toNumber()),c}coerce(n,c){return this._coerceFunc?this._coerceFunc(n,c):Reader.coerce(n,c)}_peekBytes(n,c,ie){let se=Math.ceil(c/this.wordSize)*this.wordSize;return this._offset+se>this._data.length&&(this.allowLoose&&ie&&this._offset+c<=this._data.length?se=c:logger$s.throwError("data out-of-bounds",Logger$1.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+se})),this._data.slice(this._offset,this._offset+se)}subReader(n){return new Reader(this._data.slice(this._offset+n),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(n,c){let ie=this._peekBytes(0,n,!!c);return this._offset+=ie.length,ie.slice(0,n)}readValue(){return BigNumber$1.from(this.readBytes(this.wordSize))}}function getDefaultExportFromCjs$1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var browser$e={exports:{}},process$1=browser$e.exports={},cachedSetTimeout,cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?cachedSetTimeout=setTimeout:cachedSetTimeout=defaultSetTimout}catch{cachedSetTimeout=defaultSetTimout}try{typeof clearTimeout=="function"?cachedClearTimeout=clearTimeout:cachedClearTimeout=defaultClearTimeout}catch{cachedClearTimeout=defaultClearTimeout}})();function runTimeout(t){if(cachedSetTimeout===setTimeout)return setTimeout(t,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(t,0);try{return cachedSetTimeout(t,0)}catch{try{return cachedSetTimeout.call(null,t,0)}catch{return cachedSetTimeout.call(this,t,0)}}}function runClearTimeout(t){if(cachedClearTimeout===clearTimeout)return clearTimeout(t);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(t);try{return cachedClearTimeout(t)}catch{try{return cachedClearTimeout.call(null,t)}catch{return cachedClearTimeout.call(this,t)}}}var queue=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var t=runTimeout(cleanUpNextTick);draining=!0;for(var n=queue.length;n;){for(currentQueue=queue,queue=[];++queueIndex<n;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,n=queue.length}currentQueue=null,draining=!1,runClearTimeout(t)}}process$1.nextTick=function(t){var n=new Array(arguments.length-1);if(arguments.length>1)for(var c=1;c<arguments.length;c++)n[c-1]=arguments[c];queue.push(new Item(t,n)),queue.length===1&&!draining&&runTimeout(drainQueue)};function Item(t,n){this.fun=t,this.array=n}Item.prototype.run=function(){this.fun.apply(null,this.array)};process$1.title="browser";process$1.browser=!0;process$1.env={};process$1.argv=[];process$1.version="";process$1.versions={};function noop$1(){}process$1.on=noop$1;process$1.addListener=noop$1;process$1.once=noop$1;process$1.off=noop$1;process$1.removeListener=noop$1;process$1.removeAllListeners=noop$1;process$1.emit=noop$1;process$1.prependListener=noop$1;process$1.prependOnceListener=noop$1;process$1.listeners=function(t){return[]};process$1.binding=function(t){throw new Error("process.binding is not supported")};process$1.cwd=function(){return"/"};process$1.chdir=function(t){throw new Error("process.chdir is not supported")};process$1.umask=function(){return 0};var browserExports=browser$e.exports;const process$1$1=getDefaultExportFromCjs$1(browserExports);var sha3$3={exports:{}};(function(t){(function(){var n="input is invalid type",c="finalize already called",ie=typeof window=="object",se=ie?window:{};se.JS_SHA3_NO_WINDOW&&(ie=!1);var ae=!ie&&typeof self=="object",de=!se.JS_SHA3_NO_NODE_JS&&typeof process$1$1=="object"&&process$1$1.versions&&process$1$1.versions.node;de?se=globalThis:ae&&(se=self);var ue=!se.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,pe=!se.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",ge="0123456789abcdef".split(""),be=[31,7936,2031616,520093696],_e=[4,1024,262144,67108864],we=[1,256,65536,16777216],qe=[6,1536,393216,100663296],Ye=[0,8,16,24],Ge=[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],Ze=[224,256,384,512],He=[128,256],Ht=["hex","buffer","arrayBuffer","array","digest"],un={128:168,256:136};(se.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(Cn){return Object.prototype.toString.call(Cn)==="[object Array]"}),pe&&(se.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(Cn){return typeof Cn=="object"&&Cn.buffer&&Cn.buffer.constructor===ArrayBuffer});for(var De=function(Cn,Qn,En){return function(In){return new Vt(Cn,Qn,Cn).update(In)[En]()}},$e=function(Cn,Qn,En){return function(In,Mn){return new Vt(Cn,Qn,Mn).update(In)[En]()}},me=function(Cn,Qn,En){return function(In,Mn,zn,Jn){return ze["cshake"+Cn].update(In,Mn,zn,Jn)[En]()}},Gt=function(Cn,Qn,En){return function(In,Mn,zn,Jn){return ze["kmac"+Cn].update(In,Mn,zn,Jn)[En]()}},mn=function(Cn,Qn,En,In){for(var Mn=0;Mn<Ht.length;++Mn){var zn=Ht[Mn];Cn[zn]=Qn(En,In,zn)}return Cn},dn=function(Cn,Qn){var En=De(Cn,Qn,"hex");return En.create=function(){return new Vt(Cn,Qn,Cn)},En.update=function(In){return En.create().update(In)},mn(En,De,Cn,Qn)},jt=function(Cn,Qn){var En=$e(Cn,Qn,"hex");return En.create=function(In){return new Vt(Cn,Qn,In)},En.update=function(In,Mn){return En.create(Mn).update(In)},mn(En,$e,Cn,Qn)},le=function(Cn,Qn){var En=un[Cn],In=me(Cn,Qn,"hex");return In.create=function(Mn,zn,Jn){return!zn&&!Jn?ze["shake"+Cn].create(Mn):new Vt(Cn,Qn,Mn).bytepad([zn,Jn],En)},In.update=function(Mn,zn,Jn,hn){return In.create(zn,Jn,hn).update(Mn)},mn(In,me,Cn,Qn)},Pe=function(Cn,Qn){var En=un[Cn],In=Gt(Cn,Qn,"hex");return In.create=function(Mn,zn,Jn){return new Sn(Cn,Qn,zn).bytepad(["KMAC",Jn],En).bytepad([Mn],En)},In.update=function(Mn,zn,Jn,hn){return In.create(Mn,Jn,hn).update(zn)},mn(In,Gt,Cn,Qn)},xe=[{name:"keccak",padding:we,bits:Ze,createMethod:dn},{name:"sha3",padding:qe,bits:Ze,createMethod:dn},{name:"shake",padding:be,bits:He,createMethod:jt},{name:"cshake",padding:_e,bits:He,createMethod:le},{name:"kmac",padding:_e,bits:He,createMethod:Pe}],ze={},Ft=[],yn=0;yn<xe.length;++yn)for(var Zt=xe[yn],Me=Zt.bits,ce=0;ce<Me.length;++ce){var Ne=Zt.name+"_"+Me[ce];if(Ft.push(Ne),ze[Ne]=Zt.createMethod(Me[ce],Zt.padding),Zt.name!=="sha3"){var We=Zt.name+Me[ce];Ft.push(We),ze[We]=ze[Ne]}}function Vt(Cn,Qn,En){this.blocks=[],this.s=[],this.padding=Qn,this.outputBits=En,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(Cn<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=En>>5,this.extraBytes=(En&31)>>3;for(var In=0;In<50;++In)this.s[In]=0}Vt.prototype.update=function(Cn){if(this.finalized)throw new Error(c);var Qn,En=typeof Cn;if(En!=="string"){if(En==="object"){if(Cn===null)throw new Error(n);if(pe&&Cn.constructor===ArrayBuffer)Cn=new Uint8Array(Cn);else if(!Array.isArray(Cn)&&(!pe||!ArrayBuffer.isView(Cn)))throw new Error(n)}else throw new Error(n);Qn=!0}for(var In=this.blocks,Mn=this.byteCount,zn=Cn.length,Jn=this.blockCount,hn=0,xn=this.s,Hn,ti;hn<zn;){if(this.reset)for(this.reset=!1,In[0]=this.block,Hn=1;Hn<Jn+1;++Hn)In[Hn]=0;if(Qn)for(Hn=this.start;hn<zn&&Hn<Mn;++hn)In[Hn>>2]|=Cn[hn]<<Ye[Hn++&3];else for(Hn=this.start;hn<zn&&Hn<Mn;++hn)ti=Cn.charCodeAt(hn),ti<128?In[Hn>>2]|=ti<<Ye[Hn++&3]:ti<2048?(In[Hn>>2]|=(192|ti>>6)<<Ye[Hn++&3],In[Hn>>2]|=(128|ti&63)<<Ye[Hn++&3]):ti<55296||ti>=57344?(In[Hn>>2]|=(224|ti>>12)<<Ye[Hn++&3],In[Hn>>2]|=(128|ti>>6&63)<<Ye[Hn++&3],In[Hn>>2]|=(128|ti&63)<<Ye[Hn++&3]):(ti=65536+((ti&1023)<<10|Cn.charCodeAt(++hn)&1023),In[Hn>>2]|=(240|ti>>18)<<Ye[Hn++&3],In[Hn>>2]|=(128|ti>>12&63)<<Ye[Hn++&3],In[Hn>>2]|=(128|ti>>6&63)<<Ye[Hn++&3],In[Hn>>2]|=(128|ti&63)<<Ye[Hn++&3]);if(this.lastByteIndex=Hn,Hn>=Mn){for(this.start=Hn-Mn,this.block=In[Jn],Hn=0;Hn<Jn;++Hn)xn[Hn]^=In[Hn];An(xn),this.reset=!0}else this.start=Hn}return this},Vt.prototype.encode=function(Cn,Qn){var En=Cn&255,In=1,Mn=[En];for(Cn=Cn>>8,En=Cn&255;En>0;)Mn.unshift(En),Cn=Cn>>8,En=Cn&255,++In;return Qn?Mn.push(In):Mn.unshift(In),this.update(Mn),Mn.length},Vt.prototype.encodeString=function(Cn){var Qn,En=typeof Cn;if(En!=="string"){if(En==="object"){if(Cn===null)throw new Error(n);if(pe&&Cn.constructor===ArrayBuffer)Cn=new Uint8Array(Cn);else if(!Array.isArray(Cn)&&(!pe||!ArrayBuffer.isView(Cn)))throw new Error(n)}else throw new Error(n);Qn=!0}var In=0,Mn=Cn.length;if(Qn)In=Mn;else for(var zn=0;zn<Cn.length;++zn){var Jn=Cn.charCodeAt(zn);Jn<128?In+=1:Jn<2048?In+=2:Jn<55296||Jn>=57344?In+=3:(Jn=65536+((Jn&1023)<<10|Cn.charCodeAt(++zn)&1023),In+=4)}return In+=this.encode(In*8),this.update(Cn),In},Vt.prototype.bytepad=function(Cn,Qn){for(var En=this.encode(Qn),In=0;In<Cn.length;++In)En+=this.encodeString(Cn[In]);var Mn=Qn-En%Qn,zn=[];return zn.length=Mn,this.update(zn),this},Vt.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var Cn=this.blocks,Qn=this.lastByteIndex,En=this.blockCount,In=this.s;if(Cn[Qn>>2]|=this.padding[Qn&3],this.lastByteIndex===this.byteCount)for(Cn[0]=Cn[En],Qn=1;Qn<En+1;++Qn)Cn[Qn]=0;for(Cn[En-1]|=2147483648,Qn=0;Qn<En;++Qn)In[Qn]^=Cn[Qn];An(In)}},Vt.prototype.toString=Vt.prototype.hex=function(){this.finalize();for(var Cn=this.blockCount,Qn=this.s,En=this.outputBlocks,In=this.extraBytes,Mn=0,zn=0,Jn="",hn;zn<En;){for(Mn=0;Mn<Cn&&zn<En;++Mn,++zn)hn=Qn[Mn],Jn+=ge[hn>>4&15]+ge[hn&15]+ge[hn>>12&15]+ge[hn>>8&15]+ge[hn>>20&15]+ge[hn>>16&15]+ge[hn>>28&15]+ge[hn>>24&15];zn%Cn===0&&(An(Qn),Mn=0)}return In&&(hn=Qn[Mn],Jn+=ge[hn>>4&15]+ge[hn&15],In>1&&(Jn+=ge[hn>>12&15]+ge[hn>>8&15]),In>2&&(Jn+=ge[hn>>20&15]+ge[hn>>16&15])),Jn},Vt.prototype.arrayBuffer=function(){this.finalize();var Cn=this.blockCount,Qn=this.s,En=this.outputBlocks,In=this.extraBytes,Mn=0,zn=0,Jn=this.outputBits>>3,hn;In?hn=new ArrayBuffer(En+1<<2):hn=new ArrayBuffer(Jn);for(var xn=new Uint32Array(hn);zn<En;){for(Mn=0;Mn<Cn&&zn<En;++Mn,++zn)xn[zn]=Qn[Mn];zn%Cn===0&&An(Qn)}return In&&(xn[Mn]=Qn[Mn],hn=hn.slice(0,Jn)),hn},Vt.prototype.buffer=Vt.prototype.arrayBuffer,Vt.prototype.digest=Vt.prototype.array=function(){this.finalize();for(var Cn=this.blockCount,Qn=this.s,En=this.outputBlocks,In=this.extraBytes,Mn=0,zn=0,Jn=[],hn,xn;zn<En;){for(Mn=0;Mn<Cn&&zn<En;++Mn,++zn)hn=zn<<2,xn=Qn[Mn],Jn[hn]=xn&255,Jn[hn+1]=xn>>8&255,Jn[hn+2]=xn>>16&255,Jn[hn+3]=xn>>24&255;zn%Cn===0&&An(Qn)}return In&&(hn=zn<<2,xn=Qn[Mn],Jn[hn]=xn&255,In>1&&(Jn[hn+1]=xn>>8&255),In>2&&(Jn[hn+2]=xn>>16&255)),Jn};function Sn(Cn,Qn,En){Vt.call(this,Cn,Qn,En)}Sn.prototype=new Vt,Sn.prototype.finalize=function(){return this.encode(this.outputBits,!0),Vt.prototype.finalize.call(this)};var An=function(Cn){var Qn,En,In,Mn,zn,Jn,hn,xn,Hn,ti,ri,hi,gi,vi,Ai,Ii,Ei,yi,Zn,di,li,Kn,Vn,qn,Un,Ln,$n,jn,Pn,On,Fn,Pt,gn,Nn,mi,Wn,ci,Mi,Si,Bi,Fi,ki,Gn,Oi,pi,bi,xi,wi,Ci,Ti,Ri,_i,Ui,Pi,Ni,Qi,Di,qi,Hi,Ji,Li,$i,Vi;for(In=0;In<48;In+=2)Mn=Cn[0]^Cn[10]^Cn[20]^Cn[30]^Cn[40],zn=Cn[1]^Cn[11]^Cn[21]^Cn[31]^Cn[41],Jn=Cn[2]^Cn[12]^Cn[22]^Cn[32]^Cn[42],hn=Cn[3]^Cn[13]^Cn[23]^Cn[33]^Cn[43],xn=Cn[4]^Cn[14]^Cn[24]^Cn[34]^Cn[44],Hn=Cn[5]^Cn[15]^Cn[25]^Cn[35]^Cn[45],ti=Cn[6]^Cn[16]^Cn[26]^Cn[36]^Cn[46],ri=Cn[7]^Cn[17]^Cn[27]^Cn[37]^Cn[47],hi=Cn[8]^Cn[18]^Cn[28]^Cn[38]^Cn[48],gi=Cn[9]^Cn[19]^Cn[29]^Cn[39]^Cn[49],Qn=hi^(Jn<<1|hn>>>31),En=gi^(hn<<1|Jn>>>31),Cn[0]^=Qn,Cn[1]^=En,Cn[10]^=Qn,Cn[11]^=En,Cn[20]^=Qn,Cn[21]^=En,Cn[30]^=Qn,Cn[31]^=En,Cn[40]^=Qn,Cn[41]^=En,Qn=Mn^(xn<<1|Hn>>>31),En=zn^(Hn<<1|xn>>>31),Cn[2]^=Qn,Cn[3]^=En,Cn[12]^=Qn,Cn[13]^=En,Cn[22]^=Qn,Cn[23]^=En,Cn[32]^=Qn,Cn[33]^=En,Cn[42]^=Qn,Cn[43]^=En,Qn=Jn^(ti<<1|ri>>>31),En=hn^(ri<<1|ti>>>31),Cn[4]^=Qn,Cn[5]^=En,Cn[14]^=Qn,Cn[15]^=En,Cn[24]^=Qn,Cn[25]^=En,Cn[34]^=Qn,Cn[35]^=En,Cn[44]^=Qn,Cn[45]^=En,Qn=xn^(hi<<1|gi>>>31),En=Hn^(gi<<1|hi>>>31),Cn[6]^=Qn,Cn[7]^=En,Cn[16]^=Qn,Cn[17]^=En,Cn[26]^=Qn,Cn[27]^=En,Cn[36]^=Qn,Cn[37]^=En,Cn[46]^=Qn,Cn[47]^=En,Qn=ti^(Mn<<1|zn>>>31),En=ri^(zn<<1|Mn>>>31),Cn[8]^=Qn,Cn[9]^=En,Cn[18]^=Qn,Cn[19]^=En,Cn[28]^=Qn,Cn[29]^=En,Cn[38]^=Qn,Cn[39]^=En,Cn[48]^=Qn,Cn[49]^=En,vi=Cn[0],Ai=Cn[1],bi=Cn[11]<<4|Cn[10]>>>28,xi=Cn[10]<<4|Cn[11]>>>28,jn=Cn[20]<<3|Cn[21]>>>29,Pn=Cn[21]<<3|Cn[20]>>>29,Ji=Cn[31]<<9|Cn[30]>>>23,Li=Cn[30]<<9|Cn[31]>>>23,ki=Cn[40]<<18|Cn[41]>>>14,Gn=Cn[41]<<18|Cn[40]>>>14,Nn=Cn[2]<<1|Cn[3]>>>31,mi=Cn[3]<<1|Cn[2]>>>31,Ii=Cn[13]<<12|Cn[12]>>>20,Ei=Cn[12]<<12|Cn[13]>>>20,wi=Cn[22]<<10|Cn[23]>>>22,Ci=Cn[23]<<10|Cn[22]>>>22,On=Cn[33]<<13|Cn[32]>>>19,Fn=Cn[32]<<13|Cn[33]>>>19,$i=Cn[42]<<2|Cn[43]>>>30,Vi=Cn[43]<<2|Cn[42]>>>30,Pi=Cn[5]<<30|Cn[4]>>>2,Ni=Cn[4]<<30|Cn[5]>>>2,Wn=Cn[14]<<6|Cn[15]>>>26,ci=Cn[15]<<6|Cn[14]>>>26,yi=Cn[25]<<11|Cn[24]>>>21,Zn=Cn[24]<<11|Cn[25]>>>21,Ti=Cn[34]<<15|Cn[35]>>>17,Ri=Cn[35]<<15|Cn[34]>>>17,Pt=Cn[45]<<29|Cn[44]>>>3,gn=Cn[44]<<29|Cn[45]>>>3,qn=Cn[6]<<28|Cn[7]>>>4,Un=Cn[7]<<28|Cn[6]>>>4,Qi=Cn[17]<<23|Cn[16]>>>9,Di=Cn[16]<<23|Cn[17]>>>9,Mi=Cn[26]<<25|Cn[27]>>>7,Si=Cn[27]<<25|Cn[26]>>>7,di=Cn[36]<<21|Cn[37]>>>11,li=Cn[37]<<21|Cn[36]>>>11,_i=Cn[47]<<24|Cn[46]>>>8,Ui=Cn[46]<<24|Cn[47]>>>8,Oi=Cn[8]<<27|Cn[9]>>>5,pi=Cn[9]<<27|Cn[8]>>>5,Ln=Cn[18]<<20|Cn[19]>>>12,$n=Cn[19]<<20|Cn[18]>>>12,qi=Cn[29]<<7|Cn[28]>>>25,Hi=Cn[28]<<7|Cn[29]>>>25,Bi=Cn[38]<<8|Cn[39]>>>24,Fi=Cn[39]<<8|Cn[38]>>>24,Kn=Cn[48]<<14|Cn[49]>>>18,Vn=Cn[49]<<14|Cn[48]>>>18,Cn[0]=vi^~Ii&yi,Cn[1]=Ai^~Ei&Zn,Cn[10]=qn^~Ln&jn,Cn[11]=Un^~$n&Pn,Cn[20]=Nn^~Wn&Mi,Cn[21]=mi^~ci&Si,Cn[30]=Oi^~bi&wi,Cn[31]=pi^~xi&Ci,Cn[40]=Pi^~Qi&qi,Cn[41]=Ni^~Di&Hi,Cn[2]=Ii^~yi&di,Cn[3]=Ei^~Zn&li,Cn[12]=Ln^~jn&On,Cn[13]=$n^~Pn&Fn,Cn[22]=Wn^~Mi&Bi,Cn[23]=ci^~Si&Fi,Cn[32]=bi^~wi&Ti,Cn[33]=xi^~Ci&Ri,Cn[42]=Qi^~qi&Ji,Cn[43]=Di^~Hi&Li,Cn[4]=yi^~di&Kn,Cn[5]=Zn^~li&Vn,Cn[14]=jn^~On&Pt,Cn[15]=Pn^~Fn&gn,Cn[24]=Mi^~Bi&ki,Cn[25]=Si^~Fi&Gn,Cn[34]=wi^~Ti&_i,Cn[35]=Ci^~Ri&Ui,Cn[44]=qi^~Ji&$i,Cn[45]=Hi^~Li&Vi,Cn[6]=di^~Kn&vi,Cn[7]=li^~Vn&Ai,Cn[16]=On^~Pt&qn,Cn[17]=Fn^~gn&Un,Cn[26]=Bi^~ki&Nn,Cn[27]=Fi^~Gn&mi,Cn[36]=Ti^~_i&Oi,Cn[37]=Ri^~Ui&pi,Cn[46]=Ji^~$i&Pi,Cn[47]=Li^~Vi&Ni,Cn[8]=Kn^~vi&Ii,Cn[9]=Vn^~Ai&Ei,Cn[18]=Pt^~qn&Ln,Cn[19]=gn^~Un&$n,Cn[28]=ki^~Nn&Wn,Cn[29]=Gn^~mi&ci,Cn[38]=_i^~Oi&bi,Cn[39]=Ui^~pi&xi,Cn[48]=$i^~Pi&Qi,Cn[49]=Vi^~Ni&Di,Cn[0]^=Ge[In],Cn[1]^=Ge[In+1]};if(ue)t.exports=ze;else for(yn=0;yn<Ft.length;++yn)se[Ft[yn]]=ze[Ft[yn]]})()})(sha3$3);var sha3Exports$1=sha3$3.exports;const sha3$2=getDefaultExportFromCjs$2(sha3Exports$1);function keccak256$1(t){return"0x"+sha3$2.keccak_256(arrayify(t))}const lib_esm$h=Object.freeze(Object.defineProperty({__proto__:null,keccak256:keccak256$1},Symbol.toStringTag,{value:"Module"})),version$p="rlp/5.8.0",logger$r=new Logger$1(version$p);function arrayifyInteger(t){const n=[];for(;t;)n.unshift(t&255),t>>=8;return n}function unarrayifyInteger(t,n,c){let ie=0;for(let se=0;se<c;se++)ie=ie*256+t[n+se];return ie}function _encode(t){if(Array.isArray(t)){let ie=[];if(t.forEach(function(ae){ie=ie.concat(_encode(ae))}),ie.length<=55)return ie.unshift(192+ie.length),ie;const se=arrayifyInteger(ie.length);return se.unshift(247+se.length),se.concat(ie)}isBytesLike(t)||logger$r.throwArgumentError("RLP object must be BytesLike","object",t);const n=Array.prototype.slice.call(arrayify(t));if(n.length===1&&n[0]<=127)return n;if(n.length<=55)return n.unshift(128+n.length),n;const c=arrayifyInteger(n.length);return c.unshift(183+c.length),c.concat(n)}function encode$6(t){return hexlify$1(_encode(t))}function _decodeChildren(t,n,c,ie){const se=[];for(;c<n+1+ie;){const ae=_decode(t,c);se.push(ae.result),c+=ae.consumed,c>n+1+ie&&logger$r.throwError("child data too short",Logger$1.errors.BUFFER_OVERRUN,{})}return{consumed:1+ie,result:se}}function _decode(t,n){if(t.length===0&&logger$r.throwError("data too short",Logger$1.errors.BUFFER_OVERRUN,{}),t[n]>=248){const c=t[n]-247;n+1+c>t.length&&logger$r.throwError("data short segment too short",Logger$1.errors.BUFFER_OVERRUN,{});const ie=unarrayifyInteger(t,n+1,c);return n+1+c+ie>t.length&&logger$r.throwError("data long segment too short",Logger$1.errors.BUFFER_OVERRUN,{}),_decodeChildren(t,n,n+1+c,c+ie)}else if(t[n]>=192){const c=t[n]-192;return n+1+c>t.length&&logger$r.throwError("data array too short",Logger$1.errors.BUFFER_OVERRUN,{}),_decodeChildren(t,n,n+1,c)}else if(t[n]>=184){const c=t[n]-183;n+1+c>t.length&&logger$r.throwError("data array too short",Logger$1.errors.BUFFER_OVERRUN,{});const ie=unarrayifyInteger(t,n+1,c);n+1+c+ie>t.length&&logger$r.throwError("data array too short",Logger$1.errors.BUFFER_OVERRUN,{});const se=hexlify$1(t.slice(n+1+c,n+1+c+ie));return{consumed:1+c+ie,result:se}}else if(t[n]>=128){const c=t[n]-128;n+1+c>t.length&&logger$r.throwError("data too short",Logger$1.errors.BUFFER_OVERRUN,{});const ie=hexlify$1(t.slice(n+1,n+1+c));return{consumed:1+c,result:ie}}return{consumed:1,result:hexlify$1(t[n])}}function decode$7(t){const n=arrayify(t),c=_decode(n,0);return c.consumed!==n.length&&logger$r.throwArgumentError("invalid rlp data","data",t),c.result}const lib_esm$g=Object.freeze(Object.defineProperty({__proto__:null,decode:decode$7,encode:encode$6},Symbol.toStringTag,{value:"Module"})),version$o="address/5.8.0",logger$q=new Logger$1(version$o);function getChecksumAddress(t){isHexString$1(t,20)||logger$q.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const n=t.substring(2).split(""),c=new Uint8Array(40);for(let se=0;se<40;se++)c[se]=n[se].charCodeAt(0);const ie=arrayify(keccak256$1(c));for(let se=0;se<40;se+=2)ie[se>>1]>>4>=8&&(n[se]=n[se].toUpperCase()),(ie[se>>1]&15)>=8&&(n[se+1]=n[se+1].toUpperCase());return"0x"+n.join("")}const MAX_SAFE_INTEGER=9007199254740991;function log10(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const ibanLookup={};for(let t=0;t<10;t++)ibanLookup[String(t)]=String(t);for(let t=0;t<26;t++)ibanLookup[String.fromCharCode(65+t)]=String(10+t);const safeDigits=Math.floor(log10(MAX_SAFE_INTEGER));function ibanChecksum(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let n=t.split("").map(ie=>ibanLookup[ie]).join("");for(;n.length>=safeDigits;){let ie=n.substring(0,safeDigits);n=parseInt(ie,10)%97+n.substring(ie.length)}let c=String(98-parseInt(n,10)%97);for(;c.length<2;)c="0"+c;return c}function getAddress$1(t){let n=null;if(typeof t!="string"&&logger$q.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),n=getChecksumAddress(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&n!==t&&logger$q.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==ibanChecksum(t)&&logger$q.throwArgumentError("bad icap checksum","address",t),n=_base36To16(t.substring(4));n.length<40;)n="0"+n;n=getChecksumAddress("0x"+n)}else logger$q.throwArgumentError("invalid address","address",t);return n}function isAddress(t){try{return getAddress$1(t),!0}catch{}return!1}function getIcapAddress(t){let n=_base16To36(getAddress$1(t).substring(2)).toUpperCase();for(;n.length<30;)n="0"+n;return"XE"+ibanChecksum("XE00"+n)+n}function getContractAddress(t){let n=null;try{n=getAddress$1(t.from)}catch{logger$q.throwArgumentError("missing from address","transaction",t)}const c=stripZeros(arrayify(BigNumber$1.from(t.nonce).toHexString()));return getAddress$1(hexDataSlice(keccak256$1(encode$6([n,c])),12))}function getCreate2Address(t,n,c){return hexDataLength(n)!==32&&logger$q.throwArgumentError("salt must be 32 bytes","salt",n),hexDataLength(c)!==32&&logger$q.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",c),getAddress$1(hexDataSlice(keccak256$1(concat$1(["0xff",getAddress$1(t),n,c])),12))}const lib_esm$f=Object.freeze(Object.defineProperty({__proto__:null,getAddress:getAddress$1,getContractAddress,getCreate2Address,getIcapAddress,isAddress},Symbol.toStringTag,{value:"Module"}));class AddressCoder extends Coder{constructor(n){super("address","address",n,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(n,c){try{c=getAddress$1(c)}catch(ie){this._throwError(ie.message,c)}return n.writeValue(c)}decode(n){return getAddress$1(hexZeroPad(n.readValue().toHexString(),20))}}class AnonymousCoder extends Coder{constructor(n){super(n.name,n.type,void 0,n.dynamic),this.coder=n}defaultValue(){return this.coder.defaultValue()}encode(n,c){return this.coder.encode(n,c)}decode(n){return this.coder.decode(n)}}const logger$p=new Logger$1(version$q);function pack$1(t,n,c){let ie=null;if(Array.isArray(c))ie=c;else if(c&&typeof c=="object"){let pe={};ie=n.map(ge=>{const be=ge.localName;return be||logger$p.throwError("cannot encode object for signature with missing names",Logger$1.errors.INVALID_ARGUMENT,{argument:"values",coder:ge,value:c}),pe[be]&&logger$p.throwError("cannot encode object for signature with duplicate names",Logger$1.errors.INVALID_ARGUMENT,{argument:"values",coder:ge,value:c}),pe[be]=!0,c[be]})}else logger$p.throwArgumentError("invalid tuple value","tuple",c);n.length!==ie.length&&logger$p.throwArgumentError("types/value length mismatch","tuple",c);let se=new Writer(t.wordSize),ae=new Writer(t.wordSize),de=[];n.forEach((pe,ge)=>{let be=ie[ge];if(pe.dynamic){let _e=ae.length;pe.encode(ae,be);let we=se.writeUpdatableValue();de.push(qe=>{we(qe+_e)})}else pe.encode(se,be)}),de.forEach(pe=>{pe(se.length)});let ue=t.appendWriter(se);return ue+=t.appendWriter(ae),ue}function unpack(t,n){let c=[],ie=t.subReader(0);n.forEach(ae=>{let de=null;if(ae.dynamic){let ue=t.readValue(),pe=ie.subReader(ue.toNumber());try{de=ae.decode(pe)}catch(ge){if(ge.code===Logger$1.errors.BUFFER_OVERRUN)throw ge;de=ge,de.baseType=ae.name,de.name=ae.localName,de.type=ae.type}}else try{de=ae.decode(t)}catch(ue){if(ue.code===Logger$1.errors.BUFFER_OVERRUN)throw ue;de=ue,de.baseType=ae.name,de.name=ae.localName,de.type=ae.type}de!=null&&c.push(de)});const se=n.reduce((ae,de)=>{const ue=de.localName;return ue&&(ae[ue]||(ae[ue]=0),ae[ue]++),ae},{});n.forEach((ae,de)=>{let ue=ae.localName;if(!ue||se[ue]!==1||(ue==="length"&&(ue="_length"),c[ue]!=null))return;const pe=c[de];pe instanceof Error?Object.defineProperty(c,ue,{enumerable:!0,get:()=>{throw pe}}):c[ue]=pe});for(let ae=0;ae<c.length;ae++){const de=c[ae];de instanceof Error&&Object.defineProperty(c,ae,{enumerable:!0,get:()=>{throw de}})}return Object.freeze(c)}class ArrayCoder extends Coder{constructor(n,c,ie){const se=n.type+"["+(c>=0?c:"")+"]",ae=c===-1||n.dynamic;super("array",se,ie,ae),this.coder=n,this.length=c}defaultValue(){const n=this.coder.defaultValue(),c=[];for(let ie=0;ie<this.length;ie++)c.push(n);return c}encode(n,c){Array.isArray(c)||this._throwError("expected array value",c);let ie=this.length;ie===-1&&(ie=c.length,n.writeValue(c.length)),logger$p.checkArgumentCount(c.length,ie,"coder array"+(this.localName?" "+this.localName:""));let se=[];for(let ae=0;ae<c.length;ae++)se.push(this.coder);return pack$1(n,se,c)}decode(n){let c=this.length;c===-1&&(c=n.readValue().toNumber(),c*32>n._data.length&&logger$p.throwError("insufficient data length",Logger$1.errors.BUFFER_OVERRUN,{length:n._data.length,count:c}));let ie=[];for(let se=0;se<c;se++)ie.push(new AnonymousCoder(this.coder));return n.coerce(this.name,unpack(n,ie))}}class BooleanCoder extends Coder{constructor(n){super("bool","bool",n,!1)}defaultValue(){return!1}encode(n,c){return n.writeValue(c?1:0)}decode(n){return n.coerce(this.type,!n.readValue().isZero())}}class DynamicBytesCoder extends Coder{constructor(n,c){super(n,n,c,!0)}defaultValue(){return"0x"}encode(n,c){c=arrayify(c);let ie=n.writeValue(c.length);return ie+=n.writeBytes(c),ie}decode(n){return n.readBytes(n.readValue().toNumber(),!0)}}class BytesCoder extends DynamicBytesCoder{constructor(n){super("bytes",n)}decode(n){return n.coerce(this.name,hexlify$1(super.decode(n)))}}class FixedBytesCoder extends Coder{constructor(n,c){let ie="bytes"+String(n);super(ie,ie,c,!1),this.size=n}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(n,c){let ie=arrayify(c);return ie.length!==this.size&&this._throwError("incorrect data length",c),n.writeBytes(ie)}decode(n){return n.coerce(this.name,hexlify$1(n.readBytes(this.size)))}}class NullCoder extends Coder{constructor(n){super("null","",n,!1)}defaultValue(){return null}encode(n,c){return c!=null&&this._throwError("not null",c),n.writeBytes([])}decode(n){return n.readBytes(0),n.coerce(this.name,null)}}const AddressZero="0x0000000000000000000000000000000000000000",NegativeOne$1=BigNumber$1.from(-1),Zero$1=BigNumber$1.from(0),One$1=BigNumber$1.from(1),MaxUint256$1=BigNumber$1.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),HashZero="0x0000000000000000000000000000000000000000000000000000000000000000";class NumberCoder extends Coder{constructor(n,c,ie){const se=(c?"int":"uint")+n*8;super(se,se,ie,!1),this.size=n,this.signed=c}defaultValue(){return 0}encode(n,c){let ie=BigNumber$1.from(c),se=MaxUint256$1.mask(n.wordSize*8);if(this.signed){let ae=se.mask(this.size*8-1);(ie.gt(ae)||ie.lt(ae.add(One$1).mul(NegativeOne$1)))&&this._throwError("value out-of-bounds",c)}else(ie.lt(Zero$1)||ie.gt(se.mask(this.size*8)))&&this._throwError("value out-of-bounds",c);return ie=ie.toTwos(this.size*8).mask(this.size*8),this.signed&&(ie=ie.fromTwos(this.size*8).toTwos(8*n.wordSize)),n.writeValue(ie)}decode(n){let c=n.readValue().mask(this.size*8);return this.signed&&(c=c.fromTwos(this.size*8)),n.coerce(this.name,c)}}const version$n="strings/5.8.0",logger$o=new Logger$1(version$n);var UnicodeNormalizationForm;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(UnicodeNormalizationForm||(UnicodeNormalizationForm={}));var Utf8ErrorReason;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"})(Utf8ErrorReason||(Utf8ErrorReason={}));function errorFunc(t,n,c,ie,se){return logger$o.throwArgumentError(`invalid codepoint at offset ${n}; ${t}`,"bytes",c)}function ignoreFunc(t,n,c,ie,se){if(t===Utf8ErrorReason.BAD_PREFIX||t===Utf8ErrorReason.UNEXPECTED_CONTINUE){let ae=0;for(let de=n+1;de<c.length&&c[de]>>6===2;de++)ae++;return ae}return t===Utf8ErrorReason.OVERRUN?c.length-n-1:0}function replaceFunc(t,n,c,ie,se){return t===Utf8ErrorReason.OVERLONG?(ie.push(se),0):(ie.push(65533),ignoreFunc(t,n,c))}const Utf8ErrorFuncs=Object.freeze({error:errorFunc,ignore:ignoreFunc,replace:replaceFunc});function getUtf8CodePoints(t,n){n==null&&(n=Utf8ErrorFuncs.error),t=arrayify(t);const c=[];let ie=0;for(;ie<t.length;){const se=t[ie++];if(!(se>>7)){c.push(se);continue}let ae=null,de=null;if((se&224)===192)ae=1,de=127;else if((se&240)===224)ae=2,de=2047;else if((se&248)===240)ae=3,de=65535;else{(se&192)===128?ie+=n(Utf8ErrorReason.UNEXPECTED_CONTINUE,ie-1,t,c):ie+=n(Utf8ErrorReason.BAD_PREFIX,ie-1,t,c);continue}if(ie-1+ae>=t.length){ie+=n(Utf8ErrorReason.OVERRUN,ie-1,t,c);continue}let ue=se&(1<<8-ae-1)-1;for(let pe=0;pe<ae;pe++){let ge=t[ie];if((ge&192)!=128){ie+=n(Utf8ErrorReason.MISSING_CONTINUE,ie,t,c),ue=null;break}ue=ue<<6|ge&63,ie++}if(ue!==null){if(ue>1114111){ie+=n(Utf8ErrorReason.OUT_OF_RANGE,ie-1-ae,t,c,ue);continue}if(ue>=55296&&ue<=57343){ie+=n(Utf8ErrorReason.UTF16_SURROGATE,ie-1-ae,t,c,ue);continue}if(ue<=de){ie+=n(Utf8ErrorReason.OVERLONG,ie-1-ae,t,c,ue);continue}c.push(ue)}}return c}function toUtf8Bytes(t,n=UnicodeNormalizationForm.current){n!=UnicodeNormalizationForm.current&&(logger$o.checkNormalize(),t=t.normalize(n));let c=[];for(let ie=0;ie<t.length;ie++){const se=t.charCodeAt(ie);if(se<128)c.push(se);else if(se<2048)c.push(se>>6|192),c.push(se&63|128);else if((se&64512)==55296){ie++;const ae=t.charCodeAt(ie);if(ie>=t.length||(ae&64512)!==56320)throw new Error("invalid utf-8 string");const de=65536+((se&1023)<<10)+(ae&1023);c.push(de>>18|240),c.push(de>>12&63|128),c.push(de>>6&63|128),c.push(de&63|128)}else c.push(se>>12|224),c.push(se>>6&63|128),c.push(se&63|128)}return arrayify(c)}function escapeChar(t){const n="0000"+t.toString(16);return"\\u"+n.substring(n.length-4)}function _toEscapedUtf8String(t,n){return'"'+getUtf8CodePoints(t,n).map(c=>{if(c<256){switch(c){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(c>=32&&c<127)return String.fromCharCode(c)}return c<=65535?escapeChar(c):(c-=65536,escapeChar((c>>10&1023)+55296)+escapeChar((c&1023)+56320))}).join("")+'"'}function _toUtf8String(t){return t.map(n=>n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10&1023)+55296,(n&1023)+56320))).join("")}function toUtf8String(t,n){return _toUtf8String(getUtf8CodePoints(t,n))}function toUtf8CodePoints(t,n=UnicodeNormalizationForm.current){return getUtf8CodePoints(toUtf8Bytes(t,n))}function formatBytes32String(t){const n=toUtf8Bytes(t);if(n.length>31)throw new Error("bytes32 string must be less than 32 bytes");return hexlify$1(concat$1([n,HashZero]).slice(0,32))}function parseBytes32String(t){const n=arrayify(t);if(n.length!==32)throw new Error("invalid bytes32 - not 32 bytes long");if(n[31]!==0)throw new Error("invalid bytes32 string - no null terminator");let c=31;for(;n[c-1]===0;)c--;return toUtf8String(n.slice(0,c))}function bytes2(t){if(t.length%4!==0)throw new Error("bad data");let n=[];for(let c=0;c<t.length;c+=4)n.push(parseInt(t.substring(c,c+4),16));return n}function createTable(t,n){n||(n=function(se){return[parseInt(se,16)]});let c=0,ie={};return t.split(",").forEach(se=>{let ae=se.split(":");c+=parseInt(ae[0],16),ie[c]=n(ae[1])}),ie}function createRangeTable(t){let n=0;return t.split(",").map(c=>{let ie=c.split("-");ie.length===1?ie[1]="0":ie[1]===""&&(ie[1]="1");let se=n+parseInt(ie[0],16);return n=parseInt(ie[1],16),{l:se,h:n}})}function matchMap(t,n){let c=0;for(let ie=0;ie<n.length;ie++){let se=n[ie];if(c+=se.l,t>=c&&t<=c+se.h&&(t-c)%(se.d||1)===0){if(se.e&&se.e.indexOf(t-c)!==-1)continue;return se}}return null}const Table_A_1_ranges=createRangeTable("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),Table_B_1_flags="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(t=>parseInt(t,16)),Table_B_2_ranges=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],Table_B_2_lut_abs=createTable("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),Table_B_2_lut_rel=createTable("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),Table_B_2_complex=createTable("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",bytes2),Table_C_ranges=createRangeTable("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function flatten(t){return t.reduce((n,c)=>(c.forEach(ie=>{n.push(ie)}),n),[])}function _nameprepTableA1(t){return!!matchMap(t,Table_A_1_ranges)}function _nameprepTableB2(t){let n=matchMap(t,Table_B_2_ranges);if(n)return[t+n.s];let c=Table_B_2_lut_abs[t];if(c)return c;let ie=Table_B_2_lut_rel[t];return ie?[t+ie[0]]:Table_B_2_complex[t]||null}function _nameprepTableC(t){return!!matchMap(t,Table_C_ranges)}function nameprep(t){if(t.match(/^[a-z0-9-]*$/i)&&t.length<=59)return t.toLowerCase();let n=toUtf8CodePoints(t);n=flatten(n.map(ie=>Table_B_1_flags.indexOf(ie)>=0?[]:ie>=65024&&ie<=65039?[]:_nameprepTableB2(ie)||[ie])),n=toUtf8CodePoints(_toUtf8String(n),UnicodeNormalizationForm.NFKC),n.forEach(ie=>{if(_nameprepTableC(ie))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")}),n.forEach(ie=>{if(_nameprepTableA1(ie))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")});let c=_toUtf8String(n);if(c.substring(0,1)==="-"||c.substring(2,4)==="--"||c.substring(c.length-1)==="-")throw new Error("invalid hyphen");return c}const lib_esm$e=Object.freeze(Object.defineProperty({__proto__:null,get UnicodeNormalizationForm(){return UnicodeNormalizationForm},Utf8ErrorFuncs,get Utf8ErrorReason(){return Utf8ErrorReason},_toEscapedUtf8String,formatBytes32String,nameprep,parseBytes32String,toUtf8Bytes,toUtf8CodePoints,toUtf8String},Symbol.toStringTag,{value:"Module"}));class StringCoder extends DynamicBytesCoder{constructor(n){super("string",n)}defaultValue(){return""}encode(n,c){return super.encode(n,toUtf8Bytes(c))}decode(n){return toUtf8String(super.decode(n))}}class TupleCoder extends Coder{constructor(n,c){let ie=!1;const se=[];n.forEach(de=>{de.dynamic&&(ie=!0),se.push(de.type)});const ae="tuple("+se.join(",")+")";super("tuple",ae,c,ie),this.coders=n}defaultValue(){const n=[];this.coders.forEach(ie=>{n.push(ie.defaultValue())});const c=this.coders.reduce((ie,se)=>{const ae=se.localName;return ae&&(ie[ae]||(ie[ae]=0),ie[ae]++),ie},{});return this.coders.forEach((ie,se)=>{let ae=ie.localName;!ae||c[ae]!==1||(ae==="length"&&(ae="_length"),n[ae]==null&&(n[ae]=n[se]))}),Object.freeze(n)}encode(n,c){return pack$1(n,this.coders,c)}decode(n){return n.coerce(this.name,unpack(n,this.coders))}}const logger$n=new Logger$1(version$q),paramTypeBytes=new RegExp(/^bytes([0-9]*)$/),paramTypeNumber=new RegExp(/^(u?int)([0-9]*)$/);class AbiCoder{constructor(n){defineReadOnly(this,"coerceFunc",n||null)}_getCoder(n){switch(n.baseType){case"address":return new AddressCoder(n.name);case"bool":return new BooleanCoder(n.name);case"string":return new StringCoder(n.name);case"bytes":return new BytesCoder(n.name);case"array":return new ArrayCoder(this._getCoder(n.arrayChildren),n.arrayLength,n.name);case"tuple":return new TupleCoder((n.components||[]).map(ie=>this._getCoder(ie)),n.name);case"":return new NullCoder(n.name)}let c=n.type.match(paramTypeNumber);if(c){let ie=parseInt(c[2]||"256");return(ie===0||ie>256||ie%8!==0)&&logger$n.throwArgumentError("invalid "+c[1]+" bit length","param",n),new NumberCoder(ie/8,c[1]==="int",n.name)}if(c=n.type.match(paramTypeBytes),c){let ie=parseInt(c[1]);return(ie===0||ie>32)&&logger$n.throwArgumentError("invalid bytes length","param",n),new FixedBytesCoder(ie,n.name)}return logger$n.throwArgumentError("invalid type","type",n.type)}_getWordSize(){return 32}_getReader(n,c){return new Reader(n,this._getWordSize(),this.coerceFunc,c)}_getWriter(){return new Writer(this._getWordSize())}getDefaultValue(n){const c=n.map(ie=>this._getCoder(ParamType.from(ie)));return new TupleCoder(c,"_").defaultValue()}encode(n,c){n.length!==c.length&&logger$n.throwError("types/values length mismatch",Logger$1.errors.INVALID_ARGUMENT,{count:{types:n.length,values:c.length},value:{types:n,values:c}});const ie=n.map(de=>this._getCoder(ParamType.from(de))),se=new TupleCoder(ie,"_"),ae=this._getWriter();return se.encode(ae,c),ae.data}decode(n,c,ie){const se=n.map(ae=>this._getCoder(ParamType.from(ae)));return new TupleCoder(se,"_").decode(this._getReader(arrayify(c),ie))}}const defaultAbiCoder=new AbiCoder;function id$1(t){return keccak256$1(toUtf8Bytes(t))}const version$m="hash/5.8.0";function decode$6(t){t=atob(t);const n=[];for(let c=0;c<t.length;c++)n.push(t.charCodeAt(c));return arrayify(n)}function encode$5(t){t=arrayify(t);let n="";for(let c=0;c<t.length;c++)n+=String.fromCharCode(t[c]);return btoa(n)}const lib_esm$d=Object.freeze(Object.defineProperty({__proto__:null,decode:decode$6,encode:encode$5},Symbol.toStringTag,{value:"Module"}));function flat(t,n){n==null&&(n=1);const c=[],ie=c.forEach,se=function(ae,de){ie.call(ae,function(ue){de>0&&Array.isArray(ue)?se(ue,de-1):c.push(ue)})};return se(t,n),c}function fromEntries(t){const n={};for(let c=0;c<t.length;c++){const ie=t[c];n[ie[0]]=ie[1]}return n}function decode_arithmetic(t){let n=0;function c(){return t[n++]<<8|t[n++]}let ie=c(),se=1,ae=[0,1];for(let $e=1;$e<ie;$e++)ae.push(se+=c());let de=c(),ue=n;n+=de;let pe=0,ge=0;function be(){return pe==0&&(ge=ge<<8|t[n++],pe=8),ge>>--pe&1}const _e=31,we=Math.pow(2,_e),qe=we>>>1,Ye=qe>>1,Ge=we-1;let Ze=0;for(let $e=0;$e<_e;$e++)Ze=Ze<<1|be();let He=[],Ht=0,un=we;for(;;){let $e=Math.floor(((Ze-Ht+1)*se-1)/un),me=0,Gt=ie;for(;Gt-me>1;){let jt=me+Gt>>>1;$e<ae[jt]?Gt=jt:me=jt}if(me==0)break;He.push(me);let mn=Ht+Math.floor(un*ae[me]/se),dn=Ht+Math.floor(un*ae[me+1]/se)-1;for(;!((mn^dn)&qe);)Ze=Ze<<1&Ge|be(),mn=mn<<1&Ge,dn=dn<<1&Ge|1;for(;mn&~dn&Ye;)Ze=Ze&qe|Ze<<1&Ge>>>1|be(),mn=mn<<1^qe,dn=(dn^qe)<<1|qe|1;Ht=mn,un=1+dn-mn}let De=ie-4;return He.map($e=>{switch($e-De){case 3:return De+65792+(t[ue++]<<16|t[ue++]<<8|t[ue++]);case 2:return De+256+(t[ue++]<<8|t[ue++]);case 1:return De+t[ue++];default:return $e-1}})}function read_payload(t){let n=0;return()=>t[n++]}function read_compressed_payload(t){return read_payload(decode_arithmetic(t))}function signed(t){return t&1?~t>>1:t>>1}function read_counts(t,n){let c=Array(t);for(let ie=0;ie<t;ie++)c[ie]=1+n();return c}function read_ascending(t,n){let c=Array(t);for(let ie=0,se=-1;ie<t;ie++)c[ie]=se+=1+n();return c}function read_deltas(t,n){let c=Array(t);for(let ie=0,se=0;ie<t;ie++)c[ie]=se+=signed(n());return c}function read_member_array(t,n){let c=read_ascending(t(),t),ie=t(),se=read_ascending(ie,t),ae=read_counts(ie,t);for(let de=0;de<ie;de++)for(let ue=0;ue<ae[de];ue++)c.push(se[de]+ue);return n?c.map(de=>n[de]):c}function read_mapped_map(t){let n=[];for(;;){let c=t();if(c==0)break;n.push(read_linear_table(c,t))}for(;;){let c=t()-1;if(c<0)break;n.push(read_replacement_table(c,t))}return fromEntries(flat(n))}function read_zero_terminated_array(t){let n=[];for(;;){let c=t();if(c==0)break;n.push(c)}return n}function read_transposed(t,n,c){let ie=Array(t).fill(void 0).map(()=>[]);for(let se=0;se<n;se++)read_deltas(t,c).forEach((ae,de)=>ie[de].push(ae));return ie}function read_linear_table(t,n){let c=1+n(),ie=n(),se=read_zero_terminated_array(n),ae=read_transposed(se.length,1+t,n);return flat(ae.map((de,ue)=>{const pe=de[0],ge=de.slice(1);return Array(se[ue]).fill(void 0).map((be,_e)=>{let we=_e*ie;return[pe+_e*c,ge.map(qe=>qe+we)]})}))}function read_replacement_table(t,n){let c=1+n();return read_transposed(c,1+t,n).map(ie=>[ie[0],ie.slice(1)])}function read_emoji_trie(t){let n=read_member_array(t).sort((ie,se)=>ie-se);return c();function c(){let ie=[];for(;;){let ge=read_member_array(t,n);if(ge.length==0)break;ie.push({set:new Set(ge),node:c()})}ie.sort((ge,be)=>be.set.size-ge.set.size);let se=t(),ae=se%3;se=se/3|0;let de=!!(se&1);se>>=1;let ue=se==1,pe=se==2;return{branches:ie,valid:ae,fe0f:de,save:ue,check:pe}}}function getData(){return read_compressed_payload(decode$6("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const r$2=getData(),VALID=new Set(read_member_array(r$2)),IGNORED=new Set(read_member_array(r$2)),MAPPED=read_mapped_map(r$2),EMOJI_ROOT=read_emoji_trie(r$2),HYPHEN=45,UNDERSCORE=95;function explode_cp(t){return toUtf8CodePoints(t)}function filter_fe0f(t){return t.filter(n=>n!=65039)}function ens_normalize_post_check(t){for(let n of t.split(".")){let c=explode_cp(n);try{for(let ie=c.lastIndexOf(UNDERSCORE)-1;ie>=0;ie--)if(c[ie]!==UNDERSCORE)throw new Error("underscore only allowed at start");if(c.length>=4&&c.every(ie=>ie<128)&&c[2]===HYPHEN&&c[3]===HYPHEN)throw new Error("invalid label extension")}catch(ie){throw new Error(`Invalid label "${n}": ${ie.message}`)}}return t}function ens_normalize(t){return ens_normalize_post_check(normalize(t,filter_fe0f))}function normalize(t,n){let c=explode_cp(t).reverse(),ie=[];for(;c.length;){let se=consume_emoji_reversed(c);if(se){ie.push(...n(se));continue}let ae=c.pop();if(VALID.has(ae)){ie.push(ae);continue}if(IGNORED.has(ae))continue;let de=MAPPED[ae];if(de){ie.push(...de);continue}throw new Error(`Disallowed codepoint: 0x${ae.toString(16).toUpperCase()}`)}return ens_normalize_post_check(nfc(String.fromCodePoint(...ie)))}function nfc(t){return t.normalize("NFC")}function consume_emoji_reversed(t,n){var c;let ie=EMOJI_ROOT,se,ae,de=[],ue=t.length;for(;ue;){let pe=t[--ue];if(ie=(c=ie.branches.find(ge=>ge.set.has(pe)))===null||c===void 0?void 0:c.node,!ie)break;if(ie.save)ae=pe;else if(ie.check&&pe===ae)break;de.push(pe),ie.fe0f&&(de.push(65039),ue>0&&t[ue-1]==65039&&ue--),ie.valid&&(se=de.slice(),ie.valid==2&&se.splice(1,1),t.length=ue)}return se}const logger$m=new Logger$1(version$m),Zeros$1=new Uint8Array(32);Zeros$1.fill(0);function checkComponent(t){if(t.length===0)throw new Error("invalid ENS name; empty component");return t}function ensNameSplit(t){const n=toUtf8Bytes(ens_normalize(t)),c=[];if(t.length===0)return c;let ie=0;for(let se=0;se<n.length;se++)n[se]===46&&(c.push(checkComponent(n.slice(ie,se))),ie=se+1);if(ie>=n.length)throw new Error("invalid ENS name; empty component");return c.push(checkComponent(n.slice(ie))),c}function ensNormalize(t){return ensNameSplit(t).map(n=>toUtf8String(n)).join(".")}function isValidName(t){try{return ensNameSplit(t).length!==0}catch{}return!1}function namehash$1(t){typeof t!="string"&&logger$m.throwArgumentError("invalid ENS name; not a string","name",t);let n=Zeros$1;const c=ensNameSplit(t);for(;c.length;)n=keccak256$1(concat$1([n,keccak256$1(c.pop())]));return hexlify$1(n)}function dnsEncode(t){return hexlify$1(concat$1(ensNameSplit(t).map(n=>{if(n.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const c=new Uint8Array(n.length+1);return c.set(n,1),c[0]=c.length-1,c})))+"00"}const messagePrefix=`Ethereum Signed Message:
|
|
23
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),c.useMemoCache(n)}})()),Ce}var Le;function Xe(){return Le||(Le=1,process.env.NODE_ENV==="production"?fe.exports=Ue():fe.exports=Ke()),fe.exports}var $$3=Xe();const Je=t=>{const n=$$3.c(5);let c;n[0]!==t?({...c}=t,n[0]=t,n[1]=c):c=n[1];let ie;n[2]===Symbol.for("react.memo_cache_sentinel")?(ie=jsxRuntimeExports.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),n[2]=ie):ie=n[2];let se;return n[3]!==c?(se=jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...c,children:ie}),n[3]=c,n[4]=se):se=n[4],se},Qe=t=>{const n=$$3.c(5);let c;n[0]!==t?({...c}=t,n[0]=t,n[1]=c):c=n[1];let ie;n[2]===Symbol.for("react.memo_cache_sentinel")?(ie=jsxRuntimeExports.jsx("path",{d:"M6 12L10 8L6 4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),n[2]=ie):ie=n[2];let se;return n[3]!==c?(se=jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...c,children:ie}),n[3]=c,n[4]=se):se=n[4],se},X$3={primary:{bg:"primary.main",borderColor:"primary.main",color:"text.inverse",_hover:{bg:"primary.hover"},_active:{bg:"primary.hover"}},outlined:{bg:"neutral.bgLight",borderColor:"neutral.30",color:"text.main",_hover:{bg:"neutral.10"},_active:{bg:"neutral.30"}},filled:{bg:"neutral.10",borderColor:"transparent",color:"text.main",_hover:{bg:"neutral.30"},_active:{bg:"neutral.50"}},muted:{bg:"primary.tint10",borderColor:"primary.tint10",color:"primary.main",_hover:{bg:"primary.tint20",borderColor:"primary.tint20"},_active:{bg:"primary.main"}},transparent:{bg:"transparent",borderColor:"transparent",color:"text.main",_hover:{bg:"neutral.10"},_active:{bg:"neutral.30"}},information:{bg:"state.info.tint10",borderColor:"state.info.tint10",color:"state.info.main",_hover:{bg:"state.info.tint20",borderColor:"state.info.tint20"},_active:{bg:"state.info.main"}},success:{bg:"state.success.tint10",borderColor:"state.success.tint10",color:"state.success.main",_hover:{bg:"state.success.tint20",borderColor:"state.success.tint20"},_active:{bg:"state.success.main"}},warning:{bg:"state.warning.tint10",borderColor:"state.warning.tint10",color:"state.warning.main",_hover:{bg:"state.warning.tint20",borderColor:"state.warning.tint20"},_active:{bg:"state.warning.main"}},error:{bg:"state.error.tint10",borderColor:"state.error.tint10",color:"state.error.main",_hover:{bg:"state.error.tint20",borderColor:"state.error.tint20"},_active:{bg:"state.error.main"}},disabled:{bg:"neutral.10",borderColor:"transparent",color:"text.disabled",_hover:{bg:"neutral.10"},_active:{bg:"neutral.10"}}};function et$2(t,n,c){return{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",borderRadius:"dynamic.xs",bg:c.bg,borderWidth:"1px",borderStyle:"solid",borderColor:c.borderColor,color:c.color,cursor:n?"pointer":t==="disabled"?"not-allowed":"default",opacity:t==="disabled"?.6:1,userSelect:"none",whiteSpace:"nowrap",fontFamily:"Inter, sans-serif",textStyle:"body3Regular",height:"24px"}}function oe$1(t){const n=$$3.c(26);let c,ie,se,ae,de,ue,pe,ge;n[0]!==t?({label:de,showLeftIcon:ue,showRightIcon:pe,leftIcon:c,rightIcon:ae,variant:ge,onClick:ie,...se}=t,n[0]=t,n[1]=c,n[2]=ie,n[3]=se,n[4]=ae,n[5]=de,n[6]=ue,n[7]=pe,n[8]=ge):(c=n[1],ie=n[2],se=n[3],ae=n[4],de=n[5],ue=n[6],pe=n[7],ge=n[8]);const be=de===void 0?"24":de,_e=ue===void 0?!1:ue,we=pe===void 0?!1:pe,qe=ge===void 0?"outlined":ge,Ye=X$3[qe];let Ge;n[9]!==ie||n[10]!==qe||n[11]!==Ye?(Ge=et$2(qe,ie,Ye),n[9]=ie,n[10]=qe,n[11]=Ye,n[12]=Ge):Ge=n[12];const Ze=Ge,He=qe!=="disabled"?ie:void 0;let Ht;n[13]!==c||n[14]!==_e?(Ht=_e&&jsxRuntimeExports.jsx(Box,{display:"flex",flexShrink:0,children:c||jsxRuntimeExports.jsx(Icon,{as:Je})}),n[13]=c,n[14]=_e,n[15]=Ht):Ht=n[15];let un;n[16]!==ae||n[17]!==we?(un=we&&jsxRuntimeExports.jsx(Box,{display:"flex",flexShrink:0,children:ae||jsxRuntimeExports.jsx(Icon,{as:Qe})}),n[16]=ae,n[17]=we,n[18]=un):un=n[18];let De;return n[19]!==Ze||n[20]!==be||n[21]!==se||n[22]!==He||n[23]!==Ht||n[24]!==un?(De=jsxRuntimeExports.jsxs(Box,{onClick:He,...Ze,...se,children:[Ht,be,un]}),n[19]=Ze,n[20]=be,n[21]=se,n[22]=He,n[23]=Ht,n[24]=un,n[25]=De):De=n[25],De}function tt$2({state:t}){return{container:{display:"flex",flexDirection:"column",alignItems:"flex-start",padding:"12px 16px",borderRadius:"dynamic.md",borderWidth:"1px",borderStyle:"solid",width:"full",maxWidth:"368px",...(()=>{switch(t){case"information":return{bg:"state.info.tint10",borderColor:"state.info.tint10",color:"state.info.main"};case"success":return{bg:"state.success.tint10",borderColor:"state.success.tint10",color:"state.success.main"};case"warning":return{bg:"state.warning.tint10",borderColor:"state.warning.tint10",color:"state.warning.main"};case"error":return{bg:"state.error.tint10",borderColor:"state.error.tint10",color:"state.error.main"};default:return{bg:"neutral.10",borderColor:"neutral.30",color:"text.main"}}})()},text:{textStyle:"body3Regular",color:"inherit"}}}function pn(t){const n=$$3.c(8),{state:c,message:ie}=t,se=c===void 0?"neutral":c;let ae;n[0]!==se?(ae=tt$2({state:se}),n[0]=se,n[1]=ae):ae=n[1];const de=ae;let ue;n[2]!==ie||n[3]!==de.text?(ue=jsxRuntimeExports.jsx(Text,{...de.text,children:ie}),n[2]=ie,n[3]=de.text,n[4]=ue):ue=n[4];let pe;return n[5]!==de.container||n[6]!==ue?(pe=jsxRuntimeExports.jsx(Box,{...de.container,children:ue}),n[5]=de.container,n[6]=ue,n[7]=pe):pe=n[7],pe}function nt$2(t,n,c,ie){return{padding:t==="text"?"8px 16px":"8px",gap:"8px",borderRadius:"dynamic.md",bg:c&&n==="transparent"?void 0:ie.bg,borderWidth:"1px",borderStyle:"solid",borderColor:ie.borderColor,textStyle:"body2Regular",color:ie.color,opacity:c||n==="disabled"?.6:1,cursor:c||n==="disabled"?"not-allowed":"pointer",width:t==="icon"?"40px":void 0,height:t==="icon"?"40px":void 0,minW:t==="text"?"96px":void 0,_hover:ie._hover,_active:ie._active}}function ee$1(t){const n=$$3.c(31);let c,ie,se,ae,de,ue,pe,ge;n[0]!==t?({children:c,leftIcon:se,rightIcon:de,icon:ie,variant:ue,buttonType:pe,disabled:ge,...ae}=t,n[0]=t,n[1]=c,n[2]=ie,n[3]=se,n[4]=ae,n[5]=de,n[6]=ue,n[7]=pe,n[8]=ge):(c=n[1],ie=n[2],se=n[3],ae=n[4],de=n[5],ue=n[6],pe=n[7],ge=n[8]);const be=ue===void 0?"outlined":ue,_e=pe===void 0?"text":pe,we=ge===void 0?!1:ge,qe=X$3[we?"disabled":be];let Ye;n[9]!==_e||n[10]!==we||n[11]!==be||n[12]!==qe?(Ye=nt$2(_e,be,we,qe),n[9]=_e,n[10]=we,n[11]=be,n[12]=qe,n[13]=Ye):Ye=n[13];const Ge=Ye,Ze=we||be==="disabled";let He;n[14]!==_e||n[15]!==se?(He=_e==="text"&&se&&jsxRuntimeExports.jsx(Icon,{as:se}),n[14]=_e,n[15]=se,n[16]=He):He=n[16];const Ht=_e==="text"&&c;let un;n[17]!==_e||n[18]!==ie?(un=_e==="icon"&&ie&&jsxRuntimeExports.jsx(Icon,{as:ie}),n[17]=_e,n[18]=ie,n[19]=un):un=n[19];let De;n[20]!==_e||n[21]!==de?(De=_e==="text"&&de&&jsxRuntimeExports.jsx(Icon,{as:de}),n[20]=_e,n[21]=de,n[22]=De):De=n[22];let $e;return n[23]!==Ge||n[24]!==ae||n[25]!==Ze||n[26]!==He||n[27]!==Ht||n[28]!==un||n[29]!==De?($e=jsxRuntimeExports.jsxs(Button$1,{disabled:Ze,...Ge,...ae,children:[He,Ht,un,De]}),n[23]=Ge,n[24]=ae,n[25]=Ze,n[26]=He,n[27]=Ht,n[28]=un,n[29]=De,n[30]=$e):$e=n[30],$e}const Re="outlined";function ot$2(t){return t?t==="secondary"?"filled":t==="image"?Re:t:Re}function it$2(t,n){const c=ot$2(n),ie=X$3[c],se=t==="image"||n==="image";return{container:{display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"dynamic.md",width:"40px",height:"40px",padding:se?0:"8px",bg:se?"neutral.bgLight":n==="outlined"?"transparent":ie.bg,borderWidth:"1px",borderStyle:"solid",borderColor:se?"neutral.30":ie.borderColor},icon:{color:ie.color,width:"24px",height:"24px"},text:{textStyle:"body2Regular",color:ie.color},image:{width:"100%",height:"100%",objectFit:"contain",borderRadius:"dynamic.md"}}}function te$1(t){const n=$$3.c(21),{type:c,variant:ie,icon:se,text:ae,imageSrc:de,imageAlt:ue}=t,pe=c===void 0?"icon":c,ge=ie===void 0?"outlined":ie,be=ue===void 0?"":ue;let _e;n[0]!==pe||n[1]!==ge?(_e=it$2(pe,ge),n[0]=pe,n[1]=ge,n[2]=_e):_e=n[2];const we=_e;let qe;n[3]!==se||n[4]!==we.icon||n[5]!==pe?(qe=pe==="icon"&&se&&jsxRuntimeExports.jsx(Icon,{as:se,...we.icon}),n[3]=se,n[4]=we.icon,n[5]=pe,n[6]=qe):qe=n[6];let Ye;n[7]!==we.text||n[8]!==ae||n[9]!==pe?(Ye=pe==="text"&&ae&&jsxRuntimeExports.jsx(Box,{...we.text,children:ae}),n[7]=we.text,n[8]=ae,n[9]=pe,n[10]=Ye):Ye=n[10];let Ge;n[11]!==be||n[12]!==de||n[13]!==we.image||n[14]!==pe?(Ge=pe==="image"&&de&&jsxRuntimeExports.jsx(Image,{src:de,alt:be,...we.image}),n[11]=be,n[12]=de,n[13]=we.image,n[14]=pe,n[15]=Ge):Ge=n[15];let Ze;return n[16]!==we.container||n[17]!==qe||n[18]!==Ye||n[19]!==Ge?(Ze=jsxRuntimeExports.jsxs(Box,{...we.container,children:[qe,Ye,Ge]}),n[16]=we.container,n[17]=qe,n[18]=Ye,n[19]=Ge,n[20]=Ze):Ze=n[20],Ze}function fn(t){const n=$$3.c(24);let c,ie,se,ae,de,ue,pe;n[0]!==t?({title:ae,iconContainerProps:c,rightContent:se,showIcon:de,width:ue,gap:pe,...ie}=t,n[0]=t,n[1]=c,n[2]=ie,n[3]=se,n[4]=ae,n[5]=de,n[6]=ue,n[7]=pe):(c=n[1],ie=n[2],se=n[3],ae=n[4],de=n[5],ue=n[6],pe=n[7]);const ge=ae===void 0?"Title Here":ae,be=de===void 0?!0:de,_e=ue===void 0?"100%":ue,we=pe===void 0?"16px":pe;let qe;n[8]!==c||n[9]!==be?(qe=be&&jsxRuntimeExports.jsx(te$1,{...c}),n[8]=c,n[9]=be,n[10]=qe):qe=n[10];let Ye;n[11]!==ge?(Ye=jsxRuntimeExports.jsx(Text,{flex:"1",fontFamily:"Inter, sans-serif",textStyle:"body2Medium",color:"text.main",whiteSpace:"pre-wrap",width:"max-content",children:ge}),n[11]=ge,n[12]=Ye):Ye=n[12];let Ge;n[13]!==qe||n[14]!==Ye?(Ge=jsxRuntimeExports.jsxs(Flex,{flex:"1",gap:"12px",alignItems:"center",children:[qe,Ye]}),n[13]=qe,n[14]=Ye,n[15]=Ge):Ge=n[15];let Ze;n[16]!==se?(Ze=se&&jsxRuntimeExports.jsx(Flex,{gap:"12px",alignItems:"center",flexShrink:0,children:se}),n[16]=se,n[17]=Ze):Ze=n[17];let He;return n[18]!==we||n[19]!==ie||n[20]!==Ge||n[21]!==Ze||n[22]!==_e?(He=jsxRuntimeExports.jsxs(Flex,{width:_e,gap:we,alignItems:"flex-end",justifyContent:"start",...ie,children:[Ge,Ze]}),n[18]=we,n[19]=ie,n[20]=Ge,n[21]=Ze,n[22]=_e,n[23]=He):He=n[23],He}function he(t){const n=$$3.c(6);let c,ie;n[0]!==t?({children:c,...ie}=t,n[0]=t,n[1]=c,n[2]=ie):(c=n[1],ie=n[2]);let se;return n[3]!==c||n[4]!==ie?(se=jsxRuntimeExports.jsx(Flex,{flexDirection:"column",p:4,borderRadius:"dynamic.2xl",border:"1px solid",borderColor:"neutral.30",background:"neutral.bgLight",boxShadow:"0 4px 36px 0 rgba(0, 0, 0, 0.12)",...ie,children:c}),n[3]=c,n[4]=ie,n[5]=se):se=n[5],se}function rt$2({type:t="text",isSelected:n,isDisabled:c,isInvalid:ie}){const se=t==="icon";let ae=ie?"state.error.main":"text.main";n&&(ae=ie?"state.error.main":"primary.main"),c&&(ae="text.disabled");const de=ae;return{container:{display:"flex",alignItems:"center",gap:"8px",padding:se?"8px":"8px 12px",width:se?"auto":"100%",height:"40px",borderRadius:"dynamic.md",cursor:c?"not-allowed":"pointer",userSelect:"none",_hover:c?void 0:{bg:ie?"state.error.tint10":"primary.tint10"}},label:{flex:"1 0 0",textStyle:"body2Regular",color:ae,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},icon:{color:de,flexShrink:0},chips:{flexShrink:0},rightIcon:{color:de,flexShrink:0},checkbox:{flexShrink:0}}}function lt$2(t,n,c){return n?"disabled":c?"error":t?"muted":"outlined"}function st$2(t){const n=$$3.c(32),{leftIcon:c,type:ie,isSelected:se,isDisabled:ae,isInvalid:de,onClick:ue}=t,pe=ie===void 0?"text":ie,ge=se===void 0?!1:se,be=ae===void 0?!1:ae,_e=de===void 0?!1:de,we=pe!=="icon",qe=we?t:void 0,Ye=qe?.label,Ge=qe?.chipsLabel,Ze=qe?.rightContent;let He;n[0]!==be||n[1]!==_e||n[2]!==ge||n[3]!==pe?(He=rt$2({type:pe,isSelected:ge,isDisabled:be,isInvalid:_e}),n[0]=be,n[1]=_e,n[2]=ge,n[3]=pe,n[4]=He):He=n[4];const Ht=He;let un;n[5]!==be||n[6]!==_e||n[7]!==ge?(un=lt$2(ge,be,_e),n[5]=be,n[6]=_e,n[7]=ge,n[8]=un):un=n[8];const De=un,$e=we&&!!Ye,me=we&&!!Ge,Gt=be?void 0:ue;let mn;n[9]!==c||n[10]!==Ht.icon?(mn=c&&jsxRuntimeExports.jsx(Box,{...Ht.icon,children:jsxRuntimeExports.jsx(Icon,{as:c,boxSize:"24px",color:"currentColor"})}),n[9]=c,n[10]=Ht.icon,n[11]=mn):mn=n[11];let dn;n[12]!==Ye||n[13]!==$e||n[14]!==Ht.label?(dn=$e&&jsxRuntimeExports.jsx(Box,{...Ht.label,children:Ye}),n[12]=Ye,n[13]=$e,n[14]=Ht.label,n[15]=dn):dn=n[15];let jt;n[16]!==Ge||n[17]!==De||n[18]!==me||n[19]!==Ht.chips?(jt=me&&jsxRuntimeExports.jsx(Box,{...Ht.chips,children:jsxRuntimeExports.jsx(oe$1,{label:Ge,variant:De})}),n[16]=Ge,n[17]=De,n[18]=me,n[19]=Ht.chips,n[20]=jt):jt=n[20];let le;n[21]!==we||n[22]!==Ze||n[23]!==Ht.rightIcon?(le=we&&Ze&&jsxRuntimeExports.jsx(Box,{...Ht.rightIcon,color:"currentColor",children:Ze}),n[21]=we,n[22]=Ze,n[23]=Ht.rightIcon,n[24]=le):le=n[24];let Pe;return n[25]!==Ht.container||n[26]!==le||n[27]!==Gt||n[28]!==mn||n[29]!==dn||n[30]!==jt?(Pe=jsxRuntimeExports.jsxs(Box,{...Ht.container,onClick:Gt,children:[mn,dn,jt,le]}),n[25]=Ht.container,n[26]=le,n[27]=Gt,n[28]=mn,n[29]=dn,n[30]=jt,n[31]=Pe):Pe=n[31],Pe}const Se=t=>{const n=$$3.c(5);let c;n[0]!==t?({...c}=t,n[0]=t,n[1]=c):c=n[1];let ie;n[2]===Symbol.for("react.memo_cache_sentinel")?(ie=jsxRuntimeExports.jsx("path",{d:"M17 7L7 17M7 7L17 17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),n[2]=ie):ie=n[2];let se;return n[3]!==c?(se=jsxRuntimeExports.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...c,children:ie}),n[3]=c,n[4]=se):se=n[4],se};function at$2(t){const n=$$3.c(35),{open:c,onOpenChange:ie,headerContent:se,children:ae,footerContent:de,title:ue,icon:pe,iconType:ge,iconButton:be,showCloseButton:_e,hasBlurBg:we,size:qe,maxHeight:Ye,minHeight:Ge}=t,Ze=ge===void 0?"container":ge,He=_e===void 0?!0:_e,Ht=we===void 0?!1:we,un=qe===void 0?"md":qe,De=Ye===void 0?"560px":Ye;let $e;n[0]!==pe||n[1]!==be||n[2]!==Ze?($e=Ze==="button"?be:pe?jsxRuntimeExports.jsx(te$1,{type:"icon",variant:"secondary",icon:pe}):null,n[0]=pe,n[1]=be,n[2]=Ze,n[3]=$e):$e=n[3];const me=$e;let Gt;n[4]!==ie?(Gt=Me=>ie?.(Me.open),n[4]=ie,n[5]=Gt):Gt=n[5];const mn=Ht?"blur(100px)":void 0;let dn;n[6]!==mn?(dn=jsxRuntimeExports.jsx(DialogBackdrop,{bg:"rgba(0, 0, 0, 0.50)",backdropFilter:mn}),n[6]=mn,n[7]=dn):dn=n[7];let jt;n[8]!==ue?(jt=jsxRuntimeExports.jsx(DialogTitle$2,{flex:1,textAlign:"center",textStyle:"body2Medium",color:"text.main",children:ue}),n[8]=ue,n[9]=jt):jt=n[9];let le;n[10]!==He?(le=He&&jsxRuntimeExports.jsx(DialogCloseTrigger,{position:"unset",asChild:!0,children:jsxRuntimeExports.jsx(ee$1,{variant:"outlined",buttonType:"icon",icon:Se,"aria-label":"Close"})}),n[10]=He,n[11]=le):le=n[11];let Pe;n[12]!==me||n[13]!==le||n[14]!==jt?(Pe=jsxRuntimeExports.jsxs(Flex,{gap:4,alignItems:"center",width:"100%",children:[me,jt,le]}),n[12]=me,n[13]=le,n[14]=jt,n[15]=Pe):Pe=n[15];let xe;n[16]!==se||n[17]!==Pe?(xe=jsxRuntimeExports.jsxs(DialogHeader,{bg:"neutral.bgLight",borderBottom:"1px solid",borderColor:"neutral.30",p:4,flexDirection:"column",gap:4,children:[Pe,se]}),n[16]=se,n[17]=Pe,n[18]=xe):xe=n[18];let ze;n[19]!==ae?(ze=jsxRuntimeExports.jsx(DialogBody,{display:"flex",flexDirection:"column",flex:1,overflow:"auto",p:0,children:ae}),n[19]=ae,n[20]=ze):ze=n[20];let Ft;n[21]!==de?(Ft=de&&jsxRuntimeExports.jsx(DialogFooter,{bg:"neutral.bgLight",borderTop:"1px solid",borderColor:"neutral.30",p:4,gap:3,justifyContent:"flex-end",children:de}),n[21]=de,n[22]=Ft):Ft=n[22];let yn;n[23]!==De||n[24]!==Ge||n[25]!==xe||n[26]!==ze||n[27]!==Ft?(yn=jsxRuntimeExports.jsx(DialogPositioner,{children:jsxRuntimeExports.jsxs(DialogContent$2,{bg:"neutral.bgLight",border:"1px solid",borderColor:"neutral.30",borderRadius:"dynamic.2xl",maxH:De,minH:Ge,overflow:"hidden",boxShadow:"none",children:[xe,ze,Ft]})}),n[23]=De,n[24]=Ge,n[25]=xe,n[26]=ze,n[27]=Ft,n[28]=yn):yn=n[28];let Zt;return n[29]!==c||n[30]!==un||n[31]!==yn||n[32]!==Gt||n[33]!==dn?(Zt=jsxRuntimeExports.jsxs(DialogRoot,{open:c,onOpenChange:Gt,size:un,placement:"center",children:[dn,yn]}),n[29]=c,n[30]=un,n[31]=yn,n[32]=Gt,n[33]=dn,n[34]=Zt):Zt=n[34],Zt}function ct$2(t){const n=$$3.c(35),{open:c,onOpenChange:ie,headerContent:se,children:ae,footerContent:de,title:ue,icon:pe,iconType:ge,iconButton:be,showCloseButton:_e,hasBlurBg:we,size:qe,maxHeight:Ye,minHeight:Ge}=t,Ze=ge===void 0?"container":ge,He=_e===void 0?!0:_e,Ht=we===void 0?!1:we,un=qe===void 0?"md":qe,De=Ye===void 0?"calc(100vh - 56px)":Ye;let $e;n[0]!==pe||n[1]!==be||n[2]!==Ze?($e=Ze==="button"?be:pe?jsxRuntimeExports.jsx(te$1,{type:"icon",variant:"secondary",icon:pe}):null,n[0]=pe,n[1]=be,n[2]=Ze,n[3]=$e):$e=n[3];const me=$e;let Gt;n[4]!==ie?(Gt=Me=>ie?.(Me.open),n[4]=ie,n[5]=Gt):Gt=n[5];const mn=Ht?"blur(100px)":void 0;let dn;n[6]!==mn?(dn=jsxRuntimeExports.jsx(DrawerBackdrop,{bg:"rgba(0, 0, 0, 0.50)",backdropFilter:mn}),n[6]=mn,n[7]=dn):dn=n[7];let jt;n[8]!==ue?(jt=jsxRuntimeExports.jsx(DrawerTitle,{flex:1,textAlign:"center",textStyle:"body2Medium",color:"text.main",children:ue}),n[8]=ue,n[9]=jt):jt=n[9];let le;n[10]!==He?(le=He&&jsxRuntimeExports.jsx(DrawerCloseTrigger,{position:"unset",asChild:!0,children:jsxRuntimeExports.jsx(ee$1,{variant:"outlined",buttonType:"icon",icon:Se,"aria-label":"Close"})}),n[10]=He,n[11]=le):le=n[11];let Pe;n[12]!==me||n[13]!==le||n[14]!==jt?(Pe=jsxRuntimeExports.jsxs(Flex,{gap:4,alignItems:"center",width:"100%",children:[me,jt,le]}),n[12]=me,n[13]=le,n[14]=jt,n[15]=Pe):Pe=n[15];let xe;n[16]!==se||n[17]!==Pe?(xe=jsxRuntimeExports.jsxs(DrawerHeader,{bg:"neutral.bgLight",borderBottom:"1px solid",borderColor:"neutral.30",p:4,flexDirection:"column",gap:4,children:[Pe,se]}),n[16]=se,n[17]=Pe,n[18]=xe):xe=n[18];let ze;n[19]!==ae?(ze=jsxRuntimeExports.jsx(DrawerBody,{display:"flex",flexDirection:"column",flex:1,overflow:"auto",p:0,children:ae}),n[19]=ae,n[20]=ze):ze=n[20];let Ft;n[21]!==de?(Ft=de&&jsxRuntimeExports.jsx(DrawerFooter,{bg:"neutral.bgLight",borderTop:"1px solid",borderColor:"neutral.30",p:4,gap:3,justifyContent:"flex-end",children:de}),n[21]=de,n[22]=Ft):Ft=n[22];let yn;n[23]!==De||n[24]!==Ge||n[25]!==xe||n[26]!==ze||n[27]!==Ft?(yn=jsxRuntimeExports.jsx(DrawerPositioner,{children:jsxRuntimeExports.jsxs(DrawerContent,{bg:"neutral.bgLight",border:"1px solid",borderColor:"neutral.30",borderTopRadius:"dynamic.2xl",borderBottomRadius:0,overflow:"hidden",maxH:De,minH:Ge,children:[xe,ze,Ft]})}),n[23]=De,n[24]=Ge,n[25]=xe,n[26]=ze,n[27]=Ft,n[28]=yn):yn=n[28];let Zt;return n[29]!==c||n[30]!==un||n[31]!==yn||n[32]!==Gt||n[33]!==dn?(Zt=jsxRuntimeExports.jsxs(DrawerRoot,{open:c,onOpenChange:Gt,placement:"bottom",size:un,children:[dn,yn]}),n[29]=c,n[30]=un,n[31]=yn,n[32]=Gt,n[33]=dn,n[34]=Zt):Zt=n[34],Zt}function Oe(t){const n=$$3.c(5);let c;if(n[0]===Symbol.for("react.memo_cache_sentinel")?(c={base:!1,md:!0},n[0]=c):c=n[0],useBreakpointValue(c)){let se;return n[1]!==t?(se=jsxRuntimeExports.jsx(at$2,{...t}),n[1]=t,n[2]=se):se=n[2],se}let ie;return n[3]!==t?(ie=jsxRuntimeExports.jsx(ct$2,{...t}),n[3]=t,n[4]=ie):ie=n[4],ie}const dt$2=t=>{const n=$$3.c(5);let c;n[0]!==t?({...c}=t,n[0]=t,n[1]=c):c=n[1];let ie;n[2]===Symbol.for("react.memo_cache_sentinel")?(ie=jsxRuntimeExports.jsx("path",{d:"M9.99984 9.99996H10.0082M9.99984 4.99996H10.0082M9.99984 15H10.0082M10.8332 9.99996C10.8332 10.4602 10.4601 10.8333 9.99984 10.8333C9.53959 10.8333 9.1665 10.4602 9.1665 9.99996C9.1665 9.53971 9.53959 9.16663 9.99984 9.16663C10.4601 9.16663 10.8332 9.53971 10.8332 9.99996ZM10.8332 15C10.8332 15.4602 10.4601 15.8333 9.99984 15.8333C9.53959 15.8333 9.1665 15.4602 9.1665 15C9.1665 14.5397 9.53959 14.1666 9.99984 14.1666C10.4601 14.1666 10.8332 14.5397 10.8332 15ZM10.8332 4.99996C10.8332 5.46019 10.4601 5.83329 9.99984 5.83329C9.53959 5.83329 9.1665 5.46019 9.1665 4.99996C9.1665 4.53973 9.53959 4.16663 9.99984 4.16663C10.4601 4.16663 10.8332 4.53973 10.8332 4.99996Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),n[2]=ie):ie=n[2];let se;return n[3]!==c?(se=jsxRuntimeExports.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...c,children:ie}),n[3]=c,n[4]=se):se=n[4],se};function ut$2(){return{divider:{width:"100%",borderBottom:"1px solid",borderColor:"neutral.30",my:"8px"},list:{display:"flex",flexDirection:"column",gap:"4px",width:"100%"}}}function ht$2(t){return{isInvalid:t==="error",isDisabled:t==="disabled",isSelected:t==="selected"}}function pt$2(t){const n=$$3.c(34),{items:c,triggerIcon:ie,triggerAriaLabel:se,buttonVariant:ae,buttonProps:de,modalProps:ue,headerContent:pe,open:ge,defaultOpen:be,onOpenChange:_e,closeOnSelect:we,menuWidth:qe}=t,Ye=ie===void 0?dt$2:ie,Ge=se===void 0?"Open action menu":se,Ze=ae===void 0?"outlined":ae,He=be===void 0?!1:be,Ht=we===void 0?!0:we,un=qe===void 0?"240px":qe;let De;n[0]===Symbol.for("react.memo_cache_sentinel")?(De={base:!1,md:!0},n[0]=De):De=n[0];const $e=useBreakpointValue(De);let me;n[1]!==He?(me={defaultOpen:He},n[1]=He,n[2]=me):me=n[2];const{open:Gt,onOpen:mn,onClose:dn}=useDisclosure(me),jt=ge!==void 0,le=jt?ge:Gt,Pe=ue?.title;let xe;n[3]!==jt||n[4]!==dn||n[5]!==mn||n[6]!==_e?(xe=Qn=>{const En=typeof Qn=="boolean"?Qn:Qn.open;jt||(En?mn():dn()),_e?.(En)},n[3]=jt,n[4]=dn,n[5]=mn,n[6]=_e,n[7]=xe):xe=n[7];const ze=xe;let Ft;n[8]!==ze?(Ft=()=>ze(!1),n[8]=ze,n[9]=Ft):Ft=n[9];const yn=Ft;let Zt;n[10]===Symbol.for("react.memo_cache_sentinel")?(Zt=ut$2(),n[10]=Zt):Zt=n[10];const Me=Zt;let ce;n[11]!==yn||n[12]!==Ht?(ce=Qn=>{Qn.variant!=="disabled"&&(Qn.onClick?.(),Ht&&yn())},n[11]=yn,n[12]=Ht,n[13]=ce):ce=n[13];const Ne=ce,We=Me.list;let Vt;if(n[14]!==Ne||n[15]!==c){let Qn;n[17]!==Ne?(Qn=(En,In)=>{const Mn=ht$2(En.variant);return jsxRuntimeExports.jsxs(Box,{width:"100%",children:[jsxRuntimeExports.jsx(st$2,{label:En.title,leftIcon:En.icon,onClick:()=>Ne(En),...Mn}),En.hasBottomDivider&&jsxRuntimeExports.jsx(Box,{...Me.divider})]},`${En.title}-${In}`)},n[17]=Ne,n[18]=Qn):Qn=n[18],Vt=c.map(Qn),n[14]=Ne,n[15]=c,n[16]=Vt}else Vt=n[16];let Sn;n[19]!==Vt?(Sn=jsxRuntimeExports.jsx(Box,{...We,children:Vt}),n[19]=Vt,n[20]=Sn):Sn=n[20];const An=Sn;let Cn;return n[21]!==de||n[22]!==Ze||n[23]!==le||n[24]!==ze||n[25]!==pe||n[26]!==$e||n[27]!==An||n[28]!==un||n[29]!==ue||n[30]!==Pe||n[31]!==Ge||n[32]!==Ye?(Cn=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:$e?jsxRuntimeExports.jsxs(PopoverRoot,{positioning:{placement:"bottom-start"},open:le,onOpenChange:ze,children:[jsxRuntimeExports.jsx(PopoverTrigger,{asChild:!0,children:jsxRuntimeExports.jsx(ee$1,{"aria-label":Ge,buttonType:"icon",icon:Ye,variant:Ze,...de})}),jsxRuntimeExports.jsx(Portal$2,{children:jsxRuntimeExports.jsx(PopoverPositioner,{children:jsxRuntimeExports.jsx(PopoverContent,{width:"max-content",border:"none",background:"transparent",boxShadow:"none",p:0,children:jsxRuntimeExports.jsxs(he,{p:3,gap:"12px",width:un,maxH:"260px",overflow:"hidden",children:[pe&&jsxRuntimeExports.jsx(Box,{position:"sticky",top:0,zIndex:1,bg:"neutral.bgLight",children:pe}),jsxRuntimeExports.jsx(Box,{overflowY:"auto",width:"100%",className:"dropdown-scroll-hidden",children:An})]})})})})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ee$1,{"aria-label":Ge,buttonType:"icon",icon:Ye,variant:Ze,onClick:()=>ze(!0),...de}),jsxRuntimeExports.jsx(Oe,{open:le,onOpenChange:ze,...ue,title:Pe,headerContent:pe,children:jsxRuntimeExports.jsx(he,{gap:"12px",width:"100%",border:"none",boxShadow:"none",background:"transparent",borderRadius:0,p:4,children:jsxRuntimeExports.jsx(Box,{overflowY:"auto",width:"100%",className:"dropdown-scroll-hidden",children:An})})})]})}),n[21]=de,n[22]=Ze,n[23]=le,n[24]=ze,n[25]=pe,n[26]=$e,n[27]=An,n[28]=un,n[29]=ue,n[30]=Pe,n[31]=Ge,n[32]=Ye,n[33]=Cn):Cn=n[33],Cn}const Ee=t=>{const n=$$3.c(5);let c;n[0]!==t?({...c}=t,n[0]=t,n[1]=c):c=n[1];let ie;n[2]===Symbol.for("react.memo_cache_sentinel")?(ie=jsxRuntimeExports.jsx("path",{d:"M14 6L6 14M6 6L14 14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),n[2]=ie):ie=n[2];let se;return n[3]!==c?(se=jsxRuntimeExports.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...c,children:ie}),n[3]=c,n[4]=se):se=n[4],se},St$2=(t,n,c)=>({display:"flex",alignItems:"center",flex:1,minHeight:"40px",padding:`${c?"7px":"8px"} 12px`,gap:"8px",borderRadius:"dynamic.md",borderWidth:"1px",borderStyle:"solid",transition:"all 0.2s",bg:n.bg,borderColor:Be(t,n),color:n.color,cursor:t==="disabled"?"not-allowed":"text",_focusWithin:{borderColor:"primary.main !important"},_active:n._active,_hover:{...n._hover,borderColor:Be(t,n),background:n.bg??"transparent"}}),kt$1=()=>({flex:1,bg:"transparent",border:"none",outline:"none",width:"100%",height:"100%",padding:0,margin:0,textStyle:"body2Regular",color:"inherit",_placeholder:{color:"text.subtext"},_disabled:{cursor:"not-allowed"}}),Be=(t,n)=>{switch(t){case"disabled":return"neutral.30";case"outlined":return n.borderColor;default:return n.color}},Ve=t=>{const n=$$3.c(16),{title:c,subtitle:ie,required:se,secondaryText:ae,chipsLabel:de}=t,ue=c||"Title Here";let pe;n[0]!==ue?(pe=jsxRuntimeExports.jsx(Text,{textStyle:"body2Regular",color:"text.main",children:ue}),n[0]=ue,n[1]=pe):pe=n[1];let ge;n[2]!==se||n[3]!==ae?(ge=(se||ae)&&jsxRuntimeExports.jsx(Text,{textStyle:"body3Regular",color:"text.subtext",children:ae}),n[2]=se,n[3]=ae,n[4]=ge):ge=n[4];let be;n[5]!==de?(be=de&&jsxRuntimeExports.jsx(oe$1,{label:de,variant:"muted"}),n[5]=de,n[6]=be):be=n[6];let _e;n[7]!==pe||n[8]!==ge||n[9]!==be?(_e=jsxRuntimeExports.jsxs(Flex,{gap:"4px",alignItems:"center",width:"100%",children:[pe,ge,be]}),n[7]=pe,n[8]=ge,n[9]=be,n[10]=_e):_e=n[10];let we;n[11]!==ie?(we=ie&&jsxRuntimeExports.jsx(Text,{textStyle:"body3Regular",color:"text.subtext",children:ie}),n[11]=ie,n[12]=we):we=n[12];let qe;return n[13]!==_e||n[14]!==we?(qe=jsxRuntimeExports.jsxs(Flex,{direction:"column",gap:"4px",width:"100%",children:[_e,we]}),n[13]=_e,n[14]=we,n[15]=qe):qe=n[15],qe},It$2=React.forwardRef((t,n)=>{const c=$$3.c(38);let ie,se,ae,de,ue,pe,ge,be,_e,we,qe,Ye;c[0]!==t?({title:we,leftIcon:ue,rightIcon:_e,placeholder:ge,isDisabled:de,value:qe,defaultValue:ie,maxLength:pe,wrapperStyles:Ye,inputStyles:ae,handleChange:se,...be}=t,c[0]=t,c[1]=ie,c[2]=se,c[3]=ae,c[4]=de,c[5]=ue,c[6]=pe,c[7]=ge,c[8]=be,c[9]=_e,c[10]=we,c[11]=qe,c[12]=Ye):(ie=c[1],se=c[2],ae=c[3],de=c[4],ue=c[5],pe=c[6],ge=c[7],be=c[8],_e=c[9],we=c[10],qe=c[11],Ye=c[12]);let Ge;c[13]!==we?(Ge=()=>{const $e=document.getElementById(`input-${we}`);$e&&$e.focus()},c[13]=we,c[14]=Ge):Ge=c[14];let Ze;c[15]!==ae||c[16]!==ue?(Ze=ue&&jsxRuntimeExports.jsx(Box,{flexShrink:0,width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",color:ae.color,children:ue}),c[15]=ae,c[16]=ue,c[17]=Ze):Ze=c[17];const He=`input-${we}`;let Ht;c[18]!==ie||c[19]!==se||c[20]!==ae||c[21]!==de||c[22]!==pe||c[23]!==ge||c[24]!==n||c[25]!==be||c[26]!==He||c[27]!==qe?(Ht=jsxRuntimeExports.jsx(chakra.input,{ref:n,id:He,placeholder:ge,disabled:de,value:qe,defaultValue:ie,onChange:se,maxLength:pe,...ae,...be}),c[18]=ie,c[19]=se,c[20]=ae,c[21]=de,c[22]=pe,c[23]=ge,c[24]=n,c[25]=be,c[26]=He,c[27]=qe,c[28]=Ht):Ht=c[28];let un;c[29]!==ae||c[30]!==_e?(un=_e&&jsxRuntimeExports.jsx(Box,{flexShrink:0,width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",color:ae.color,children:_e}),c[29]=ae,c[30]=_e,c[31]=un):un=c[31];let De;return c[32]!==Ge||c[33]!==Ze||c[34]!==Ht||c[35]!==un||c[36]!==Ye?(De=jsxRuntimeExports.jsxs(Box,{...Ye,onClick:Ge,children:[Ze,Ht,un]}),c[32]=Ge,c[33]=Ze,c[34]=Ht,c[35]=un,c[36]=Ye,c[37]=De):De=c[37],De}),je=t=>{const n=$$3.c(10),{supportingMessage:c,charCount:ie,maxLength:se,effectiveVariant:ae}=t,de=!!se,ue=X$3[ae];if(!c&&!de)return null;const pe=ae==="outlined"?"text.subtext":ue.color;let ge;n[0]!==c?(ge=c&&jsxRuntimeExports.jsx(Text,{flex:"1",children:c}),n[0]=c,n[1]=ge):ge=n[1];let be;n[2]!==ie||n[3]!==de||n[4]!==se?(be=de&&jsxRuntimeExports.jsxs(Text,{children:[ie,se?`/${se}`:""]}),n[2]=ie,n[3]=de,n[4]=se,n[5]=be):be=n[5];let _e;return n[6]!==pe||n[7]!==ge||n[8]!==be?(_e=jsxRuntimeExports.jsxs(Flex,{width:"100%",paddingX:"12px",gap:"8px",justifyContent:"flex-end",textStyle:"body3Regular",color:pe,children:[ge,be]}),n[6]=pe,n[7]=ge,n[8]=be,n[9]=_e):_e=n[9],_e};React.forwardRef((t,n)=>{const c=$$3.c(59);let ie,se,ae,de,ue,pe,ge,be,_e,we,qe,Ye,Ge,Ze,He,Ht,un;c[0]!==t?({title:Ht,subtitle:Ge,supportingMessage:Ze,rightElement:we,leftIcon:de,rightIcon:qe,secondaryText:Ye,required:be,chipsLabel:ie,variant:He,isDisabled:ae,value:un,defaultValue:se,onChange:pe,placeholder:ge,maxLength:ue,..._e}=t,c[0]=t,c[1]=ie,c[2]=se,c[3]=ae,c[4]=de,c[5]=ue,c[6]=pe,c[7]=ge,c[8]=be,c[9]=_e,c[10]=we,c[11]=qe,c[12]=Ye,c[13]=Ge,c[14]=Ze,c[15]=He,c[16]=Ht,c[17]=un):(ie=c[1],se=c[2],ae=c[3],de=c[4],ue=c[5],pe=c[6],ge=c[7],be=c[8],_e=c[9],we=c[10],qe=c[11],Ye=c[12],Ge=c[13],Ze=c[14],He=c[15],Ht=c[16],un=c[17]);const De=He===void 0?"outlined":He,$e=un!==void 0;let me;c[18]!==se?(me=()=>se!==void 0?String(se).length:0,c[18]=se,c[19]=me):me=c[19];const[Gt,mn]=React.useState(me),dn=$e?String(un).length:Gt;let jt;c[20]!==$e||c[21]!==pe?(jt=An=>{$e||mn(An.target.value.length),pe?.(An)},c[20]=$e,c[21]=pe,c[22]=jt):jt=c[22];const le=jt,Pe=ae?"disabled":De,xe=X$3[Pe]||X$3.outlined,ze=!!(de||qe);let Ft;c[23]!==Pe||c[24]!==ze||c[25]!==xe?(Ft=St$2(Pe,xe,ze),c[23]=Pe,c[24]=ze,c[25]=xe,c[26]=Ft):Ft=c[26];const yn=Ft;let Zt;c[27]===Symbol.for("react.memo_cache_sentinel")?(Zt=kt$1(),c[27]=Zt):Zt=c[27];const Me=Zt;let ce;c[28]!==ie||c[29]!==be||c[30]!==Ye||c[31]!==Ge||c[32]!==Ht?(ce=Ht&&jsxRuntimeExports.jsx(Ve,{title:Ht,subtitle:Ge,required:be,secondaryText:Ye,chipsLabel:ie}),c[28]=ie,c[29]=be,c[30]=Ye,c[31]=Ge,c[32]=Ht,c[33]=ce):ce=c[33];let Ne;c[34]!==se||c[35]!==le||c[36]!==ae||c[37]!==de||c[38]!==ue||c[39]!==ge||c[40]!==n||c[41]!==_e||c[42]!==qe||c[43]!==Ht||c[44]!==un||c[45]!==yn?(Ne=jsxRuntimeExports.jsx(It$2,{ref:n,title:Ht,leftIcon:de,rightIcon:qe,isDisabled:ae,value:un,defaultValue:se,placeholder:ge,maxLength:ue,wrapperStyles:yn,inputStyles:Me,handleChange:le,..._e}),c[34]=se,c[35]=le,c[36]=ae,c[37]=de,c[38]=ue,c[39]=ge,c[40]=n,c[41]=_e,c[42]=qe,c[43]=Ht,c[44]=un,c[45]=yn,c[46]=Ne):Ne=c[46];let We;c[47]!==we||c[48]!==Ne?(We=jsxRuntimeExports.jsxs(Flex,{gap:"8px",width:"100%",alignItems:"center",children:[Ne,we]}),c[47]=we,c[48]=Ne,c[49]=We):We=c[49];let Vt;c[50]!==dn||c[51]!==Pe||c[52]!==ue||c[53]!==Ze?(Vt=jsxRuntimeExports.jsx(je,{supportingMessage:Ze,charCount:dn,maxLength:ue,effectiveVariant:Pe}),c[50]=dn,c[51]=Pe,c[52]=ue,c[53]=Ze,c[54]=Vt):Vt=c[54];let Sn;return c[55]!==ce||c[56]!==We||c[57]!==Vt?(Sn=jsxRuntimeExports.jsxs(Flex,{direction:"column",gap:"8px",width:"100%",alignItems:"flex-start",children:[ce,We,Vt]}),c[55]=ce,c[56]=We,c[57]=Vt,c[58]=Sn):Sn=c[58],Sn});const Lt$1=t=>{const n=$$3.c(16),{title:c,subtitle:ie,required:se,secondaryText:ae,chipsLabel:de}=t,ue=c||"Title Here";let pe;n[0]!==ue?(pe=jsxRuntimeExports.jsx(Text,{textStyle:"body2Regular",color:"text.main",children:ue}),n[0]=ue,n[1]=pe):pe=n[1];let ge;n[2]!==se||n[3]!==ae?(ge=se&&jsxRuntimeExports.jsx(Text,{textStyle:"body3Regular",color:"text.subtext",children:ae}),n[2]=se,n[3]=ae,n[4]=ge):ge=n[4];let be;n[5]!==de?(be=de&&jsxRuntimeExports.jsx(oe$1,{label:de,variant:"muted"}),n[5]=de,n[6]=be):be=n[6];let _e;n[7]!==pe||n[8]!==ge||n[9]!==be?(_e=jsxRuntimeExports.jsxs(Flex,{gap:"4px",alignItems:"center",width:"100%",children:[pe,ge,be]}),n[7]=pe,n[8]=ge,n[9]=be,n[10]=_e):_e=n[10];let we;n[11]!==ie?(we=ie&&jsxRuntimeExports.jsx(Text,{textStyle:"body3Regular",color:"text.subtext",children:ie}),n[11]=ie,n[12]=we):we=n[12];let qe;return n[13]!==_e||n[14]!==we?(qe=jsxRuntimeExports.jsxs(Flex,{direction:"column",gap:"4px",width:"100%",children:[_e,we]}),n[13]=_e,n[14]=we,n[15]=qe):qe=n[15],qe},Rt=t=>{const n=$$3.c(10),{supportingMessage:c,charCount:ie,maxLength:se,effectiveVariant:ae}=t,de=!!se,ue=X$3[ae];if(!c&&de)return null;const pe=ae==="outlined"?"text.subtext":ue.color;let ge;n[0]!==c?(ge=c&&jsxRuntimeExports.jsx(Text,{flex:"1",children:c}),n[0]=c,n[1]=ge):ge=n[1];let be;n[2]!==ie||n[3]!==de||n[4]!==se?(be=de&&jsxRuntimeExports.jsxs(Text,{children:[ie,se?`/${se}`:""]}),n[2]=ie,n[3]=de,n[4]=se,n[5]=be):be=n[5];let _e;return n[6]!==pe||n[7]!==ge||n[8]!==be?(_e=jsxRuntimeExports.jsxs(Flex,{width:"100%",paddingX:"12px",gap:"8px",justifyContent:"flex-end",textStyle:"body3Regular",color:pe,children:[ge,be]}),n[6]=pe,n[7]=ge,n[8]=be,n[9]=_e):_e=n[9],_e};function _t$1(t,n){return{display:"flex",flexDirection:"column",alignItems:"flex-start",flex:1,minHeight:"72px",padding:"8px 12px",gap:"8px",borderRadius:"dynamic.md",borderWidth:"1px",borderStyle:"solid",transition:"all 0.2s",bg:n.bg,borderColor:ve(t,n),color:n.color,width:"100%",cursor:t==="disabled"?"not-allowed":"text",_hover:{...n._hover,borderColor:ve(t,n)},_active:{bg:n.bg,borderColor:ve(t,n)},_focusWithin:{borderColor:"primary.main"}}}function Bt$2(){return{bg:"transparent",border:"none",outline:"none",width:"100%",alignSelf:"stretch",height:"auto",minHeight:"48px",padding:0,margin:0,textStyle:"body2Regular",color:"inherit",resize:"vertical",overflow:"auto",_placeholder:{color:"text.subtext"},_disabled:{cursor:"not-allowed",color:"text.disabled",_placeholder:{color:"text.disabled"}},_focusWithin:{bg:"transparent"}}}const ve=(t,n)=>{switch(t){case"disabled":return"neutral.30";case"outlined":return n.borderColor;default:return n.color}},Tt$1=React.forwardRef((t,n)=>{const c=$$3.c(34);let ie,se,ae,de,ue,pe,ge,be,_e,we,qe;c[0]!==t?({id:de,title:we,placeholder:ge,isDisabled:ue,value:qe,defaultValue:ie,maxLength:pe,rows:_e,effectiveVariant:se,handleChange:ae,...be}=t,c[0]=t,c[1]=ie,c[2]=se,c[3]=ae,c[4]=de,c[5]=ue,c[6]=pe,c[7]=ge,c[8]=be,c[9]=_e,c[10]=we,c[11]=qe):(ie=c[1],se=c[2],ae=c[3],de=c[4],ue=c[5],pe=c[6],ge=c[7],be=c[8],_e=c[9],we=c[10],qe=c[11]);const Ye=_e===void 0?3:_e,Ge=X$3[se]||X$3.outlined;let Ze;c[12]!==se||c[13]!==Ge?(Ze=_t$1(se,Ge),c[12]=se,c[13]=Ge,c[14]=Ze):Ze=c[14];const He=Ze;let Ht;c[15]===Symbol.for("react.memo_cache_sentinel")?(Ht=Bt$2(),c[15]=Ht):Ht=c[15];const un=Ht;let De;c[16]!==de||c[17]!==we?(De=()=>{const mn=document.getElementById(de||`textarea-${we}`);mn&&mn.focus()},c[16]=de,c[17]=we,c[18]=De):De=c[18];const $e=de||`textarea-${we}`;let me;c[19]!==ie||c[20]!==ae||c[21]!==ue||c[22]!==pe||c[23]!==ge||c[24]!==n||c[25]!==be||c[26]!==Ye||c[27]!==$e||c[28]!==qe?(me=jsxRuntimeExports.jsx(chakra.textarea,{ref:n,id:$e,placeholder:ge,disabled:ue,value:qe,defaultValue:ie,onChange:ae,maxLength:pe,rows:Ye,...un,...be}),c[19]=ie,c[20]=ae,c[21]=ue,c[22]=pe,c[23]=ge,c[24]=n,c[25]=be,c[26]=Ye,c[27]=$e,c[28]=qe,c[29]=me):me=c[29];let Gt;return c[30]!==De||c[31]!==me||c[32]!==He?(Gt=jsxRuntimeExports.jsx(Box,{...He,onClick:De,children:me}),c[30]=De,c[31]=me,c[32]=He,c[33]=Gt):Gt=c[33],Gt});React.forwardRef((t,n)=>{const c=$$3.c(49);let ie,se,ae,de,ue,pe,ge,be,_e,we,qe,Ye,Ge,Ze,He;c[0]!==t?({title:Ze,subtitle:_e,supportingMessage:we,secondaryText:qe,required:ge,chipsLabel:ie,variant:Ye,isDisabled:ae,value:He,defaultValue:se,onChange:ue,placeholder:pe,maxLength:de,rows:Ge,...be}=t,c[0]=t,c[1]=ie,c[2]=se,c[3]=ae,c[4]=de,c[5]=ue,c[6]=pe,c[7]=ge,c[8]=be,c[9]=_e,c[10]=we,c[11]=qe,c[12]=Ye,c[13]=Ge,c[14]=Ze,c[15]=He):(ie=c[1],se=c[2],ae=c[3],de=c[4],ue=c[5],pe=c[6],ge=c[7],be=c[8],_e=c[9],we=c[10],qe=c[11],Ye=c[12],Ge=c[13],Ze=c[14],He=c[15]);const Ht=qe===void 0?"(Required)":qe,un=Ye===void 0?"outlined":Ye,De=Ge===void 0?3:Ge,$e=React.useId(),me=He!==void 0;let Gt;c[16]!==se?(Gt=()=>se!==void 0?String(se).length:0,c[16]=se,c[17]=Gt):Gt=c[17];const[mn,dn]=React.useState(Gt),jt=me?String(He).length:mn;let le;c[18]!==me||c[19]!==ue?(le=ce=>{me||dn(ce.target.value.length),ue?.(ce)},c[18]=me,c[19]=ue,c[20]=le):le=c[20];const Pe=le,xe=ae?"disabled":un;let ze;c[21]!==ie||c[22]!==ge||c[23]!==Ht||c[24]!==_e||c[25]!==Ze?(ze=Ze&&jsxRuntimeExports.jsx(Lt$1,{title:Ze,subtitle:_e,required:ge,secondaryText:Ht,chipsLabel:ie}),c[21]=ie,c[22]=ge,c[23]=Ht,c[24]=_e,c[25]=Ze,c[26]=ze):ze=c[26];const Ft=`textarea-${$e}`;let yn;c[27]!==se||c[28]!==xe||c[29]!==Pe||c[30]!==ae||c[31]!==de||c[32]!==pe||c[33]!==n||c[34]!==be||c[35]!==De||c[36]!==Ft||c[37]!==Ze||c[38]!==He?(yn=jsxRuntimeExports.jsx(Tt$1,{ref:n,id:Ft,title:Ze,isDisabled:ae,value:He,defaultValue:se,placeholder:pe,maxLength:de,rows:De,effectiveVariant:xe,handleChange:Pe,...be}),c[27]=se,c[28]=xe,c[29]=Pe,c[30]=ae,c[31]=de,c[32]=pe,c[33]=n,c[34]=be,c[35]=De,c[36]=Ft,c[37]=Ze,c[38]=He,c[39]=yn):yn=c[39];let Zt;c[40]!==jt||c[41]!==xe||c[42]!==de||c[43]!==we?(Zt=jsxRuntimeExports.jsx(Rt,{supportingMessage:we,charCount:jt,maxLength:de,effectiveVariant:xe}),c[40]=jt,c[41]=xe,c[42]=de,c[43]=we,c[44]=Zt):Zt=c[44];let Me;return c[45]!==ze||c[46]!==yn||c[47]!==Zt?(Me=jsxRuntimeExports.jsxs(Flex,{direction:"column",gap:"8px",width:"100%",alignItems:"flex-start",children:[ze,yn,Zt]}),c[45]=ze,c[46]=yn,c[47]=Zt,c[48]=Me):Me=c[48],Me});function Wt({variant:t,isDisabled:n,hasValue:c,expanded:ie}){const se=t==="icon",ae=!!ie||!se;return{container:{display:"flex",alignItems:"center",gap:se&&!ae?"0px":"8px",width:se?ae?"100%":"40px":"100%",height:se&&!ae?"40px":void 0,padding:se&&!ae?"0px":"7px 12px",borderRadius:"dynamic.md",borderWidth:"1px",borderStyle:"solid",borderColor:"neutral.30",bg:"neutral.bgLight",transition:"border-color 0.2s, background-color 0.2s, width 0.25s ease",_hover:{borderColor:"neutral.50"},_focusWithin:{borderColor:"primary.main"},opacity:n?.6:1,cursor:n?"not-allowed":se&&!ae?"pointer":"text",overflow:"hidden",justifyContent:se&&!ae?"center":"flex-start",...se&&!ae?{padding:"8px",borderWidth:"0px",bg:"transparent",_hover:{bg:"neutral.10"}}:{}},input:{flex:ae?"1 0 0":"0 0 auto",border:"none",outline:"none",padding:0,height:ae?"24px":"0px",overflow:"hidden",minW:"0px",minInlineSize:"0px",textStyle:"body2Regular",color:c?"text.main":"text.subtext",_placeholder:{color:"text.subtext"},bg:"transparent",_focus:{boxShadow:"none"},opacity:ae?1:0,pointerEvents:ae?"auto":"none",width:ae?"auto":"0px",maxW:ae?"none":"0px",transition:"opacity 0.2s ease, width 0.2s ease"},searchIconColor:n?"text.disabled":se&&!ae||c?"text.main":"text.subtext",clearIconColor:n?"text.disabled":"text.subtext",clearButton:{display:"flex",alignItems:"center",justifyContent:"center",opacity:ae?1:0,pointerEvents:ae?"auto":"none",transition:"opacity 0.2s ease, width 0.2s ease",width:ae?"24px":"0px",height:ae?"24px":"0px",overflow:"hidden",minW:"0px",padding:0,borderRadius:"full",bg:"transparent",cursor:n?"not-allowed":"pointer",_hover:{bg:"neutral.10"}},iconButton:{display:"flex",alignItems:"center",justifyContent:"center",padding:"8px",borderRadius:"dynamic.md",bg:se?"transparent":"neutral.10",cursor:"pointer",_hover:{bg:"neutral.10"}}}}const Dt=t=>{const n=$$3.c(5);let c;n[0]!==t?({...c}=t,n[0]=t,n[1]=c):c=n[1];let ie;n[2]===Symbol.for("react.memo_cache_sentinel")?(ie=jsxRuntimeExports.jsx("path",{d:"M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),n[2]=ie):ie=n[2];let se;return n[3]!==c?(se=jsxRuntimeExports.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...c,children:ie}),n[3]=c,n[4]=se):se=n[4],se};function vn(t){const n=$$3.c(50);let c,ie,se,ae,de,ue,pe,ge,be,_e,we;n[0]!==t?({placeholder:ue,variant:pe,value:we,defaultValue:c,onChange:se,showClear:ge,isDisabled:be,isExpanded:ie,defaultExpanded:_e,onExpandedChange:ae,...de}=t,n[0]=t,n[1]=c,n[2]=ie,n[3]=se,n[4]=ae,n[5]=de,n[6]=ue,n[7]=pe,n[8]=ge,n[9]=be,n[10]=_e,n[11]=we):(c=n[1],ie=n[2],se=n[3],ae=n[4],de=n[5],ue=n[6],pe=n[7],ge=n[8],be=n[9],_e=n[10],we=n[11]);const qe=ue===void 0?"Search...":ue,Ye=pe===void 0?"maximized":pe,Ge=ge===void 0?!0:ge,Ze=be===void 0?!1:be,He=_e===void 0?!1:_e,Ht=we!==void 0,un=ie!==void 0,[De,$e]=React.useState(He),me=un?ie:De,[Gt,mn]=React.useState(c||""),dn=Ht?we:Gt;let jt;n[12]!==Ht||n[13]!==se?(jt=Sn=>{Ht||mn(Sn.target.value),se?.(Sn)},n[12]=Ht,n[13]=se,n[14]=jt):jt=n[14];const le=jt;let Pe;n[15]!==Ht||n[16]!==se?(Pe=()=>{if(!Ht){mn("");return}se?.({target:{value:""}})},n[15]=Ht,n[16]=se,n[17]=Pe):Pe=n[17];const xe=Pe;let ze;n[18]!==me||n[19]!==un||n[20]!==ae||n[21]!==Ye?(ze=()=>{Ye!=="icon"||me||(un||$e(!0),ae?.(!0))},n[18]=me,n[19]=un,n[20]=ae,n[21]=Ye,n[22]=ze):ze=n[22];const Ft=ze,yn=!!dn;let Zt;n[23]!==me||n[24]!==Ze||n[25]!==yn||n[26]!==Ye?(Zt=Wt({variant:Ye,isDisabled:Ze,hasValue:yn,expanded:me}),n[23]=me,n[24]=Ze,n[25]=yn,n[26]=Ye,n[27]=Zt):Zt=n[27];const Me=Zt;let ce;n[28]!==Me.searchIconColor?(ce=jsxRuntimeExports.jsx(Icon,{as:Dt,color:Me.searchIconColor,boxSize:"24px"}),n[28]=Me.searchIconColor,n[29]=ce):ce=n[29];let Ne;n[30]!==dn||n[31]!==le||n[32]!==Ze||n[33]!==qe||n[34]!==t.autoFocus||n[35]!==Me.input?(Ne=jsxRuntimeExports.jsx(Input,{value:dn,placeholder:qe,onChange:le,disabled:Ze,autoFocus:t.autoFocus,...Me.input}),n[30]=dn,n[31]=le,n[32]=Ze,n[33]=qe,n[34]=t.autoFocus,n[35]=Me.input,n[36]=Ne):Ne=n[36];let We;n[37]!==dn||n[38]!==xe||n[39]!==Ge||n[40]!==Me.clearButton||n[41]!==Me.clearIconColor?(We=Ge&&jsxRuntimeExports.jsx(Box,{visibility:dn?"visible":"hidden",as:"button",...Me.clearButton,onClick:xe,children:jsxRuntimeExports.jsx(Icon,{as:Ee,color:Me.clearIconColor,boxSize:"24px"})}),n[37]=dn,n[38]=xe,n[39]=Ge,n[40]=Me.clearButton,n[41]=Me.clearIconColor,n[42]=We):We=n[42];let Vt;return n[43]!==Ft||n[44]!==de||n[45]!==Me.container||n[46]!==ce||n[47]!==Ne||n[48]!==We?(Vt=jsxRuntimeExports.jsxs(Box,{...Me.container,...de,onClick:Ft,children:[ce,Ne,We]}),n[43]=Ft,n[44]=de,n[45]=Me.container,n[46]=ce,n[47]=Ne,n[48]=We,n[49]=Vt):Vt=n[49],Vt}function $t(t,n,c){return t?"disabled":n?"error":c?"success":"outlined"}function Mt(t){const n=X$3[t];return{display:"flex",alignItems:"center",flex:1,minHeight:"40px",padding:"7px 12px",gap:"8px",borderRadius:"dynamic.md",borderWidth:"1px",borderStyle:"solid",transition:"all 0.2s",bg:n.bg,borderColor:Te(t,n),color:n.color,cursor:t==="disabled"?"not-allowed":"pointer",_hover:{...n._hover,borderColor:Te(t,n)},_active:n._active,_focusWithin:{borderColor:"primary.main"}}}const Ot$2={flex:1,bg:"transparent",border:"none",outline:"none",width:"100%",height:"100%",padding:0,margin:0,textStyle:"body2Regular",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:"left"},Te=(t,n)=>{switch(t){case"disabled":return"neutral.30";case"outlined":return n.borderColor;default:return n.color}},Et$2=t=>{const n=$$3.c(5);let c;n[0]!==t?({...c}=t,n[0]=t,n[1]=c):c=n[1];let ie;n[2]===Symbol.for("react.memo_cache_sentinel")?(ie=jsxRuntimeExports.jsx("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),n[2]=ie):ie=n[2];let se;return n[3]!==c?(se=jsxRuntimeExports.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...c,children:ie}),n[3]=c,n[4]=se):se=n[4],se};function wn(t){const n=$$3.c(57),{triggerText:c,children:ie,open:se,defaultOpen:ae,onOpenChange:de,title:ue,subtitle:pe,secondaryText:ge,required:be,chipsLabel:_e,isDisabled:we,isError:qe,isSuccess:Ye,message:Ge,leftIcon:Ze,modalProps:He,headerContent:Ht}=t,un=c===void 0?"Select":c,De=ae===void 0?!1:ae;let $e;n[0]===Symbol.for("react.memo_cache_sentinel")?($e={base:!1,md:!0},n[0]=$e):$e=n[0];const me=useBreakpointValue($e);let Gt;n[1]!==De?(Gt={defaultOpen:De},n[1]=De,n[2]=Gt):Gt=n[2];const{open:mn,onOpen:dn,onClose:jt}=useDisclosure(Gt),le=se!==void 0,Pe=le?se:mn;let xe;n[3]!==le||n[4]!==we||n[5]!==jt||n[6]!==dn||n[7]!==de?(xe=Hn=>{const ti=typeof Hn=="boolean"?Hn:Hn.open;we&&ti||(le||(ti?dn():jt()),de?.(ti))},n[3]=le,n[4]=we,n[5]=jt,n[6]=dn,n[7]=de,n[8]=xe):xe=n[8];const ze=xe;let Ft;n[9]!==ze?(Ft=()=>ze(!1),n[9]=ze,n[10]=Ft):Ft=n[10];const yn=Ft;let Zt;n[11]!==ie||n[12]!==yn||n[13]!==Pe?(Zt=typeof ie=="function"?ie({open:Pe,close:yn}):ie,n[11]=ie,n[12]=yn,n[13]=Pe,n[14]=Zt):Zt=n[14];const Me=Zt;let ce,Ne;n[15]!==we||n[16]!==qe||n[17]!==Ye?(Ne=$t(we,qe,Ye),ce=Mt(Ne),n[15]=we,n[16]=qe,n[17]=Ye,n[18]=ce,n[19]=Ne):(ce=n[18],Ne=n[19]);const We=ce,Vt=He?.title??ue;let Sn;n[20]!==ze||n[21]!==we?(Sn=we?void 0:()=>ze(!0),n[20]=ze,n[21]=we,n[22]=Sn):Sn=n[22];const An=Sn;let Cn;n[23]!==Ze?(Cn=Ze&&jsxRuntimeExports.jsx(Icon,{as:Ze,boxSize:"24px",color:"text.subtext"}),n[23]=Ze,n[24]=Cn):Cn=n[24];let Qn;n[25]!==We.color||n[26]!==un?(Qn=jsxRuntimeExports.jsx(Box,{...Ot$2,color:We.color,children:un}),n[25]=We.color,n[26]=un,n[27]=Qn):Qn=n[27];let En;n[28]===Symbol.for("react.memo_cache_sentinel")?(En=jsxRuntimeExports.jsx(Icon,{as:Et$2,boxSize:"24px",color:"text.subtext"}),n[28]=En):En=n[28];let In;n[29]!==we||n[30]!==Qn||n[31]!==Cn||n[32]!==We?(In=jsxRuntimeExports.jsxs(chakra.button,{...We,width:"100%",alignItems:"center",type:"button",disabled:we,"aria-disabled":we,children:[Cn,Qn,En]}),n[29]=we,n[30]=Qn,n[31]=Cn,n[32]=We,n[33]=In):In=n[33];const Mn=In;let zn;n[34]!==_e||n[35]!==be||n[36]!==ge||n[37]!==pe||n[38]!==ue?(zn=ue&&jsxRuntimeExports.jsx(Ve,{title:ue,subtitle:pe,required:be,secondaryText:ge,chipsLabel:_e}),n[34]=_e,n[35]=be,n[36]=ge,n[37]=pe,n[38]=ue,n[39]=zn):zn=n[39];let Jn;n[40]!==Pe||n[41]!==ze||n[42]!==An||n[43]!==Ht||n[44]!==me||n[45]!==He||n[46]!==Vt||n[47]!==Me||n[48]!==Mn?(Jn=me?jsxRuntimeExports.jsxs(PopoverRoot,{positioning:{placement:"bottom-start",sameWidth:!0},open:Pe,onOpenChange:ze,children:[jsxRuntimeExports.jsx(PopoverTrigger,{asChild:!0,children:Mn}),jsxRuntimeExports.jsx(Portal$2,{children:jsxRuntimeExports.jsx(PopoverPositioner,{width:"100%",children:jsxRuntimeExports.jsx(PopoverContent,{border:"none",background:"transparent",boxShadow:"none",p:0,width:"100%",children:jsxRuntimeExports.jsxs(he,{p:3,gap:"12px",width:"100%",maxH:"304px",overflow:"hidden",children:[Ht&&jsxRuntimeExports.jsx(Box,{position:"sticky",top:0,zIndex:1,bg:"neutral.bgLight",children:Ht}),jsxRuntimeExports.jsx(Box,{overflowY:"auto",width:"100%",className:"dropdown-scroll-hidden",children:Me})]})})})})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box,{onClick:An,width:"100%",children:Mn}),jsxRuntimeExports.jsx(Oe,{open:Pe,onOpenChange:ze,...He,title:Vt,headerContent:Ht,children:jsxRuntimeExports.jsx(he,{gap:"12px",width:"100%",border:"none",boxShadow:"none",background:"transparent",borderRadius:0,p:4,children:Me})})]}),n[40]=Pe,n[41]=ze,n[42]=An,n[43]=Ht,n[44]=me,n[45]=He,n[46]=Vt,n[47]=Me,n[48]=Mn,n[49]=Jn):Jn=n[49];let hn;n[50]!==Ge||n[51]!==Ne?(hn=jsxRuntimeExports.jsx(je,{supportingMessage:Ge,charCount:0,maxLength:0,effectiveVariant:Ne}),n[50]=Ge,n[51]=Ne,n[52]=hn):hn=n[52];let xn;return n[53]!==zn||n[54]!==Jn||n[55]!==hn?(xn=jsxRuntimeExports.jsxs(Box,{display:"flex",flexDirection:"column",gap:"8px",width:"100%",alignItems:"flex-start",children:[zn,Jn,hn]}),n[53]=zn,n[54]=Jn,n[55]=hn,n[56]=xn):xn=n[56],xn}chakra("input");function Nt$1({orientation:t="horizontal",length:n="100%",thickness:c="1px",colorToken:ie="neutral.30"}){const se=t==="horizontal";return{container:{width:se?n:c,height:se?c:n,bg:ie,flexShrink:0}}}function kn(t){const n=$$3.c(15);let c,ie,se,ae,de;n[0]!==t?({orientation:ie,length:se,thickness:ae,colorToken:de,...c}=t,n[0]=t,n[1]=c,n[2]=ie,n[3]=se,n[4]=ae,n[5]=de):(c=n[1],ie=n[2],se=n[3],ae=n[4],de=n[5]);const ue=ie===void 0?"horizontal":ie,pe=se===void 0?"100%":se,ge=ae===void 0?"1px":ae,be=de===void 0?"neutral.30":de;let _e;n[6]!==be||n[7]!==pe||n[8]!==ue||n[9]!==ge?(_e=Nt$1({orientation:ue,length:pe,thickness:ge,colorToken:be}),n[6]=be,n[7]=pe,n[8]=ue,n[9]=ge,n[10]=_e):_e=n[10];const we=_e;let qe;return n[11]!==ue||n[12]!==c||n[13]!==we.container?(qe=jsxRuntimeExports.jsx(Box,{role:"separator","aria-orientation":ue,...we.container,...c}),n[11]=ue,n[12]=c,n[13]=we.container,n[14]=qe):qe=n[14],qe}function zt$1({variant:t="text",contentAlign:n="end"}){return{container:{display:"flex",alignItems:"center",justifyContent:n==="end"?"flex-end":"flex-start",gap:t==="text"||t==="subtext"?"8px":"0px"},text:{textStyle:"body2Regular",color:"text.main",textAlign:n==="end"?"right":"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},subtextGroup:{display:"flex",alignItems:"center",gap:"4px",whiteSpace:"nowrap"},subtextMain:{textStyle:"body2Regular",color:"text.main"},subtext:{textStyle:"body2Regular",color:"text.subtext"},icon:{width:"24px",height:"24px"}}}function qt$1(t){const n=$$3.c(43);let c,ie,se,ae,de,ue,pe,ge;n[0]!==t?({variant:de,text:ge,subtext:ae,chipsLabel:c,chipsVariant:ue,icon:ie,contentAlign:pe,...se}=t,n[0]=t,n[1]=c,n[2]=ie,n[3]=se,n[4]=ae,n[5]=de,n[6]=ue,n[7]=pe,n[8]=ge):(c=n[1],ie=n[2],se=n[3],ae=n[4],de=n[5],ue=n[6],pe=n[7],ge=n[8]);const be=de===void 0?"text":de,_e=ue===void 0?"success":ue,we=pe===void 0?"end":pe;let qe;n[9]!==we||n[10]!==be?(qe=zt$1({variant:be,contentAlign:we}),n[9]=we,n[10]=be,n[11]=qe):qe=n[11];const Ye=qe,Ge=be==="text",Ze=be==="subtext",He=be==="icon",Ht=be==="chips",un=Ge||Ze;let De;n[12]!==c||n[13]!==_e||n[14]!==un?(De=un&&c&&jsxRuntimeExports.jsx(oe$1,{label:c,variant:_e}),n[12]=c,n[13]=_e,n[14]=un,n[15]=De):De=n[15];let $e;n[16]!==Ge||n[17]!==Ye.text||n[18]!==ge?($e=Ge&&jsxRuntimeExports.jsx(Text,{...Ye.text,children:ge}),n[16]=Ge,n[17]=Ye.text,n[18]=ge,n[19]=$e):$e=n[19];let me;n[20]!==Ze||n[21]!==Ye.subtext||n[22]!==Ye.subtextGroup||n[23]!==Ye.subtextMain||n[24]!==ae||n[25]!==ge?(me=Ze&&jsxRuntimeExports.jsxs(Box,{...Ye.subtextGroup,children:[jsxRuntimeExports.jsx(Text,{...Ye.subtextMain,children:ge}),jsxRuntimeExports.jsx(Text,{...Ye.subtext,children:ae})]}),n[20]=Ze,n[21]=Ye.subtext,n[22]=Ye.subtextGroup,n[23]=Ye.subtextMain,n[24]=ae,n[25]=ge,n[26]=me):me=n[26];let Gt;n[27]!==ie||n[28]!==He||n[29]!==Ye.icon?(Gt=He&&ie&&jsxRuntimeExports.jsx(Icon,{as:ie,...Ye.icon}),n[27]=ie,n[28]=He,n[29]=Ye.icon,n[30]=Gt):Gt=n[30];let mn;n[31]!==c||n[32]!==_e||n[33]!==Ht?(mn=Ht&&c&&jsxRuntimeExports.jsx(oe$1,{label:c,variant:_e}),n[31]=c,n[32]=_e,n[33]=Ht,n[34]=mn):mn=n[34];let dn;return n[35]!==se||n[36]!==Ye.container||n[37]!==De||n[38]!==$e||n[39]!==me||n[40]!==Gt||n[41]!==mn?(dn=jsxRuntimeExports.jsxs(Box,{...Ye.container,...se,children:[De,$e,me,Gt,mn]}),n[35]=se,n[36]=Ye.container,n[37]=De,n[38]=$e,n[39]=me,n[40]=Gt,n[41]=mn,n[42]=dn):dn=n[42],dn}function Yt({nested:t,borderColor:n,borderRadius:c}){return{container:{borderWidth:t?"0":"1px",borderStyle:"solid",borderColor:n,borderRadius:t?void 0:c,overflow:"hidden"}}}function Ut$2({borderColor:t,isLastColumn:n,isLastRow:c}){return{borderInlineEndWidth:n?"0":"1px",borderInlineEndStyle:"solid",borderInlineEndColor:t,borderBottomWidth:c?"0":"1px",borderBottomStyle:"solid",borderBottomColor:t}}function Rn(t){const n=$$3.c(12);let c,ie,se,ae,de;if(n[0]!==t){const{columns:pe,nested:ge,children:be,..._e}=t,we=ge===void 0?!1:ge,qe=React.Children.toArray(be),Ye=_e.borderColor??"neutral.30",Ge=_e.borderRadius??"dynamic.md",Ze=Yt({nested:we,borderColor:Ye,borderRadius:Ge});c=Grid,ie=`repeat(${pe}, 1fr)`,se=Ze.container,ae=_e,de=qe.map((He,Ht)=>{const un=Ht%pe===pe-1,De=Ht>=qe.length-pe,$e=Ut$2({borderColor:Ye,isLastColumn:un,isLastRow:De});return jsxRuntimeExports.jsx(Box,{...$e,children:He},Ht)}),n[0]=t,n[1]=c,n[2]=ie,n[3]=se,n[4]=ae,n[5]=de}else c=n[1],ie=n[2],se=n[3],ae=n[4],de=n[5];let ue;return n[6]!==c||n[7]!==ie||n[8]!==se||n[9]!==ae||n[10]!==de?(ue=jsxRuntimeExports.jsx(c,{templateColumns:ie,...se,...ae,children:de}),n[6]=c,n[7]=ie,n[8]=se,n[9]=ae,n[10]=de,n[11]=ue):ue=n[11],ue}function Kt({isDisabled:t}){return{container:{position:"relative",width:"40px",height:"40px",display:"inline-flex",alignItems:"center",justifyContent:"center"},networkContainer:{position:"absolute",top:"23px",left:"23px",display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",borderRadius:"full",bg:"neutral.10",borderWidth:"1px",borderStyle:"solid",borderColor:"neutral.30",opacity:t?.5:1}}}const Xt=t=>{const n=$$3.c(8);let c;n[0]!==t?({...c}=t,n[0]=t,n[1]=c):c=n[1];let ie,se,ae,de;n[2]===Symbol.for("react.memo_cache_sentinel")?(ie=jsxRuntimeExports.jsx("path",{d:"M13.9996 7.00003L16.828 9.82846M19.5162 3.74615L20.0819 4.31183C20.4779 4.70785 20.6759 4.90586 20.7501 5.13419C20.8154 5.33503 20.8154 5.55138 20.7501 5.75222C20.6759 5.98055 20.4779 6.17856 20.0819 6.57457L6.52508 20.1314C6.12906 20.5274 5.93105 20.7254 5.70272 20.7996C5.50188 20.8649 5.28553 20.8649 5.08469 20.7996C4.85636 20.7254 4.65835 20.5274 4.26234 20.1314L3.69665 19.5657C3.30063 19.1697 3.10262 18.9717 3.02844 18.7433C2.96318 18.5425 2.96318 18.3262 3.02844 18.1253C3.10262 17.897 3.30063 17.699 3.69665 17.303L17.2535 3.74615C17.6495 3.35013 17.8475 3.15212 18.0758 3.07793C18.2767 3.01268 18.493 3.01268 18.6939 3.07793C18.9222 3.15212 19.1202 3.35013 19.5162 3.74615Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),se=jsxRuntimeExports.jsx("path",{d:"M7.5 2L6.975 3.33115C6.90789 3.50131 6.87434 3.58639 6.82295 3.65814C6.77741 3.72173 6.72173 3.77741 6.65814 3.82296C6.58639 3.87432 6.50131 3.90789 6.33115 3.975L5 4.5L6.33115 5.025C6.50131 5.09211 6.58639 5.12568 6.65814 5.17704C6.72173 5.22261 6.77741 5.27829 6.82295 5.34186C6.87434 5.41361 6.90789 5.49868 6.975 5.66886L7.5 7L8.025 5.66886C8.09211 5.49868 8.12568 5.41361 8.17704 5.34186C8.22261 5.27829 8.27829 5.22261 8.34186 5.17704C8.41361 5.12568 8.49868 5.09211 8.66886 5.025L10 4.5L8.66886 3.975C8.49868 3.90789 8.41361 3.87432 8.34186 3.82296C8.27829 3.77741 8.22261 3.72173 8.17704 3.65814C8.12568 3.58639 8.09211 3.50131 8.025 3.33115L7.5 2Z",stroke:"currentColor",strokeWidth:"0.75",strokeLinecap:"round",strokeLinejoin:"round"}),ae=jsxRuntimeExports.jsx("path",{d:"M14 1L13.79 1.53246C13.7632 1.60052 13.7497 1.63456 13.7292 1.66325C13.711 1.68869 13.6887 1.71096 13.6633 1.72919C13.6346 1.74973 13.6005 1.76316 13.5325 1.79L13 2L13.5325 2.21C13.6005 2.23684 13.6346 2.25027 13.6633 2.27081C13.6887 2.28904 13.711 2.31131 13.7292 2.33674C13.7497 2.36544 13.7632 2.39947 13.79 2.46754L14 3L14.21 2.46754C14.2368 2.39947 14.2503 2.36544 14.2708 2.33674C14.289 2.31131 14.3113 2.28904 14.3367 2.27081C14.3654 2.25027 14.3995 2.23684 14.4675 2.21L15 2L14.4675 1.79C14.3995 1.76316 14.3654 1.74973 14.3367 1.72919C14.3113 1.71096 14.289 1.68869 14.2708 1.66325C14.2503 1.63456 14.2368 1.60052 14.21 1.53246L14 1Z",stroke:"currentColor",strokeWidth:"0.5",strokeLinecap:"round",strokeLinejoin:"round"}),de=jsxRuntimeExports.jsx("path",{d:"M15.5 16L15.185 16.7987C15.1447 16.9008 15.1246 16.9518 15.0938 16.9949C15.0664 17.033 15.033 17.0664 14.9949 17.0938C14.9518 17.1246 14.9008 17.1447 14.7987 17.185L14 17.5L14.7987 17.815C14.9008 17.8553 14.9518 17.8754 14.9949 17.9062C15.033 17.9336 15.0664 17.967 15.0938 18.0051C15.1246 18.0482 15.1447 18.0992 15.185 18.2013L15.5 19L15.815 18.2013C15.8553 18.0992 15.8754 18.0482 15.9062 18.0051C15.9336 17.967 15.967 17.9336 16.0051 17.9062C16.0482 17.8754 16.0992 17.8553 16.2013 17.815L17 17.5L16.2013 17.185C16.0992 17.1447 16.0482 17.1246 16.0051 17.0938C15.967 17.0664 15.9336 17.033 15.9062 16.9949C15.8754 16.9518 15.8553 16.9008 15.815 16.7987L15.5 16Z",stroke:"currentColor",strokeWidth:"0.5",strokeLinecap:"round",strokeLinejoin:"round"}),n[2]=ie,n[3]=se,n[4]=ae,n[5]=de):(ie=n[2],se=n[3],ae=n[4],de=n[5]);let ue;return n[6]!==c?(ue=jsxRuntimeExports.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...c,children:[ie,se,ae,de]}),n[6]=c,n[7]=ue):ue=n[7],ue};function Fe(t){const n=$$3.c(14),{icon:c,showNetwork:ie,isDisabled:se,networkIcon:ae}=t,de=c===void 0?Xt:c,ue=se===void 0?!1:se;let pe;n[0]!==ue?(pe=Kt({isDisabled:ue}),n[0]=ue,n[1]=pe):pe=n[1];const ge=pe,be=ue?"disabled":"outlined";let _e;n[2]!==de||n[3]!==be?(_e=jsxRuntimeExports.jsx(te$1,{type:"icon",variant:be,icon:de}),n[2]=de,n[3]=be,n[4]=_e):_e=n[4];let we;n[5]!==ae||n[6]!==ie||n[7]!==ge.networkContainer?(we=ie&&ae&&jsxRuntimeExports.jsx(Box,{...ge.networkContainer,children:jsxRuntimeExports.jsx(Icon,{as:ae,boxSize:"12px"})}),n[5]=ae,n[6]=ie,n[7]=ge.networkContainer,n[8]=we):we=n[8];let qe;return n[9]!==ue||n[10]!==ge.container||n[11]!==_e||n[12]!==we?(qe=jsxRuntimeExports.jsxs(Box,{...ge.container,"aria-disabled":ue,children:[_e,we]}),n[9]=ue,n[10]=ge.container,n[11]=_e,n[12]=we,n[13]=qe):qe=n[13],qe}function Jt({isSelected:t,isDisabled:n,isInteractive:c}){return{container:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",borderRadius:"dynamic.2xl",borderWidth:"1px",borderStyle:"solid",borderColor:t?"state.success.main":"transparent",bg:t?"state.success.tint10":"neutral.10",width:"100%",cursor:n?"not-allowed":c?"pointer":"default",opacity:n?.6:1,_hover:!c||t||n?void 0:{borderColor:"neutral.30"}},content:{display:"flex",flexDirection:"column",flex:"1 0 0",minWidth:0},title:{textStyle:"body2Regular",color:n?"text.disabled":"text.main"},subtitle:{textStyle:"captionRegular",color:n?"text.disabled":"text.subtext"},actions:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0}}}function _n(t){const n=$$3.c(33),{isDisabled:c,chipsVariant:ie,chipsLabel:se,title:ae,subtitle:de,rightContent:ue,icon:pe,networkIcon:ge,isSelected:be,onClick:_e}=t,we=c===void 0?!1:c,qe=ie===void 0?"information":ie,Ye=be===void 0?!1:be,Ge=!!_e;let Ze;n[0]!==we||n[1]!==Ye||n[2]!==Ge?(Ze=Jt({isSelected:Ye,isDisabled:we,isInteractive:Ge}),n[0]=we,n[1]=Ye,n[2]=Ge,n[3]=Ze):Ze=n[3];const He=Ze,Ht=we?"disabled":qe,un=He.container,De=_e?"button":void 0,$e=_e&&!we?0:void 0,me=we?void 0:_e,Gt=!!ge;let mn;n[4]!==pe||n[5]!==we||n[6]!==ge||n[7]!==Gt?(mn=jsxRuntimeExports.jsx(Fe,{icon:pe,networkIcon:ge,showNetwork:Gt,isDisabled:we}),n[4]=pe,n[5]=we,n[6]=ge,n[7]=Gt,n[8]=mn):mn=n[8];let dn;n[9]!==He.title||n[10]!==ae?(dn=jsxRuntimeExports.jsx(Box,{...He.title,children:ae}),n[9]=He.title,n[10]=ae,n[11]=dn):dn=n[11];let jt;n[12]!==He.subtitle||n[13]!==de?(jt=de&&jsxRuntimeExports.jsx(Box,{...He.subtitle,children:de}),n[12]=He.subtitle,n[13]=de,n[14]=jt):jt=n[14];let le;n[15]!==He.content||n[16]!==dn||n[17]!==jt?(le=jsxRuntimeExports.jsxs(Box,{...He.content,children:[dn,jt]}),n[15]=He.content,n[16]=dn,n[17]=jt,n[18]=le):le=n[18];let Pe;n[19]!==se||n[20]!==Ht||n[21]!==ue||n[22]!==He.actions?(Pe=(se||ue)&&jsxRuntimeExports.jsxs(Box,{...He.actions,children:[se&&jsxRuntimeExports.jsx(oe$1,{label:se,variant:Ht}),ue&&ue]}),n[19]=se,n[20]=Ht,n[21]=ue,n[22]=He.actions,n[23]=Pe):Pe=n[23];let xe;return n[24]!==we||n[25]!==He.container||n[26]!==mn||n[27]!==le||n[28]!==Pe||n[29]!==De||n[30]!==$e||n[31]!==me?(xe=jsxRuntimeExports.jsxs(Box,{...un,role:De,tabIndex:$e,"aria-disabled":we,onClick:me,children:[mn,le,Pe]}),n[24]=we,n[25]=He.container,n[26]=mn,n[27]=le,n[28]=Pe,n[29]=De,n[30]=$e,n[31]=me,n[32]=xe):xe=n[32],xe}function Qt({isSelected:t,isDisabled:n,isInteractive:c}){return{container:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",borderRadius:"dynamic.2xl",borderWidth:"1px",borderStyle:"solid",borderColor:t?"state.info.main":"transparent",bg:t?"state.info.tint10":"neutral.10",width:"100%",cursor:n?"not-allowed":c?"pointer":"default",opacity:n?.6:1,_hover:!c||t||n?void 0:{borderColor:"neutral.30"}},content:{display:"flex",flexDirection:"column",flex:"1 0 0",minWidth:0},title:{textStyle:"body2Regular",color:n?"text.disabled":"text.main"},subtitle:{textStyle:"captionRegular",color:n?"text.disabled":"text.subtext"},actions:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0}}}function Bn(t){const n=$$3.c(33),{isDisabled:c,chipsVariant:ie,chipsLabel:se,title:ae,subtitle:de,rightContent:ue,icon:pe,networkIcon:ge,isSelected:be,onClick:_e}=t,we=c===void 0?!1:c,qe=ie===void 0?"information":ie,Ye=be===void 0?!1:be,Ge=!!_e;let Ze;n[0]!==we||n[1]!==Ye||n[2]!==Ge?(Ze=Qt({isSelected:Ye,isDisabled:we,isInteractive:Ge}),n[0]=we,n[1]=Ye,n[2]=Ge,n[3]=Ze):Ze=n[3];const He=Ze,Ht=we?"disabled":qe,un=He.container,De=_e?"button":void 0,$e=_e&&!we?0:void 0,me=we?void 0:_e,Gt=!!ge;let mn;n[4]!==pe||n[5]!==we||n[6]!==ge||n[7]!==Gt?(mn=jsxRuntimeExports.jsx(Fe,{icon:pe,networkIcon:ge,showNetwork:Gt,isDisabled:we}),n[4]=pe,n[5]=we,n[6]=ge,n[7]=Gt,n[8]=mn):mn=n[8];let dn;n[9]!==He.title||n[10]!==ae?(dn=jsxRuntimeExports.jsx(Box,{...He.title,children:ae}),n[9]=He.title,n[10]=ae,n[11]=dn):dn=n[11];let jt;n[12]!==He.subtitle||n[13]!==de?(jt=de&&jsxRuntimeExports.jsx(Box,{...He.subtitle,children:de}),n[12]=He.subtitle,n[13]=de,n[14]=jt):jt=n[14];let le;n[15]!==He.content||n[16]!==dn||n[17]!==jt?(le=jsxRuntimeExports.jsxs(Box,{...He.content,children:[dn,jt]}),n[15]=He.content,n[16]=dn,n[17]=jt,n[18]=le):le=n[18];let Pe;n[19]!==se||n[20]!==Ht||n[21]!==ue||n[22]!==He.actions?(Pe=(se||ue)&&jsxRuntimeExports.jsxs(Box,{...He.actions,children:[se&&jsxRuntimeExports.jsx(oe$1,{label:se,variant:Ht}),ue&&ue]}),n[19]=se,n[20]=Ht,n[21]=ue,n[22]=He.actions,n[23]=Pe):Pe=n[23];let xe;return n[24]!==we||n[25]!==He.container||n[26]!==mn||n[27]!==le||n[28]!==Pe||n[29]!==De||n[30]!==$e||n[31]!==me?(xe=jsxRuntimeExports.jsxs(Box,{...un,role:De,tabIndex:$e,"aria-disabled":we,onClick:me,children:[mn,le,Pe]}),n[24]=we,n[25]=He.container,n[26]=mn,n[27]=le,n[28]=Pe,n[29]=De,n[30]=$e,n[31]=me,n[32]=xe):xe=n[32],xe}function en({status:t}){return{container:{position:"relative",display:"inline-flex",alignItems:"center",gap:"12px",padding:"8px",borderRadius:"20px",borderWidth:"1px",borderStyle:"solid",borderColor:t==="success"?"state.success.main":t==="error"?"state.error.main":"neutral.30",bg:"transparent",justifyContent:"center"},spinner:{position:"absolute",inset:"-1px",width:"calc(100% + 2px)",height:"calc(100% + 2px)",animation:"walletTransferSpin",pointerEvents:"none"},centerIcon:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",color:t==="success"?"state.success.main":t==="error"?"state.error.main":"text.main",flexShrink:0}}}function tn(t){let n=getComputedStyle(document.documentElement).getPropertyValue(t);for(;n.startsWith("var(");){const c=n.slice(4,n.length-1);n=getComputedStyle(document.documentElement).getPropertyValue(c)}return n.trim()}function Tn(t){const n=$$3.c(22),{leftIcon:c,centerIcon:ie,rightIcon:se,status:ae}=t,de=ae===void 0?"loading":ae;let ue;n[0]===Symbol.for("react.memo_cache_sentinel")?(ue=tn("--chakra-colors-primary.main"),n[0]=ue):ue=n[0];const pe=ue;let ge;n[1]!==de?(ge=en({status:de}),n[1]=de,n[2]=ge):ge=n[2];const be=ge,_e=de==="loading",we=de==="loading";let qe;n[3]!==_e||n[4]!==be.spinner?(qe=_e&&jsxRuntimeExports.jsx(Box,{...be.spinner,children:jsxRuntimeExports.jsx("svg",{viewBox:"0 0 200 80",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{width:"100%",height:"100%"},children:jsxRuntimeExports.jsx("rect",{x:"1",y:"1",width:"198",height:"78",rx:"20",stroke:pe,strokeWidth:"2",pathLength:"100",strokeDasharray:"15 85",strokeLinecap:"round"})})}),n[3]=_e,n[4]=be.spinner,n[5]=qe):qe=n[5];let Ye;n[6]!==c?(Ye=jsxRuntimeExports.jsx(te$1,{type:"icon",variant:"secondary",icon:c}),n[6]=c,n[7]=Ye):Ye=n[7];let Ge;n[8]!==ie?(Ge=jsxRuntimeExports.jsx(Icon,{as:ie,boxSize:"24px"}),n[8]=ie,n[9]=Ge):Ge=n[9];let Ze;n[10]!==be.centerIcon||n[11]!==Ge?(Ze=jsxRuntimeExports.jsx(Box,{...be.centerIcon,children:Ge}),n[10]=be.centerIcon,n[11]=Ge,n[12]=Ze):Ze=n[12];let He;n[13]!==se?(He=jsxRuntimeExports.jsx(te$1,{type:"icon",variant:"secondary",icon:se}),n[13]=se,n[14]=He):He=n[14];let Ht;return n[15]!==be.container||n[16]!==we||n[17]!==qe||n[18]!==Ye||n[19]!==Ze||n[20]!==He?(Ht=jsxRuntimeExports.jsxs(Box,{...be.container,"aria-busy":we,children:[qe,Ye,Ze,He]}),n[15]=be.container,n[16]=we,n[17]=qe,n[18]=Ye,n[19]=Ze,n[20]=He,n[21]=Ht):Ht=n[21],Ht}const nn={isDarkTheme:!1,themeName:"Default Light",primary:{main:"#3963F8",hover:"#2D4EC6",tint10:"rgba(57, 99, 248, 0.1)",tint20:"rgba(57, 99, 248, 0.2)"},neutral:{bgDark:"#171A1C",bgLight:"#FFFFFF",neutral10:"#F1F2F4",neutral30:"#D8DBDF",neutral50:"#B3BAC1"},text:{main:"#171A1C",inverse:"#FFFFFF",subtext:"#6B7280",disabled:"#B3BAC1"},state:{success:{main:"#07C067",tint10:"rgba(7, 192, 103, 0.1)",tint20:"rgba(7, 192, 103, 0.2)"},error:{main:"#FF2244",tint10:"rgba(255, 34, 68, 0.1)",tint20:"rgba(255, 34, 68, 0.2)"},warning:{main:"#EA8E16",tint10:"rgba(234, 142, 22, 0.1)",tint20:"rgba(234, 142, 22, 0.2)"},info:{main:"#179EF8",tint10:"rgba(23, 158, 248, 0.1)",tint20:"rgba(23, 158, 248, 0.2)"}}},on$1={fontFamily:"Inter, sans-serif",fontSizes:{h1:"48px",h2:"40px",h3:"36px",h4:"32px",h5:"28px",h6:"24px",subtitle:"20px",body1:"18px",body2:"16px",body3:"14px",caption:"12px"}},Ae={option1:{xs:"4px",sm:"4px",md:"8px",lg:"12px",xl:"16px","2xl":"20px"},option2:{xs:"6px",sm:"8px",md:"12px",lg:"16px",xl:"20px","2xl":"24px"},option3:{xs:"8px",sm:"12px",md:"16px",lg:"20px",xl:"24px","2xl":"28px"},option4:{xs:"12px",sm:"16px",md:"20px",lg:"24px",xl:"28px","2xl":"32px"}};function rn(t,n){const c={colors:{"primary.main":{value:t.primary.main},"primary.hover":{value:t.primary.hover},"primary.tint10":{value:t.primary.tint10},"primary.tint20":{value:t.primary.tint20},"neutral.bgDark":{value:t.neutral.bgDark},"neutral.bgLight":{value:t.neutral.bgLight},"neutral.10":{value:t.neutral.neutral10},"neutral.30":{value:t.neutral.neutral30},"neutral.50":{value:t.neutral.neutral50},"text.main":{value:t.text.main},"text.inverse":{value:t.text.inverse},"text.subtext":{value:t.text.subtext},"text.disabled":{value:t.text.disabled},"state.success.main":{value:t.state.success.main},"state.success.tint10":{value:t.state.success.tint10},"state.success.tint20":{value:t.state.success.tint20},"state.error.main":{value:t.state.error.main},"state.error.tint10":{value:t.state.error.tint10},"state.error.tint20":{value:t.state.error.tint20},"state.warning.main":{value:t.state.warning.main},"state.warning.tint10":{value:t.state.warning.tint10},"state.warning.tint20":{value:t.state.warning.tint20},"state.info.main":{value:t.state.info.main},"state.info.tint10":{value:t.state.info.tint10},"state.info.tint20":{value:t.state.info.tint20}}};return n&&(c.radii={"dynamic.xs":{value:n.xs},"dynamic.sm":{value:n.sm},"dynamic.md":{value:n.md},"dynamic.lg":{value:n.lg},"dynamic.xl":{value:n.xl},"dynamic.2xl":{value:n["2xl"]}}),c}function ln(t){const n=t.fontSizes||{},c=t.fontFamily,ie={Regular:400,Medium:500,Bold:700},se={h1:"64px",h2:"56px",h3:"52px",h4:"48px",h5:"40px",h6:"36px",subtitle:"32px",body1:"28px",body2:"24px",body3:"20px",caption:"16px"},ae={};return Object.entries(n).forEach(([de,ue])=>{Object.entries(ie).forEach(([pe,ge])=>{const be=`${de}${pe}`;ae[be]={value:{fontFamily:c,fontSize:ue,fontWeight:ge,lineHeight:se[de]}}})}),ae}function sn(t=nn,n=on$1,c="option2"){const ie=Ae[c],se=rn(t,ie),ae=ln(n),de=defineConfig({theme:{semanticTokens:se,textStyles:ae,keyframes:{walletTransferSpin:{from:{strokeDashoffset:"0"},to:{strokeDashoffset:"-100"}}},tokens:{animations:{walletTransferSpin:{value:"walletTransferSpin 2s linear infinite"}}},breakpoints:{sm:"390px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1440px","3xl":"1920px"}}});return createSystem(defaultConfig,de)}const an=sn();function Dn(t){const n=$$3.c(5),{children:c,system:ie}=t,se=ie===void 0?an:ie;let ae;n[0]!==c?(ae=jsxRuntimeExports.jsx(J$3,{attribute:"class",disableTransitionOnChange:!0,children:c}),n[0]=c,n[1]=ae):ae=n[1];let de;return n[2]!==se||n[3]!==ae?(de=jsxRuntimeExports.jsx(ChakraProvider,{value:se,children:ae}),n[2]=se,n[3]=ae,n[4]=de):de=n[4],de}var si=Object.defineProperty,ni=t=>{throw TypeError(t)},fi=(t,n,c)=>n in t?si(t,n,{enumerable:!0,configurable:!0,writable:!0,value:c}):t[n]=c,Xn=(t,n,c)=>fi(t,typeof n!="symbol"?n+"":n,c),ui=(t,n,c)=>n.has(t)||ni("Cannot "+c),ii=(t,n,c)=>n.has(t)?ni("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,c),ai=(t,n,c)=>(ui(t,n,"access private method"),c);class WalletException extends Error{constructor(n,c){const ie=`<${n}> ${c}`;console.log(ie),super(c),this.name=new.target.name}}class WalletNotFoundException extends WalletException{constructor(n,c=""){const ie=`Wallet Not found ${c}`;super(n,ie)}}class UserDeniedException extends WalletException{constructor(n){super(n,"User denied the request")}}class NotSupportedException extends WalletException{constructor(n,c){super(n,`${c} networks are not supported by this wallet.`)}}class WalletNotInstalledException extends WalletException{constructor(n){super(n,"Not Installed.")}}class TokenNotSupportedException extends WalletException{constructor(n,c){super(n,`${c} token is not supported by this wallet.`)}}class ChainNotSupportedException extends WalletException{constructor(n,c){super(n,`${c} is not supported by this wallet.`)}}class ProviderException extends WalletException{constructor(n){super(n,"Provider could not be initialized.")}}class ChainException extends Error{constructor(n,c){const ie=`<${n}> ${c}`;console.log(ie),super(c),this.name=new.target.name}}class ChainNotImplementedException extends ChainException{constructor(n){super(n,"Not Implemented!")}}class InvalidParametersException extends ChainException{constructor(n,c){super(n,`Invalid parameters: ${c}`)}}class Unauthorized extends ChainException{constructor(n,c,ie,se){super(n,`Unauthorized access to ${c} from ${ie} to ${se}`),this.method=c,this.from=ie,this.to=se}}class ActionExceptions extends Error{constructor(n,c){super(`${n}: ${c}`),this.name=new.target.name}}class ActionNotImplementedException extends ActionExceptions{constructor(n){super(n,"Not Implemented!")}}class Web3CallbackFailedException extends ActionExceptions{constructor(n){super(n,"Something went wrong during web3 callback process!")}}class InitializationException extends ActionExceptions{constructor(){super("","Provider not initialized.")}}class InsufficientBalanceException extends ActionExceptions{constructor(){super("Payment","Insufficient Funds")}}var Actions$1=(t=>(t.Payment="Payment",t.ClaimNFT="ClaimNFT",t.Record="Record",t.Auth="Aut",t.Login="Login",t))(Actions$1||{}),Groups=(t=>(t.EVM="EVM",t.SOL="SOL",t.BTC="BTC",t.XION="XION",t.UD="UD",t))(Groups||{}),Network=(t=>(t.TESTNET="TESTNET",t.MAINNET="MAINNET",t))(Network||{}),Chains=(t=>(t.POLYGON="POLYGON",t.BINANCE="BINANCE",t.SKALE="SKALE",t.BASE="BASE",t.LINEA="LINEA",t.ETH="ETH",t.SOLANA="SOLANA",t.REDBELLY="REDBELLY",t.UNSTOPPABLE="UNSTOPPABLE",t.BITLAYER="BITLAYER",t.XION="XION",t))(Chains||{});const chains=[{name:"BINANCE",group:Groups.EVM,TESTNET:{chainName:"Smart Chain - Testnet",chainId:"0x61",nativeCurrency:{name:"BNB",decimals:18,symbol:"BNB"},rpcUrls:["https://bsc-testnet-dataseed.bnbchain.org/"]},MAINNET:{chainName:"Smart Chain",chainId:"0x38",nativeCurrency:{name:"BNB",decimals:18,symbol:"BNB"},rpcUrls:["https://bsc-dataseed.binance.org/"]}},{name:"POLYGON",group:Groups.EVM,TESTNET:{chainName:"Polygon Amoy Testnet",chainId:"0x13882",nativeCurrency:{name:"MATIC",decimals:18,symbol:"MATIC"},rpcUrls:["https://rpc-amoy.polygon.technology"]},MAINNET:{chainName:"Polygon Mainnet",chainId:"0x89",nativeCurrency:{name:"MATIC",decimals:18,symbol:"MATIC"},rpcUrls:["https://polygon-rpc.com/"]}},{name:"SKALE",group:Groups.EVM,TESTNET:{chainName:"SKALE Testnet Calypso Hub",chainId:"0x3A14269B",nativeCurrency:{name:"sFUEL",decimals:18,symbol:"sFUEL"},rpcUrls:["https://testnet.skalenodes.com/v1/giant-half-dual-testnet"]},MAINNET:{chainName:"SKALE Calypso Hub",chainId:"0x5D456C62",nativeCurrency:{name:"sFUEL",decimals:18,symbol:"sFUEL"},rpcUrls:["https://mainnet.skalenodes.com/v1/honorable-steel-rasalhague"]}},{name:"BASE",group:Groups.EVM,TESTNET:{chainName:"Base Sepolia",chainId:"0x14a34",nativeCurrency:{name:"ETH",decimals:18,symbol:"ETH"},rpcUrls:["https://sepolia.base.org"]},MAINNET:{chainName:"Base Mainnet",chainId:"0x2105",nativeCurrency:{name:"ETH",decimals:18,symbol:"ETH"},rpcUrls:["https://mainnet.base.org/"]}},{name:"LINEA",group:Groups.EVM,MAINNET:{chainName:"Linea",chainId:"0xe708",nativeCurrency:{name:"ETH",decimals:18,symbol:"LineaETH"},rpcUrls:["https://rpc.linea.build"]},TESTNET:{chainName:"Linea",chainId:"0xe705",nativeCurrency:{name:"ETH",decimals:18,symbol:"LineaETH"},rpcUrls:["https://rpc.sepolia.linea.build"]}},{name:"ETH",group:Groups.EVM,MAINNET:{chainName:"Ethereum",chainId:"0x1",nativeCurrency:{name:"ETH",decimals:18,symbol:"ETH"},rpcUrls:["https://mainnet.infura.io/v3/"]},TESTNET:{chainName:"Sepolia",chainId:"0xaa36a7",nativeCurrency:{name:"ETH",decimals:18,symbol:"ETH"},rpcUrls:["https://eth-sepolia.public.blastapi.io/"]}},{name:"REDBELLY",group:Groups.EVM,TESTNET:{chainName:"Redbelly Network Testnet",chainId:"0x99",nativeCurrency:{name:"RBNT",decimals:18,symbol:"RBNT"},rpcUrls:["https://governors.testnet.redbelly.network"]},MAINNET:{chainName:"Redbelly Network Mainnet",chainId:"0x97",nativeCurrency:{name:"RBNT",decimals:18,symbol:"RBNT"},rpcUrls:["https://governors.mainnet.redbelly.network"]}},{name:"BITLAYER",group:Groups.EVM,MAINNET:{chainName:"Bitlayer Mainnet",chainId:"0x310C5",nativeCurrency:{name:"BTC",decimals:18,symbol:"BTC"},rpcUrls:["https://rpc.bitlayer.org"]},TESTNET:{chainName:"Bitlayer Testnet",chainId:"0x3106A",nativeCurrency:{name:"BTC",decimals:18,symbol:"BTC"},rpcUrls:["https://testnet-rpc.bitlayer.org"]}},{name:"SOLANA",group:Groups.SOL,MAINNET:{chainName:"Solana Mainnet",chainId:"0x1",nativeCurrency:{name:"SOL",decimals:9,symbol:"SOL"},rpcUrls:[]},TESTNET:{chainName:"Solana Testnet",chainId:"0x01",nativeCurrency:{name:"SOL",decimals:9,symbol:"SOL"},rpcUrls:[]}},{name:"XION",group:Groups.XION,MAINNET:{chainName:"Xion Mainnet",chainId:"0x1",nativeCurrency:{name:"XION",decimals:6,symbol:"XION"},rpcUrls:[]},TESTNET:{chainName:"Xion Testnet",chainId:"0x01",nativeCurrency:{name:"XION",decimals:6,symbol:"XION"},rpcUrls:[]}},{name:"UNSTOPPABLE",group:Groups.UD,MAINNET:{chainName:"Unstoppable Domains Mainnet",chainId:"0x1",nativeCurrency:{name:"UD",decimals:18,symbol:"UD"},rpcUrls:[]},TESTNET:{chainName:"Unstoppable Domains Testnet",chainId:"0x01",nativeCurrency:{name:"UD",decimals:18,symbol:"UD"},rpcUrls:[]}}];function getChainByName(t){const n=chains.find(c=>c.name.toLowerCase()===t.toLowerCase());if(!n)throw new ChainNotImplementedException(t);return n}function getGroupOfChain(t){return getChainByName(t).group}function isChainInGroup(t,n){return getGroupOfChain(t)===n}class Web3Wallet{constructor(n,c,ie){this.name=n,this.group=c,this.stepizer=ie}}async function getEvmProviderByWalletName(t,n=500){return new Promise(c=>{const ie=[];function se(ae){const de=ae.detail;!(de!=null&&de.provider)||!(de!=null&&de.info)||ie.push(de)}window.addEventListener("eip6963:announceProvider",se),window.dispatchEvent(new Event("eip6963:requestProvider")),setTimeout(()=>{window.removeEventListener("eip6963:announceProvider",se),console.log("EIP-6963 providers announced:",ie.map(ue=>ue.info.name));const ae=ie.find(({info:ue})=>ue.name===t||ue.name.toLowerCase()===t.toLowerCase());if(ae){c(ae.provider);return}const de=window.ethereum;if(t.toLowerCase()==="metamask"&&de!=null&&de.isMetaMask){c(de);return}c(null)},n)})}var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};function getDefaultExportFromCjs$2(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function getAugmentedNamespace(t){if(t.__esModule)return t;var n=t.default;if(typeof n=="function"){var c=function ie(){return this instanceof ie?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};c.prototype=n.prototype}else c={};return Object.defineProperty(c,"__esModule",{value:!0}),Object.keys(t).forEach(function(ie){var se=Object.getOwnPropertyDescriptor(t,ie);Object.defineProperty(c,ie,se.get?se:{enumerable:!0,get:function(){return t[ie]}})}),c}var bn$8={exports:{}},buffer$1={},base64Js$1={};base64Js$1.byteLength=byteLength;base64Js$1.toByteArray=toByteArray;base64Js$1.fromByteArray=fromByteArray;var lookup=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i$3=0,len=code.length;i$3<len;++i$3)lookup[i$3]=code[i$3],revLookup[code.charCodeAt(i$3)]=i$3;revLookup[45]=62;revLookup[95]=63;function getLens(t){var n=t.length;if(n%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var c=t.indexOf("=");c===-1&&(c=n);var ie=c===n?0:4-c%4;return[c,ie]}function byteLength(t){var n=getLens(t),c=n[0],ie=n[1];return(c+ie)*3/4-ie}function _byteLength(t,n,c){return(n+c)*3/4-c}function toByteArray(t){var n,c=getLens(t),ie=c[0],se=c[1],ae=new Arr(_byteLength(t,ie,se)),de=0,ue=se>0?ie-4:ie,pe;for(pe=0;pe<ue;pe+=4)n=revLookup[t.charCodeAt(pe)]<<18|revLookup[t.charCodeAt(pe+1)]<<12|revLookup[t.charCodeAt(pe+2)]<<6|revLookup[t.charCodeAt(pe+3)],ae[de++]=n>>16&255,ae[de++]=n>>8&255,ae[de++]=n&255;return se===2&&(n=revLookup[t.charCodeAt(pe)]<<2|revLookup[t.charCodeAt(pe+1)]>>4,ae[de++]=n&255),se===1&&(n=revLookup[t.charCodeAt(pe)]<<10|revLookup[t.charCodeAt(pe+1)]<<4|revLookup[t.charCodeAt(pe+2)]>>2,ae[de++]=n>>8&255,ae[de++]=n&255),ae}function tripletToBase64(t){return lookup[t>>18&63]+lookup[t>>12&63]+lookup[t>>6&63]+lookup[t&63]}function encodeChunk(t,n,c){for(var ie,se=[],ae=n;ae<c;ae+=3)ie=(t[ae]<<16&16711680)+(t[ae+1]<<8&65280)+(t[ae+2]&255),se.push(tripletToBase64(ie));return se.join("")}function fromByteArray(t){for(var n,c=t.length,ie=c%3,se=[],ae=16383,de=0,ue=c-ie;de<ue;de+=ae)se.push(encodeChunk(t,de,de+ae>ue?ue:de+ae));return ie===1?(n=t[c-1],se.push(lookup[n>>2]+lookup[n<<4&63]+"==")):ie===2&&(n=(t[c-2]<<8)+t[c-1],se.push(lookup[n>>10]+lookup[n>>4&63]+lookup[n<<2&63]+"=")),se.join("")}var ieee754$1={};ieee754$1.read=function(t,n,c,ie,se){var ae,de,ue=se*8-ie-1,pe=(1<<ue)-1,ge=pe>>1,be=-7,_e=c?se-1:0,we=c?-1:1,qe=t[n+_e];for(_e+=we,ae=qe&(1<<-be)-1,qe>>=-be,be+=ue;be>0;ae=ae*256+t[n+_e],_e+=we,be-=8);for(de=ae&(1<<-be)-1,ae>>=-be,be+=ie;be>0;de=de*256+t[n+_e],_e+=we,be-=8);if(ae===0)ae=1-ge;else{if(ae===pe)return de?NaN:(qe?-1:1)*(1/0);de=de+Math.pow(2,ie),ae=ae-ge}return(qe?-1:1)*de*Math.pow(2,ae-ie)};ieee754$1.write=function(t,n,c,ie,se,ae){var de,ue,pe,ge=ae*8-se-1,be=(1<<ge)-1,_e=be>>1,we=se===23?Math.pow(2,-24)-Math.pow(2,-77):0,qe=ie?0:ae-1,Ye=ie?1:-1,Ge=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(ue=isNaN(n)?1:0,de=be):(de=Math.floor(Math.log(n)/Math.LN2),n*(pe=Math.pow(2,-de))<1&&(de--,pe*=2),de+_e>=1?n+=we/pe:n+=we*Math.pow(2,1-_e),n*pe>=2&&(de++,pe/=2),de+_e>=be?(ue=0,de=be):de+_e>=1?(ue=(n*pe-1)*Math.pow(2,se),de=de+_e):(ue=n*Math.pow(2,_e-1)*Math.pow(2,se),de=0));se>=8;t[c+qe]=ue&255,qe+=Ye,ue/=256,se-=8);for(de=de<<se|ue,ge+=se;ge>0;t[c+qe]=de&255,qe+=Ye,de/=256,ge-=8);t[c+qe-Ye]|=Ge*128};(function(t){const n=base64Js$1,c=ieee754$1,ie=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=be,t.SlowBuffer=$e,t.INSPECT_MAX_BYTES=50;const se=2147483647;t.kMaxLength=se;const{Uint8Array:ae,ArrayBuffer:de,SharedArrayBuffer:ue}=globalThis;be.TYPED_ARRAY_SUPPORT=pe(),!be.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function pe(){try{const Un=new ae(1),Ln={foo:function(){return 42}};return Object.setPrototypeOf(Ln,ae.prototype),Object.setPrototypeOf(Un,Ln),Un.foo()===42}catch{return!1}}Object.defineProperty(be.prototype,"parent",{enumerable:!0,get:function(){if(be.isBuffer(this))return this.buffer}}),Object.defineProperty(be.prototype,"offset",{enumerable:!0,get:function(){if(be.isBuffer(this))return this.byteOffset}});function ge(Un){if(Un>se)throw new RangeError('The value "'+Un+'" is invalid for option "size"');const Ln=new ae(Un);return Object.setPrototypeOf(Ln,be.prototype),Ln}function be(Un,Ln,$n){if(typeof Un=="number"){if(typeof Ln=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Ye(Un)}return _e(Un,Ln,$n)}be.poolSize=8192;function _e(Un,Ln,$n){if(typeof Un=="string")return Ge(Un,Ln);if(de.isView(Un))return He(Un);if(Un==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Un);if(di(Un,de)||Un&&di(Un.buffer,de)||typeof ue<"u"&&(di(Un,ue)||Un&&di(Un.buffer,ue)))return Ht(Un,Ln,$n);if(typeof Un=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const jn=Un.valueOf&&Un.valueOf();if(jn!=null&&jn!==Un)return be.from(jn,Ln,$n);const Pn=un(Un);if(Pn)return Pn;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Un[Symbol.toPrimitive]=="function")return be.from(Un[Symbol.toPrimitive]("string"),Ln,$n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Un)}be.from=function(Un,Ln,$n){return _e(Un,Ln,$n)},Object.setPrototypeOf(be.prototype,ae.prototype),Object.setPrototypeOf(be,ae);function we(Un){if(typeof Un!="number")throw new TypeError('"size" argument must be of type number');if(Un<0)throw new RangeError('The value "'+Un+'" is invalid for option "size"')}function qe(Un,Ln,$n){return we(Un),Un<=0?ge(Un):Ln!==void 0?typeof $n=="string"?ge(Un).fill(Ln,$n):ge(Un).fill(Ln):ge(Un)}be.alloc=function(Un,Ln,$n){return qe(Un,Ln,$n)};function Ye(Un){return we(Un),ge(Un<0?0:De(Un)|0)}be.allocUnsafe=function(Un){return Ye(Un)},be.allocUnsafeSlow=function(Un){return Ye(Un)};function Ge(Un,Ln){if((typeof Ln!="string"||Ln==="")&&(Ln="utf8"),!be.isEncoding(Ln))throw new TypeError("Unknown encoding: "+Ln);const $n=me(Un,Ln)|0;let jn=ge($n);const Pn=jn.write(Un,Ln);return Pn!==$n&&(jn=jn.slice(0,Pn)),jn}function Ze(Un){const Ln=Un.length<0?0:De(Un.length)|0,$n=ge(Ln);for(let jn=0;jn<Ln;jn+=1)$n[jn]=Un[jn]&255;return $n}function He(Un){if(di(Un,ae)){const Ln=new ae(Un);return Ht(Ln.buffer,Ln.byteOffset,Ln.byteLength)}return Ze(Un)}function Ht(Un,Ln,$n){if(Ln<0||Un.byteLength<Ln)throw new RangeError('"offset" is outside of buffer bounds');if(Un.byteLength<Ln+($n||0))throw new RangeError('"length" is outside of buffer bounds');let jn;return Ln===void 0&&$n===void 0?jn=new ae(Un):$n===void 0?jn=new ae(Un,Ln):jn=new ae(Un,Ln,$n),Object.setPrototypeOf(jn,be.prototype),jn}function un(Un){if(be.isBuffer(Un)){const Ln=De(Un.length)|0,$n=ge(Ln);return $n.length===0||Un.copy($n,0,0,Ln),$n}if(Un.length!==void 0)return typeof Un.length!="number"||li(Un.length)?ge(0):Ze(Un);if(Un.type==="Buffer"&&Array.isArray(Un.data))return Ze(Un.data)}function De(Un){if(Un>=se)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+se.toString(16)+" bytes");return Un|0}function $e(Un){return+Un!=Un&&(Un=0),be.alloc(+Un)}be.isBuffer=function(Un){return Un!=null&&Un._isBuffer===!0&&Un!==be.prototype},be.compare=function(Un,Ln){if(di(Un,ae)&&(Un=be.from(Un,Un.offset,Un.byteLength)),di(Ln,ae)&&(Ln=be.from(Ln,Ln.offset,Ln.byteLength)),!be.isBuffer(Un)||!be.isBuffer(Ln))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Un===Ln)return 0;let $n=Un.length,jn=Ln.length;for(let Pn=0,On=Math.min($n,jn);Pn<On;++Pn)if(Un[Pn]!==Ln[Pn]){$n=Un[Pn],jn=Ln[Pn];break}return $n<jn?-1:jn<$n?1:0},be.isEncoding=function(Un){switch(String(Un).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},be.concat=function(Un,Ln){if(!Array.isArray(Un))throw new TypeError('"list" argument must be an Array of Buffers');if(Un.length===0)return be.alloc(0);let $n;if(Ln===void 0)for(Ln=0,$n=0;$n<Un.length;++$n)Ln+=Un[$n].length;const jn=be.allocUnsafe(Ln);let Pn=0;for($n=0;$n<Un.length;++$n){let On=Un[$n];if(di(On,ae))Pn+On.length>jn.length?(be.isBuffer(On)||(On=be.from(On)),On.copy(jn,Pn)):ae.prototype.set.call(jn,On,Pn);else if(be.isBuffer(On))On.copy(jn,Pn);else throw new TypeError('"list" argument must be an Array of Buffers');Pn+=On.length}return jn};function me(Un,Ln){if(be.isBuffer(Un))return Un.length;if(de.isView(Un)||di(Un,de))return Un.byteLength;if(typeof Un!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Un);const $n=Un.length,jn=arguments.length>2&&arguments[2]===!0;if(!jn&&$n===0)return 0;let Pn=!1;for(;;)switch(Ln){case"ascii":case"latin1":case"binary":return $n;case"utf8":case"utf-8":return Ai(Un).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $n*2;case"hex":return $n>>>1;case"base64":return yi(Un).length;default:if(Pn)return jn?-1:Ai(Un).length;Ln=(""+Ln).toLowerCase(),Pn=!0}}be.byteLength=me;function Gt(Un,Ln,$n){let jn=!1;if((Ln===void 0||Ln<0)&&(Ln=0),Ln>this.length||(($n===void 0||$n>this.length)&&($n=this.length),$n<=0)||($n>>>=0,Ln>>>=0,$n<=Ln))return"";for(Un||(Un="utf8");;)switch(Un){case"hex":return Vt(this,Ln,$n);case"utf8":case"utf-8":return Zt(this,Ln,$n);case"ascii":return Ne(this,Ln,$n);case"latin1":case"binary":return We(this,Ln,$n);case"base64":return yn(this,Ln,$n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Sn(this,Ln,$n);default:if(jn)throw new TypeError("Unknown encoding: "+Un);Un=(Un+"").toLowerCase(),jn=!0}}be.prototype._isBuffer=!0;function mn(Un,Ln,$n){const jn=Un[Ln];Un[Ln]=Un[$n],Un[$n]=jn}be.prototype.swap16=function(){const Un=this.length;if(Un%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Ln=0;Ln<Un;Ln+=2)mn(this,Ln,Ln+1);return this},be.prototype.swap32=function(){const Un=this.length;if(Un%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let Ln=0;Ln<Un;Ln+=4)mn(this,Ln,Ln+3),mn(this,Ln+1,Ln+2);return this},be.prototype.swap64=function(){const Un=this.length;if(Un%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let Ln=0;Ln<Un;Ln+=8)mn(this,Ln,Ln+7),mn(this,Ln+1,Ln+6),mn(this,Ln+2,Ln+5),mn(this,Ln+3,Ln+4);return this},be.prototype.toString=function(){const Un=this.length;return Un===0?"":arguments.length===0?Zt(this,0,Un):Gt.apply(this,arguments)},be.prototype.toLocaleString=be.prototype.toString,be.prototype.equals=function(Un){if(!be.isBuffer(Un))throw new TypeError("Argument must be a Buffer");return this===Un?!0:be.compare(this,Un)===0},be.prototype.inspect=function(){let Un="";const Ln=t.INSPECT_MAX_BYTES;return Un=this.toString("hex",0,Ln).replace(/(.{2})/g,"$1 ").trim(),this.length>Ln&&(Un+=" ... "),"<Buffer "+Un+">"},ie&&(be.prototype[ie]=be.prototype.inspect),be.prototype.compare=function(Un,Ln,$n,jn,Pn){if(di(Un,ae)&&(Un=be.from(Un,Un.offset,Un.byteLength)),!be.isBuffer(Un))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Un);if(Ln===void 0&&(Ln=0),$n===void 0&&($n=Un?Un.length:0),jn===void 0&&(jn=0),Pn===void 0&&(Pn=this.length),Ln<0||$n>Un.length||jn<0||Pn>this.length)throw new RangeError("out of range index");if(jn>=Pn&&Ln>=$n)return 0;if(jn>=Pn)return-1;if(Ln>=$n)return 1;if(Ln>>>=0,$n>>>=0,jn>>>=0,Pn>>>=0,this===Un)return 0;let On=Pn-jn,Fn=$n-Ln;const Pt=Math.min(On,Fn),gn=this.slice(jn,Pn),Nn=Un.slice(Ln,$n);for(let mi=0;mi<Pt;++mi)if(gn[mi]!==Nn[mi]){On=gn[mi],Fn=Nn[mi];break}return On<Fn?-1:Fn<On?1:0};function dn(Un,Ln,$n,jn,Pn){if(Un.length===0)return-1;if(typeof $n=="string"?(jn=$n,$n=0):$n>2147483647?$n=2147483647:$n<-2147483648&&($n=-2147483648),$n=+$n,li($n)&&($n=Pn?0:Un.length-1),$n<0&&($n=Un.length+$n),$n>=Un.length){if(Pn)return-1;$n=Un.length-1}else if($n<0)if(Pn)$n=0;else return-1;if(typeof Ln=="string"&&(Ln=be.from(Ln,jn)),be.isBuffer(Ln))return Ln.length===0?-1:jt(Un,Ln,$n,jn,Pn);if(typeof Ln=="number")return Ln=Ln&255,typeof ae.prototype.indexOf=="function"?Pn?ae.prototype.indexOf.call(Un,Ln,$n):ae.prototype.lastIndexOf.call(Un,Ln,$n):jt(Un,[Ln],$n,jn,Pn);throw new TypeError("val must be string, number or Buffer")}function jt(Un,Ln,$n,jn,Pn){let On=1,Fn=Un.length,Pt=Ln.length;if(jn!==void 0&&(jn=String(jn).toLowerCase(),jn==="ucs2"||jn==="ucs-2"||jn==="utf16le"||jn==="utf-16le")){if(Un.length<2||Ln.length<2)return-1;On=2,Fn/=2,Pt/=2,$n/=2}function gn(mi,Wn){return On===1?mi[Wn]:mi.readUInt16BE(Wn*On)}let Nn;if(Pn){let mi=-1;for(Nn=$n;Nn<Fn;Nn++)if(gn(Un,Nn)===gn(Ln,mi===-1?0:Nn-mi)){if(mi===-1&&(mi=Nn),Nn-mi+1===Pt)return mi*On}else mi!==-1&&(Nn-=Nn-mi),mi=-1}else for($n+Pt>Fn&&($n=Fn-Pt),Nn=$n;Nn>=0;Nn--){let mi=!0;for(let Wn=0;Wn<Pt;Wn++)if(gn(Un,Nn+Wn)!==gn(Ln,Wn)){mi=!1;break}if(mi)return Nn}return-1}be.prototype.includes=function(Un,Ln,$n){return this.indexOf(Un,Ln,$n)!==-1},be.prototype.indexOf=function(Un,Ln,$n){return dn(this,Un,Ln,$n,!0)},be.prototype.lastIndexOf=function(Un,Ln,$n){return dn(this,Un,Ln,$n,!1)};function le(Un,Ln,$n,jn){$n=Number($n)||0;const Pn=Un.length-$n;jn?(jn=Number(jn),jn>Pn&&(jn=Pn)):jn=Pn;const On=Ln.length;jn>On/2&&(jn=On/2);let Fn;for(Fn=0;Fn<jn;++Fn){const Pt=parseInt(Ln.substr(Fn*2,2),16);if(li(Pt))return Fn;Un[$n+Fn]=Pt}return Fn}function Pe(Un,Ln,$n,jn){return Zn(Ai(Ln,Un.length-$n),Un,$n,jn)}function xe(Un,Ln,$n,jn){return Zn(Ii(Ln),Un,$n,jn)}function ze(Un,Ln,$n,jn){return Zn(yi(Ln),Un,$n,jn)}function Ft(Un,Ln,$n,jn){return Zn(Ei(Ln,Un.length-$n),Un,$n,jn)}be.prototype.write=function(Un,Ln,$n,jn){if(Ln===void 0)jn="utf8",$n=this.length,Ln=0;else if($n===void 0&&typeof Ln=="string")jn=Ln,$n=this.length,Ln=0;else if(isFinite(Ln))Ln=Ln>>>0,isFinite($n)?($n=$n>>>0,jn===void 0&&(jn="utf8")):(jn=$n,$n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Pn=this.length-Ln;if(($n===void 0||$n>Pn)&&($n=Pn),Un.length>0&&($n<0||Ln<0)||Ln>this.length)throw new RangeError("Attempt to write outside buffer bounds");jn||(jn="utf8");let On=!1;for(;;)switch(jn){case"hex":return le(this,Un,Ln,$n);case"utf8":case"utf-8":return Pe(this,Un,Ln,$n);case"ascii":case"latin1":case"binary":return xe(this,Un,Ln,$n);case"base64":return ze(this,Un,Ln,$n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ft(this,Un,Ln,$n);default:if(On)throw new TypeError("Unknown encoding: "+jn);jn=(""+jn).toLowerCase(),On=!0}},be.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function yn(Un,Ln,$n){return Ln===0&&$n===Un.length?n.fromByteArray(Un):n.fromByteArray(Un.slice(Ln,$n))}function Zt(Un,Ln,$n){$n=Math.min(Un.length,$n);const jn=[];let Pn=Ln;for(;Pn<$n;){const On=Un[Pn];let Fn=null,Pt=On>239?4:On>223?3:On>191?2:1;if(Pn+Pt<=$n){let gn,Nn,mi,Wn;switch(Pt){case 1:On<128&&(Fn=On);break;case 2:gn=Un[Pn+1],(gn&192)===128&&(Wn=(On&31)<<6|gn&63,Wn>127&&(Fn=Wn));break;case 3:gn=Un[Pn+1],Nn=Un[Pn+2],(gn&192)===128&&(Nn&192)===128&&(Wn=(On&15)<<12|(gn&63)<<6|Nn&63,Wn>2047&&(Wn<55296||Wn>57343)&&(Fn=Wn));break;case 4:gn=Un[Pn+1],Nn=Un[Pn+2],mi=Un[Pn+3],(gn&192)===128&&(Nn&192)===128&&(mi&192)===128&&(Wn=(On&15)<<18|(gn&63)<<12|(Nn&63)<<6|mi&63,Wn>65535&&Wn<1114112&&(Fn=Wn))}}Fn===null?(Fn=65533,Pt=1):Fn>65535&&(Fn-=65536,jn.push(Fn>>>10&1023|55296),Fn=56320|Fn&1023),jn.push(Fn),Pn+=Pt}return ce(jn)}const Me=4096;function ce(Un){const Ln=Un.length;if(Ln<=Me)return String.fromCharCode.apply(String,Un);let $n="",jn=0;for(;jn<Ln;)$n+=String.fromCharCode.apply(String,Un.slice(jn,jn+=Me));return $n}function Ne(Un,Ln,$n){let jn="";$n=Math.min(Un.length,$n);for(let Pn=Ln;Pn<$n;++Pn)jn+=String.fromCharCode(Un[Pn]&127);return jn}function We(Un,Ln,$n){let jn="";$n=Math.min(Un.length,$n);for(let Pn=Ln;Pn<$n;++Pn)jn+=String.fromCharCode(Un[Pn]);return jn}function Vt(Un,Ln,$n){const jn=Un.length;(!Ln||Ln<0)&&(Ln=0),(!$n||$n<0||$n>jn)&&($n=jn);let Pn="";for(let On=Ln;On<$n;++On)Pn+=Kn[Un[On]];return Pn}function Sn(Un,Ln,$n){const jn=Un.slice(Ln,$n);let Pn="";for(let On=0;On<jn.length-1;On+=2)Pn+=String.fromCharCode(jn[On]+jn[On+1]*256);return Pn}be.prototype.slice=function(Un,Ln){const $n=this.length;Un=~~Un,Ln=Ln===void 0?$n:~~Ln,Un<0?(Un+=$n,Un<0&&(Un=0)):Un>$n&&(Un=$n),Ln<0?(Ln+=$n,Ln<0&&(Ln=0)):Ln>$n&&(Ln=$n),Ln<Un&&(Ln=Un);const jn=this.subarray(Un,Ln);return Object.setPrototypeOf(jn,be.prototype),jn};function An(Un,Ln,$n){if(Un%1!==0||Un<0)throw new RangeError("offset is not uint");if(Un+Ln>$n)throw new RangeError("Trying to access beyond buffer length")}be.prototype.readUintLE=be.prototype.readUIntLE=function(Un,Ln,$n){Un=Un>>>0,Ln=Ln>>>0,$n||An(Un,Ln,this.length);let jn=this[Un],Pn=1,On=0;for(;++On<Ln&&(Pn*=256);)jn+=this[Un+On]*Pn;return jn},be.prototype.readUintBE=be.prototype.readUIntBE=function(Un,Ln,$n){Un=Un>>>0,Ln=Ln>>>0,$n||An(Un,Ln,this.length);let jn=this[Un+--Ln],Pn=1;for(;Ln>0&&(Pn*=256);)jn+=this[Un+--Ln]*Pn;return jn},be.prototype.readUint8=be.prototype.readUInt8=function(Un,Ln){return Un=Un>>>0,Ln||An(Un,1,this.length),this[Un]},be.prototype.readUint16LE=be.prototype.readUInt16LE=function(Un,Ln){return Un=Un>>>0,Ln||An(Un,2,this.length),this[Un]|this[Un+1]<<8},be.prototype.readUint16BE=be.prototype.readUInt16BE=function(Un,Ln){return Un=Un>>>0,Ln||An(Un,2,this.length),this[Un]<<8|this[Un+1]},be.prototype.readUint32LE=be.prototype.readUInt32LE=function(Un,Ln){return Un=Un>>>0,Ln||An(Un,4,this.length),(this[Un]|this[Un+1]<<8|this[Un+2]<<16)+this[Un+3]*16777216},be.prototype.readUint32BE=be.prototype.readUInt32BE=function(Un,Ln){return Un=Un>>>0,Ln||An(Un,4,this.length),this[Un]*16777216+(this[Un+1]<<16|this[Un+2]<<8|this[Un+3])},be.prototype.readBigUInt64LE=Vn(function(Un){Un=Un>>>0,ri(Un,"offset");const Ln=this[Un],$n=this[Un+7];(Ln===void 0||$n===void 0)&&hi(Un,this.length-8);const jn=Ln+this[++Un]*2**8+this[++Un]*2**16+this[++Un]*2**24,Pn=this[++Un]+this[++Un]*2**8+this[++Un]*2**16+$n*2**24;return BigInt(jn)+(BigInt(Pn)<<BigInt(32))}),be.prototype.readBigUInt64BE=Vn(function(Un){Un=Un>>>0,ri(Un,"offset");const Ln=this[Un],$n=this[Un+7];(Ln===void 0||$n===void 0)&&hi(Un,this.length-8);const jn=Ln*2**24+this[++Un]*2**16+this[++Un]*2**8+this[++Un],Pn=this[++Un]*2**24+this[++Un]*2**16+this[++Un]*2**8+$n;return(BigInt(jn)<<BigInt(32))+BigInt(Pn)}),be.prototype.readIntLE=function(Un,Ln,$n){Un=Un>>>0,Ln=Ln>>>0,$n||An(Un,Ln,this.length);let jn=this[Un],Pn=1,On=0;for(;++On<Ln&&(Pn*=256);)jn+=this[Un+On]*Pn;return Pn*=128,jn>=Pn&&(jn-=Math.pow(2,8*Ln)),jn},be.prototype.readIntBE=function(Un,Ln,$n){Un=Un>>>0,Ln=Ln>>>0,$n||An(Un,Ln,this.length);let jn=Ln,Pn=1,On=this[Un+--jn];for(;jn>0&&(Pn*=256);)On+=this[Un+--jn]*Pn;return Pn*=128,On>=Pn&&(On-=Math.pow(2,8*Ln)),On},be.prototype.readInt8=function(Un,Ln){return Un=Un>>>0,Ln||An(Un,1,this.length),this[Un]&128?(255-this[Un]+1)*-1:this[Un]},be.prototype.readInt16LE=function(Un,Ln){Un=Un>>>0,Ln||An(Un,2,this.length);const $n=this[Un]|this[Un+1]<<8;return $n&32768?$n|4294901760:$n},be.prototype.readInt16BE=function(Un,Ln){Un=Un>>>0,Ln||An(Un,2,this.length);const $n=this[Un+1]|this[Un]<<8;return $n&32768?$n|4294901760:$n},be.prototype.readInt32LE=function(Un,Ln){return Un=Un>>>0,Ln||An(Un,4,this.length),this[Un]|this[Un+1]<<8|this[Un+2]<<16|this[Un+3]<<24},be.prototype.readInt32BE=function(Un,Ln){return Un=Un>>>0,Ln||An(Un,4,this.length),this[Un]<<24|this[Un+1]<<16|this[Un+2]<<8|this[Un+3]},be.prototype.readBigInt64LE=Vn(function(Un){Un=Un>>>0,ri(Un,"offset");const Ln=this[Un],$n=this[Un+7];(Ln===void 0||$n===void 0)&&hi(Un,this.length-8);const jn=this[Un+4]+this[Un+5]*2**8+this[Un+6]*2**16+($n<<24);return(BigInt(jn)<<BigInt(32))+BigInt(Ln+this[++Un]*2**8+this[++Un]*2**16+this[++Un]*2**24)}),be.prototype.readBigInt64BE=Vn(function(Un){Un=Un>>>0,ri(Un,"offset");const Ln=this[Un],$n=this[Un+7];(Ln===void 0||$n===void 0)&&hi(Un,this.length-8);const jn=(Ln<<24)+this[++Un]*2**16+this[++Un]*2**8+this[++Un];return(BigInt(jn)<<BigInt(32))+BigInt(this[++Un]*2**24+this[++Un]*2**16+this[++Un]*2**8+$n)}),be.prototype.readFloatLE=function(Un,Ln){return Un=Un>>>0,Ln||An(Un,4,this.length),c.read(this,Un,!0,23,4)},be.prototype.readFloatBE=function(Un,Ln){return Un=Un>>>0,Ln||An(Un,4,this.length),c.read(this,Un,!1,23,4)},be.prototype.readDoubleLE=function(Un,Ln){return Un=Un>>>0,Ln||An(Un,8,this.length),c.read(this,Un,!0,52,8)},be.prototype.readDoubleBE=function(Un,Ln){return Un=Un>>>0,Ln||An(Un,8,this.length),c.read(this,Un,!1,52,8)};function Cn(Un,Ln,$n,jn,Pn,On){if(!be.isBuffer(Un))throw new TypeError('"buffer" argument must be a Buffer instance');if(Ln>Pn||Ln<On)throw new RangeError('"value" argument is out of bounds');if($n+jn>Un.length)throw new RangeError("Index out of range")}be.prototype.writeUintLE=be.prototype.writeUIntLE=function(Un,Ln,$n,jn){if(Un=+Un,Ln=Ln>>>0,$n=$n>>>0,!jn){const Fn=Math.pow(2,8*$n)-1;Cn(this,Un,Ln,$n,Fn,0)}let Pn=1,On=0;for(this[Ln]=Un&255;++On<$n&&(Pn*=256);)this[Ln+On]=Un/Pn&255;return Ln+$n},be.prototype.writeUintBE=be.prototype.writeUIntBE=function(Un,Ln,$n,jn){if(Un=+Un,Ln=Ln>>>0,$n=$n>>>0,!jn){const Fn=Math.pow(2,8*$n)-1;Cn(this,Un,Ln,$n,Fn,0)}let Pn=$n-1,On=1;for(this[Ln+Pn]=Un&255;--Pn>=0&&(On*=256);)this[Ln+Pn]=Un/On&255;return Ln+$n},be.prototype.writeUint8=be.prototype.writeUInt8=function(Un,Ln,$n){return Un=+Un,Ln=Ln>>>0,$n||Cn(this,Un,Ln,1,255,0),this[Ln]=Un&255,Ln+1},be.prototype.writeUint16LE=be.prototype.writeUInt16LE=function(Un,Ln,$n){return Un=+Un,Ln=Ln>>>0,$n||Cn(this,Un,Ln,2,65535,0),this[Ln]=Un&255,this[Ln+1]=Un>>>8,Ln+2},be.prototype.writeUint16BE=be.prototype.writeUInt16BE=function(Un,Ln,$n){return Un=+Un,Ln=Ln>>>0,$n||Cn(this,Un,Ln,2,65535,0),this[Ln]=Un>>>8,this[Ln+1]=Un&255,Ln+2},be.prototype.writeUint32LE=be.prototype.writeUInt32LE=function(Un,Ln,$n){return Un=+Un,Ln=Ln>>>0,$n||Cn(this,Un,Ln,4,4294967295,0),this[Ln+3]=Un>>>24,this[Ln+2]=Un>>>16,this[Ln+1]=Un>>>8,this[Ln]=Un&255,Ln+4},be.prototype.writeUint32BE=be.prototype.writeUInt32BE=function(Un,Ln,$n){return Un=+Un,Ln=Ln>>>0,$n||Cn(this,Un,Ln,4,4294967295,0),this[Ln]=Un>>>24,this[Ln+1]=Un>>>16,this[Ln+2]=Un>>>8,this[Ln+3]=Un&255,Ln+4};function Qn(Un,Ln,$n,jn,Pn){ti(Ln,jn,Pn,Un,$n,7);let On=Number(Ln&BigInt(4294967295));Un[$n++]=On,On=On>>8,Un[$n++]=On,On=On>>8,Un[$n++]=On,On=On>>8,Un[$n++]=On;let Fn=Number(Ln>>BigInt(32)&BigInt(4294967295));return Un[$n++]=Fn,Fn=Fn>>8,Un[$n++]=Fn,Fn=Fn>>8,Un[$n++]=Fn,Fn=Fn>>8,Un[$n++]=Fn,$n}function En(Un,Ln,$n,jn,Pn){ti(Ln,jn,Pn,Un,$n,7);let On=Number(Ln&BigInt(4294967295));Un[$n+7]=On,On=On>>8,Un[$n+6]=On,On=On>>8,Un[$n+5]=On,On=On>>8,Un[$n+4]=On;let Fn=Number(Ln>>BigInt(32)&BigInt(4294967295));return Un[$n+3]=Fn,Fn=Fn>>8,Un[$n+2]=Fn,Fn=Fn>>8,Un[$n+1]=Fn,Fn=Fn>>8,Un[$n]=Fn,$n+8}be.prototype.writeBigUInt64LE=Vn(function(Un,Ln=0){return Qn(this,Un,Ln,BigInt(0),BigInt("0xffffffffffffffff"))}),be.prototype.writeBigUInt64BE=Vn(function(Un,Ln=0){return En(this,Un,Ln,BigInt(0),BigInt("0xffffffffffffffff"))}),be.prototype.writeIntLE=function(Un,Ln,$n,jn){if(Un=+Un,Ln=Ln>>>0,!jn){const Pt=Math.pow(2,8*$n-1);Cn(this,Un,Ln,$n,Pt-1,-Pt)}let Pn=0,On=1,Fn=0;for(this[Ln]=Un&255;++Pn<$n&&(On*=256);)Un<0&&Fn===0&&this[Ln+Pn-1]!==0&&(Fn=1),this[Ln+Pn]=(Un/On>>0)-Fn&255;return Ln+$n},be.prototype.writeIntBE=function(Un,Ln,$n,jn){if(Un=+Un,Ln=Ln>>>0,!jn){const Pt=Math.pow(2,8*$n-1);Cn(this,Un,Ln,$n,Pt-1,-Pt)}let Pn=$n-1,On=1,Fn=0;for(this[Ln+Pn]=Un&255;--Pn>=0&&(On*=256);)Un<0&&Fn===0&&this[Ln+Pn+1]!==0&&(Fn=1),this[Ln+Pn]=(Un/On>>0)-Fn&255;return Ln+$n},be.prototype.writeInt8=function(Un,Ln,$n){return Un=+Un,Ln=Ln>>>0,$n||Cn(this,Un,Ln,1,127,-128),Un<0&&(Un=255+Un+1),this[Ln]=Un&255,Ln+1},be.prototype.writeInt16LE=function(Un,Ln,$n){return Un=+Un,Ln=Ln>>>0,$n||Cn(this,Un,Ln,2,32767,-32768),this[Ln]=Un&255,this[Ln+1]=Un>>>8,Ln+2},be.prototype.writeInt16BE=function(Un,Ln,$n){return Un=+Un,Ln=Ln>>>0,$n||Cn(this,Un,Ln,2,32767,-32768),this[Ln]=Un>>>8,this[Ln+1]=Un&255,Ln+2},be.prototype.writeInt32LE=function(Un,Ln,$n){return Un=+Un,Ln=Ln>>>0,$n||Cn(this,Un,Ln,4,2147483647,-2147483648),this[Ln]=Un&255,this[Ln+1]=Un>>>8,this[Ln+2]=Un>>>16,this[Ln+3]=Un>>>24,Ln+4},be.prototype.writeInt32BE=function(Un,Ln,$n){return Un=+Un,Ln=Ln>>>0,$n||Cn(this,Un,Ln,4,2147483647,-2147483648),Un<0&&(Un=4294967295+Un+1),this[Ln]=Un>>>24,this[Ln+1]=Un>>>16,this[Ln+2]=Un>>>8,this[Ln+3]=Un&255,Ln+4},be.prototype.writeBigInt64LE=Vn(function(Un,Ln=0){return Qn(this,Un,Ln,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),be.prototype.writeBigInt64BE=Vn(function(Un,Ln=0){return En(this,Un,Ln,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function In(Un,Ln,$n,jn,Pn,On){if($n+jn>Un.length)throw new RangeError("Index out of range");if($n<0)throw new RangeError("Index out of range")}function Mn(Un,Ln,$n,jn,Pn){return Ln=+Ln,$n=$n>>>0,Pn||In(Un,Ln,$n,4),c.write(Un,Ln,$n,jn,23,4),$n+4}be.prototype.writeFloatLE=function(Un,Ln,$n){return Mn(this,Un,Ln,!0,$n)},be.prototype.writeFloatBE=function(Un,Ln,$n){return Mn(this,Un,Ln,!1,$n)};function zn(Un,Ln,$n,jn,Pn){return Ln=+Ln,$n=$n>>>0,Pn||In(Un,Ln,$n,8),c.write(Un,Ln,$n,jn,52,8),$n+8}be.prototype.writeDoubleLE=function(Un,Ln,$n){return zn(this,Un,Ln,!0,$n)},be.prototype.writeDoubleBE=function(Un,Ln,$n){return zn(this,Un,Ln,!1,$n)},be.prototype.copy=function(Un,Ln,$n,jn){if(!be.isBuffer(Un))throw new TypeError("argument should be a Buffer");if($n||($n=0),!jn&&jn!==0&&(jn=this.length),Ln>=Un.length&&(Ln=Un.length),Ln||(Ln=0),jn>0&&jn<$n&&(jn=$n),jn===$n||Un.length===0||this.length===0)return 0;if(Ln<0)throw new RangeError("targetStart out of bounds");if($n<0||$n>=this.length)throw new RangeError("Index out of range");if(jn<0)throw new RangeError("sourceEnd out of bounds");jn>this.length&&(jn=this.length),Un.length-Ln<jn-$n&&(jn=Un.length-Ln+$n);const Pn=jn-$n;return this===Un&&typeof ae.prototype.copyWithin=="function"?this.copyWithin(Ln,$n,jn):ae.prototype.set.call(Un,this.subarray($n,jn),Ln),Pn},be.prototype.fill=function(Un,Ln,$n,jn){if(typeof Un=="string"){if(typeof Ln=="string"?(jn=Ln,Ln=0,$n=this.length):typeof $n=="string"&&(jn=$n,$n=this.length),jn!==void 0&&typeof jn!="string")throw new TypeError("encoding must be a string");if(typeof jn=="string"&&!be.isEncoding(jn))throw new TypeError("Unknown encoding: "+jn);if(Un.length===1){const On=Un.charCodeAt(0);(jn==="utf8"&&On<128||jn==="latin1")&&(Un=On)}}else typeof Un=="number"?Un=Un&255:typeof Un=="boolean"&&(Un=Number(Un));if(Ln<0||this.length<Ln||this.length<$n)throw new RangeError("Out of range index");if($n<=Ln)return this;Ln=Ln>>>0,$n=$n===void 0?this.length:$n>>>0,Un||(Un=0);let Pn;if(typeof Un=="number")for(Pn=Ln;Pn<$n;++Pn)this[Pn]=Un;else{const On=be.isBuffer(Un)?Un:be.from(Un,jn),Fn=On.length;if(Fn===0)throw new TypeError('The value "'+Un+'" is invalid for argument "value"');for(Pn=0;Pn<$n-Ln;++Pn)this[Pn+Ln]=On[Pn%Fn]}return this};const Jn={};function hn(Un,Ln,$n){Jn[Un]=class extends $n{constructor(){super(),Object.defineProperty(this,"message",{value:Ln.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${Un}]`,this.stack,delete this.name}get code(){return Un}set code(jn){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:jn,writable:!0})}toString(){return`${this.name} [${Un}]: ${this.message}`}}}hn("ERR_BUFFER_OUT_OF_BOUNDS",function(Un){return Un?`${Un} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),hn("ERR_INVALID_ARG_TYPE",function(Un,Ln){return`The "${Un}" argument must be of type number. Received type ${typeof Ln}`},TypeError),hn("ERR_OUT_OF_RANGE",function(Un,Ln,$n){let jn=`The value of "${Un}" is out of range.`,Pn=$n;return Number.isInteger($n)&&Math.abs($n)>2**32?Pn=xn(String($n)):typeof $n=="bigint"&&(Pn=String($n),($n>BigInt(2)**BigInt(32)||$n<-(BigInt(2)**BigInt(32)))&&(Pn=xn(Pn)),Pn+="n"),jn+=` It must be ${Ln}. Received ${Pn}`,jn},RangeError);function xn(Un){let Ln="",$n=Un.length;const jn=Un[0]==="-"?1:0;for(;$n>=jn+4;$n-=3)Ln=`_${Un.slice($n-3,$n)}${Ln}`;return`${Un.slice(0,$n)}${Ln}`}function Hn(Un,Ln,$n){ri(Ln,"offset"),(Un[Ln]===void 0||Un[Ln+$n]===void 0)&&hi(Ln,Un.length-($n+1))}function ti(Un,Ln,$n,jn,Pn,On){if(Un>$n||Un<Ln){const Fn=typeof Ln=="bigint"?"n":"";let Pt;throw Ln===0||Ln===BigInt(0)?Pt=`>= 0${Fn} and < 2${Fn} ** ${(On+1)*8}${Fn}`:Pt=`>= -(2${Fn} ** ${(On+1)*8-1}${Fn}) and < 2 ** ${(On+1)*8-1}${Fn}`,new Jn.ERR_OUT_OF_RANGE("value",Pt,Un)}Hn(jn,Pn,On)}function ri(Un,Ln){if(typeof Un!="number")throw new Jn.ERR_INVALID_ARG_TYPE(Ln,"number",Un)}function hi(Un,Ln,$n){throw Math.floor(Un)!==Un?(ri(Un,$n),new Jn.ERR_OUT_OF_RANGE("offset","an integer",Un)):Ln<0?new Jn.ERR_BUFFER_OUT_OF_BOUNDS:new Jn.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Ln}`,Un)}const gi=/[^+/0-9A-Za-z-_]/g;function vi(Un){if(Un=Un.split("=")[0],Un=Un.trim().replace(gi,""),Un.length<2)return"";for(;Un.length%4!==0;)Un=Un+"=";return Un}function Ai(Un,Ln){Ln=Ln||1/0;let $n;const jn=Un.length;let Pn=null;const On=[];for(let Fn=0;Fn<jn;++Fn){if($n=Un.charCodeAt(Fn),$n>55295&&$n<57344){if(!Pn){if($n>56319){(Ln-=3)>-1&&On.push(239,191,189);continue}else if(Fn+1===jn){(Ln-=3)>-1&&On.push(239,191,189);continue}Pn=$n;continue}if($n<56320){(Ln-=3)>-1&&On.push(239,191,189),Pn=$n;continue}$n=(Pn-55296<<10|$n-56320)+65536}else Pn&&(Ln-=3)>-1&&On.push(239,191,189);if(Pn=null,$n<128){if((Ln-=1)<0)break;On.push($n)}else if($n<2048){if((Ln-=2)<0)break;On.push($n>>6|192,$n&63|128)}else if($n<65536){if((Ln-=3)<0)break;On.push($n>>12|224,$n>>6&63|128,$n&63|128)}else if($n<1114112){if((Ln-=4)<0)break;On.push($n>>18|240,$n>>12&63|128,$n>>6&63|128,$n&63|128)}else throw new Error("Invalid code point")}return On}function Ii(Un){const Ln=[];for(let $n=0;$n<Un.length;++$n)Ln.push(Un.charCodeAt($n)&255);return Ln}function Ei(Un,Ln){let $n,jn,Pn;const On=[];for(let Fn=0;Fn<Un.length&&!((Ln-=2)<0);++Fn)$n=Un.charCodeAt(Fn),jn=$n>>8,Pn=$n%256,On.push(Pn),On.push(jn);return On}function yi(Un){return n.toByteArray(vi(Un))}function Zn(Un,Ln,$n,jn){let Pn;for(Pn=0;Pn<jn&&!(Pn+$n>=Ln.length||Pn>=Un.length);++Pn)Ln[Pn+$n]=Un[Pn];return Pn}function di(Un,Ln){return Un instanceof Ln||Un!=null&&Un.constructor!=null&&Un.constructor.name!=null&&Un.constructor.name===Ln.name}function li(Un){return Un!==Un}const Kn=(function(){const Un="0123456789abcdef",Ln=new Array(256);for(let $n=0;$n<16;++$n){const jn=$n*16;for(let Pn=0;Pn<16;++Pn)Ln[jn+Pn]=Un[$n]+Un[Pn]}return Ln})();function Vn(Un){return typeof BigInt>"u"?qn:Un}function qn(){throw new Error("BigInt not supported")}})(buffer$1);const Buffer$7=buffer$1.Buffer,Blob$2=buffer$1.Blob,BlobOptions=buffer$1.BlobOptions,Buffer$1$1=buffer$1.Buffer,File=buffer$1.File,FileOptions=buffer$1.FileOptions,INSPECT_MAX_BYTES=buffer$1.INSPECT_MAX_BYTES,SlowBuffer=buffer$1.SlowBuffer,TranscodeEncoding=buffer$1.TranscodeEncoding,atob$1=buffer$1.atob,btoa$1=buffer$1.btoa,constants$4=buffer$1.constants,isAscii=buffer$1.isAscii,isUtf8=buffer$1.isUtf8,kMaxLength=buffer$1.kMaxLength,kStringMaxLength=buffer$1.kStringMaxLength,resolveObjectURL=buffer$1.resolveObjectURL,transcode=buffer$1.transcode,dist$1=Object.freeze(Object.defineProperty({__proto__:null,Blob:Blob$2,BlobOptions,Buffer:Buffer$1$1,File,FileOptions,INSPECT_MAX_BYTES,SlowBuffer,TranscodeEncoding,atob:atob$1,btoa:btoa$1,constants:constants$4,default:Buffer$7,isAscii,isUtf8,kMaxLength,kStringMaxLength,resolveObjectURL,transcode},Symbol.toStringTag,{value:"Module"})),require$$0$4=getAugmentedNamespace(dist$1);(function(t){(function(n,c){function ie(xe,ze){if(!xe)throw new Error(ze||"Assertion failed")}function se(xe,ze){xe.super_=ze;var Ft=function(){};Ft.prototype=ze.prototype,xe.prototype=new Ft,xe.prototype.constructor=xe}function ae(xe,ze,Ft){if(ae.isBN(xe))return xe;this.negative=0,this.words=null,this.length=0,this.red=null,xe!==null&&((ze==="le"||ze==="be")&&(Ft=ze,ze=10),this._init(xe||0,ze||10,Ft||"be"))}typeof n=="object"?n.exports=ae:c.BN=ae,ae.BN=ae,ae.wordSize=26;var de;try{typeof window<"u"&&typeof window.Buffer<"u"?de=window.Buffer:de=require$$0$4.Buffer}catch{}ae.isBN=function(xe){return xe instanceof ae?!0:xe!==null&&typeof xe=="object"&&xe.constructor.wordSize===ae.wordSize&&Array.isArray(xe.words)},ae.max=function(xe,ze){return xe.cmp(ze)>0?xe:ze},ae.min=function(xe,ze){return xe.cmp(ze)<0?xe:ze},ae.prototype._init=function(xe,ze,Ft){if(typeof xe=="number")return this._initNumber(xe,ze,Ft);if(typeof xe=="object")return this._initArray(xe,ze,Ft);ze==="hex"&&(ze=16),ie(ze===(ze|0)&&ze>=2&&ze<=36),xe=xe.toString().replace(/\s+/g,"");var yn=0;xe[0]==="-"&&(yn++,this.negative=1),yn<xe.length&&(ze===16?this._parseHex(xe,yn,Ft):(this._parseBase(xe,ze,yn),Ft==="le"&&this._initArray(this.toArray(),ze,Ft)))},ae.prototype._initNumber=function(xe,ze,Ft){xe<0&&(this.negative=1,xe=-xe),xe<67108864?(this.words=[xe&67108863],this.length=1):xe<4503599627370496?(this.words=[xe&67108863,xe/67108864&67108863],this.length=2):(ie(xe<9007199254740992),this.words=[xe&67108863,xe/67108864&67108863,1],this.length=3),Ft==="le"&&this._initArray(this.toArray(),ze,Ft)},ae.prototype._initArray=function(xe,ze,Ft){if(ie(typeof xe.length=="number"),xe.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(xe.length/3),this.words=new Array(this.length);for(var yn=0;yn<this.length;yn++)this.words[yn]=0;var Zt,Me,ce=0;if(Ft==="be")for(yn=xe.length-1,Zt=0;yn>=0;yn-=3)Me=xe[yn]|xe[yn-1]<<8|xe[yn-2]<<16,this.words[Zt]|=Me<<ce&67108863,this.words[Zt+1]=Me>>>26-ce&67108863,ce+=24,ce>=26&&(ce-=26,Zt++);else if(Ft==="le")for(yn=0,Zt=0;yn<xe.length;yn+=3)Me=xe[yn]|xe[yn+1]<<8|xe[yn+2]<<16,this.words[Zt]|=Me<<ce&67108863,this.words[Zt+1]=Me>>>26-ce&67108863,ce+=24,ce>=26&&(ce-=26,Zt++);return this._strip()};function ue(xe,ze){var Ft=xe.charCodeAt(ze);if(Ft>=48&&Ft<=57)return Ft-48;if(Ft>=65&&Ft<=70)return Ft-55;if(Ft>=97&&Ft<=102)return Ft-87;ie(!1,"Invalid character in "+xe)}function pe(xe,ze,Ft){var yn=ue(xe,Ft);return Ft-1>=ze&&(yn|=ue(xe,Ft-1)<<4),yn}ae.prototype._parseHex=function(xe,ze,Ft){this.length=Math.ceil((xe.length-ze)/6),this.words=new Array(this.length);for(var yn=0;yn<this.length;yn++)this.words[yn]=0;var Zt=0,Me=0,ce;if(Ft==="be")for(yn=xe.length-1;yn>=ze;yn-=2)ce=pe(xe,ze,yn)<<Zt,this.words[Me]|=ce&67108863,Zt>=18?(Zt-=18,Me+=1,this.words[Me]|=ce>>>26):Zt+=8;else{var Ne=xe.length-ze;for(yn=Ne%2===0?ze+1:ze;yn<xe.length;yn+=2)ce=pe(xe,ze,yn)<<Zt,this.words[Me]|=ce&67108863,Zt>=18?(Zt-=18,Me+=1,this.words[Me]|=ce>>>26):Zt+=8}this._strip()};function ge(xe,ze,Ft,yn){for(var Zt=0,Me=0,ce=Math.min(xe.length,Ft),Ne=ze;Ne<ce;Ne++){var We=xe.charCodeAt(Ne)-48;Zt*=yn,We>=49?Me=We-49+10:We>=17?Me=We-17+10:Me=We,ie(We>=0&&Me<yn,"Invalid character"),Zt+=Me}return Zt}ae.prototype._parseBase=function(xe,ze,Ft){this.words=[0],this.length=1;for(var yn=0,Zt=1;Zt<=67108863;Zt*=ze)yn++;yn--,Zt=Zt/ze|0;for(var Me=xe.length-Ft,ce=Me%yn,Ne=Math.min(Me,Me-ce)+Ft,We=0,Vt=Ft;Vt<Ne;Vt+=yn)We=ge(xe,Vt,Vt+yn,ze),this.imuln(Zt),this.words[0]+We<67108864?this.words[0]+=We:this._iaddn(We);if(ce!==0){var Sn=1;for(We=ge(xe,Vt,xe.length,ze),Vt=0;Vt<ce;Vt++)Sn*=ze;this.imuln(Sn),this.words[0]+We<67108864?this.words[0]+=We:this._iaddn(We)}this._strip()},ae.prototype.copy=function(xe){xe.words=new Array(this.length);for(var ze=0;ze<this.length;ze++)xe.words[ze]=this.words[ze];xe.length=this.length,xe.negative=this.negative,xe.red=this.red};function be(xe,ze){xe.words=ze.words,xe.length=ze.length,xe.negative=ze.negative,xe.red=ze.red}if(ae.prototype._move=function(xe){be(xe,this)},ae.prototype.clone=function(){var xe=new ae(null);return this.copy(xe),xe},ae.prototype._expand=function(xe){for(;this.length<xe;)this.words[this.length++]=0;return this},ae.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},ae.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{ae.prototype[Symbol.for("nodejs.util.inspect.custom")]=_e}catch{ae.prototype.inspect=_e}else ae.prototype.inspect=_e;function _e(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var we=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],qe=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],Ye=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];ae.prototype.toString=function(xe,ze){xe=xe||10,ze=ze|0||1;var Ft;if(xe===16||xe==="hex"){Ft="";for(var yn=0,Zt=0,Me=0;Me<this.length;Me++){var ce=this.words[Me],Ne=((ce<<yn|Zt)&16777215).toString(16);Zt=ce>>>24-yn&16777215,yn+=2,yn>=26&&(yn-=26,Me--),Zt!==0||Me!==this.length-1?Ft=we[6-Ne.length]+Ne+Ft:Ft=Ne+Ft}for(Zt!==0&&(Ft=Zt.toString(16)+Ft);Ft.length%ze!==0;)Ft="0"+Ft;return this.negative!==0&&(Ft="-"+Ft),Ft}if(xe===(xe|0)&&xe>=2&&xe<=36){var We=qe[xe],Vt=Ye[xe];Ft="";var Sn=this.clone();for(Sn.negative=0;!Sn.isZero();){var An=Sn.modrn(Vt).toString(xe);Sn=Sn.idivn(Vt),Sn.isZero()?Ft=An+Ft:Ft=we[We-An.length]+An+Ft}for(this.isZero()&&(Ft="0"+Ft);Ft.length%ze!==0;)Ft="0"+Ft;return this.negative!==0&&(Ft="-"+Ft),Ft}ie(!1,"Base should be between 2 and 36")},ae.prototype.toNumber=function(){var xe=this.words[0];return this.length===2?xe+=this.words[1]*67108864:this.length===3&&this.words[2]===1?xe+=4503599627370496+this.words[1]*67108864:this.length>2&&ie(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-xe:xe},ae.prototype.toJSON=function(){return this.toString(16,2)},de&&(ae.prototype.toBuffer=function(xe,ze){return this.toArrayLike(de,xe,ze)}),ae.prototype.toArray=function(xe,ze){return this.toArrayLike(Array,xe,ze)};var Ge=function(xe,ze){return xe.allocUnsafe?xe.allocUnsafe(ze):new xe(ze)};ae.prototype.toArrayLike=function(xe,ze,Ft){this._strip();var yn=this.byteLength(),Zt=Ft||Math.max(1,yn);ie(yn<=Zt,"byte array longer than desired length"),ie(Zt>0,"Requested array length <= 0");var Me=Ge(xe,Zt),ce=ze==="le"?"LE":"BE";return this["_toArrayLike"+ce](Me,yn),Me},ae.prototype._toArrayLikeLE=function(xe,ze){for(var Ft=0,yn=0,Zt=0,Me=0;Zt<this.length;Zt++){var ce=this.words[Zt]<<Me|yn;xe[Ft++]=ce&255,Ft<xe.length&&(xe[Ft++]=ce>>8&255),Ft<xe.length&&(xe[Ft++]=ce>>16&255),Me===6?(Ft<xe.length&&(xe[Ft++]=ce>>24&255),yn=0,Me=0):(yn=ce>>>24,Me+=2)}if(Ft<xe.length)for(xe[Ft++]=yn;Ft<xe.length;)xe[Ft++]=0},ae.prototype._toArrayLikeBE=function(xe,ze){for(var Ft=xe.length-1,yn=0,Zt=0,Me=0;Zt<this.length;Zt++){var ce=this.words[Zt]<<Me|yn;xe[Ft--]=ce&255,Ft>=0&&(xe[Ft--]=ce>>8&255),Ft>=0&&(xe[Ft--]=ce>>16&255),Me===6?(Ft>=0&&(xe[Ft--]=ce>>24&255),yn=0,Me=0):(yn=ce>>>24,Me+=2)}if(Ft>=0)for(xe[Ft--]=yn;Ft>=0;)xe[Ft--]=0},Math.clz32?ae.prototype._countBits=function(xe){return 32-Math.clz32(xe)}:ae.prototype._countBits=function(xe){var ze=xe,Ft=0;return ze>=4096&&(Ft+=13,ze>>>=13),ze>=64&&(Ft+=7,ze>>>=7),ze>=8&&(Ft+=4,ze>>>=4),ze>=2&&(Ft+=2,ze>>>=2),Ft+ze},ae.prototype._zeroBits=function(xe){if(xe===0)return 26;var ze=xe,Ft=0;return ze&8191||(Ft+=13,ze>>>=13),ze&127||(Ft+=7,ze>>>=7),ze&15||(Ft+=4,ze>>>=4),ze&3||(Ft+=2,ze>>>=2),ze&1||Ft++,Ft},ae.prototype.bitLength=function(){var xe=this.words[this.length-1],ze=this._countBits(xe);return(this.length-1)*26+ze};function Ze(xe){for(var ze=new Array(xe.bitLength()),Ft=0;Ft<ze.length;Ft++){var yn=Ft/26|0,Zt=Ft%26;ze[Ft]=xe.words[yn]>>>Zt&1}return ze}ae.prototype.zeroBits=function(){if(this.isZero())return 0;for(var xe=0,ze=0;ze<this.length;ze++){var Ft=this._zeroBits(this.words[ze]);if(xe+=Ft,Ft!==26)break}return xe},ae.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},ae.prototype.toTwos=function(xe){return this.negative!==0?this.abs().inotn(xe).iaddn(1):this.clone()},ae.prototype.fromTwos=function(xe){return this.testn(xe-1)?this.notn(xe).iaddn(1).ineg():this.clone()},ae.prototype.isNeg=function(){return this.negative!==0},ae.prototype.neg=function(){return this.clone().ineg()},ae.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},ae.prototype.iuor=function(xe){for(;this.length<xe.length;)this.words[this.length++]=0;for(var ze=0;ze<xe.length;ze++)this.words[ze]=this.words[ze]|xe.words[ze];return this._strip()},ae.prototype.ior=function(xe){return ie((this.negative|xe.negative)===0),this.iuor(xe)},ae.prototype.or=function(xe){return this.length>xe.length?this.clone().ior(xe):xe.clone().ior(this)},ae.prototype.uor=function(xe){return this.length>xe.length?this.clone().iuor(xe):xe.clone().iuor(this)},ae.prototype.iuand=function(xe){var ze;this.length>xe.length?ze=xe:ze=this;for(var Ft=0;Ft<ze.length;Ft++)this.words[Ft]=this.words[Ft]&xe.words[Ft];return this.length=ze.length,this._strip()},ae.prototype.iand=function(xe){return ie((this.negative|xe.negative)===0),this.iuand(xe)},ae.prototype.and=function(xe){return this.length>xe.length?this.clone().iand(xe):xe.clone().iand(this)},ae.prototype.uand=function(xe){return this.length>xe.length?this.clone().iuand(xe):xe.clone().iuand(this)},ae.prototype.iuxor=function(xe){var ze,Ft;this.length>xe.length?(ze=this,Ft=xe):(ze=xe,Ft=this);for(var yn=0;yn<Ft.length;yn++)this.words[yn]=ze.words[yn]^Ft.words[yn];if(this!==ze)for(;yn<ze.length;yn++)this.words[yn]=ze.words[yn];return this.length=ze.length,this._strip()},ae.prototype.ixor=function(xe){return ie((this.negative|xe.negative)===0),this.iuxor(xe)},ae.prototype.xor=function(xe){return this.length>xe.length?this.clone().ixor(xe):xe.clone().ixor(this)},ae.prototype.uxor=function(xe){return this.length>xe.length?this.clone().iuxor(xe):xe.clone().iuxor(this)},ae.prototype.inotn=function(xe){ie(typeof xe=="number"&&xe>=0);var ze=Math.ceil(xe/26)|0,Ft=xe%26;this._expand(ze),Ft>0&&ze--;for(var yn=0;yn<ze;yn++)this.words[yn]=~this.words[yn]&67108863;return Ft>0&&(this.words[yn]=~this.words[yn]&67108863>>26-Ft),this._strip()},ae.prototype.notn=function(xe){return this.clone().inotn(xe)},ae.prototype.setn=function(xe,ze){ie(typeof xe=="number"&&xe>=0);var Ft=xe/26|0,yn=xe%26;return this._expand(Ft+1),ze?this.words[Ft]=this.words[Ft]|1<<yn:this.words[Ft]=this.words[Ft]&~(1<<yn),this._strip()},ae.prototype.iadd=function(xe){var ze;if(this.negative!==0&&xe.negative===0)return this.negative=0,ze=this.isub(xe),this.negative^=1,this._normSign();if(this.negative===0&&xe.negative!==0)return xe.negative=0,ze=this.isub(xe),xe.negative=1,ze._normSign();var Ft,yn;this.length>xe.length?(Ft=this,yn=xe):(Ft=xe,yn=this);for(var Zt=0,Me=0;Me<yn.length;Me++)ze=(Ft.words[Me]|0)+(yn.words[Me]|0)+Zt,this.words[Me]=ze&67108863,Zt=ze>>>26;for(;Zt!==0&&Me<Ft.length;Me++)ze=(Ft.words[Me]|0)+Zt,this.words[Me]=ze&67108863,Zt=ze>>>26;if(this.length=Ft.length,Zt!==0)this.words[this.length]=Zt,this.length++;else if(Ft!==this)for(;Me<Ft.length;Me++)this.words[Me]=Ft.words[Me];return this},ae.prototype.add=function(xe){var ze;return xe.negative!==0&&this.negative===0?(xe.negative=0,ze=this.sub(xe),xe.negative^=1,ze):xe.negative===0&&this.negative!==0?(this.negative=0,ze=xe.sub(this),this.negative=1,ze):this.length>xe.length?this.clone().iadd(xe):xe.clone().iadd(this)},ae.prototype.isub=function(xe){if(xe.negative!==0){xe.negative=0;var ze=this.iadd(xe);return xe.negative=1,ze._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(xe),this.negative=1,this._normSign();var Ft=this.cmp(xe);if(Ft===0)return this.negative=0,this.length=1,this.words[0]=0,this;var yn,Zt;Ft>0?(yn=this,Zt=xe):(yn=xe,Zt=this);for(var Me=0,ce=0;ce<Zt.length;ce++)ze=(yn.words[ce]|0)-(Zt.words[ce]|0)+Me,Me=ze>>26,this.words[ce]=ze&67108863;for(;Me!==0&&ce<yn.length;ce++)ze=(yn.words[ce]|0)+Me,Me=ze>>26,this.words[ce]=ze&67108863;if(Me===0&&ce<yn.length&&yn!==this)for(;ce<yn.length;ce++)this.words[ce]=yn.words[ce];return this.length=Math.max(this.length,ce),yn!==this&&(this.negative=1),this._strip()},ae.prototype.sub=function(xe){return this.clone().isub(xe)};function He(xe,ze,Ft){Ft.negative=ze.negative^xe.negative;var yn=xe.length+ze.length|0;Ft.length=yn,yn=yn-1|0;var Zt=xe.words[0]|0,Me=ze.words[0]|0,ce=Zt*Me,Ne=ce&67108863,We=ce/67108864|0;Ft.words[0]=Ne;for(var Vt=1;Vt<yn;Vt++){for(var Sn=We>>>26,An=We&67108863,Cn=Math.min(Vt,ze.length-1),Qn=Math.max(0,Vt-xe.length+1);Qn<=Cn;Qn++){var En=Vt-Qn|0;Zt=xe.words[En]|0,Me=ze.words[Qn]|0,ce=Zt*Me+An,Sn+=ce/67108864|0,An=ce&67108863}Ft.words[Vt]=An|0,We=Sn|0}return We!==0?Ft.words[Vt]=We|0:Ft.length--,Ft._strip()}var Ht=function(xe,ze,Ft){var yn=xe.words,Zt=ze.words,Me=Ft.words,ce=0,Ne,We,Vt,Sn=yn[0]|0,An=Sn&8191,Cn=Sn>>>13,Qn=yn[1]|0,En=Qn&8191,In=Qn>>>13,Mn=yn[2]|0,zn=Mn&8191,Jn=Mn>>>13,hn=yn[3]|0,xn=hn&8191,Hn=hn>>>13,ti=yn[4]|0,ri=ti&8191,hi=ti>>>13,gi=yn[5]|0,vi=gi&8191,Ai=gi>>>13,Ii=yn[6]|0,Ei=Ii&8191,yi=Ii>>>13,Zn=yn[7]|0,di=Zn&8191,li=Zn>>>13,Kn=yn[8]|0,Vn=Kn&8191,qn=Kn>>>13,Un=yn[9]|0,Ln=Un&8191,$n=Un>>>13,jn=Zt[0]|0,Pn=jn&8191,On=jn>>>13,Fn=Zt[1]|0,Pt=Fn&8191,gn=Fn>>>13,Nn=Zt[2]|0,mi=Nn&8191,Wn=Nn>>>13,ci=Zt[3]|0,Mi=ci&8191,Si=ci>>>13,Bi=Zt[4]|0,Fi=Bi&8191,ki=Bi>>>13,Gn=Zt[5]|0,Oi=Gn&8191,pi=Gn>>>13,bi=Zt[6]|0,xi=bi&8191,wi=bi>>>13,Ci=Zt[7]|0,Ti=Ci&8191,Ri=Ci>>>13,_i=Zt[8]|0,Ui=_i&8191,Pi=_i>>>13,Ni=Zt[9]|0,Qi=Ni&8191,Di=Ni>>>13;Ft.negative=xe.negative^ze.negative,Ft.length=19,Ne=Math.imul(An,Pn),We=Math.imul(An,On),We=We+Math.imul(Cn,Pn)|0,Vt=Math.imul(Cn,On);var qi=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(qi>>>26)|0,qi&=67108863,Ne=Math.imul(En,Pn),We=Math.imul(En,On),We=We+Math.imul(In,Pn)|0,Vt=Math.imul(In,On),Ne=Ne+Math.imul(An,Pt)|0,We=We+Math.imul(An,gn)|0,We=We+Math.imul(Cn,Pt)|0,Vt=Vt+Math.imul(Cn,gn)|0;var Hi=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(Hi>>>26)|0,Hi&=67108863,Ne=Math.imul(zn,Pn),We=Math.imul(zn,On),We=We+Math.imul(Jn,Pn)|0,Vt=Math.imul(Jn,On),Ne=Ne+Math.imul(En,Pt)|0,We=We+Math.imul(En,gn)|0,We=We+Math.imul(In,Pt)|0,Vt=Vt+Math.imul(In,gn)|0,Ne=Ne+Math.imul(An,mi)|0,We=We+Math.imul(An,Wn)|0,We=We+Math.imul(Cn,mi)|0,Vt=Vt+Math.imul(Cn,Wn)|0;var Ji=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(Ji>>>26)|0,Ji&=67108863,Ne=Math.imul(xn,Pn),We=Math.imul(xn,On),We=We+Math.imul(Hn,Pn)|0,Vt=Math.imul(Hn,On),Ne=Ne+Math.imul(zn,Pt)|0,We=We+Math.imul(zn,gn)|0,We=We+Math.imul(Jn,Pt)|0,Vt=Vt+Math.imul(Jn,gn)|0,Ne=Ne+Math.imul(En,mi)|0,We=We+Math.imul(En,Wn)|0,We=We+Math.imul(In,mi)|0,Vt=Vt+Math.imul(In,Wn)|0,Ne=Ne+Math.imul(An,Mi)|0,We=We+Math.imul(An,Si)|0,We=We+Math.imul(Cn,Mi)|0,Vt=Vt+Math.imul(Cn,Si)|0;var Li=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(Li>>>26)|0,Li&=67108863,Ne=Math.imul(ri,Pn),We=Math.imul(ri,On),We=We+Math.imul(hi,Pn)|0,Vt=Math.imul(hi,On),Ne=Ne+Math.imul(xn,Pt)|0,We=We+Math.imul(xn,gn)|0,We=We+Math.imul(Hn,Pt)|0,Vt=Vt+Math.imul(Hn,gn)|0,Ne=Ne+Math.imul(zn,mi)|0,We=We+Math.imul(zn,Wn)|0,We=We+Math.imul(Jn,mi)|0,Vt=Vt+Math.imul(Jn,Wn)|0,Ne=Ne+Math.imul(En,Mi)|0,We=We+Math.imul(En,Si)|0,We=We+Math.imul(In,Mi)|0,Vt=Vt+Math.imul(In,Si)|0,Ne=Ne+Math.imul(An,Fi)|0,We=We+Math.imul(An,ki)|0,We=We+Math.imul(Cn,Fi)|0,Vt=Vt+Math.imul(Cn,ki)|0;var $i=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+($i>>>26)|0,$i&=67108863,Ne=Math.imul(vi,Pn),We=Math.imul(vi,On),We=We+Math.imul(Ai,Pn)|0,Vt=Math.imul(Ai,On),Ne=Ne+Math.imul(ri,Pt)|0,We=We+Math.imul(ri,gn)|0,We=We+Math.imul(hi,Pt)|0,Vt=Vt+Math.imul(hi,gn)|0,Ne=Ne+Math.imul(xn,mi)|0,We=We+Math.imul(xn,Wn)|0,We=We+Math.imul(Hn,mi)|0,Vt=Vt+Math.imul(Hn,Wn)|0,Ne=Ne+Math.imul(zn,Mi)|0,We=We+Math.imul(zn,Si)|0,We=We+Math.imul(Jn,Mi)|0,Vt=Vt+Math.imul(Jn,Si)|0,Ne=Ne+Math.imul(En,Fi)|0,We=We+Math.imul(En,ki)|0,We=We+Math.imul(In,Fi)|0,Vt=Vt+Math.imul(In,ki)|0,Ne=Ne+Math.imul(An,Oi)|0,We=We+Math.imul(An,pi)|0,We=We+Math.imul(Cn,Oi)|0,Vt=Vt+Math.imul(Cn,pi)|0;var Vi=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(Vi>>>26)|0,Vi&=67108863,Ne=Math.imul(Ei,Pn),We=Math.imul(Ei,On),We=We+Math.imul(yi,Pn)|0,Vt=Math.imul(yi,On),Ne=Ne+Math.imul(vi,Pt)|0,We=We+Math.imul(vi,gn)|0,We=We+Math.imul(Ai,Pt)|0,Vt=Vt+Math.imul(Ai,gn)|0,Ne=Ne+Math.imul(ri,mi)|0,We=We+Math.imul(ri,Wn)|0,We=We+Math.imul(hi,mi)|0,Vt=Vt+Math.imul(hi,Wn)|0,Ne=Ne+Math.imul(xn,Mi)|0,We=We+Math.imul(xn,Si)|0,We=We+Math.imul(Hn,Mi)|0,Vt=Vt+Math.imul(Hn,Si)|0,Ne=Ne+Math.imul(zn,Fi)|0,We=We+Math.imul(zn,ki)|0,We=We+Math.imul(Jn,Fi)|0,Vt=Vt+Math.imul(Jn,ki)|0,Ne=Ne+Math.imul(En,Oi)|0,We=We+Math.imul(En,pi)|0,We=We+Math.imul(In,Oi)|0,Vt=Vt+Math.imul(In,pi)|0,Ne=Ne+Math.imul(An,xi)|0,We=We+Math.imul(An,wi)|0,We=We+Math.imul(Cn,xi)|0,Vt=Vt+Math.imul(Cn,wi)|0;var Gi=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(Gi>>>26)|0,Gi&=67108863,Ne=Math.imul(di,Pn),We=Math.imul(di,On),We=We+Math.imul(li,Pn)|0,Vt=Math.imul(li,On),Ne=Ne+Math.imul(Ei,Pt)|0,We=We+Math.imul(Ei,gn)|0,We=We+Math.imul(yi,Pt)|0,Vt=Vt+Math.imul(yi,gn)|0,Ne=Ne+Math.imul(vi,mi)|0,We=We+Math.imul(vi,Wn)|0,We=We+Math.imul(Ai,mi)|0,Vt=Vt+Math.imul(Ai,Wn)|0,Ne=Ne+Math.imul(ri,Mi)|0,We=We+Math.imul(ri,Si)|0,We=We+Math.imul(hi,Mi)|0,Vt=Vt+Math.imul(hi,Si)|0,Ne=Ne+Math.imul(xn,Fi)|0,We=We+Math.imul(xn,ki)|0,We=We+Math.imul(Hn,Fi)|0,Vt=Vt+Math.imul(Hn,ki)|0,Ne=Ne+Math.imul(zn,Oi)|0,We=We+Math.imul(zn,pi)|0,We=We+Math.imul(Jn,Oi)|0,Vt=Vt+Math.imul(Jn,pi)|0,Ne=Ne+Math.imul(En,xi)|0,We=We+Math.imul(En,wi)|0,We=We+Math.imul(In,xi)|0,Vt=Vt+Math.imul(In,wi)|0,Ne=Ne+Math.imul(An,Ti)|0,We=We+Math.imul(An,Ri)|0,We=We+Math.imul(Cn,Ti)|0,Vt=Vt+Math.imul(Cn,Ri)|0;var Wi=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(Wi>>>26)|0,Wi&=67108863,Ne=Math.imul(Vn,Pn),We=Math.imul(Vn,On),We=We+Math.imul(qn,Pn)|0,Vt=Math.imul(qn,On),Ne=Ne+Math.imul(di,Pt)|0,We=We+Math.imul(di,gn)|0,We=We+Math.imul(li,Pt)|0,Vt=Vt+Math.imul(li,gn)|0,Ne=Ne+Math.imul(Ei,mi)|0,We=We+Math.imul(Ei,Wn)|0,We=We+Math.imul(yi,mi)|0,Vt=Vt+Math.imul(yi,Wn)|0,Ne=Ne+Math.imul(vi,Mi)|0,We=We+Math.imul(vi,Si)|0,We=We+Math.imul(Ai,Mi)|0,Vt=Vt+Math.imul(Ai,Si)|0,Ne=Ne+Math.imul(ri,Fi)|0,We=We+Math.imul(ri,ki)|0,We=We+Math.imul(hi,Fi)|0,Vt=Vt+Math.imul(hi,ki)|0,Ne=Ne+Math.imul(xn,Oi)|0,We=We+Math.imul(xn,pi)|0,We=We+Math.imul(Hn,Oi)|0,Vt=Vt+Math.imul(Hn,pi)|0,Ne=Ne+Math.imul(zn,xi)|0,We=We+Math.imul(zn,wi)|0,We=We+Math.imul(Jn,xi)|0,Vt=Vt+Math.imul(Jn,wi)|0,Ne=Ne+Math.imul(En,Ti)|0,We=We+Math.imul(En,Ri)|0,We=We+Math.imul(In,Ti)|0,Vt=Vt+Math.imul(In,Ri)|0,Ne=Ne+Math.imul(An,Ui)|0,We=We+Math.imul(An,Pi)|0,We=We+Math.imul(Cn,Ui)|0,Vt=Vt+Math.imul(Cn,Pi)|0;var Ki=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(Ki>>>26)|0,Ki&=67108863,Ne=Math.imul(Ln,Pn),We=Math.imul(Ln,On),We=We+Math.imul($n,Pn)|0,Vt=Math.imul($n,On),Ne=Ne+Math.imul(Vn,Pt)|0,We=We+Math.imul(Vn,gn)|0,We=We+Math.imul(qn,Pt)|0,Vt=Vt+Math.imul(qn,gn)|0,Ne=Ne+Math.imul(di,mi)|0,We=We+Math.imul(di,Wn)|0,We=We+Math.imul(li,mi)|0,Vt=Vt+Math.imul(li,Wn)|0,Ne=Ne+Math.imul(Ei,Mi)|0,We=We+Math.imul(Ei,Si)|0,We=We+Math.imul(yi,Mi)|0,Vt=Vt+Math.imul(yi,Si)|0,Ne=Ne+Math.imul(vi,Fi)|0,We=We+Math.imul(vi,ki)|0,We=We+Math.imul(Ai,Fi)|0,Vt=Vt+Math.imul(Ai,ki)|0,Ne=Ne+Math.imul(ri,Oi)|0,We=We+Math.imul(ri,pi)|0,We=We+Math.imul(hi,Oi)|0,Vt=Vt+Math.imul(hi,pi)|0,Ne=Ne+Math.imul(xn,xi)|0,We=We+Math.imul(xn,wi)|0,We=We+Math.imul(Hn,xi)|0,Vt=Vt+Math.imul(Hn,wi)|0,Ne=Ne+Math.imul(zn,Ti)|0,We=We+Math.imul(zn,Ri)|0,We=We+Math.imul(Jn,Ti)|0,Vt=Vt+Math.imul(Jn,Ri)|0,Ne=Ne+Math.imul(En,Ui)|0,We=We+Math.imul(En,Pi)|0,We=We+Math.imul(In,Ui)|0,Vt=Vt+Math.imul(In,Pi)|0,Ne=Ne+Math.imul(An,Qi)|0,We=We+Math.imul(An,Di)|0,We=We+Math.imul(Cn,Qi)|0,Vt=Vt+Math.imul(Cn,Di)|0;var zi=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(zi>>>26)|0,zi&=67108863,Ne=Math.imul(Ln,Pt),We=Math.imul(Ln,gn),We=We+Math.imul($n,Pt)|0,Vt=Math.imul($n,gn),Ne=Ne+Math.imul(Vn,mi)|0,We=We+Math.imul(Vn,Wn)|0,We=We+Math.imul(qn,mi)|0,Vt=Vt+Math.imul(qn,Wn)|0,Ne=Ne+Math.imul(di,Mi)|0,We=We+Math.imul(di,Si)|0,We=We+Math.imul(li,Mi)|0,Vt=Vt+Math.imul(li,Si)|0,Ne=Ne+Math.imul(Ei,Fi)|0,We=We+Math.imul(Ei,ki)|0,We=We+Math.imul(yi,Fi)|0,Vt=Vt+Math.imul(yi,ki)|0,Ne=Ne+Math.imul(vi,Oi)|0,We=We+Math.imul(vi,pi)|0,We=We+Math.imul(Ai,Oi)|0,Vt=Vt+Math.imul(Ai,pi)|0,Ne=Ne+Math.imul(ri,xi)|0,We=We+Math.imul(ri,wi)|0,We=We+Math.imul(hi,xi)|0,Vt=Vt+Math.imul(hi,wi)|0,Ne=Ne+Math.imul(xn,Ti)|0,We=We+Math.imul(xn,Ri)|0,We=We+Math.imul(Hn,Ti)|0,Vt=Vt+Math.imul(Hn,Ri)|0,Ne=Ne+Math.imul(zn,Ui)|0,We=We+Math.imul(zn,Pi)|0,We=We+Math.imul(Jn,Ui)|0,Vt=Vt+Math.imul(Jn,Pi)|0,Ne=Ne+Math.imul(En,Qi)|0,We=We+Math.imul(En,Di)|0,We=We+Math.imul(In,Qi)|0,Vt=Vt+Math.imul(In,Di)|0;var Yi=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(Yi>>>26)|0,Yi&=67108863,Ne=Math.imul(Ln,mi),We=Math.imul(Ln,Wn),We=We+Math.imul($n,mi)|0,Vt=Math.imul($n,Wn),Ne=Ne+Math.imul(Vn,Mi)|0,We=We+Math.imul(Vn,Si)|0,We=We+Math.imul(qn,Mi)|0,Vt=Vt+Math.imul(qn,Si)|0,Ne=Ne+Math.imul(di,Fi)|0,We=We+Math.imul(di,ki)|0,We=We+Math.imul(li,Fi)|0,Vt=Vt+Math.imul(li,ki)|0,Ne=Ne+Math.imul(Ei,Oi)|0,We=We+Math.imul(Ei,pi)|0,We=We+Math.imul(yi,Oi)|0,Vt=Vt+Math.imul(yi,pi)|0,Ne=Ne+Math.imul(vi,xi)|0,We=We+Math.imul(vi,wi)|0,We=We+Math.imul(Ai,xi)|0,Vt=Vt+Math.imul(Ai,wi)|0,Ne=Ne+Math.imul(ri,Ti)|0,We=We+Math.imul(ri,Ri)|0,We=We+Math.imul(hi,Ti)|0,Vt=Vt+Math.imul(hi,Ri)|0,Ne=Ne+Math.imul(xn,Ui)|0,We=We+Math.imul(xn,Pi)|0,We=We+Math.imul(Hn,Ui)|0,Vt=Vt+Math.imul(Hn,Pi)|0,Ne=Ne+Math.imul(zn,Qi)|0,We=We+Math.imul(zn,Di)|0,We=We+Math.imul(Jn,Qi)|0,Vt=Vt+Math.imul(Jn,Di)|0;var Zi=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(Zi>>>26)|0,Zi&=67108863,Ne=Math.imul(Ln,Mi),We=Math.imul(Ln,Si),We=We+Math.imul($n,Mi)|0,Vt=Math.imul($n,Si),Ne=Ne+Math.imul(Vn,Fi)|0,We=We+Math.imul(Vn,ki)|0,We=We+Math.imul(qn,Fi)|0,Vt=Vt+Math.imul(qn,ki)|0,Ne=Ne+Math.imul(di,Oi)|0,We=We+Math.imul(di,pi)|0,We=We+Math.imul(li,Oi)|0,Vt=Vt+Math.imul(li,pi)|0,Ne=Ne+Math.imul(Ei,xi)|0,We=We+Math.imul(Ei,wi)|0,We=We+Math.imul(yi,xi)|0,Vt=Vt+Math.imul(yi,wi)|0,Ne=Ne+Math.imul(vi,Ti)|0,We=We+Math.imul(vi,Ri)|0,We=We+Math.imul(Ai,Ti)|0,Vt=Vt+Math.imul(Ai,Ri)|0,Ne=Ne+Math.imul(ri,Ui)|0,We=We+Math.imul(ri,Pi)|0,We=We+Math.imul(hi,Ui)|0,Vt=Vt+Math.imul(hi,Pi)|0,Ne=Ne+Math.imul(xn,Qi)|0,We=We+Math.imul(xn,Di)|0,We=We+Math.imul(Hn,Qi)|0,Vt=Vt+Math.imul(Hn,Di)|0;var Xi=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(Xi>>>26)|0,Xi&=67108863,Ne=Math.imul(Ln,Fi),We=Math.imul(Ln,ki),We=We+Math.imul($n,Fi)|0,Vt=Math.imul($n,ki),Ne=Ne+Math.imul(Vn,Oi)|0,We=We+Math.imul(Vn,pi)|0,We=We+Math.imul(qn,Oi)|0,Vt=Vt+Math.imul(qn,pi)|0,Ne=Ne+Math.imul(di,xi)|0,We=We+Math.imul(di,wi)|0,We=We+Math.imul(li,xi)|0,Vt=Vt+Math.imul(li,wi)|0,Ne=Ne+Math.imul(Ei,Ti)|0,We=We+Math.imul(Ei,Ri)|0,We=We+Math.imul(yi,Ti)|0,Vt=Vt+Math.imul(yi,Ri)|0,Ne=Ne+Math.imul(vi,Ui)|0,We=We+Math.imul(vi,Pi)|0,We=We+Math.imul(Ai,Ui)|0,Vt=Vt+Math.imul(Ai,Pi)|0,Ne=Ne+Math.imul(ri,Qi)|0,We=We+Math.imul(ri,Di)|0,We=We+Math.imul(hi,Qi)|0,Vt=Vt+Math.imul(hi,Di)|0;var ji=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(ji>>>26)|0,ji&=67108863,Ne=Math.imul(Ln,Oi),We=Math.imul(Ln,pi),We=We+Math.imul($n,Oi)|0,Vt=Math.imul($n,pi),Ne=Ne+Math.imul(Vn,xi)|0,We=We+Math.imul(Vn,wi)|0,We=We+Math.imul(qn,xi)|0,Vt=Vt+Math.imul(qn,wi)|0,Ne=Ne+Math.imul(di,Ti)|0,We=We+Math.imul(di,Ri)|0,We=We+Math.imul(li,Ti)|0,Vt=Vt+Math.imul(li,Ri)|0,Ne=Ne+Math.imul(Ei,Ui)|0,We=We+Math.imul(Ei,Pi)|0,We=We+Math.imul(yi,Ui)|0,Vt=Vt+Math.imul(yi,Pi)|0,Ne=Ne+Math.imul(vi,Qi)|0,We=We+Math.imul(vi,Di)|0,We=We+Math.imul(Ai,Qi)|0,Vt=Vt+Math.imul(Ai,Di)|0;var eo=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(eo>>>26)|0,eo&=67108863,Ne=Math.imul(Ln,xi),We=Math.imul(Ln,wi),We=We+Math.imul($n,xi)|0,Vt=Math.imul($n,wi),Ne=Ne+Math.imul(Vn,Ti)|0,We=We+Math.imul(Vn,Ri)|0,We=We+Math.imul(qn,Ti)|0,Vt=Vt+Math.imul(qn,Ri)|0,Ne=Ne+Math.imul(di,Ui)|0,We=We+Math.imul(di,Pi)|0,We=We+Math.imul(li,Ui)|0,Vt=Vt+Math.imul(li,Pi)|0,Ne=Ne+Math.imul(Ei,Qi)|0,We=We+Math.imul(Ei,Di)|0,We=We+Math.imul(yi,Qi)|0,Vt=Vt+Math.imul(yi,Di)|0;var to=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(to>>>26)|0,to&=67108863,Ne=Math.imul(Ln,Ti),We=Math.imul(Ln,Ri),We=We+Math.imul($n,Ti)|0,Vt=Math.imul($n,Ri),Ne=Ne+Math.imul(Vn,Ui)|0,We=We+Math.imul(Vn,Pi)|0,We=We+Math.imul(qn,Ui)|0,Vt=Vt+Math.imul(qn,Pi)|0,Ne=Ne+Math.imul(di,Qi)|0,We=We+Math.imul(di,Di)|0,We=We+Math.imul(li,Qi)|0,Vt=Vt+Math.imul(li,Di)|0;var no=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(no>>>26)|0,no&=67108863,Ne=Math.imul(Ln,Ui),We=Math.imul(Ln,Pi),We=We+Math.imul($n,Ui)|0,Vt=Math.imul($n,Pi),Ne=Ne+Math.imul(Vn,Qi)|0,We=We+Math.imul(Vn,Di)|0,We=We+Math.imul(qn,Qi)|0,Vt=Vt+Math.imul(qn,Di)|0;var oo=(ce+Ne|0)+((We&8191)<<13)|0;ce=(Vt+(We>>>13)|0)+(oo>>>26)|0,oo&=67108863,Ne=Math.imul(Ln,Qi),We=Math.imul(Ln,Di),We=We+Math.imul($n,Qi)|0,Vt=Math.imul($n,Di);var ao=(ce+Ne|0)+((We&8191)<<13)|0;return ce=(Vt+(We>>>13)|0)+(ao>>>26)|0,ao&=67108863,Me[0]=qi,Me[1]=Hi,Me[2]=Ji,Me[3]=Li,Me[4]=$i,Me[5]=Vi,Me[6]=Gi,Me[7]=Wi,Me[8]=Ki,Me[9]=zi,Me[10]=Yi,Me[11]=Zi,Me[12]=Xi,Me[13]=ji,Me[14]=eo,Me[15]=to,Me[16]=no,Me[17]=oo,Me[18]=ao,ce!==0&&(Me[19]=ce,Ft.length++),Ft};Math.imul||(Ht=He);function un(xe,ze,Ft){Ft.negative=ze.negative^xe.negative,Ft.length=xe.length+ze.length;for(var yn=0,Zt=0,Me=0;Me<Ft.length-1;Me++){var ce=Zt;Zt=0;for(var Ne=yn&67108863,We=Math.min(Me,ze.length-1),Vt=Math.max(0,Me-xe.length+1);Vt<=We;Vt++){var Sn=Me-Vt,An=xe.words[Sn]|0,Cn=ze.words[Vt]|0,Qn=An*Cn,En=Qn&67108863;ce=ce+(Qn/67108864|0)|0,En=En+Ne|0,Ne=En&67108863,ce=ce+(En>>>26)|0,Zt+=ce>>>26,ce&=67108863}Ft.words[Me]=Ne,yn=ce,ce=Zt}return yn!==0?Ft.words[Me]=yn:Ft.length--,Ft._strip()}function De(xe,ze,Ft){return un(xe,ze,Ft)}ae.prototype.mulTo=function(xe,ze){var Ft,yn=this.length+xe.length;return this.length===10&&xe.length===10?Ft=Ht(this,xe,ze):yn<63?Ft=He(this,xe,ze):yn<1024?Ft=un(this,xe,ze):Ft=De(this,xe,ze),Ft},ae.prototype.mul=function(xe){var ze=new ae(null);return ze.words=new Array(this.length+xe.length),this.mulTo(xe,ze)},ae.prototype.mulf=function(xe){var ze=new ae(null);return ze.words=new Array(this.length+xe.length),De(this,xe,ze)},ae.prototype.imul=function(xe){return this.clone().mulTo(xe,this)},ae.prototype.imuln=function(xe){var ze=xe<0;ze&&(xe=-xe),ie(typeof xe=="number"),ie(xe<67108864);for(var Ft=0,yn=0;yn<this.length;yn++){var Zt=(this.words[yn]|0)*xe,Me=(Zt&67108863)+(Ft&67108863);Ft>>=26,Ft+=Zt/67108864|0,Ft+=Me>>>26,this.words[yn]=Me&67108863}return Ft!==0&&(this.words[yn]=Ft,this.length++),this.length=xe===0?1:this.length,ze?this.ineg():this},ae.prototype.muln=function(xe){return this.clone().imuln(xe)},ae.prototype.sqr=function(){return this.mul(this)},ae.prototype.isqr=function(){return this.imul(this.clone())},ae.prototype.pow=function(xe){var ze=Ze(xe);if(ze.length===0)return new ae(1);for(var Ft=this,yn=0;yn<ze.length&&ze[yn]===0;yn++,Ft=Ft.sqr());if(++yn<ze.length)for(var Zt=Ft.sqr();yn<ze.length;yn++,Zt=Zt.sqr())ze[yn]!==0&&(Ft=Ft.mul(Zt));return Ft},ae.prototype.iushln=function(xe){ie(typeof xe=="number"&&xe>=0);var ze=xe%26,Ft=(xe-ze)/26,yn=67108863>>>26-ze<<26-ze,Zt;if(ze!==0){var Me=0;for(Zt=0;Zt<this.length;Zt++){var ce=this.words[Zt]&yn,Ne=(this.words[Zt]|0)-ce<<ze;this.words[Zt]=Ne|Me,Me=ce>>>26-ze}Me&&(this.words[Zt]=Me,this.length++)}if(Ft!==0){for(Zt=this.length-1;Zt>=0;Zt--)this.words[Zt+Ft]=this.words[Zt];for(Zt=0;Zt<Ft;Zt++)this.words[Zt]=0;this.length+=Ft}return this._strip()},ae.prototype.ishln=function(xe){return ie(this.negative===0),this.iushln(xe)},ae.prototype.iushrn=function(xe,ze,Ft){ie(typeof xe=="number"&&xe>=0);var yn;ze?yn=(ze-ze%26)/26:yn=0;var Zt=xe%26,Me=Math.min((xe-Zt)/26,this.length),ce=67108863^67108863>>>Zt<<Zt,Ne=Ft;if(yn-=Me,yn=Math.max(0,yn),Ne){for(var We=0;We<Me;We++)Ne.words[We]=this.words[We];Ne.length=Me}if(Me!==0)if(this.length>Me)for(this.length-=Me,We=0;We<this.length;We++)this.words[We]=this.words[We+Me];else this.words[0]=0,this.length=1;var Vt=0;for(We=this.length-1;We>=0&&(Vt!==0||We>=yn);We--){var Sn=this.words[We]|0;this.words[We]=Vt<<26-Zt|Sn>>>Zt,Vt=Sn&ce}return Ne&&Vt!==0&&(Ne.words[Ne.length++]=Vt),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},ae.prototype.ishrn=function(xe,ze,Ft){return ie(this.negative===0),this.iushrn(xe,ze,Ft)},ae.prototype.shln=function(xe){return this.clone().ishln(xe)},ae.prototype.ushln=function(xe){return this.clone().iushln(xe)},ae.prototype.shrn=function(xe){return this.clone().ishrn(xe)},ae.prototype.ushrn=function(xe){return this.clone().iushrn(xe)},ae.prototype.testn=function(xe){ie(typeof xe=="number"&&xe>=0);var ze=xe%26,Ft=(xe-ze)/26,yn=1<<ze;if(this.length<=Ft)return!1;var Zt=this.words[Ft];return!!(Zt&yn)},ae.prototype.imaskn=function(xe){ie(typeof xe=="number"&&xe>=0);var ze=xe%26,Ft=(xe-ze)/26;if(ie(this.negative===0,"imaskn works only with positive numbers"),this.length<=Ft)return this;if(ze!==0&&Ft++,this.length=Math.min(Ft,this.length),ze!==0){var yn=67108863^67108863>>>ze<<ze;this.words[this.length-1]&=yn}return this._strip()},ae.prototype.maskn=function(xe){return this.clone().imaskn(xe)},ae.prototype.iaddn=function(xe){return ie(typeof xe=="number"),ie(xe<67108864),xe<0?this.isubn(-xe):this.negative!==0?this.length===1&&(this.words[0]|0)<=xe?(this.words[0]=xe-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(xe),this.negative=1,this):this._iaddn(xe)},ae.prototype._iaddn=function(xe){this.words[0]+=xe;for(var ze=0;ze<this.length&&this.words[ze]>=67108864;ze++)this.words[ze]-=67108864,ze===this.length-1?this.words[ze+1]=1:this.words[ze+1]++;return this.length=Math.max(this.length,ze+1),this},ae.prototype.isubn=function(xe){if(ie(typeof xe=="number"),ie(xe<67108864),xe<0)return this.iaddn(-xe);if(this.negative!==0)return this.negative=0,this.iaddn(xe),this.negative=1,this;if(this.words[0]-=xe,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var ze=0;ze<this.length&&this.words[ze]<0;ze++)this.words[ze]+=67108864,this.words[ze+1]-=1;return this._strip()},ae.prototype.addn=function(xe){return this.clone().iaddn(xe)},ae.prototype.subn=function(xe){return this.clone().isubn(xe)},ae.prototype.iabs=function(){return this.negative=0,this},ae.prototype.abs=function(){return this.clone().iabs()},ae.prototype._ishlnsubmul=function(xe,ze,Ft){var yn=xe.length+Ft,Zt;this._expand(yn);var Me,ce=0;for(Zt=0;Zt<xe.length;Zt++){Me=(this.words[Zt+Ft]|0)+ce;var Ne=(xe.words[Zt]|0)*ze;Me-=Ne&67108863,ce=(Me>>26)-(Ne/67108864|0),this.words[Zt+Ft]=Me&67108863}for(;Zt<this.length-Ft;Zt++)Me=(this.words[Zt+Ft]|0)+ce,ce=Me>>26,this.words[Zt+Ft]=Me&67108863;if(ce===0)return this._strip();for(ie(ce===-1),ce=0,Zt=0;Zt<this.length;Zt++)Me=-(this.words[Zt]|0)+ce,ce=Me>>26,this.words[Zt]=Me&67108863;return this.negative=1,this._strip()},ae.prototype._wordDiv=function(xe,ze){var Ft=this.length-xe.length,yn=this.clone(),Zt=xe,Me=Zt.words[Zt.length-1]|0,ce=this._countBits(Me);Ft=26-ce,Ft!==0&&(Zt=Zt.ushln(Ft),yn.iushln(Ft),Me=Zt.words[Zt.length-1]|0);var Ne=yn.length-Zt.length,We;if(ze!=="mod"){We=new ae(null),We.length=Ne+1,We.words=new Array(We.length);for(var Vt=0;Vt<We.length;Vt++)We.words[Vt]=0}var Sn=yn.clone()._ishlnsubmul(Zt,1,Ne);Sn.negative===0&&(yn=Sn,We&&(We.words[Ne]=1));for(var An=Ne-1;An>=0;An--){var Cn=(yn.words[Zt.length+An]|0)*67108864+(yn.words[Zt.length+An-1]|0);for(Cn=Math.min(Cn/Me|0,67108863),yn._ishlnsubmul(Zt,Cn,An);yn.negative!==0;)Cn--,yn.negative=0,yn._ishlnsubmul(Zt,1,An),yn.isZero()||(yn.negative^=1);We&&(We.words[An]=Cn)}return We&&We._strip(),yn._strip(),ze!=="div"&&Ft!==0&&yn.iushrn(Ft),{div:We||null,mod:yn}},ae.prototype.divmod=function(xe,ze,Ft){if(ie(!xe.isZero()),this.isZero())return{div:new ae(0),mod:new ae(0)};var yn,Zt,Me;return this.negative!==0&&xe.negative===0?(Me=this.neg().divmod(xe,ze),ze!=="mod"&&(yn=Me.div.neg()),ze!=="div"&&(Zt=Me.mod.neg(),Ft&&Zt.negative!==0&&Zt.iadd(xe)),{div:yn,mod:Zt}):this.negative===0&&xe.negative!==0?(Me=this.divmod(xe.neg(),ze),ze!=="mod"&&(yn=Me.div.neg()),{div:yn,mod:Me.mod}):this.negative&xe.negative?(Me=this.neg().divmod(xe.neg(),ze),ze!=="div"&&(Zt=Me.mod.neg(),Ft&&Zt.negative!==0&&Zt.isub(xe)),{div:Me.div,mod:Zt}):xe.length>this.length||this.cmp(xe)<0?{div:new ae(0),mod:this}:xe.length===1?ze==="div"?{div:this.divn(xe.words[0]),mod:null}:ze==="mod"?{div:null,mod:new ae(this.modrn(xe.words[0]))}:{div:this.divn(xe.words[0]),mod:new ae(this.modrn(xe.words[0]))}:this._wordDiv(xe,ze)},ae.prototype.div=function(xe){return this.divmod(xe,"div",!1).div},ae.prototype.mod=function(xe){return this.divmod(xe,"mod",!1).mod},ae.prototype.umod=function(xe){return this.divmod(xe,"mod",!0).mod},ae.prototype.divRound=function(xe){var ze=this.divmod(xe);if(ze.mod.isZero())return ze.div;var Ft=ze.div.negative!==0?ze.mod.isub(xe):ze.mod,yn=xe.ushrn(1),Zt=xe.andln(1),Me=Ft.cmp(yn);return Me<0||Zt===1&&Me===0?ze.div:ze.div.negative!==0?ze.div.isubn(1):ze.div.iaddn(1)},ae.prototype.modrn=function(xe){var ze=xe<0;ze&&(xe=-xe),ie(xe<=67108863);for(var Ft=(1<<26)%xe,yn=0,Zt=this.length-1;Zt>=0;Zt--)yn=(Ft*yn+(this.words[Zt]|0))%xe;return ze?-yn:yn},ae.prototype.modn=function(xe){return this.modrn(xe)},ae.prototype.idivn=function(xe){var ze=xe<0;ze&&(xe=-xe),ie(xe<=67108863);for(var Ft=0,yn=this.length-1;yn>=0;yn--){var Zt=(this.words[yn]|0)+Ft*67108864;this.words[yn]=Zt/xe|0,Ft=Zt%xe}return this._strip(),ze?this.ineg():this},ae.prototype.divn=function(xe){return this.clone().idivn(xe)},ae.prototype.egcd=function(xe){ie(xe.negative===0),ie(!xe.isZero());var ze=this,Ft=xe.clone();ze.negative!==0?ze=ze.umod(xe):ze=ze.clone();for(var yn=new ae(1),Zt=new ae(0),Me=new ae(0),ce=new ae(1),Ne=0;ze.isEven()&&Ft.isEven();)ze.iushrn(1),Ft.iushrn(1),++Ne;for(var We=Ft.clone(),Vt=ze.clone();!ze.isZero();){for(var Sn=0,An=1;!(ze.words[0]&An)&&Sn<26;++Sn,An<<=1);if(Sn>0)for(ze.iushrn(Sn);Sn-- >0;)(yn.isOdd()||Zt.isOdd())&&(yn.iadd(We),Zt.isub(Vt)),yn.iushrn(1),Zt.iushrn(1);for(var Cn=0,Qn=1;!(Ft.words[0]&Qn)&&Cn<26;++Cn,Qn<<=1);if(Cn>0)for(Ft.iushrn(Cn);Cn-- >0;)(Me.isOdd()||ce.isOdd())&&(Me.iadd(We),ce.isub(Vt)),Me.iushrn(1),ce.iushrn(1);ze.cmp(Ft)>=0?(ze.isub(Ft),yn.isub(Me),Zt.isub(ce)):(Ft.isub(ze),Me.isub(yn),ce.isub(Zt))}return{a:Me,b:ce,gcd:Ft.iushln(Ne)}},ae.prototype._invmp=function(xe){ie(xe.negative===0),ie(!xe.isZero());var ze=this,Ft=xe.clone();ze.negative!==0?ze=ze.umod(xe):ze=ze.clone();for(var yn=new ae(1),Zt=new ae(0),Me=Ft.clone();ze.cmpn(1)>0&&Ft.cmpn(1)>0;){for(var ce=0,Ne=1;!(ze.words[0]&Ne)&&ce<26;++ce,Ne<<=1);if(ce>0)for(ze.iushrn(ce);ce-- >0;)yn.isOdd()&&yn.iadd(Me),yn.iushrn(1);for(var We=0,Vt=1;!(Ft.words[0]&Vt)&&We<26;++We,Vt<<=1);if(We>0)for(Ft.iushrn(We);We-- >0;)Zt.isOdd()&&Zt.iadd(Me),Zt.iushrn(1);ze.cmp(Ft)>=0?(ze.isub(Ft),yn.isub(Zt)):(Ft.isub(ze),Zt.isub(yn))}var Sn;return ze.cmpn(1)===0?Sn=yn:Sn=Zt,Sn.cmpn(0)<0&&Sn.iadd(xe),Sn},ae.prototype.gcd=function(xe){if(this.isZero())return xe.abs();if(xe.isZero())return this.abs();var ze=this.clone(),Ft=xe.clone();ze.negative=0,Ft.negative=0;for(var yn=0;ze.isEven()&&Ft.isEven();yn++)ze.iushrn(1),Ft.iushrn(1);do{for(;ze.isEven();)ze.iushrn(1);for(;Ft.isEven();)Ft.iushrn(1);var Zt=ze.cmp(Ft);if(Zt<0){var Me=ze;ze=Ft,Ft=Me}else if(Zt===0||Ft.cmpn(1)===0)break;ze.isub(Ft)}while(!0);return Ft.iushln(yn)},ae.prototype.invm=function(xe){return this.egcd(xe).a.umod(xe)},ae.prototype.isEven=function(){return(this.words[0]&1)===0},ae.prototype.isOdd=function(){return(this.words[0]&1)===1},ae.prototype.andln=function(xe){return this.words[0]&xe},ae.prototype.bincn=function(xe){ie(typeof xe=="number");var ze=xe%26,Ft=(xe-ze)/26,yn=1<<ze;if(this.length<=Ft)return this._expand(Ft+1),this.words[Ft]|=yn,this;for(var Zt=yn,Me=Ft;Zt!==0&&Me<this.length;Me++){var ce=this.words[Me]|0;ce+=Zt,Zt=ce>>>26,ce&=67108863,this.words[Me]=ce}return Zt!==0&&(this.words[Me]=Zt,this.length++),this},ae.prototype.isZero=function(){return this.length===1&&this.words[0]===0},ae.prototype.cmpn=function(xe){var ze=xe<0;if(this.negative!==0&&!ze)return-1;if(this.negative===0&&ze)return 1;this._strip();var Ft;if(this.length>1)Ft=1;else{ze&&(xe=-xe),ie(xe<=67108863,"Number is too big");var yn=this.words[0]|0;Ft=yn===xe?0:yn<xe?-1:1}return this.negative!==0?-Ft|0:Ft},ae.prototype.cmp=function(xe){if(this.negative!==0&&xe.negative===0)return-1;if(this.negative===0&&xe.negative!==0)return 1;var ze=this.ucmp(xe);return this.negative!==0?-ze|0:ze},ae.prototype.ucmp=function(xe){if(this.length>xe.length)return 1;if(this.length<xe.length)return-1;for(var ze=0,Ft=this.length-1;Ft>=0;Ft--){var yn=this.words[Ft]|0,Zt=xe.words[Ft]|0;if(yn!==Zt){yn<Zt?ze=-1:yn>Zt&&(ze=1);break}}return ze},ae.prototype.gtn=function(xe){return this.cmpn(xe)===1},ae.prototype.gt=function(xe){return this.cmp(xe)===1},ae.prototype.gten=function(xe){return this.cmpn(xe)>=0},ae.prototype.gte=function(xe){return this.cmp(xe)>=0},ae.prototype.ltn=function(xe){return this.cmpn(xe)===-1},ae.prototype.lt=function(xe){return this.cmp(xe)===-1},ae.prototype.lten=function(xe){return this.cmpn(xe)<=0},ae.prototype.lte=function(xe){return this.cmp(xe)<=0},ae.prototype.eqn=function(xe){return this.cmpn(xe)===0},ae.prototype.eq=function(xe){return this.cmp(xe)===0},ae.red=function(xe){return new le(xe)},ae.prototype.toRed=function(xe){return ie(!this.red,"Already a number in reduction context"),ie(this.negative===0,"red works only with positives"),xe.convertTo(this)._forceRed(xe)},ae.prototype.fromRed=function(){return ie(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},ae.prototype._forceRed=function(xe){return this.red=xe,this},ae.prototype.forceRed=function(xe){return ie(!this.red,"Already a number in reduction context"),this._forceRed(xe)},ae.prototype.redAdd=function(xe){return ie(this.red,"redAdd works only with red numbers"),this.red.add(this,xe)},ae.prototype.redIAdd=function(xe){return ie(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,xe)},ae.prototype.redSub=function(xe){return ie(this.red,"redSub works only with red numbers"),this.red.sub(this,xe)},ae.prototype.redISub=function(xe){return ie(this.red,"redISub works only with red numbers"),this.red.isub(this,xe)},ae.prototype.redShl=function(xe){return ie(this.red,"redShl works only with red numbers"),this.red.shl(this,xe)},ae.prototype.redMul=function(xe){return ie(this.red,"redMul works only with red numbers"),this.red._verify2(this,xe),this.red.mul(this,xe)},ae.prototype.redIMul=function(xe){return ie(this.red,"redMul works only with red numbers"),this.red._verify2(this,xe),this.red.imul(this,xe)},ae.prototype.redSqr=function(){return ie(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},ae.prototype.redISqr=function(){return ie(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},ae.prototype.redSqrt=function(){return ie(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},ae.prototype.redInvm=function(){return ie(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},ae.prototype.redNeg=function(){return ie(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},ae.prototype.redPow=function(xe){return ie(this.red&&!xe.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,xe)};var $e={k256:null,p224:null,p192:null,p25519:null};function me(xe,ze){this.name=xe,this.p=new ae(ze,16),this.n=this.p.bitLength(),this.k=new ae(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}me.prototype._tmp=function(){var xe=new ae(null);return xe.words=new Array(Math.ceil(this.n/13)),xe},me.prototype.ireduce=function(xe){var ze=xe,Ft;do this.split(ze,this.tmp),ze=this.imulK(ze),ze=ze.iadd(this.tmp),Ft=ze.bitLength();while(Ft>this.n);var yn=Ft<this.n?-1:ze.ucmp(this.p);return yn===0?(ze.words[0]=0,ze.length=1):yn>0?ze.isub(this.p):ze.strip!==void 0?ze.strip():ze._strip(),ze},me.prototype.split=function(xe,ze){xe.iushrn(this.n,0,ze)},me.prototype.imulK=function(xe){return xe.imul(this.k)};function Gt(){me.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}se(Gt,me),Gt.prototype.split=function(xe,ze){for(var Ft=4194303,yn=Math.min(xe.length,9),Zt=0;Zt<yn;Zt++)ze.words[Zt]=xe.words[Zt];if(ze.length=yn,xe.length<=9){xe.words[0]=0,xe.length=1;return}var Me=xe.words[9];for(ze.words[ze.length++]=Me&Ft,Zt=10;Zt<xe.length;Zt++){var ce=xe.words[Zt]|0;xe.words[Zt-10]=(ce&Ft)<<4|Me>>>22,Me=ce}Me>>>=22,xe.words[Zt-10]=Me,Me===0&&xe.length>10?xe.length-=10:xe.length-=9},Gt.prototype.imulK=function(xe){xe.words[xe.length]=0,xe.words[xe.length+1]=0,xe.length+=2;for(var ze=0,Ft=0;Ft<xe.length;Ft++){var yn=xe.words[Ft]|0;ze+=yn*977,xe.words[Ft]=ze&67108863,ze=yn*64+(ze/67108864|0)}return xe.words[xe.length-1]===0&&(xe.length--,xe.words[xe.length-1]===0&&xe.length--),xe};function mn(){me.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}se(mn,me);function dn(){me.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}se(dn,me);function jt(){me.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}se(jt,me),jt.prototype.imulK=function(xe){for(var ze=0,Ft=0;Ft<xe.length;Ft++){var yn=(xe.words[Ft]|0)*19+ze,Zt=yn&67108863;yn>>>=26,xe.words[Ft]=Zt,ze=yn}return ze!==0&&(xe.words[xe.length++]=ze),xe},ae._prime=function(xe){if($e[xe])return $e[xe];var ze;if(xe==="k256")ze=new Gt;else if(xe==="p224")ze=new mn;else if(xe==="p192")ze=new dn;else if(xe==="p25519")ze=new jt;else throw new Error("Unknown prime "+xe);return $e[xe]=ze,ze};function le(xe){if(typeof xe=="string"){var ze=ae._prime(xe);this.m=ze.p,this.prime=ze}else ie(xe.gtn(1),"modulus must be greater than 1"),this.m=xe,this.prime=null}le.prototype._verify1=function(xe){ie(xe.negative===0,"red works only with positives"),ie(xe.red,"red works only with red numbers")},le.prototype._verify2=function(xe,ze){ie((xe.negative|ze.negative)===0,"red works only with positives"),ie(xe.red&&xe.red===ze.red,"red works only with red numbers")},le.prototype.imod=function(xe){return this.prime?this.prime.ireduce(xe)._forceRed(this):(be(xe,xe.umod(this.m)._forceRed(this)),xe)},le.prototype.neg=function(xe){return xe.isZero()?xe.clone():this.m.sub(xe)._forceRed(this)},le.prototype.add=function(xe,ze){this._verify2(xe,ze);var Ft=xe.add(ze);return Ft.cmp(this.m)>=0&&Ft.isub(this.m),Ft._forceRed(this)},le.prototype.iadd=function(xe,ze){this._verify2(xe,ze);var Ft=xe.iadd(ze);return Ft.cmp(this.m)>=0&&Ft.isub(this.m),Ft},le.prototype.sub=function(xe,ze){this._verify2(xe,ze);var Ft=xe.sub(ze);return Ft.cmpn(0)<0&&Ft.iadd(this.m),Ft._forceRed(this)},le.prototype.isub=function(xe,ze){this._verify2(xe,ze);var Ft=xe.isub(ze);return Ft.cmpn(0)<0&&Ft.iadd(this.m),Ft},le.prototype.shl=function(xe,ze){return this._verify1(xe),this.imod(xe.ushln(ze))},le.prototype.imul=function(xe,ze){return this._verify2(xe,ze),this.imod(xe.imul(ze))},le.prototype.mul=function(xe,ze){return this._verify2(xe,ze),this.imod(xe.mul(ze))},le.prototype.isqr=function(xe){return this.imul(xe,xe.clone())},le.prototype.sqr=function(xe){return this.mul(xe,xe)},le.prototype.sqrt=function(xe){if(xe.isZero())return xe.clone();var ze=this.m.andln(3);if(ie(ze%2===1),ze===3){var Ft=this.m.add(new ae(1)).iushrn(2);return this.pow(xe,Ft)}for(var yn=this.m.subn(1),Zt=0;!yn.isZero()&&yn.andln(1)===0;)Zt++,yn.iushrn(1);ie(!yn.isZero());var Me=new ae(1).toRed(this),ce=Me.redNeg(),Ne=this.m.subn(1).iushrn(1),We=this.m.bitLength();for(We=new ae(2*We*We).toRed(this);this.pow(We,Ne).cmp(ce)!==0;)We.redIAdd(ce);for(var Vt=this.pow(We,yn),Sn=this.pow(xe,yn.addn(1).iushrn(1)),An=this.pow(xe,yn),Cn=Zt;An.cmp(Me)!==0;){for(var Qn=An,En=0;Qn.cmp(Me)!==0;En++)Qn=Qn.redSqr();ie(En<Cn);var In=this.pow(Vt,new ae(1).iushln(Cn-En-1));Sn=Sn.redMul(In),Vt=In.redSqr(),An=An.redMul(Vt),Cn=En}return Sn},le.prototype.invm=function(xe){var ze=xe._invmp(this.m);return ze.negative!==0?(ze.negative=0,this.imod(ze).redNeg()):this.imod(ze)},le.prototype.pow=function(xe,ze){if(ze.isZero())return new ae(1).toRed(this);if(ze.cmpn(1)===0)return xe.clone();var Ft=4,yn=new Array(1<<Ft);yn[0]=new ae(1).toRed(this),yn[1]=xe;for(var Zt=2;Zt<yn.length;Zt++)yn[Zt]=this.mul(yn[Zt-1],xe);var Me=yn[0],ce=0,Ne=0,We=ze.bitLength()%26;for(We===0&&(We=26),Zt=ze.length-1;Zt>=0;Zt--){for(var Vt=ze.words[Zt],Sn=We-1;Sn>=0;Sn--){var An=Vt>>Sn&1;if(Me!==yn[0]&&(Me=this.sqr(Me)),An===0&&ce===0){Ne=0;continue}ce<<=1,ce|=An,Ne++,!(Ne!==Ft&&(Zt!==0||Sn!==0))&&(Me=this.mul(Me,yn[ce]),Ne=0,ce=0)}We=26}return Me},le.prototype.convertTo=function(xe){var ze=xe.umod(this.m);return ze===xe?ze.clone():ze},le.prototype.convertFrom=function(xe){var ze=xe.clone();return ze.red=null,ze},ae.mont=function(xe){return new Pe(xe)};function Pe(xe){le.call(this,xe),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new ae(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}se(Pe,le),Pe.prototype.convertTo=function(xe){return this.imod(xe.ushln(this.shift))},Pe.prototype.convertFrom=function(xe){var ze=this.imod(xe.mul(this.rinv));return ze.red=null,ze},Pe.prototype.imul=function(xe,ze){if(xe.isZero()||ze.isZero())return xe.words[0]=0,xe.length=1,xe;var Ft=xe.imul(ze),yn=Ft.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Zt=Ft.isub(yn).iushrn(this.shift),Me=Zt;return Zt.cmp(this.m)>=0?Me=Zt.isub(this.m):Zt.cmpn(0)<0&&(Me=Zt.iadd(this.m)),Me._forceRed(this)},Pe.prototype.mul=function(xe,ze){if(xe.isZero()||ze.isZero())return new ae(0)._forceRed(this);var Ft=xe.mul(ze),yn=Ft.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Zt=Ft.isub(yn).iushrn(this.shift),Me=Zt;return Zt.cmp(this.m)>=0?Me=Zt.isub(this.m):Zt.cmpn(0)<0&&(Me=Zt.iadd(this.m)),Me._forceRed(this)},Pe.prototype.invm=function(xe){var ze=this.imod(xe._invmp(this.m).mul(this.r2));return ze._forceRed(this)}})(t,commonjsGlobal)})(bn$8);var bnExports$3=bn$8.exports;const BN$8=getDefaultExportFromCjs$2(bnExports$3),version$u="logger/5.8.0";let _permanentCensorErrors$1=!1,_censorErrors$1=!1;const LogLevels$1={debug:1,default:2,info:2,warning:3,error:4,off:5};let _logLevel$1=LogLevels$1.default,_globalLogger$1=null;function _checkNormalize$1(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(n=>{try{if("test".normalize(n)!=="test")throw new Error("bad normalize")}catch{t.push(n)}}),t.length)throw new Error("missing "+t.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(t){return t.message}return null}const _normalizeError$1=_checkNormalize$1();var LogLevel$1;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(LogLevel$1||(LogLevel$1={}));var ErrorCode$1;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(ErrorCode$1||(ErrorCode$1={}));const HEX$1="0123456789abcdef";let Logger$1=class ro{constructor(n){Object.defineProperty(this,"version",{enumerable:!0,value:n,writable:!1})}_log(n,c){const ie=n.toLowerCase();LogLevels$1[ie]==null&&this.throwArgumentError("invalid log level name","logLevel",n),!(_logLevel$1>LogLevels$1[ie])&&console.log.apply(console,c)}debug(...n){this._log(ro.levels.DEBUG,n)}info(...n){this._log(ro.levels.INFO,n)}warn(...n){this._log(ro.levels.WARNING,n)}makeError(n,c,ie){if(_censorErrors$1)return this.makeError("censored error",c,{});c||(c=ro.errors.UNKNOWN_ERROR),ie||(ie={});const se=[];Object.keys(ie).forEach(pe=>{const ge=ie[pe];try{if(ge instanceof Uint8Array){let be="";for(let _e=0;_e<ge.length;_e++)be+=HEX$1[ge[_e]>>4],be+=HEX$1[ge[_e]&15];se.push(pe+"=Uint8Array(0x"+be+")")}else se.push(pe+"="+JSON.stringify(ge))}catch{se.push(pe+"="+JSON.stringify(ie[pe].toString()))}}),se.push(`code=${c}`),se.push(`version=${this.version}`);const ae=n;let de="";switch(c){case ErrorCode$1.NUMERIC_FAULT:{de="NUMERIC_FAULT";const pe=n;switch(pe){case"overflow":case"underflow":case"division-by-zero":de+="-"+pe;break;case"negative-power":case"negative-width":de+="-unsupported";break;case"unbound-bitwise-result":de+="-unbound-result";break}break}case ErrorCode$1.CALL_EXCEPTION:case ErrorCode$1.INSUFFICIENT_FUNDS:case ErrorCode$1.MISSING_NEW:case ErrorCode$1.NONCE_EXPIRED:case ErrorCode$1.REPLACEMENT_UNDERPRICED:case ErrorCode$1.TRANSACTION_REPLACED:case ErrorCode$1.UNPREDICTABLE_GAS_LIMIT:de=c;break}de&&(n+=" [ See: https://links.ethers.org/v5-errors-"+de+" ]"),se.length&&(n+=" ("+se.join(", ")+")");const ue=new Error(n);return ue.reason=ae,ue.code=c,Object.keys(ie).forEach(function(pe){ue[pe]=ie[pe]}),ue}throwError(n,c,ie){throw this.makeError(n,c,ie)}throwArgumentError(n,c,ie){return this.throwError(n,ro.errors.INVALID_ARGUMENT,{argument:c,value:ie})}assert(n,c,ie,se){n||this.throwError(c,ie,se)}assertArgument(n,c,ie,se){n||this.throwArgumentError(c,ie,se)}checkNormalize(n){_normalizeError$1&&this.throwError("platform missing String.prototype.normalize",ro.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:_normalizeError$1})}checkSafeUint53(n,c){typeof n=="number"&&(c==null&&(c="value not safe"),(n<0||n>=9007199254740991)&&this.throwError(c,ro.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:n}),n%1&&this.throwError(c,ro.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:n}))}checkArgumentCount(n,c,ie){ie?ie=": "+ie:ie="",n<c&&this.throwError("missing argument"+ie,ro.errors.MISSING_ARGUMENT,{count:n,expectedCount:c}),n>c&&this.throwError("too many arguments"+ie,ro.errors.UNEXPECTED_ARGUMENT,{count:n,expectedCount:c})}checkNew(n,c){(n===Object||n==null)&&this.throwError("missing new",ro.errors.MISSING_NEW,{name:c.name})}checkAbstract(n,c){n===c?this.throwError("cannot instantiate abstract class "+JSON.stringify(c.name)+" directly; use a sub-class",ro.errors.UNSUPPORTED_OPERATION,{name:n.name,operation:"new"}):(n===Object||n==null)&&this.throwError("missing new",ro.errors.MISSING_NEW,{name:c.name})}static globalLogger(){return _globalLogger$1||(_globalLogger$1=new ro(version$u)),_globalLogger$1}static setCensorship(n,c){if(!n&&c&&this.globalLogger().throwError("cannot permanently disable censorship",ro.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),_permanentCensorErrors$1){if(!n)return;this.globalLogger().throwError("error censorship permanent",ro.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}_censorErrors$1=!!n,_permanentCensorErrors$1=!!c}static setLogLevel(n){const c=LogLevels$1[n.toLowerCase()];if(c==null){ro.globalLogger().warn("invalid log level - "+n);return}_logLevel$1=c}static from(n){return new ro(n)}};Logger$1.errors=ErrorCode$1;Logger$1.levels=LogLevel$1;const lib_esm$k=Object.freeze(Object.defineProperty({__proto__:null,get ErrorCode(){return ErrorCode$1},get LogLevel(){return LogLevel$1},Logger:Logger$1},Symbol.toStringTag,{value:"Module"})),version$t="bytes/5.8.0",logger$x=new Logger$1(version$t);function isHexable$1(t){return!!t.toHexString}function addSlice(t){return t.slice||(t.slice=function(){const n=Array.prototype.slice.call(arguments);return addSlice(new Uint8Array(Array.prototype.slice.apply(t,n)))}),t}function isBytesLike(t){return isHexString$1(t)&&!(t.length%2)||isBytes$1(t)}function isInteger$2(t){return typeof t=="number"&&t==t&&t%1===0}function isBytes$1(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!isInteger$2(t.length)||t.length<0)return!1;for(let n=0;n<t.length;n++){const c=t[n];if(!isInteger$2(c)||c<0||c>=256)return!1}return!0}function arrayify(t,n){if(n||(n={}),typeof t=="number"){logger$x.checkSafeUint53(t,"invalid arrayify value");const c=[];for(;t;)c.unshift(t&255),t=parseInt(String(t/256));return c.length===0&&c.push(0),addSlice(new Uint8Array(c))}if(n.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),isHexable$1(t)&&(t=t.toHexString()),isHexString$1(t)){let c=t.substring(2);c.length%2&&(n.hexPad==="left"?c="0"+c:n.hexPad==="right"?c+="0":logger$x.throwArgumentError("hex data is odd-length","value",t));const ie=[];for(let se=0;se<c.length;se+=2)ie.push(parseInt(c.substring(se,se+2),16));return addSlice(new Uint8Array(ie))}return isBytes$1(t)?addSlice(new Uint8Array(t)):logger$x.throwArgumentError("invalid arrayify value","value",t)}function concat$1(t){const n=t.map(se=>arrayify(se)),c=n.reduce((se,ae)=>se+ae.length,0),ie=new Uint8Array(c);return n.reduce((se,ae)=>(ie.set(ae,se),se+ae.length),0),addSlice(ie)}function stripZeros(t){let n=arrayify(t);if(n.length===0)return n;let c=0;for(;c<n.length&&n[c]===0;)c++;return c&&(n=n.slice(c)),n}function zeroPad(t,n){t=arrayify(t),t.length>n&&logger$x.throwArgumentError("value out of range","value",arguments[0]);const c=new Uint8Array(n);return c.set(t,n-t.length),addSlice(c)}function isHexString$1(t,n){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||n&&t.length!==2+2*n)}const HexCharacters$1="0123456789abcdef";function hexlify$1(t,n){if(n||(n={}),typeof t=="number"){logger$x.checkSafeUint53(t,"invalid hexlify value");let c="";for(;t;)c=HexCharacters$1[t&15]+c,t=Math.floor(t/16);return c.length?(c.length%2&&(c="0"+c),"0x"+c):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(n.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),isHexable$1(t))return t.toHexString();if(isHexString$1(t))return t.length%2&&(n.hexPad==="left"?t="0x0"+t.substring(2):n.hexPad==="right"?t+="0":logger$x.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(isBytes$1(t)){let c="0x";for(let ie=0;ie<t.length;ie++){let se=t[ie];c+=HexCharacters$1[(se&240)>>4]+HexCharacters$1[se&15]}return c}return logger$x.throwArgumentError("invalid hexlify value","value",t)}function hexDataLength(t){if(typeof t!="string")t=hexlify$1(t);else if(!isHexString$1(t)||t.length%2)return null;return(t.length-2)/2}function hexDataSlice(t,n,c){return typeof t!="string"?t=hexlify$1(t):(!isHexString$1(t)||t.length%2)&&logger$x.throwArgumentError("invalid hexData","value",t),n=2+2*n,c!=null?"0x"+t.substring(n,2+2*c):"0x"+t.substring(n)}function hexConcat(t){let n="0x";return t.forEach(c=>{n+=hexlify$1(c).substring(2)}),n}function hexValue(t){const n=hexStripZeros(hexlify$1(t,{hexPad:"left"}));return n==="0x"?"0x0":n}function hexStripZeros(t){typeof t!="string"&&(t=hexlify$1(t)),isHexString$1(t)||logger$x.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let n=0;for(;n<t.length&&t[n]==="0";)n++;return"0x"+t.substring(n)}function hexZeroPad(t,n){for(typeof t!="string"?t=hexlify$1(t):isHexString$1(t)||logger$x.throwArgumentError("invalid hex string","value",t),t.length>2*n+2&&logger$x.throwArgumentError("value out of range","value",arguments[1]);t.length<2*n+2;)t="0x0"+t.substring(2);return t}function splitSignature(t){const n={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(isBytesLike(t)){let c=arrayify(t);c.length===64?(n.v=27+(c[32]>>7),c[32]&=127,n.r=hexlify$1(c.slice(0,32)),n.s=hexlify$1(c.slice(32,64))):c.length===65?(n.r=hexlify$1(c.slice(0,32)),n.s=hexlify$1(c.slice(32,64)),n.v=c[64]):logger$x.throwArgumentError("invalid signature string","signature",t),n.v<27&&(n.v===0||n.v===1?n.v+=27:logger$x.throwArgumentError("signature invalid v byte","signature",t)),n.recoveryParam=1-n.v%2,n.recoveryParam&&(c[32]|=128),n._vs=hexlify$1(c.slice(32,64))}else{if(n.r=t.r,n.s=t.s,n.v=t.v,n.recoveryParam=t.recoveryParam,n._vs=t._vs,n._vs!=null){const se=zeroPad(arrayify(n._vs),32);n._vs=hexlify$1(se);const ae=se[0]>=128?1:0;n.recoveryParam==null?n.recoveryParam=ae:n.recoveryParam!==ae&&logger$x.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),se[0]&=127;const de=hexlify$1(se);n.s==null?n.s=de:n.s!==de&&logger$x.throwArgumentError("signature v mismatch _vs","signature",t)}if(n.recoveryParam==null)n.v==null?logger$x.throwArgumentError("signature missing v and recoveryParam","signature",t):n.v===0||n.v===1?n.recoveryParam=n.v:n.recoveryParam=1-n.v%2;else if(n.v==null)n.v=27+n.recoveryParam;else{const se=n.v===0||n.v===1?n.v:1-n.v%2;n.recoveryParam!==se&&logger$x.throwArgumentError("signature recoveryParam mismatch v","signature",t)}n.r==null||!isHexString$1(n.r)?logger$x.throwArgumentError("signature missing or invalid r","signature",t):n.r=hexZeroPad(n.r,32),n.s==null||!isHexString$1(n.s)?logger$x.throwArgumentError("signature missing or invalid s","signature",t):n.s=hexZeroPad(n.s,32);const c=arrayify(n.s);c[0]>=128&&logger$x.throwArgumentError("signature s out of range","signature",t),n.recoveryParam&&(c[0]|=128);const ie=hexlify$1(c);n._vs&&(isHexString$1(n._vs)||logger$x.throwArgumentError("signature invalid _vs","signature",t),n._vs=hexZeroPad(n._vs,32)),n._vs==null?n._vs=ie:n._vs!==ie&&logger$x.throwArgumentError("signature _vs mismatch v and s","signature",t)}return n.yParityAndS=n._vs,n.compact=n.r+n.yParityAndS.substring(2),n}function joinSignature(t){return t=splitSignature(t),hexlify$1(concat$1([t.r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}const lib_esm$j=Object.freeze(Object.defineProperty({__proto__:null,arrayify,concat:concat$1,hexConcat,hexDataLength,hexDataSlice,hexStripZeros,hexValue,hexZeroPad,hexlify:hexlify$1,isBytes:isBytes$1,isBytesLike,isHexString:isHexString$1,joinSignature,splitSignature,stripZeros,zeroPad},Symbol.toStringTag,{value:"Module"})),version$s="bignumber/5.8.0";var BN$7=BN$8.BN;const logger$w=new Logger$1(version$s),_constructorGuard$4={},MAX_SAFE$1=9007199254740991;function isBigNumberish(t){return t!=null&&(BigNumber$1.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||isHexString$1(t)||typeof t=="bigint"||isBytes$1(t))}let _warnedToStringRadix$1=!1,BigNumber$1=class io{constructor(n,c){n!==_constructorGuard$4&&logger$w.throwError("cannot call constructor directly; use BigNumber.from",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=c,this._isBigNumber=!0,Object.freeze(this)}fromTwos(n){return toBigNumber$1(toBN$1(this).fromTwos(n))}toTwos(n){return toBigNumber$1(toBN$1(this).toTwos(n))}abs(){return this._hex[0]==="-"?io.from(this._hex.substring(1)):this}add(n){return toBigNumber$1(toBN$1(this).add(toBN$1(n)))}sub(n){return toBigNumber$1(toBN$1(this).sub(toBN$1(n)))}div(n){return io.from(n).isZero()&&throwFault$1("division-by-zero","div"),toBigNumber$1(toBN$1(this).div(toBN$1(n)))}mul(n){return toBigNumber$1(toBN$1(this).mul(toBN$1(n)))}mod(n){const c=toBN$1(n);return c.isNeg()&&throwFault$1("division-by-zero","mod"),toBigNumber$1(toBN$1(this).umod(c))}pow(n){const c=toBN$1(n);return c.isNeg()&&throwFault$1("negative-power","pow"),toBigNumber$1(toBN$1(this).pow(c))}and(n){const c=toBN$1(n);return(this.isNegative()||c.isNeg())&&throwFault$1("unbound-bitwise-result","and"),toBigNumber$1(toBN$1(this).and(c))}or(n){const c=toBN$1(n);return(this.isNegative()||c.isNeg())&&throwFault$1("unbound-bitwise-result","or"),toBigNumber$1(toBN$1(this).or(c))}xor(n){const c=toBN$1(n);return(this.isNegative()||c.isNeg())&&throwFault$1("unbound-bitwise-result","xor"),toBigNumber$1(toBN$1(this).xor(c))}mask(n){return(this.isNegative()||n<0)&&throwFault$1("negative-width","mask"),toBigNumber$1(toBN$1(this).maskn(n))}shl(n){return(this.isNegative()||n<0)&&throwFault$1("negative-width","shl"),toBigNumber$1(toBN$1(this).shln(n))}shr(n){return(this.isNegative()||n<0)&&throwFault$1("negative-width","shr"),toBigNumber$1(toBN$1(this).shrn(n))}eq(n){return toBN$1(this).eq(toBN$1(n))}lt(n){return toBN$1(this).lt(toBN$1(n))}lte(n){return toBN$1(this).lte(toBN$1(n))}gt(n){return toBN$1(this).gt(toBN$1(n))}gte(n){return toBN$1(this).gte(toBN$1(n))}isNegative(){return this._hex[0]==="-"}isZero(){return toBN$1(this).isZero()}toNumber(){try{return toBN$1(this).toNumber()}catch{throwFault$1("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return logger$w.throwError("this platform does not support BigInt",Logger$1.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?_warnedToStringRadix$1||(_warnedToStringRadix$1=!0,logger$w.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?logger$w.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Logger$1.errors.UNEXPECTED_ARGUMENT,{}):logger$w.throwError("BigNumber.toString does not accept parameters",Logger$1.errors.UNEXPECTED_ARGUMENT,{})),toBN$1(this).toString(10)}toHexString(){return this._hex}toJSON(n){return{type:"BigNumber",hex:this.toHexString()}}static from(n){if(n instanceof io)return n;if(typeof n=="string")return n.match(/^-?0x[0-9a-f]+$/i)?new io(_constructorGuard$4,toHex$2(n)):n.match(/^-?[0-9]+$/)?new io(_constructorGuard$4,toHex$2(new BN$7(n))):logger$w.throwArgumentError("invalid BigNumber string","value",n);if(typeof n=="number")return n%1&&throwFault$1("underflow","BigNumber.from",n),(n>=MAX_SAFE$1||n<=-MAX_SAFE$1)&&throwFault$1("overflow","BigNumber.from",n),io.from(String(n));const c=n;if(typeof c=="bigint")return io.from(c.toString());if(isBytes$1(c))return io.from(hexlify$1(c));if(c)if(c.toHexString){const ie=c.toHexString();if(typeof ie=="string")return io.from(ie)}else{let ie=c._hex;if(ie==null&&c.type==="BigNumber"&&(ie=c.hex),typeof ie=="string"&&(isHexString$1(ie)||ie[0]==="-"&&isHexString$1(ie.substring(1))))return io.from(ie)}return logger$w.throwArgumentError("invalid BigNumber value","value",n)}static isBigNumber(n){return!!(n&&n._isBigNumber)}};function toHex$2(t){if(typeof t!="string")return toHex$2(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&logger$w.throwArgumentError("invalid hex","value",t),t=toHex$2(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function toBigNumber$1(t){return BigNumber$1.from(toHex$2(t))}function toBN$1(t){const n=BigNumber$1.from(t).toHexString();return n[0]==="-"?new BN$7("-"+n.substring(3),16):new BN$7(n.substring(2),16)}function throwFault$1(t,n,c){const ie={fault:t,operation:n};return c!=null&&(ie.value=c),logger$w.throwError(t,Logger$1.errors.NUMERIC_FAULT,ie)}function _base36To16(t){return new BN$7(t,36).toString(16)}function _base16To36(t){return new BN$7(t,16).toString(36)}const logger$v=new Logger$1(version$s),_constructorGuard$3={},Zero$2=BigNumber$1.from(0),NegativeOne$2=BigNumber$1.from(-1);function throwFault$2(t,n,c,ie){const se={fault:n,operation:c};return ie!==void 0&&(se.value=ie),logger$v.throwError(t,Logger$1.errors.NUMERIC_FAULT,se)}let zeros="0";for(;zeros.length<256;)zeros+=zeros;function getMultiplier(t){if(typeof t!="number")try{t=BigNumber$1.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+zeros.substring(0,t):logger$v.throwArgumentError("invalid decimal size","decimals",t)}function formatFixed(t,n){n==null&&(n=0);const c=getMultiplier(n);t=BigNumber$1.from(t);const ie=t.lt(Zero$2);ie&&(t=t.mul(NegativeOne$2));let se=t.mod(c).toString();for(;se.length<c.length-1;)se="0"+se;se=se.match(/^([0-9]*[1-9]|0)(0*)/)[1];const ae=t.div(c).toString();return c.length===1?t=ae:t=ae+"."+se,ie&&(t="-"+t),t}function parseFixed(t,n){n==null&&(n=0);const c=getMultiplier(n);(typeof t!="string"||!t.match(/^-?[0-9.]+$/))&&logger$v.throwArgumentError("invalid decimal value","value",t);const ie=t.substring(0,1)==="-";ie&&(t=t.substring(1)),t==="."&&logger$v.throwArgumentError("missing value","value",t);const se=t.split(".");se.length>2&&logger$v.throwArgumentError("too many decimal points","value",t);let ae=se[0],de=se[1];for(ae||(ae="0"),de||(de="0");de[de.length-1]==="0";)de=de.substring(0,de.length-1);for(de.length>c.length-1&&throwFault$2("fractional component exceeds decimals","underflow","parseFixed"),de===""&&(de="0");de.length<c.length-1;)de+="0";const ue=BigNumber$1.from(ae),pe=BigNumber$1.from(de);let ge=ue.mul(c).add(pe);return ie&&(ge=ge.mul(NegativeOne$2)),ge}class FixedFormat{constructor(n,c,ie,se){n!==_constructorGuard$3&&logger$v.throwError("cannot use FixedFormat constructor; use FixedFormat.from",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=c,this.width=ie,this.decimals=se,this.name=(c?"":"u")+"fixed"+String(ie)+"x"+String(se),this._multiplier=getMultiplier(se),Object.freeze(this)}static from(n){if(n instanceof FixedFormat)return n;typeof n=="number"&&(n=`fixed128x${n}`);let c=!0,ie=128,se=18;if(typeof n=="string"){if(n!=="fixed")if(n==="ufixed")c=!1;else{const ae=n.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);ae||logger$v.throwArgumentError("invalid fixed format","format",n),c=ae[1]!=="u",ie=parseInt(ae[2]),se=parseInt(ae[3])}}else if(n){const ae=(de,ue,pe)=>n[de]==null?pe:(typeof n[de]!==ue&&logger$v.throwArgumentError("invalid fixed format ("+de+" not "+ue+")","format."+de,n[de]),n[de]);c=ae("signed","boolean",c),ie=ae("width","number",ie),se=ae("decimals","number",se)}return ie%8&&logger$v.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",ie),se>80&&logger$v.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",se),new FixedFormat(_constructorGuard$3,c,ie,se)}}class FixedNumber{constructor(n,c,ie,se){n!==_constructorGuard$3&&logger$v.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=se,this._hex=c,this._value=ie,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(n){this.format.name!==n.format.name&&logger$v.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",n)}addUnsafe(n){this._checkFormat(n);const c=parseFixed(this._value,this.format.decimals),ie=parseFixed(n._value,n.format.decimals);return FixedNumber.fromValue(c.add(ie),this.format.decimals,this.format)}subUnsafe(n){this._checkFormat(n);const c=parseFixed(this._value,this.format.decimals),ie=parseFixed(n._value,n.format.decimals);return FixedNumber.fromValue(c.sub(ie),this.format.decimals,this.format)}mulUnsafe(n){this._checkFormat(n);const c=parseFixed(this._value,this.format.decimals),ie=parseFixed(n._value,n.format.decimals);return FixedNumber.fromValue(c.mul(ie).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(n){this._checkFormat(n);const c=parseFixed(this._value,this.format.decimals),ie=parseFixed(n._value,n.format.decimals);return FixedNumber.fromValue(c.mul(this.format._multiplier).div(ie),this.format.decimals,this.format)}floor(){const n=this.toString().split(".");n.length===1&&n.push("0");let c=FixedNumber.from(n[0],this.format);const ie=!n[1].match(/^(0*)$/);return this.isNegative()&&ie&&(c=c.subUnsafe(ONE.toFormat(c.format))),c}ceiling(){const n=this.toString().split(".");n.length===1&&n.push("0");let c=FixedNumber.from(n[0],this.format);const ie=!n[1].match(/^(0*)$/);return!this.isNegative()&&ie&&(c=c.addUnsafe(ONE.toFormat(c.format))),c}round(n){n==null&&(n=0);const c=this.toString().split(".");if(c.length===1&&c.push("0"),(n<0||n>80||n%1)&&logger$v.throwArgumentError("invalid decimal count","decimals",n),c[1].length<=n)return this;const ie=FixedNumber.from("1"+zeros.substring(0,n),this.format),se=BUMP.toFormat(this.format);return this.mulUnsafe(ie).addUnsafe(se).floor().divUnsafe(ie)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(n){if(n==null)return this._hex;n%8&&logger$v.throwArgumentError("invalid byte width","width",n);const c=BigNumber$1.from(this._hex).fromTwos(this.format.width).toTwos(n).toHexString();return hexZeroPad(c,n/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(n){return FixedNumber.fromString(this._value,n)}static fromValue(n,c,ie){return ie==null&&c!=null&&!isBigNumberish(c)&&(ie=c,c=null),c==null&&(c=0),ie==null&&(ie="fixed"),FixedNumber.fromString(formatFixed(n,c),FixedFormat.from(ie))}static fromString(n,c){c==null&&(c="fixed");const ie=FixedFormat.from(c),se=parseFixed(n,ie.decimals);!ie.signed&&se.lt(Zero$2)&&throwFault$2("unsigned value cannot be negative","overflow","value",n);let ae=null;ie.signed?ae=se.toTwos(ie.width).toHexString():(ae=se.toHexString(),ae=hexZeroPad(ae,ie.width/8));const de=formatFixed(se,ie.decimals);return new FixedNumber(_constructorGuard$3,ae,de,ie)}static fromBytes(n,c){c==null&&(c="fixed");const ie=FixedFormat.from(c);if(arrayify(n).length>ie.width/8)throw new Error("overflow");let se=BigNumber$1.from(n);ie.signed&&(se=se.fromTwos(ie.width));const ae=se.toTwos((ie.signed?0:1)+ie.width).toHexString(),de=formatFixed(se,ie.decimals);return new FixedNumber(_constructorGuard$3,ae,de,ie)}static from(n,c){if(typeof n=="string")return FixedNumber.fromString(n,c);if(isBytes$1(n))return FixedNumber.fromBytes(n,c);try{return FixedNumber.fromValue(n,0,c)}catch(ie){if(ie.code!==Logger$1.errors.INVALID_ARGUMENT)throw ie}return logger$v.throwArgumentError("invalid FixedNumber value","value",n)}static isFixedNumber(n){return!!(n&&n._isFixedNumber)}}const ONE=FixedNumber.from(1),BUMP=FixedNumber.from("0.5"),version$r="properties/5.8.0";var __awaiter$l=function(t,n,c,ie){function se(ae){return ae instanceof c?ae:new c(function(de){de(ae)})}return new(c||(c=Promise))(function(ae,de){function ue(be){try{ge(ie.next(be))}catch(_e){de(_e)}}function pe(be){try{ge(ie.throw(be))}catch(_e){de(_e)}}function ge(be){be.done?ae(be.value):se(be.value).then(ue,pe)}ge((ie=ie.apply(t,[])).next())})};const logger$u=new Logger$1(version$r);function defineReadOnly(t,n,c){Object.defineProperty(t,n,{enumerable:!0,value:c,writable:!1})}function getStatic(t,n){for(let c=0;c<32;c++){if(t[n])return t[n];if(!t.prototype||typeof t.prototype!="object")break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function resolveProperties(t){return __awaiter$l(this,void 0,void 0,function*(){const n=Object.keys(t).map(c=>{const ie=t[c];return Promise.resolve(ie).then(se=>({key:c,value:se}))});return(yield Promise.all(n)).reduce((c,ie)=>(c[ie.key]=ie.value,c),{})})}function checkProperties(t,n){(!t||typeof t!="object")&&logger$u.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(c=>{n[c]||logger$u.throwArgumentError("invalid object key - "+c,"transaction:"+c,t)})}function shallowCopy(t){const n={};for(const c in t)n[c]=t[c];return n}const opaque={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function _isFrozen(t){if(t==null||opaque[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;const n=Object.keys(t);for(let c=0;c<n.length;c++){let ie=null;try{ie=t[n[c]]}catch{continue}if(!_isFrozen(ie))return!1}return!0}return logger$u.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function _deepCopy(t){if(_isFrozen(t))return t;if(Array.isArray(t))return Object.freeze(t.map(n=>deepCopy(n)));if(typeof t=="object"){const n={};for(const c in t){const ie=t[c];ie!==void 0&&defineReadOnly(n,c,deepCopy(ie))}return n}return logger$u.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function deepCopy(t){return _deepCopy(t)}let Description$1=class{constructor(n){for(const c in n)this[c]=deepCopy(n[c])}};const lib_esm$i=Object.freeze(Object.defineProperty({__proto__:null,Description:Description$1,checkProperties,deepCopy,defineReadOnly,getStatic,resolveProperties,shallowCopy},Symbol.toStringTag,{value:"Module"})),version$q="abi/5.8.0",logger$t=new Logger$1(version$q),_constructorGuard$2={};let ModifiersBytes={calldata:!0,memory:!0,storage:!0},ModifiersNest={calldata:!0,memory:!0};function checkModifier(t,n){if(t==="bytes"||t==="string"){if(ModifiersBytes[n])return!0}else if(t==="address"){if(n==="payable")return!0}else if((t.indexOf("[")>=0||t==="tuple")&&ModifiersNest[n])return!0;return(ModifiersBytes[n]||n==="payable")&&logger$t.throwArgumentError("invalid modifier","name",n),!1}function parseParamType(t,n){let c=t;function ie(ue){logger$t.throwArgumentError(`unexpected character at position ${ue}`,"param",t)}t=t.replace(/\s/g," ");function se(ue){let pe={type:"",name:"",parent:ue,state:{allowType:!0}};return n&&(pe.indexed=!1),pe}let ae={type:"",name:"",state:{allowType:!0}},de=ae;for(let ue=0;ue<t.length;ue++){let pe=t[ue];switch(pe){case"(":de.state.allowType&&de.type===""?de.type="tuple":de.state.allowParams||ie(ue),de.state.allowType=!1,de.type=verifyType(de.type),de.components=[se(de)],de=de.components[0];break;case")":delete de.state,de.name==="indexed"&&(n||ie(ue),de.indexed=!0,de.name=""),checkModifier(de.type,de.name)&&(de.name=""),de.type=verifyType(de.type);let ge=de;de=de.parent,de||ie(ue),delete ge.parent,de.state.allowParams=!1,de.state.allowName=!0,de.state.allowArray=!0;break;case",":delete de.state,de.name==="indexed"&&(n||ie(ue),de.indexed=!0,de.name=""),checkModifier(de.type,de.name)&&(de.name=""),de.type=verifyType(de.type);let be=se(de.parent);de.parent.components.push(be),delete de.parent,de=be;break;case" ":de.state.allowType&&de.type!==""&&(de.type=verifyType(de.type),delete de.state.allowType,de.state.allowName=!0,de.state.allowParams=!0),de.state.allowName&&de.name!==""&&(de.name==="indexed"?(n||ie(ue),de.indexed&&ie(ue),de.indexed=!0,de.name=""):checkModifier(de.type,de.name)?de.name="":de.state.allowName=!1);break;case"[":de.state.allowArray||ie(ue),de.type+=pe,de.state.allowArray=!1,de.state.allowName=!1,de.state.readArray=!0;break;case"]":de.state.readArray||ie(ue),de.type+=pe,de.state.readArray=!1,de.state.allowArray=!0,de.state.allowName=!0;break;default:de.state.allowType?(de.type+=pe,de.state.allowParams=!0,de.state.allowArray=!0):de.state.allowName?(de.name+=pe,delete de.state.allowArray):de.state.readArray?de.type+=pe:ie(ue)}}return de.parent&&logger$t.throwArgumentError("unexpected eof","param",t),delete ae.state,de.name==="indexed"?(n||ie(c.length-7),de.indexed&&ie(c.length-7),de.indexed=!0,de.name=""):checkModifier(de.type,de.name)&&(de.name=""),ae.type=verifyType(ae.type),ae}function populate(t,n){for(let c in n)defineReadOnly(t,c,n[c])}const FormatTypes=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),paramTypeArray=new RegExp(/^(.*)\[([0-9]*)\]$/);class ParamType{constructor(n,c){n!==_constructorGuard$2&&logger$t.throwError("use fromString",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),populate(this,c);let ie=this.type.match(paramTypeArray);ie?populate(this,{arrayLength:parseInt(ie[2]||"-1"),arrayChildren:ParamType.fromObject({type:ie[1],components:this.components}),baseType:"array"}):populate(this,{arrayLength:null,arrayChildren:null,baseType:this.components!=null?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(n){if(n||(n=FormatTypes.sighash),FormatTypes[n]||logger$t.throwArgumentError("invalid format type","format",n),n===FormatTypes.json){let ie={type:this.baseType==="tuple"?"tuple":this.type,name:this.name||void 0};return typeof this.indexed=="boolean"&&(ie.indexed=this.indexed),this.components&&(ie.components=this.components.map(se=>JSON.parse(se.format(n)))),JSON.stringify(ie)}let c="";return this.baseType==="array"?(c+=this.arrayChildren.format(n),c+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(n!==FormatTypes.sighash&&(c+=this.type),c+="("+this.components.map(ie=>ie.format(n)).join(n===FormatTypes.full?", ":",")+")"):c+=this.type,n!==FormatTypes.sighash&&(this.indexed===!0&&(c+=" indexed"),n===FormatTypes.full&&this.name&&(c+=" "+this.name)),c}static from(n,c){return typeof n=="string"?ParamType.fromString(n,c):ParamType.fromObject(n)}static fromObject(n){return ParamType.isParamType(n)?n:new ParamType(_constructorGuard$2,{name:n.name||null,type:verifyType(n.type),indexed:n.indexed==null?null:!!n.indexed,components:n.components?n.components.map(ParamType.fromObject):null})}static fromString(n,c){function ie(se){return ParamType.fromObject({name:se.name,type:se.type,indexed:se.indexed,components:se.components})}return ie(parseParamType(n,!!c))}static isParamType(n){return!!(n!=null&&n._isParamType)}}function parseParams(t,n){return splitNesting(t).map(c=>ParamType.fromString(c,n))}class Fragment{constructor(n,c){n!==_constructorGuard$2&&logger$t.throwError("use a static from method",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),populate(this,c),this._isFragment=!0,Object.freeze(this)}static from(n){return Fragment.isFragment(n)?n:typeof n=="string"?Fragment.fromString(n):Fragment.fromObject(n)}static fromObject(n){if(Fragment.isFragment(n))return n;switch(n.type){case"function":return FunctionFragment.fromObject(n);case"event":return EventFragment.fromObject(n);case"constructor":return ConstructorFragment.fromObject(n);case"error":return ErrorFragment.fromObject(n);case"fallback":case"receive":return null}return logger$t.throwArgumentError("invalid fragment object","value",n)}static fromString(n){return n=n.replace(/\s/g," "),n=n.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),n=n.trim(),n.split(" ")[0]==="event"?EventFragment.fromString(n.substring(5).trim()):n.split(" ")[0]==="function"?FunctionFragment.fromString(n.substring(8).trim()):n.split("(")[0].trim()==="constructor"?ConstructorFragment.fromString(n.trim()):n.split(" ")[0]==="error"?ErrorFragment.fromString(n.substring(5).trim()):logger$t.throwArgumentError("unsupported fragment","value",n)}static isFragment(n){return!!(n&&n._isFragment)}}class EventFragment extends Fragment{format(n){if(n||(n=FormatTypes.sighash),FormatTypes[n]||logger$t.throwArgumentError("invalid format type","format",n),n===FormatTypes.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(ie=>JSON.parse(ie.format(n)))});let c="";return n!==FormatTypes.sighash&&(c+="event "),c+=this.name+"("+this.inputs.map(ie=>ie.format(n)).join(n===FormatTypes.full?", ":",")+") ",n!==FormatTypes.sighash&&this.anonymous&&(c+="anonymous "),c.trim()}static from(n){return typeof n=="string"?EventFragment.fromString(n):EventFragment.fromObject(n)}static fromObject(n){if(EventFragment.isEventFragment(n))return n;n.type!=="event"&&logger$t.throwArgumentError("invalid event object","value",n);const c={name:verifyIdentifier(n.name),anonymous:n.anonymous,inputs:n.inputs?n.inputs.map(ParamType.fromObject):[],type:"event"};return new EventFragment(_constructorGuard$2,c)}static fromString(n){let c=n.match(regexParen);c||logger$t.throwArgumentError("invalid event string","value",n);let ie=!1;return c[3].split(" ").forEach(se=>{switch(se.trim()){case"anonymous":ie=!0;break;case"":break;default:logger$t.warn("unknown modifier: "+se)}}),EventFragment.fromObject({name:c[1].trim(),anonymous:ie,inputs:parseParams(c[2],!0),type:"event"})}static isEventFragment(n){return n&&n._isFragment&&n.type==="event"}}function parseGas(t,n){n.gas=null;let c=t.split("@");return c.length!==1?(c.length>2&&logger$t.throwArgumentError("invalid human-readable ABI signature","value",t),c[1].match(/^[0-9]+$/)||logger$t.throwArgumentError("invalid human-readable ABI signature gas","value",t),n.gas=BigNumber$1.from(c[1]),c[0]):t}function parseModifiers(t,n){n.constant=!1,n.payable=!1,n.stateMutability="nonpayable",t.split(" ").forEach(c=>{switch(c.trim()){case"constant":n.constant=!0;break;case"payable":n.payable=!0,n.stateMutability="payable";break;case"nonpayable":n.payable=!1,n.stateMutability="nonpayable";break;case"pure":n.constant=!0,n.stateMutability="pure";break;case"view":n.constant=!0,n.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+c)}})}function verifyState(t){let n={constant:!1,payable:!0,stateMutability:"payable"};return t.stateMutability!=null?(n.stateMutability=t.stateMutability,n.constant=n.stateMutability==="view"||n.stateMutability==="pure",t.constant!=null&&!!t.constant!==n.constant&&logger$t.throwArgumentError("cannot have constant function with mutability "+n.stateMutability,"value",t),n.payable=n.stateMutability==="payable",t.payable!=null&&!!t.payable!==n.payable&&logger$t.throwArgumentError("cannot have payable function with mutability "+n.stateMutability,"value",t)):t.payable!=null?(n.payable=!!t.payable,t.constant==null&&!n.payable&&t.type!=="constructor"&&logger$t.throwArgumentError("unable to determine stateMutability","value",t),n.constant=!!t.constant,n.constant?n.stateMutability="view":n.stateMutability=n.payable?"payable":"nonpayable",n.payable&&n.constant&&logger$t.throwArgumentError("cannot have constant payable function","value",t)):t.constant!=null?(n.constant=!!t.constant,n.payable=!n.constant,n.stateMutability=n.constant?"view":"payable"):t.type!=="constructor"&&logger$t.throwArgumentError("unable to determine stateMutability","value",t),n}class ConstructorFragment extends Fragment{format(n){if(n||(n=FormatTypes.sighash),FormatTypes[n]||logger$t.throwArgumentError("invalid format type","format",n),n===FormatTypes.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(ie=>JSON.parse(ie.format(n)))});n===FormatTypes.sighash&&logger$t.throwError("cannot format a constructor for sighash",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let c="constructor("+this.inputs.map(ie=>ie.format(n)).join(n===FormatTypes.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(c+=this.stateMutability+" "),c.trim()}static from(n){return typeof n=="string"?ConstructorFragment.fromString(n):ConstructorFragment.fromObject(n)}static fromObject(n){if(ConstructorFragment.isConstructorFragment(n))return n;n.type!=="constructor"&&logger$t.throwArgumentError("invalid constructor object","value",n);let c=verifyState(n);c.constant&&logger$t.throwArgumentError("constructor cannot be constant","value",n);const ie={name:null,type:n.type,inputs:n.inputs?n.inputs.map(ParamType.fromObject):[],payable:c.payable,stateMutability:c.stateMutability,gas:n.gas?BigNumber$1.from(n.gas):null};return new ConstructorFragment(_constructorGuard$2,ie)}static fromString(n){let c={type:"constructor"};n=parseGas(n,c);let ie=n.match(regexParen);return(!ie||ie[1].trim()!=="constructor")&&logger$t.throwArgumentError("invalid constructor string","value",n),c.inputs=parseParams(ie[2].trim(),!1),parseModifiers(ie[3].trim(),c),ConstructorFragment.fromObject(c)}static isConstructorFragment(n){return n&&n._isFragment&&n.type==="constructor"}}class FunctionFragment extends ConstructorFragment{format(n){if(n||(n=FormatTypes.sighash),FormatTypes[n]||logger$t.throwArgumentError("invalid format type","format",n),n===FormatTypes.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(ie=>JSON.parse(ie.format(n))),outputs:this.outputs.map(ie=>JSON.parse(ie.format(n)))});let c="";return n!==FormatTypes.sighash&&(c+="function "),c+=this.name+"("+this.inputs.map(ie=>ie.format(n)).join(n===FormatTypes.full?", ":",")+") ",n!==FormatTypes.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(c+=this.stateMutability+" "):this.constant&&(c+="view "),this.outputs&&this.outputs.length&&(c+="returns ("+this.outputs.map(ie=>ie.format(n)).join(", ")+") "),this.gas!=null&&(c+="@"+this.gas.toString()+" ")),c.trim()}static from(n){return typeof n=="string"?FunctionFragment.fromString(n):FunctionFragment.fromObject(n)}static fromObject(n){if(FunctionFragment.isFunctionFragment(n))return n;n.type!=="function"&&logger$t.throwArgumentError("invalid function object","value",n);let c=verifyState(n);const ie={type:n.type,name:verifyIdentifier(n.name),constant:c.constant,inputs:n.inputs?n.inputs.map(ParamType.fromObject):[],outputs:n.outputs?n.outputs.map(ParamType.fromObject):[],payable:c.payable,stateMutability:c.stateMutability,gas:n.gas?BigNumber$1.from(n.gas):null};return new FunctionFragment(_constructorGuard$2,ie)}static fromString(n){let c={type:"function"};n=parseGas(n,c);let ie=n.split(" returns ");ie.length>2&&logger$t.throwArgumentError("invalid function string","value",n);let se=ie[0].match(regexParen);if(se||logger$t.throwArgumentError("invalid function signature","value",n),c.name=se[1].trim(),c.name&&verifyIdentifier(c.name),c.inputs=parseParams(se[2],!1),parseModifiers(se[3].trim(),c),ie.length>1){let ae=ie[1].match(regexParen);(ae[1].trim()!=""||ae[3].trim()!="")&&logger$t.throwArgumentError("unexpected tokens","value",n),c.outputs=parseParams(ae[2],!1)}else c.outputs=[];return FunctionFragment.fromObject(c)}static isFunctionFragment(n){return n&&n._isFragment&&n.type==="function"}}function checkForbidden(t){const n=t.format();return(n==="Error(string)"||n==="Panic(uint256)")&&logger$t.throwArgumentError(`cannot specify user defined ${n} error`,"fragment",t),t}class ErrorFragment extends Fragment{format(n){if(n||(n=FormatTypes.sighash),FormatTypes[n]||logger$t.throwArgumentError("invalid format type","format",n),n===FormatTypes.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(ie=>JSON.parse(ie.format(n)))});let c="";return n!==FormatTypes.sighash&&(c+="error "),c+=this.name+"("+this.inputs.map(ie=>ie.format(n)).join(n===FormatTypes.full?", ":",")+") ",c.trim()}static from(n){return typeof n=="string"?ErrorFragment.fromString(n):ErrorFragment.fromObject(n)}static fromObject(n){if(ErrorFragment.isErrorFragment(n))return n;n.type!=="error"&&logger$t.throwArgumentError("invalid error object","value",n);const c={type:n.type,name:verifyIdentifier(n.name),inputs:n.inputs?n.inputs.map(ParamType.fromObject):[]};return checkForbidden(new ErrorFragment(_constructorGuard$2,c))}static fromString(n){let c={type:"error"},ie=n.match(regexParen);return ie||logger$t.throwArgumentError("invalid error signature","value",n),c.name=ie[1].trim(),c.name&&verifyIdentifier(c.name),c.inputs=parseParams(ie[2],!1),checkForbidden(ErrorFragment.fromObject(c))}static isErrorFragment(n){return n&&n._isFragment&&n.type==="error"}}function verifyType(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const regexIdentifier=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function verifyIdentifier(t){return(!t||!t.match(regexIdentifier))&&logger$t.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const regexParen=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function splitNesting(t){t=t.trim();let n=[],c="",ie=0;for(let se=0;se<t.length;se++){let ae=t[se];ae===","&&ie===0?(n.push(c),c=""):(c+=ae,ae==="("?ie++:ae===")"&&(ie--,ie===-1&&logger$t.throwArgumentError("unbalanced parenthesis","value",t)))}return c&&n.push(c),n}const logger$s=new Logger$1(version$q);function checkResultErrors(t){const n=[],c=function(ie,se){if(Array.isArray(se))for(let ae in se){const de=ie.slice();de.push(ae);try{c(de,se[ae])}catch(ue){n.push({path:de,error:ue})}}};return c([],t),n}class Coder{constructor(n,c,ie,se){this.name=n,this.type=c,this.localName=ie,this.dynamic=se}_throwError(n,c){logger$s.throwArgumentError(n,this.localName,c)}}class Writer{constructor(n){defineReadOnly(this,"wordSize",n||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(n)}get data(){return hexConcat(this._data)}get length(){return this._dataLength}_writeData(n){return this._data.push(n),this._dataLength+=n.length,n.length}appendWriter(n){return this._writeData(concat$1(n._data))}writeBytes(n){let c=arrayify(n);const ie=c.length%this.wordSize;return ie&&(c=concat$1([c,this._padding.slice(ie)])),this._writeData(c)}_getValue(n){let c=arrayify(BigNumber$1.from(n));return c.length>this.wordSize&&logger$s.throwError("value out-of-bounds",Logger$1.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:c.length}),c.length%this.wordSize&&(c=concat$1([this._padding.slice(c.length%this.wordSize),c])),c}writeValue(n){return this._writeData(this._getValue(n))}writeUpdatableValue(){const n=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,c=>{this._data[n]=this._getValue(c)}}}class Reader{constructor(n,c,ie,se){defineReadOnly(this,"_data",arrayify(n)),defineReadOnly(this,"wordSize",c||32),defineReadOnly(this,"_coerceFunc",ie),defineReadOnly(this,"allowLoose",se),this._offset=0}get data(){return hexlify$1(this._data)}get consumed(){return this._offset}static coerce(n,c){let ie=n.match("^u?int([0-9]+)$");return ie&&parseInt(ie[1])<=48&&(c=c.toNumber()),c}coerce(n,c){return this._coerceFunc?this._coerceFunc(n,c):Reader.coerce(n,c)}_peekBytes(n,c,ie){let se=Math.ceil(c/this.wordSize)*this.wordSize;return this._offset+se>this._data.length&&(this.allowLoose&&ie&&this._offset+c<=this._data.length?se=c:logger$s.throwError("data out-of-bounds",Logger$1.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+se})),this._data.slice(this._offset,this._offset+se)}subReader(n){return new Reader(this._data.slice(this._offset+n),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(n,c){let ie=this._peekBytes(0,n,!!c);return this._offset+=ie.length,ie.slice(0,n)}readValue(){return BigNumber$1.from(this.readBytes(this.wordSize))}}function getDefaultExportFromCjs$1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var browser$e={exports:{}},process$1=browser$e.exports={},cachedSetTimeout,cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?cachedSetTimeout=setTimeout:cachedSetTimeout=defaultSetTimout}catch{cachedSetTimeout=defaultSetTimout}try{typeof clearTimeout=="function"?cachedClearTimeout=clearTimeout:cachedClearTimeout=defaultClearTimeout}catch{cachedClearTimeout=defaultClearTimeout}})();function runTimeout(t){if(cachedSetTimeout===setTimeout)return setTimeout(t,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(t,0);try{return cachedSetTimeout(t,0)}catch{try{return cachedSetTimeout.call(null,t,0)}catch{return cachedSetTimeout.call(this,t,0)}}}function runClearTimeout(t){if(cachedClearTimeout===clearTimeout)return clearTimeout(t);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(t);try{return cachedClearTimeout(t)}catch{try{return cachedClearTimeout.call(null,t)}catch{return cachedClearTimeout.call(this,t)}}}var queue=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var t=runTimeout(cleanUpNextTick);draining=!0;for(var n=queue.length;n;){for(currentQueue=queue,queue=[];++queueIndex<n;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,n=queue.length}currentQueue=null,draining=!1,runClearTimeout(t)}}process$1.nextTick=function(t){var n=new Array(arguments.length-1);if(arguments.length>1)for(var c=1;c<arguments.length;c++)n[c-1]=arguments[c];queue.push(new Item(t,n)),queue.length===1&&!draining&&runTimeout(drainQueue)};function Item(t,n){this.fun=t,this.array=n}Item.prototype.run=function(){this.fun.apply(null,this.array)};process$1.title="browser";process$1.browser=!0;process$1.env={};process$1.argv=[];process$1.version="";process$1.versions={};function noop$1(){}process$1.on=noop$1;process$1.addListener=noop$1;process$1.once=noop$1;process$1.off=noop$1;process$1.removeListener=noop$1;process$1.removeAllListeners=noop$1;process$1.emit=noop$1;process$1.prependListener=noop$1;process$1.prependOnceListener=noop$1;process$1.listeners=function(t){return[]};process$1.binding=function(t){throw new Error("process.binding is not supported")};process$1.cwd=function(){return"/"};process$1.chdir=function(t){throw new Error("process.chdir is not supported")};process$1.umask=function(){return 0};var browserExports=browser$e.exports;const process$1$1=getDefaultExportFromCjs$1(browserExports);var sha3$3={exports:{}};(function(t){(function(){var n="input is invalid type",c="finalize already called",ie=typeof window=="object",se=ie?window:{};se.JS_SHA3_NO_WINDOW&&(ie=!1);var ae=!ie&&typeof self=="object",de=!se.JS_SHA3_NO_NODE_JS&&typeof process$1$1=="object"&&process$1$1.versions&&process$1$1.versions.node;de?se=globalThis:ae&&(se=self);var ue=!se.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,pe=!se.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",ge="0123456789abcdef".split(""),be=[31,7936,2031616,520093696],_e=[4,1024,262144,67108864],we=[1,256,65536,16777216],qe=[6,1536,393216,100663296],Ye=[0,8,16,24],Ge=[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],Ze=[224,256,384,512],He=[128,256],Ht=["hex","buffer","arrayBuffer","array","digest"],un={128:168,256:136};(se.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(Cn){return Object.prototype.toString.call(Cn)==="[object Array]"}),pe&&(se.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(Cn){return typeof Cn=="object"&&Cn.buffer&&Cn.buffer.constructor===ArrayBuffer});for(var De=function(Cn,Qn,En){return function(In){return new Vt(Cn,Qn,Cn).update(In)[En]()}},$e=function(Cn,Qn,En){return function(In,Mn){return new Vt(Cn,Qn,Mn).update(In)[En]()}},me=function(Cn,Qn,En){return function(In,Mn,zn,Jn){return ze["cshake"+Cn].update(In,Mn,zn,Jn)[En]()}},Gt=function(Cn,Qn,En){return function(In,Mn,zn,Jn){return ze["kmac"+Cn].update(In,Mn,zn,Jn)[En]()}},mn=function(Cn,Qn,En,In){for(var Mn=0;Mn<Ht.length;++Mn){var zn=Ht[Mn];Cn[zn]=Qn(En,In,zn)}return Cn},dn=function(Cn,Qn){var En=De(Cn,Qn,"hex");return En.create=function(){return new Vt(Cn,Qn,Cn)},En.update=function(In){return En.create().update(In)},mn(En,De,Cn,Qn)},jt=function(Cn,Qn){var En=$e(Cn,Qn,"hex");return En.create=function(In){return new Vt(Cn,Qn,In)},En.update=function(In,Mn){return En.create(Mn).update(In)},mn(En,$e,Cn,Qn)},le=function(Cn,Qn){var En=un[Cn],In=me(Cn,Qn,"hex");return In.create=function(Mn,zn,Jn){return!zn&&!Jn?ze["shake"+Cn].create(Mn):new Vt(Cn,Qn,Mn).bytepad([zn,Jn],En)},In.update=function(Mn,zn,Jn,hn){return In.create(zn,Jn,hn).update(Mn)},mn(In,me,Cn,Qn)},Pe=function(Cn,Qn){var En=un[Cn],In=Gt(Cn,Qn,"hex");return In.create=function(Mn,zn,Jn){return new Sn(Cn,Qn,zn).bytepad(["KMAC",Jn],En).bytepad([Mn],En)},In.update=function(Mn,zn,Jn,hn){return In.create(Mn,Jn,hn).update(zn)},mn(In,Gt,Cn,Qn)},xe=[{name:"keccak",padding:we,bits:Ze,createMethod:dn},{name:"sha3",padding:qe,bits:Ze,createMethod:dn},{name:"shake",padding:be,bits:He,createMethod:jt},{name:"cshake",padding:_e,bits:He,createMethod:le},{name:"kmac",padding:_e,bits:He,createMethod:Pe}],ze={},Ft=[],yn=0;yn<xe.length;++yn)for(var Zt=xe[yn],Me=Zt.bits,ce=0;ce<Me.length;++ce){var Ne=Zt.name+"_"+Me[ce];if(Ft.push(Ne),ze[Ne]=Zt.createMethod(Me[ce],Zt.padding),Zt.name!=="sha3"){var We=Zt.name+Me[ce];Ft.push(We),ze[We]=ze[Ne]}}function Vt(Cn,Qn,En){this.blocks=[],this.s=[],this.padding=Qn,this.outputBits=En,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(Cn<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=En>>5,this.extraBytes=(En&31)>>3;for(var In=0;In<50;++In)this.s[In]=0}Vt.prototype.update=function(Cn){if(this.finalized)throw new Error(c);var Qn,En=typeof Cn;if(En!=="string"){if(En==="object"){if(Cn===null)throw new Error(n);if(pe&&Cn.constructor===ArrayBuffer)Cn=new Uint8Array(Cn);else if(!Array.isArray(Cn)&&(!pe||!ArrayBuffer.isView(Cn)))throw new Error(n)}else throw new Error(n);Qn=!0}for(var In=this.blocks,Mn=this.byteCount,zn=Cn.length,Jn=this.blockCount,hn=0,xn=this.s,Hn,ti;hn<zn;){if(this.reset)for(this.reset=!1,In[0]=this.block,Hn=1;Hn<Jn+1;++Hn)In[Hn]=0;if(Qn)for(Hn=this.start;hn<zn&&Hn<Mn;++hn)In[Hn>>2]|=Cn[hn]<<Ye[Hn++&3];else for(Hn=this.start;hn<zn&&Hn<Mn;++hn)ti=Cn.charCodeAt(hn),ti<128?In[Hn>>2]|=ti<<Ye[Hn++&3]:ti<2048?(In[Hn>>2]|=(192|ti>>6)<<Ye[Hn++&3],In[Hn>>2]|=(128|ti&63)<<Ye[Hn++&3]):ti<55296||ti>=57344?(In[Hn>>2]|=(224|ti>>12)<<Ye[Hn++&3],In[Hn>>2]|=(128|ti>>6&63)<<Ye[Hn++&3],In[Hn>>2]|=(128|ti&63)<<Ye[Hn++&3]):(ti=65536+((ti&1023)<<10|Cn.charCodeAt(++hn)&1023),In[Hn>>2]|=(240|ti>>18)<<Ye[Hn++&3],In[Hn>>2]|=(128|ti>>12&63)<<Ye[Hn++&3],In[Hn>>2]|=(128|ti>>6&63)<<Ye[Hn++&3],In[Hn>>2]|=(128|ti&63)<<Ye[Hn++&3]);if(this.lastByteIndex=Hn,Hn>=Mn){for(this.start=Hn-Mn,this.block=In[Jn],Hn=0;Hn<Jn;++Hn)xn[Hn]^=In[Hn];An(xn),this.reset=!0}else this.start=Hn}return this},Vt.prototype.encode=function(Cn,Qn){var En=Cn&255,In=1,Mn=[En];for(Cn=Cn>>8,En=Cn&255;En>0;)Mn.unshift(En),Cn=Cn>>8,En=Cn&255,++In;return Qn?Mn.push(In):Mn.unshift(In),this.update(Mn),Mn.length},Vt.prototype.encodeString=function(Cn){var Qn,En=typeof Cn;if(En!=="string"){if(En==="object"){if(Cn===null)throw new Error(n);if(pe&&Cn.constructor===ArrayBuffer)Cn=new Uint8Array(Cn);else if(!Array.isArray(Cn)&&(!pe||!ArrayBuffer.isView(Cn)))throw new Error(n)}else throw new Error(n);Qn=!0}var In=0,Mn=Cn.length;if(Qn)In=Mn;else for(var zn=0;zn<Cn.length;++zn){var Jn=Cn.charCodeAt(zn);Jn<128?In+=1:Jn<2048?In+=2:Jn<55296||Jn>=57344?In+=3:(Jn=65536+((Jn&1023)<<10|Cn.charCodeAt(++zn)&1023),In+=4)}return In+=this.encode(In*8),this.update(Cn),In},Vt.prototype.bytepad=function(Cn,Qn){for(var En=this.encode(Qn),In=0;In<Cn.length;++In)En+=this.encodeString(Cn[In]);var Mn=Qn-En%Qn,zn=[];return zn.length=Mn,this.update(zn),this},Vt.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var Cn=this.blocks,Qn=this.lastByteIndex,En=this.blockCount,In=this.s;if(Cn[Qn>>2]|=this.padding[Qn&3],this.lastByteIndex===this.byteCount)for(Cn[0]=Cn[En],Qn=1;Qn<En+1;++Qn)Cn[Qn]=0;for(Cn[En-1]|=2147483648,Qn=0;Qn<En;++Qn)In[Qn]^=Cn[Qn];An(In)}},Vt.prototype.toString=Vt.prototype.hex=function(){this.finalize();for(var Cn=this.blockCount,Qn=this.s,En=this.outputBlocks,In=this.extraBytes,Mn=0,zn=0,Jn="",hn;zn<En;){for(Mn=0;Mn<Cn&&zn<En;++Mn,++zn)hn=Qn[Mn],Jn+=ge[hn>>4&15]+ge[hn&15]+ge[hn>>12&15]+ge[hn>>8&15]+ge[hn>>20&15]+ge[hn>>16&15]+ge[hn>>28&15]+ge[hn>>24&15];zn%Cn===0&&(An(Qn),Mn=0)}return In&&(hn=Qn[Mn],Jn+=ge[hn>>4&15]+ge[hn&15],In>1&&(Jn+=ge[hn>>12&15]+ge[hn>>8&15]),In>2&&(Jn+=ge[hn>>20&15]+ge[hn>>16&15])),Jn},Vt.prototype.arrayBuffer=function(){this.finalize();var Cn=this.blockCount,Qn=this.s,En=this.outputBlocks,In=this.extraBytes,Mn=0,zn=0,Jn=this.outputBits>>3,hn;In?hn=new ArrayBuffer(En+1<<2):hn=new ArrayBuffer(Jn);for(var xn=new Uint32Array(hn);zn<En;){for(Mn=0;Mn<Cn&&zn<En;++Mn,++zn)xn[zn]=Qn[Mn];zn%Cn===0&&An(Qn)}return In&&(xn[Mn]=Qn[Mn],hn=hn.slice(0,Jn)),hn},Vt.prototype.buffer=Vt.prototype.arrayBuffer,Vt.prototype.digest=Vt.prototype.array=function(){this.finalize();for(var Cn=this.blockCount,Qn=this.s,En=this.outputBlocks,In=this.extraBytes,Mn=0,zn=0,Jn=[],hn,xn;zn<En;){for(Mn=0;Mn<Cn&&zn<En;++Mn,++zn)hn=zn<<2,xn=Qn[Mn],Jn[hn]=xn&255,Jn[hn+1]=xn>>8&255,Jn[hn+2]=xn>>16&255,Jn[hn+3]=xn>>24&255;zn%Cn===0&&An(Qn)}return In&&(hn=zn<<2,xn=Qn[Mn],Jn[hn]=xn&255,In>1&&(Jn[hn+1]=xn>>8&255),In>2&&(Jn[hn+2]=xn>>16&255)),Jn};function Sn(Cn,Qn,En){Vt.call(this,Cn,Qn,En)}Sn.prototype=new Vt,Sn.prototype.finalize=function(){return this.encode(this.outputBits,!0),Vt.prototype.finalize.call(this)};var An=function(Cn){var Qn,En,In,Mn,zn,Jn,hn,xn,Hn,ti,ri,hi,gi,vi,Ai,Ii,Ei,yi,Zn,di,li,Kn,Vn,qn,Un,Ln,$n,jn,Pn,On,Fn,Pt,gn,Nn,mi,Wn,ci,Mi,Si,Bi,Fi,ki,Gn,Oi,pi,bi,xi,wi,Ci,Ti,Ri,_i,Ui,Pi,Ni,Qi,Di,qi,Hi,Ji,Li,$i,Vi;for(In=0;In<48;In+=2)Mn=Cn[0]^Cn[10]^Cn[20]^Cn[30]^Cn[40],zn=Cn[1]^Cn[11]^Cn[21]^Cn[31]^Cn[41],Jn=Cn[2]^Cn[12]^Cn[22]^Cn[32]^Cn[42],hn=Cn[3]^Cn[13]^Cn[23]^Cn[33]^Cn[43],xn=Cn[4]^Cn[14]^Cn[24]^Cn[34]^Cn[44],Hn=Cn[5]^Cn[15]^Cn[25]^Cn[35]^Cn[45],ti=Cn[6]^Cn[16]^Cn[26]^Cn[36]^Cn[46],ri=Cn[7]^Cn[17]^Cn[27]^Cn[37]^Cn[47],hi=Cn[8]^Cn[18]^Cn[28]^Cn[38]^Cn[48],gi=Cn[9]^Cn[19]^Cn[29]^Cn[39]^Cn[49],Qn=hi^(Jn<<1|hn>>>31),En=gi^(hn<<1|Jn>>>31),Cn[0]^=Qn,Cn[1]^=En,Cn[10]^=Qn,Cn[11]^=En,Cn[20]^=Qn,Cn[21]^=En,Cn[30]^=Qn,Cn[31]^=En,Cn[40]^=Qn,Cn[41]^=En,Qn=Mn^(xn<<1|Hn>>>31),En=zn^(Hn<<1|xn>>>31),Cn[2]^=Qn,Cn[3]^=En,Cn[12]^=Qn,Cn[13]^=En,Cn[22]^=Qn,Cn[23]^=En,Cn[32]^=Qn,Cn[33]^=En,Cn[42]^=Qn,Cn[43]^=En,Qn=Jn^(ti<<1|ri>>>31),En=hn^(ri<<1|ti>>>31),Cn[4]^=Qn,Cn[5]^=En,Cn[14]^=Qn,Cn[15]^=En,Cn[24]^=Qn,Cn[25]^=En,Cn[34]^=Qn,Cn[35]^=En,Cn[44]^=Qn,Cn[45]^=En,Qn=xn^(hi<<1|gi>>>31),En=Hn^(gi<<1|hi>>>31),Cn[6]^=Qn,Cn[7]^=En,Cn[16]^=Qn,Cn[17]^=En,Cn[26]^=Qn,Cn[27]^=En,Cn[36]^=Qn,Cn[37]^=En,Cn[46]^=Qn,Cn[47]^=En,Qn=ti^(Mn<<1|zn>>>31),En=ri^(zn<<1|Mn>>>31),Cn[8]^=Qn,Cn[9]^=En,Cn[18]^=Qn,Cn[19]^=En,Cn[28]^=Qn,Cn[29]^=En,Cn[38]^=Qn,Cn[39]^=En,Cn[48]^=Qn,Cn[49]^=En,vi=Cn[0],Ai=Cn[1],bi=Cn[11]<<4|Cn[10]>>>28,xi=Cn[10]<<4|Cn[11]>>>28,jn=Cn[20]<<3|Cn[21]>>>29,Pn=Cn[21]<<3|Cn[20]>>>29,Ji=Cn[31]<<9|Cn[30]>>>23,Li=Cn[30]<<9|Cn[31]>>>23,ki=Cn[40]<<18|Cn[41]>>>14,Gn=Cn[41]<<18|Cn[40]>>>14,Nn=Cn[2]<<1|Cn[3]>>>31,mi=Cn[3]<<1|Cn[2]>>>31,Ii=Cn[13]<<12|Cn[12]>>>20,Ei=Cn[12]<<12|Cn[13]>>>20,wi=Cn[22]<<10|Cn[23]>>>22,Ci=Cn[23]<<10|Cn[22]>>>22,On=Cn[33]<<13|Cn[32]>>>19,Fn=Cn[32]<<13|Cn[33]>>>19,$i=Cn[42]<<2|Cn[43]>>>30,Vi=Cn[43]<<2|Cn[42]>>>30,Pi=Cn[5]<<30|Cn[4]>>>2,Ni=Cn[4]<<30|Cn[5]>>>2,Wn=Cn[14]<<6|Cn[15]>>>26,ci=Cn[15]<<6|Cn[14]>>>26,yi=Cn[25]<<11|Cn[24]>>>21,Zn=Cn[24]<<11|Cn[25]>>>21,Ti=Cn[34]<<15|Cn[35]>>>17,Ri=Cn[35]<<15|Cn[34]>>>17,Pt=Cn[45]<<29|Cn[44]>>>3,gn=Cn[44]<<29|Cn[45]>>>3,qn=Cn[6]<<28|Cn[7]>>>4,Un=Cn[7]<<28|Cn[6]>>>4,Qi=Cn[17]<<23|Cn[16]>>>9,Di=Cn[16]<<23|Cn[17]>>>9,Mi=Cn[26]<<25|Cn[27]>>>7,Si=Cn[27]<<25|Cn[26]>>>7,di=Cn[36]<<21|Cn[37]>>>11,li=Cn[37]<<21|Cn[36]>>>11,_i=Cn[47]<<24|Cn[46]>>>8,Ui=Cn[46]<<24|Cn[47]>>>8,Oi=Cn[8]<<27|Cn[9]>>>5,pi=Cn[9]<<27|Cn[8]>>>5,Ln=Cn[18]<<20|Cn[19]>>>12,$n=Cn[19]<<20|Cn[18]>>>12,qi=Cn[29]<<7|Cn[28]>>>25,Hi=Cn[28]<<7|Cn[29]>>>25,Bi=Cn[38]<<8|Cn[39]>>>24,Fi=Cn[39]<<8|Cn[38]>>>24,Kn=Cn[48]<<14|Cn[49]>>>18,Vn=Cn[49]<<14|Cn[48]>>>18,Cn[0]=vi^~Ii&yi,Cn[1]=Ai^~Ei&Zn,Cn[10]=qn^~Ln&jn,Cn[11]=Un^~$n&Pn,Cn[20]=Nn^~Wn&Mi,Cn[21]=mi^~ci&Si,Cn[30]=Oi^~bi&wi,Cn[31]=pi^~xi&Ci,Cn[40]=Pi^~Qi&qi,Cn[41]=Ni^~Di&Hi,Cn[2]=Ii^~yi&di,Cn[3]=Ei^~Zn&li,Cn[12]=Ln^~jn&On,Cn[13]=$n^~Pn&Fn,Cn[22]=Wn^~Mi&Bi,Cn[23]=ci^~Si&Fi,Cn[32]=bi^~wi&Ti,Cn[33]=xi^~Ci&Ri,Cn[42]=Qi^~qi&Ji,Cn[43]=Di^~Hi&Li,Cn[4]=yi^~di&Kn,Cn[5]=Zn^~li&Vn,Cn[14]=jn^~On&Pt,Cn[15]=Pn^~Fn&gn,Cn[24]=Mi^~Bi&ki,Cn[25]=Si^~Fi&Gn,Cn[34]=wi^~Ti&_i,Cn[35]=Ci^~Ri&Ui,Cn[44]=qi^~Ji&$i,Cn[45]=Hi^~Li&Vi,Cn[6]=di^~Kn&vi,Cn[7]=li^~Vn&Ai,Cn[16]=On^~Pt&qn,Cn[17]=Fn^~gn&Un,Cn[26]=Bi^~ki&Nn,Cn[27]=Fi^~Gn&mi,Cn[36]=Ti^~_i&Oi,Cn[37]=Ri^~Ui&pi,Cn[46]=Ji^~$i&Pi,Cn[47]=Li^~Vi&Ni,Cn[8]=Kn^~vi&Ii,Cn[9]=Vn^~Ai&Ei,Cn[18]=Pt^~qn&Ln,Cn[19]=gn^~Un&$n,Cn[28]=ki^~Nn&Wn,Cn[29]=Gn^~mi&ci,Cn[38]=_i^~Oi&bi,Cn[39]=Ui^~pi&xi,Cn[48]=$i^~Pi&Qi,Cn[49]=Vi^~Ni&Di,Cn[0]^=Ge[In],Cn[1]^=Ge[In+1]};if(ue)t.exports=ze;else for(yn=0;yn<Ft.length;++yn)se[Ft[yn]]=ze[Ft[yn]]})()})(sha3$3);var sha3Exports$1=sha3$3.exports;const sha3$2=getDefaultExportFromCjs$2(sha3Exports$1);function keccak256$1(t){return"0x"+sha3$2.keccak_256(arrayify(t))}const lib_esm$h=Object.freeze(Object.defineProperty({__proto__:null,keccak256:keccak256$1},Symbol.toStringTag,{value:"Module"})),version$p="rlp/5.8.0",logger$r=new Logger$1(version$p);function arrayifyInteger(t){const n=[];for(;t;)n.unshift(t&255),t>>=8;return n}function unarrayifyInteger(t,n,c){let ie=0;for(let se=0;se<c;se++)ie=ie*256+t[n+se];return ie}function _encode(t){if(Array.isArray(t)){let ie=[];if(t.forEach(function(ae){ie=ie.concat(_encode(ae))}),ie.length<=55)return ie.unshift(192+ie.length),ie;const se=arrayifyInteger(ie.length);return se.unshift(247+se.length),se.concat(ie)}isBytesLike(t)||logger$r.throwArgumentError("RLP object must be BytesLike","object",t);const n=Array.prototype.slice.call(arrayify(t));if(n.length===1&&n[0]<=127)return n;if(n.length<=55)return n.unshift(128+n.length),n;const c=arrayifyInteger(n.length);return c.unshift(183+c.length),c.concat(n)}function encode$6(t){return hexlify$1(_encode(t))}function _decodeChildren(t,n,c,ie){const se=[];for(;c<n+1+ie;){const ae=_decode(t,c);se.push(ae.result),c+=ae.consumed,c>n+1+ie&&logger$r.throwError("child data too short",Logger$1.errors.BUFFER_OVERRUN,{})}return{consumed:1+ie,result:se}}function _decode(t,n){if(t.length===0&&logger$r.throwError("data too short",Logger$1.errors.BUFFER_OVERRUN,{}),t[n]>=248){const c=t[n]-247;n+1+c>t.length&&logger$r.throwError("data short segment too short",Logger$1.errors.BUFFER_OVERRUN,{});const ie=unarrayifyInteger(t,n+1,c);return n+1+c+ie>t.length&&logger$r.throwError("data long segment too short",Logger$1.errors.BUFFER_OVERRUN,{}),_decodeChildren(t,n,n+1+c,c+ie)}else if(t[n]>=192){const c=t[n]-192;return n+1+c>t.length&&logger$r.throwError("data array too short",Logger$1.errors.BUFFER_OVERRUN,{}),_decodeChildren(t,n,n+1,c)}else if(t[n]>=184){const c=t[n]-183;n+1+c>t.length&&logger$r.throwError("data array too short",Logger$1.errors.BUFFER_OVERRUN,{});const ie=unarrayifyInteger(t,n+1,c);n+1+c+ie>t.length&&logger$r.throwError("data array too short",Logger$1.errors.BUFFER_OVERRUN,{});const se=hexlify$1(t.slice(n+1+c,n+1+c+ie));return{consumed:1+c+ie,result:se}}else if(t[n]>=128){const c=t[n]-128;n+1+c>t.length&&logger$r.throwError("data too short",Logger$1.errors.BUFFER_OVERRUN,{});const ie=hexlify$1(t.slice(n+1,n+1+c));return{consumed:1+c,result:ie}}return{consumed:1,result:hexlify$1(t[n])}}function decode$7(t){const n=arrayify(t),c=_decode(n,0);return c.consumed!==n.length&&logger$r.throwArgumentError("invalid rlp data","data",t),c.result}const lib_esm$g=Object.freeze(Object.defineProperty({__proto__:null,decode:decode$7,encode:encode$6},Symbol.toStringTag,{value:"Module"})),version$o="address/5.8.0",logger$q=new Logger$1(version$o);function getChecksumAddress(t){isHexString$1(t,20)||logger$q.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const n=t.substring(2).split(""),c=new Uint8Array(40);for(let se=0;se<40;se++)c[se]=n[se].charCodeAt(0);const ie=arrayify(keccak256$1(c));for(let se=0;se<40;se+=2)ie[se>>1]>>4>=8&&(n[se]=n[se].toUpperCase()),(ie[se>>1]&15)>=8&&(n[se+1]=n[se+1].toUpperCase());return"0x"+n.join("")}const MAX_SAFE_INTEGER=9007199254740991;function log10(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const ibanLookup={};for(let t=0;t<10;t++)ibanLookup[String(t)]=String(t);for(let t=0;t<26;t++)ibanLookup[String.fromCharCode(65+t)]=String(10+t);const safeDigits=Math.floor(log10(MAX_SAFE_INTEGER));function ibanChecksum(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let n=t.split("").map(ie=>ibanLookup[ie]).join("");for(;n.length>=safeDigits;){let ie=n.substring(0,safeDigits);n=parseInt(ie,10)%97+n.substring(ie.length)}let c=String(98-parseInt(n,10)%97);for(;c.length<2;)c="0"+c;return c}function getAddress$1(t){let n=null;if(typeof t!="string"&&logger$q.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),n=getChecksumAddress(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&n!==t&&logger$q.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==ibanChecksum(t)&&logger$q.throwArgumentError("bad icap checksum","address",t),n=_base36To16(t.substring(4));n.length<40;)n="0"+n;n=getChecksumAddress("0x"+n)}else logger$q.throwArgumentError("invalid address","address",t);return n}function isAddress(t){try{return getAddress$1(t),!0}catch{}return!1}function getIcapAddress(t){let n=_base16To36(getAddress$1(t).substring(2)).toUpperCase();for(;n.length<30;)n="0"+n;return"XE"+ibanChecksum("XE00"+n)+n}function getContractAddress(t){let n=null;try{n=getAddress$1(t.from)}catch{logger$q.throwArgumentError("missing from address","transaction",t)}const c=stripZeros(arrayify(BigNumber$1.from(t.nonce).toHexString()));return getAddress$1(hexDataSlice(keccak256$1(encode$6([n,c])),12))}function getCreate2Address(t,n,c){return hexDataLength(n)!==32&&logger$q.throwArgumentError("salt must be 32 bytes","salt",n),hexDataLength(c)!==32&&logger$q.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",c),getAddress$1(hexDataSlice(keccak256$1(concat$1(["0xff",getAddress$1(t),n,c])),12))}const lib_esm$f=Object.freeze(Object.defineProperty({__proto__:null,getAddress:getAddress$1,getContractAddress,getCreate2Address,getIcapAddress,isAddress},Symbol.toStringTag,{value:"Module"}));class AddressCoder extends Coder{constructor(n){super("address","address",n,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(n,c){try{c=getAddress$1(c)}catch(ie){this._throwError(ie.message,c)}return n.writeValue(c)}decode(n){return getAddress$1(hexZeroPad(n.readValue().toHexString(),20))}}class AnonymousCoder extends Coder{constructor(n){super(n.name,n.type,void 0,n.dynamic),this.coder=n}defaultValue(){return this.coder.defaultValue()}encode(n,c){return this.coder.encode(n,c)}decode(n){return this.coder.decode(n)}}const logger$p=new Logger$1(version$q);function pack$1(t,n,c){let ie=null;if(Array.isArray(c))ie=c;else if(c&&typeof c=="object"){let pe={};ie=n.map(ge=>{const be=ge.localName;return be||logger$p.throwError("cannot encode object for signature with missing names",Logger$1.errors.INVALID_ARGUMENT,{argument:"values",coder:ge,value:c}),pe[be]&&logger$p.throwError("cannot encode object for signature with duplicate names",Logger$1.errors.INVALID_ARGUMENT,{argument:"values",coder:ge,value:c}),pe[be]=!0,c[be]})}else logger$p.throwArgumentError("invalid tuple value","tuple",c);n.length!==ie.length&&logger$p.throwArgumentError("types/value length mismatch","tuple",c);let se=new Writer(t.wordSize),ae=new Writer(t.wordSize),de=[];n.forEach((pe,ge)=>{let be=ie[ge];if(pe.dynamic){let _e=ae.length;pe.encode(ae,be);let we=se.writeUpdatableValue();de.push(qe=>{we(qe+_e)})}else pe.encode(se,be)}),de.forEach(pe=>{pe(se.length)});let ue=t.appendWriter(se);return ue+=t.appendWriter(ae),ue}function unpack(t,n){let c=[],ie=t.subReader(0);n.forEach(ae=>{let de=null;if(ae.dynamic){let ue=t.readValue(),pe=ie.subReader(ue.toNumber());try{de=ae.decode(pe)}catch(ge){if(ge.code===Logger$1.errors.BUFFER_OVERRUN)throw ge;de=ge,de.baseType=ae.name,de.name=ae.localName,de.type=ae.type}}else try{de=ae.decode(t)}catch(ue){if(ue.code===Logger$1.errors.BUFFER_OVERRUN)throw ue;de=ue,de.baseType=ae.name,de.name=ae.localName,de.type=ae.type}de!=null&&c.push(de)});const se=n.reduce((ae,de)=>{const ue=de.localName;return ue&&(ae[ue]||(ae[ue]=0),ae[ue]++),ae},{});n.forEach((ae,de)=>{let ue=ae.localName;if(!ue||se[ue]!==1||(ue==="length"&&(ue="_length"),c[ue]!=null))return;const pe=c[de];pe instanceof Error?Object.defineProperty(c,ue,{enumerable:!0,get:()=>{throw pe}}):c[ue]=pe});for(let ae=0;ae<c.length;ae++){const de=c[ae];de instanceof Error&&Object.defineProperty(c,ae,{enumerable:!0,get:()=>{throw de}})}return Object.freeze(c)}class ArrayCoder extends Coder{constructor(n,c,ie){const se=n.type+"["+(c>=0?c:"")+"]",ae=c===-1||n.dynamic;super("array",se,ie,ae),this.coder=n,this.length=c}defaultValue(){const n=this.coder.defaultValue(),c=[];for(let ie=0;ie<this.length;ie++)c.push(n);return c}encode(n,c){Array.isArray(c)||this._throwError("expected array value",c);let ie=this.length;ie===-1&&(ie=c.length,n.writeValue(c.length)),logger$p.checkArgumentCount(c.length,ie,"coder array"+(this.localName?" "+this.localName:""));let se=[];for(let ae=0;ae<c.length;ae++)se.push(this.coder);return pack$1(n,se,c)}decode(n){let c=this.length;c===-1&&(c=n.readValue().toNumber(),c*32>n._data.length&&logger$p.throwError("insufficient data length",Logger$1.errors.BUFFER_OVERRUN,{length:n._data.length,count:c}));let ie=[];for(let se=0;se<c;se++)ie.push(new AnonymousCoder(this.coder));return n.coerce(this.name,unpack(n,ie))}}class BooleanCoder extends Coder{constructor(n){super("bool","bool",n,!1)}defaultValue(){return!1}encode(n,c){return n.writeValue(c?1:0)}decode(n){return n.coerce(this.type,!n.readValue().isZero())}}class DynamicBytesCoder extends Coder{constructor(n,c){super(n,n,c,!0)}defaultValue(){return"0x"}encode(n,c){c=arrayify(c);let ie=n.writeValue(c.length);return ie+=n.writeBytes(c),ie}decode(n){return n.readBytes(n.readValue().toNumber(),!0)}}class BytesCoder extends DynamicBytesCoder{constructor(n){super("bytes",n)}decode(n){return n.coerce(this.name,hexlify$1(super.decode(n)))}}class FixedBytesCoder extends Coder{constructor(n,c){let ie="bytes"+String(n);super(ie,ie,c,!1),this.size=n}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(n,c){let ie=arrayify(c);return ie.length!==this.size&&this._throwError("incorrect data length",c),n.writeBytes(ie)}decode(n){return n.coerce(this.name,hexlify$1(n.readBytes(this.size)))}}class NullCoder extends Coder{constructor(n){super("null","",n,!1)}defaultValue(){return null}encode(n,c){return c!=null&&this._throwError("not null",c),n.writeBytes([])}decode(n){return n.readBytes(0),n.coerce(this.name,null)}}const AddressZero="0x0000000000000000000000000000000000000000",NegativeOne$1=BigNumber$1.from(-1),Zero$1=BigNumber$1.from(0),One$1=BigNumber$1.from(1),MaxUint256$1=BigNumber$1.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),HashZero="0x0000000000000000000000000000000000000000000000000000000000000000";class NumberCoder extends Coder{constructor(n,c,ie){const se=(c?"int":"uint")+n*8;super(se,se,ie,!1),this.size=n,this.signed=c}defaultValue(){return 0}encode(n,c){let ie=BigNumber$1.from(c),se=MaxUint256$1.mask(n.wordSize*8);if(this.signed){let ae=se.mask(this.size*8-1);(ie.gt(ae)||ie.lt(ae.add(One$1).mul(NegativeOne$1)))&&this._throwError("value out-of-bounds",c)}else(ie.lt(Zero$1)||ie.gt(se.mask(this.size*8)))&&this._throwError("value out-of-bounds",c);return ie=ie.toTwos(this.size*8).mask(this.size*8),this.signed&&(ie=ie.fromTwos(this.size*8).toTwos(8*n.wordSize)),n.writeValue(ie)}decode(n){let c=n.readValue().mask(this.size*8);return this.signed&&(c=c.fromTwos(this.size*8)),n.coerce(this.name,c)}}const version$n="strings/5.8.0",logger$o=new Logger$1(version$n);var UnicodeNormalizationForm;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(UnicodeNormalizationForm||(UnicodeNormalizationForm={}));var Utf8ErrorReason;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"})(Utf8ErrorReason||(Utf8ErrorReason={}));function errorFunc(t,n,c,ie,se){return logger$o.throwArgumentError(`invalid codepoint at offset ${n}; ${t}`,"bytes",c)}function ignoreFunc(t,n,c,ie,se){if(t===Utf8ErrorReason.BAD_PREFIX||t===Utf8ErrorReason.UNEXPECTED_CONTINUE){let ae=0;for(let de=n+1;de<c.length&&c[de]>>6===2;de++)ae++;return ae}return t===Utf8ErrorReason.OVERRUN?c.length-n-1:0}function replaceFunc(t,n,c,ie,se){return t===Utf8ErrorReason.OVERLONG?(ie.push(se),0):(ie.push(65533),ignoreFunc(t,n,c))}const Utf8ErrorFuncs=Object.freeze({error:errorFunc,ignore:ignoreFunc,replace:replaceFunc});function getUtf8CodePoints(t,n){n==null&&(n=Utf8ErrorFuncs.error),t=arrayify(t);const c=[];let ie=0;for(;ie<t.length;){const se=t[ie++];if(!(se>>7)){c.push(se);continue}let ae=null,de=null;if((se&224)===192)ae=1,de=127;else if((se&240)===224)ae=2,de=2047;else if((se&248)===240)ae=3,de=65535;else{(se&192)===128?ie+=n(Utf8ErrorReason.UNEXPECTED_CONTINUE,ie-1,t,c):ie+=n(Utf8ErrorReason.BAD_PREFIX,ie-1,t,c);continue}if(ie-1+ae>=t.length){ie+=n(Utf8ErrorReason.OVERRUN,ie-1,t,c);continue}let ue=se&(1<<8-ae-1)-1;for(let pe=0;pe<ae;pe++){let ge=t[ie];if((ge&192)!=128){ie+=n(Utf8ErrorReason.MISSING_CONTINUE,ie,t,c),ue=null;break}ue=ue<<6|ge&63,ie++}if(ue!==null){if(ue>1114111){ie+=n(Utf8ErrorReason.OUT_OF_RANGE,ie-1-ae,t,c,ue);continue}if(ue>=55296&&ue<=57343){ie+=n(Utf8ErrorReason.UTF16_SURROGATE,ie-1-ae,t,c,ue);continue}if(ue<=de){ie+=n(Utf8ErrorReason.OVERLONG,ie-1-ae,t,c,ue);continue}c.push(ue)}}return c}function toUtf8Bytes(t,n=UnicodeNormalizationForm.current){n!=UnicodeNormalizationForm.current&&(logger$o.checkNormalize(),t=t.normalize(n));let c=[];for(let ie=0;ie<t.length;ie++){const se=t.charCodeAt(ie);if(se<128)c.push(se);else if(se<2048)c.push(se>>6|192),c.push(se&63|128);else if((se&64512)==55296){ie++;const ae=t.charCodeAt(ie);if(ie>=t.length||(ae&64512)!==56320)throw new Error("invalid utf-8 string");const de=65536+((se&1023)<<10)+(ae&1023);c.push(de>>18|240),c.push(de>>12&63|128),c.push(de>>6&63|128),c.push(de&63|128)}else c.push(se>>12|224),c.push(se>>6&63|128),c.push(se&63|128)}return arrayify(c)}function escapeChar(t){const n="0000"+t.toString(16);return"\\u"+n.substring(n.length-4)}function _toEscapedUtf8String(t,n){return'"'+getUtf8CodePoints(t,n).map(c=>{if(c<256){switch(c){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(c>=32&&c<127)return String.fromCharCode(c)}return c<=65535?escapeChar(c):(c-=65536,escapeChar((c>>10&1023)+55296)+escapeChar((c&1023)+56320))}).join("")+'"'}function _toUtf8String(t){return t.map(n=>n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10&1023)+55296,(n&1023)+56320))).join("")}function toUtf8String(t,n){return _toUtf8String(getUtf8CodePoints(t,n))}function toUtf8CodePoints(t,n=UnicodeNormalizationForm.current){return getUtf8CodePoints(toUtf8Bytes(t,n))}function formatBytes32String(t){const n=toUtf8Bytes(t);if(n.length>31)throw new Error("bytes32 string must be less than 32 bytes");return hexlify$1(concat$1([n,HashZero]).slice(0,32))}function parseBytes32String(t){const n=arrayify(t);if(n.length!==32)throw new Error("invalid bytes32 - not 32 bytes long");if(n[31]!==0)throw new Error("invalid bytes32 string - no null terminator");let c=31;for(;n[c-1]===0;)c--;return toUtf8String(n.slice(0,c))}function bytes2(t){if(t.length%4!==0)throw new Error("bad data");let n=[];for(let c=0;c<t.length;c+=4)n.push(parseInt(t.substring(c,c+4),16));return n}function createTable(t,n){n||(n=function(se){return[parseInt(se,16)]});let c=0,ie={};return t.split(",").forEach(se=>{let ae=se.split(":");c+=parseInt(ae[0],16),ie[c]=n(ae[1])}),ie}function createRangeTable(t){let n=0;return t.split(",").map(c=>{let ie=c.split("-");ie.length===1?ie[1]="0":ie[1]===""&&(ie[1]="1");let se=n+parseInt(ie[0],16);return n=parseInt(ie[1],16),{l:se,h:n}})}function matchMap(t,n){let c=0;for(let ie=0;ie<n.length;ie++){let se=n[ie];if(c+=se.l,t>=c&&t<=c+se.h&&(t-c)%(se.d||1)===0){if(se.e&&se.e.indexOf(t-c)!==-1)continue;return se}}return null}const Table_A_1_ranges=createRangeTable("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),Table_B_1_flags="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(t=>parseInt(t,16)),Table_B_2_ranges=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],Table_B_2_lut_abs=createTable("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),Table_B_2_lut_rel=createTable("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),Table_B_2_complex=createTable("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",bytes2),Table_C_ranges=createRangeTable("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function flatten(t){return t.reduce((n,c)=>(c.forEach(ie=>{n.push(ie)}),n),[])}function _nameprepTableA1(t){return!!matchMap(t,Table_A_1_ranges)}function _nameprepTableB2(t){let n=matchMap(t,Table_B_2_ranges);if(n)return[t+n.s];let c=Table_B_2_lut_abs[t];if(c)return c;let ie=Table_B_2_lut_rel[t];return ie?[t+ie[0]]:Table_B_2_complex[t]||null}function _nameprepTableC(t){return!!matchMap(t,Table_C_ranges)}function nameprep(t){if(t.match(/^[a-z0-9-]*$/i)&&t.length<=59)return t.toLowerCase();let n=toUtf8CodePoints(t);n=flatten(n.map(ie=>Table_B_1_flags.indexOf(ie)>=0?[]:ie>=65024&&ie<=65039?[]:_nameprepTableB2(ie)||[ie])),n=toUtf8CodePoints(_toUtf8String(n),UnicodeNormalizationForm.NFKC),n.forEach(ie=>{if(_nameprepTableC(ie))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")}),n.forEach(ie=>{if(_nameprepTableA1(ie))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")});let c=_toUtf8String(n);if(c.substring(0,1)==="-"||c.substring(2,4)==="--"||c.substring(c.length-1)==="-")throw new Error("invalid hyphen");return c}const lib_esm$e=Object.freeze(Object.defineProperty({__proto__:null,get UnicodeNormalizationForm(){return UnicodeNormalizationForm},Utf8ErrorFuncs,get Utf8ErrorReason(){return Utf8ErrorReason},_toEscapedUtf8String,formatBytes32String,nameprep,parseBytes32String,toUtf8Bytes,toUtf8CodePoints,toUtf8String},Symbol.toStringTag,{value:"Module"}));class StringCoder extends DynamicBytesCoder{constructor(n){super("string",n)}defaultValue(){return""}encode(n,c){return super.encode(n,toUtf8Bytes(c))}decode(n){return toUtf8String(super.decode(n))}}class TupleCoder extends Coder{constructor(n,c){let ie=!1;const se=[];n.forEach(de=>{de.dynamic&&(ie=!0),se.push(de.type)});const ae="tuple("+se.join(",")+")";super("tuple",ae,c,ie),this.coders=n}defaultValue(){const n=[];this.coders.forEach(ie=>{n.push(ie.defaultValue())});const c=this.coders.reduce((ie,se)=>{const ae=se.localName;return ae&&(ie[ae]||(ie[ae]=0),ie[ae]++),ie},{});return this.coders.forEach((ie,se)=>{let ae=ie.localName;!ae||c[ae]!==1||(ae==="length"&&(ae="_length"),n[ae]==null&&(n[ae]=n[se]))}),Object.freeze(n)}encode(n,c){return pack$1(n,this.coders,c)}decode(n){return n.coerce(this.name,unpack(n,this.coders))}}const logger$n=new Logger$1(version$q),paramTypeBytes=new RegExp(/^bytes([0-9]*)$/),paramTypeNumber=new RegExp(/^(u?int)([0-9]*)$/);class AbiCoder{constructor(n){defineReadOnly(this,"coerceFunc",n||null)}_getCoder(n){switch(n.baseType){case"address":return new AddressCoder(n.name);case"bool":return new BooleanCoder(n.name);case"string":return new StringCoder(n.name);case"bytes":return new BytesCoder(n.name);case"array":return new ArrayCoder(this._getCoder(n.arrayChildren),n.arrayLength,n.name);case"tuple":return new TupleCoder((n.components||[]).map(ie=>this._getCoder(ie)),n.name);case"":return new NullCoder(n.name)}let c=n.type.match(paramTypeNumber);if(c){let ie=parseInt(c[2]||"256");return(ie===0||ie>256||ie%8!==0)&&logger$n.throwArgumentError("invalid "+c[1]+" bit length","param",n),new NumberCoder(ie/8,c[1]==="int",n.name)}if(c=n.type.match(paramTypeBytes),c){let ie=parseInt(c[1]);return(ie===0||ie>32)&&logger$n.throwArgumentError("invalid bytes length","param",n),new FixedBytesCoder(ie,n.name)}return logger$n.throwArgumentError("invalid type","type",n.type)}_getWordSize(){return 32}_getReader(n,c){return new Reader(n,this._getWordSize(),this.coerceFunc,c)}_getWriter(){return new Writer(this._getWordSize())}getDefaultValue(n){const c=n.map(ie=>this._getCoder(ParamType.from(ie)));return new TupleCoder(c,"_").defaultValue()}encode(n,c){n.length!==c.length&&logger$n.throwError("types/values length mismatch",Logger$1.errors.INVALID_ARGUMENT,{count:{types:n.length,values:c.length},value:{types:n,values:c}});const ie=n.map(de=>this._getCoder(ParamType.from(de))),se=new TupleCoder(ie,"_"),ae=this._getWriter();return se.encode(ae,c),ae.data}decode(n,c,ie){const se=n.map(ae=>this._getCoder(ParamType.from(ae)));return new TupleCoder(se,"_").decode(this._getReader(arrayify(c),ie))}}const defaultAbiCoder=new AbiCoder;function id$1(t){return keccak256$1(toUtf8Bytes(t))}const version$m="hash/5.8.0";function decode$6(t){t=atob(t);const n=[];for(let c=0;c<t.length;c++)n.push(t.charCodeAt(c));return arrayify(n)}function encode$5(t){t=arrayify(t);let n="";for(let c=0;c<t.length;c++)n+=String.fromCharCode(t[c]);return btoa(n)}const lib_esm$d=Object.freeze(Object.defineProperty({__proto__:null,decode:decode$6,encode:encode$5},Symbol.toStringTag,{value:"Module"}));function flat(t,n){n==null&&(n=1);const c=[],ie=c.forEach,se=function(ae,de){ie.call(ae,function(ue){de>0&&Array.isArray(ue)?se(ue,de-1):c.push(ue)})};return se(t,n),c}function fromEntries(t){const n={};for(let c=0;c<t.length;c++){const ie=t[c];n[ie[0]]=ie[1]}return n}function decode_arithmetic(t){let n=0;function c(){return t[n++]<<8|t[n++]}let ie=c(),se=1,ae=[0,1];for(let $e=1;$e<ie;$e++)ae.push(se+=c());let de=c(),ue=n;n+=de;let pe=0,ge=0;function be(){return pe==0&&(ge=ge<<8|t[n++],pe=8),ge>>--pe&1}const _e=31,we=Math.pow(2,_e),qe=we>>>1,Ye=qe>>1,Ge=we-1;let Ze=0;for(let $e=0;$e<_e;$e++)Ze=Ze<<1|be();let He=[],Ht=0,un=we;for(;;){let $e=Math.floor(((Ze-Ht+1)*se-1)/un),me=0,Gt=ie;for(;Gt-me>1;){let jt=me+Gt>>>1;$e<ae[jt]?Gt=jt:me=jt}if(me==0)break;He.push(me);let mn=Ht+Math.floor(un*ae[me]/se),dn=Ht+Math.floor(un*ae[me+1]/se)-1;for(;!((mn^dn)&qe);)Ze=Ze<<1&Ge|be(),mn=mn<<1&Ge,dn=dn<<1&Ge|1;for(;mn&~dn&Ye;)Ze=Ze&qe|Ze<<1&Ge>>>1|be(),mn=mn<<1^qe,dn=(dn^qe)<<1|qe|1;Ht=mn,un=1+dn-mn}let De=ie-4;return He.map($e=>{switch($e-De){case 3:return De+65792+(t[ue++]<<16|t[ue++]<<8|t[ue++]);case 2:return De+256+(t[ue++]<<8|t[ue++]);case 1:return De+t[ue++];default:return $e-1}})}function read_payload(t){let n=0;return()=>t[n++]}function read_compressed_payload(t){return read_payload(decode_arithmetic(t))}function signed(t){return t&1?~t>>1:t>>1}function read_counts(t,n){let c=Array(t);for(let ie=0;ie<t;ie++)c[ie]=1+n();return c}function read_ascending(t,n){let c=Array(t);for(let ie=0,se=-1;ie<t;ie++)c[ie]=se+=1+n();return c}function read_deltas(t,n){let c=Array(t);for(let ie=0,se=0;ie<t;ie++)c[ie]=se+=signed(n());return c}function read_member_array(t,n){let c=read_ascending(t(),t),ie=t(),se=read_ascending(ie,t),ae=read_counts(ie,t);for(let de=0;de<ie;de++)for(let ue=0;ue<ae[de];ue++)c.push(se[de]+ue);return n?c.map(de=>n[de]):c}function read_mapped_map(t){let n=[];for(;;){let c=t();if(c==0)break;n.push(read_linear_table(c,t))}for(;;){let c=t()-1;if(c<0)break;n.push(read_replacement_table(c,t))}return fromEntries(flat(n))}function read_zero_terminated_array(t){let n=[];for(;;){let c=t();if(c==0)break;n.push(c)}return n}function read_transposed(t,n,c){let ie=Array(t).fill(void 0).map(()=>[]);for(let se=0;se<n;se++)read_deltas(t,c).forEach((ae,de)=>ie[de].push(ae));return ie}function read_linear_table(t,n){let c=1+n(),ie=n(),se=read_zero_terminated_array(n),ae=read_transposed(se.length,1+t,n);return flat(ae.map((de,ue)=>{const pe=de[0],ge=de.slice(1);return Array(se[ue]).fill(void 0).map((be,_e)=>{let we=_e*ie;return[pe+_e*c,ge.map(qe=>qe+we)]})}))}function read_replacement_table(t,n){let c=1+n();return read_transposed(c,1+t,n).map(ie=>[ie[0],ie.slice(1)])}function read_emoji_trie(t){let n=read_member_array(t).sort((ie,se)=>ie-se);return c();function c(){let ie=[];for(;;){let ge=read_member_array(t,n);if(ge.length==0)break;ie.push({set:new Set(ge),node:c()})}ie.sort((ge,be)=>be.set.size-ge.set.size);let se=t(),ae=se%3;se=se/3|0;let de=!!(se&1);se>>=1;let ue=se==1,pe=se==2;return{branches:ie,valid:ae,fe0f:de,save:ue,check:pe}}}function getData(){return read_compressed_payload(decode$6("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const r$2=getData(),VALID=new Set(read_member_array(r$2)),IGNORED=new Set(read_member_array(r$2)),MAPPED=read_mapped_map(r$2),EMOJI_ROOT=read_emoji_trie(r$2),HYPHEN=45,UNDERSCORE=95;function explode_cp(t){return toUtf8CodePoints(t)}function filter_fe0f(t){return t.filter(n=>n!=65039)}function ens_normalize_post_check(t){for(let n of t.split(".")){let c=explode_cp(n);try{for(let ie=c.lastIndexOf(UNDERSCORE)-1;ie>=0;ie--)if(c[ie]!==UNDERSCORE)throw new Error("underscore only allowed at start");if(c.length>=4&&c.every(ie=>ie<128)&&c[2]===HYPHEN&&c[3]===HYPHEN)throw new Error("invalid label extension")}catch(ie){throw new Error(`Invalid label "${n}": ${ie.message}`)}}return t}function ens_normalize(t){return ens_normalize_post_check(normalize(t,filter_fe0f))}function normalize(t,n){let c=explode_cp(t).reverse(),ie=[];for(;c.length;){let se=consume_emoji_reversed(c);if(se){ie.push(...n(se));continue}let ae=c.pop();if(VALID.has(ae)){ie.push(ae);continue}if(IGNORED.has(ae))continue;let de=MAPPED[ae];if(de){ie.push(...de);continue}throw new Error(`Disallowed codepoint: 0x${ae.toString(16).toUpperCase()}`)}return ens_normalize_post_check(nfc(String.fromCodePoint(...ie)))}function nfc(t){return t.normalize("NFC")}function consume_emoji_reversed(t,n){var c;let ie=EMOJI_ROOT,se,ae,de=[],ue=t.length;for(;ue;){let pe=t[--ue];if(ie=(c=ie.branches.find(ge=>ge.set.has(pe)))===null||c===void 0?void 0:c.node,!ie)break;if(ie.save)ae=pe;else if(ie.check&&pe===ae)break;de.push(pe),ie.fe0f&&(de.push(65039),ue>0&&t[ue-1]==65039&&ue--),ie.valid&&(se=de.slice(),ie.valid==2&&se.splice(1,1),t.length=ue)}return se}const logger$m=new Logger$1(version$m),Zeros$1=new Uint8Array(32);Zeros$1.fill(0);function checkComponent(t){if(t.length===0)throw new Error("invalid ENS name; empty component");return t}function ensNameSplit(t){const n=toUtf8Bytes(ens_normalize(t)),c=[];if(t.length===0)return c;let ie=0;for(let se=0;se<n.length;se++)n[se]===46&&(c.push(checkComponent(n.slice(ie,se))),ie=se+1);if(ie>=n.length)throw new Error("invalid ENS name; empty component");return c.push(checkComponent(n.slice(ie))),c}function ensNormalize(t){return ensNameSplit(t).map(n=>toUtf8String(n)).join(".")}function isValidName(t){try{return ensNameSplit(t).length!==0}catch{}return!1}function namehash$1(t){typeof t!="string"&&logger$m.throwArgumentError("invalid ENS name; not a string","name",t);let n=Zeros$1;const c=ensNameSplit(t);for(;c.length;)n=keccak256$1(concat$1([n,keccak256$1(c.pop())]));return hexlify$1(n)}function dnsEncode(t){return hexlify$1(concat$1(ensNameSplit(t).map(n=>{if(n.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const c=new Uint8Array(n.length+1);return c.set(n,1),c[0]=c.length-1,c})))+"00"}const messagePrefix=`Ethereum Signed Message:
|
|
24
24
|
`;function hashMessage(t){return typeof t=="string"&&(t=toUtf8Bytes(t)),keccak256$1(concat$1([toUtf8Bytes(messagePrefix),toUtf8Bytes(String(t.length)),t]))}var __awaiter$k=function(t,n,c,ie){function se(ae){return ae instanceof c?ae:new c(function(de){de(ae)})}return new(c||(c=Promise))(function(ae,de){function ue(be){try{ge(ie.next(be))}catch(_e){de(_e)}}function pe(be){try{ge(ie.throw(be))}catch(_e){de(_e)}}function ge(be){be.done?ae(be.value):se(be.value).then(ue,pe)}ge((ie=ie.apply(t,[])).next())})};const logger$l=new Logger$1(version$m),padding=new Uint8Array(32);padding.fill(0);const NegativeOne=BigNumber$1.from(-1),Zero=BigNumber$1.from(0),One=BigNumber$1.from(1),MaxUint256=BigNumber$1.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function hexPadRight(t){const n=arrayify(t),c=n.length%32;return c?hexConcat([n,padding.slice(c)]):hexlify$1(n)}const hexTrue=hexZeroPad(One.toHexString(),32),hexFalse=hexZeroPad(Zero.toHexString(),32),domainFieldTypes={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},domainFieldNames=["name","version","chainId","verifyingContract","salt"];function checkString(t){return function(n){return typeof n!="string"&&logger$l.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,n),n}}const domainChecks={name:checkString("name"),version:checkString("version"),chainId:function(t){try{return BigNumber$1.from(t).toString()}catch{}return logger$l.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return getAddress$1(t).toLowerCase()}catch{}return logger$l.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const n=arrayify(t);if(n.length!==32)throw new Error("bad length");return hexlify$1(n)}catch{}return logger$l.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function getBaseEncoder(t){{const n=t.match(/^(u?)int(\d*)$/);if(n){const c=n[1]==="",ie=parseInt(n[2]||"256");(ie%8!==0||ie>256||n[2]&&n[2]!==String(ie))&&logger$l.throwArgumentError("invalid numeric width","type",t);const se=MaxUint256.mask(c?ie-1:ie),ae=c?se.add(One).mul(NegativeOne):Zero;return function(de){const ue=BigNumber$1.from(de);return(ue.lt(ae)||ue.gt(se))&&logger$l.throwArgumentError(`value out-of-bounds for ${t}`,"value",de),hexZeroPad(ue.toTwos(256).toHexString(),32)}}}{const n=t.match(/^bytes(\d+)$/);if(n){const c=parseInt(n[1]);return(c===0||c>32||n[1]!==String(c))&&logger$l.throwArgumentError("invalid bytes width","type",t),function(ie){return arrayify(ie).length!==c&&logger$l.throwArgumentError(`invalid length for ${t}`,"value",ie),hexPadRight(ie)}}}switch(t){case"address":return function(n){return hexZeroPad(getAddress$1(n),32)};case"bool":return function(n){return n?hexTrue:hexFalse};case"bytes":return function(n){return keccak256$1(n)};case"string":return function(n){return id$1(n)}}return null}function encodeType(t,n){return`${t}(${n.map(({name:c,type:ie})=>ie+" "+c).join(",")})`}class TypedDataEncoder{constructor(n){defineReadOnly(this,"types",Object.freeze(deepCopy(n))),defineReadOnly(this,"_encoderCache",{}),defineReadOnly(this,"_types",{});const c={},ie={},se={};Object.keys(n).forEach(ue=>{c[ue]={},ie[ue]=[],se[ue]={}});for(const ue in n){const pe={};n[ue].forEach(ge=>{pe[ge.name]&&logger$l.throwArgumentError(`duplicate variable name ${JSON.stringify(ge.name)} in ${JSON.stringify(ue)}`,"types",n),pe[ge.name]=!0;const be=ge.type.match(/^([^\x5b]*)(\x5b|$)/)[1];be===ue&&logger$l.throwArgumentError(`circular type reference to ${JSON.stringify(be)}`,"types",n),!getBaseEncoder(be)&&(ie[be]||logger$l.throwArgumentError(`unknown type ${JSON.stringify(be)}`,"types",n),ie[be].push(ue),c[ue][be]=!0)})}const ae=Object.keys(ie).filter(ue=>ie[ue].length===0);ae.length===0?logger$l.throwArgumentError("missing primary type","types",n):ae.length>1&&logger$l.throwArgumentError(`ambiguous primary types or unused types: ${ae.map(ue=>JSON.stringify(ue)).join(", ")}`,"types",n),defineReadOnly(this,"primaryType",ae[0]);function de(ue,pe){pe[ue]&&logger$l.throwArgumentError(`circular type reference to ${JSON.stringify(ue)}`,"types",n),pe[ue]=!0,Object.keys(c[ue]).forEach(ge=>{ie[ge]&&(de(ge,pe),Object.keys(pe).forEach(be=>{se[be][ge]=!0}))}),delete pe[ue]}de(this.primaryType,{});for(const ue in se){const pe=Object.keys(se[ue]);pe.sort(),this._types[ue]=encodeType(ue,n[ue])+pe.map(ge=>encodeType(ge,n[ge])).join("")}}getEncoder(n){let c=this._encoderCache[n];return c||(c=this._encoderCache[n]=this._getEncoder(n)),c}_getEncoder(n){{const se=getBaseEncoder(n);if(se)return se}const c=n.match(/^(.*)(\x5b(\d*)\x5d)$/);if(c){const se=c[1],ae=this.getEncoder(se),de=parseInt(c[3]);return ue=>{de>=0&&ue.length!==de&&logger$l.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",ue);let pe=ue.map(ae);return this._types[se]&&(pe=pe.map(keccak256$1)),keccak256$1(hexConcat(pe))}}const ie=this.types[n];if(ie){const se=id$1(this._types[n]);return ae=>{const de=ie.map(({name:ue,type:pe})=>{const ge=this.getEncoder(pe)(ae[ue]);return this._types[pe]?keccak256$1(ge):ge});return de.unshift(se),hexConcat(de)}}return logger$l.throwArgumentError(`unknown type: ${n}`,"type",n)}encodeType(n){const c=this._types[n];return c||logger$l.throwArgumentError(`unknown type: ${JSON.stringify(n)}`,"name",n),c}encodeData(n,c){return this.getEncoder(n)(c)}hashStruct(n,c){return keccak256$1(this.encodeData(n,c))}encode(n){return this.encodeData(this.primaryType,n)}hash(n){return this.hashStruct(this.primaryType,n)}_visit(n,c,ie){if(getBaseEncoder(n))return ie(n,c);const se=n.match(/^(.*)(\x5b(\d*)\x5d)$/);if(se){const de=se[1],ue=parseInt(se[3]);return ue>=0&&c.length!==ue&&logger$l.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",c),c.map(pe=>this._visit(de,pe,ie))}const ae=this.types[n];return ae?ae.reduce((de,{name:ue,type:pe})=>(de[ue]=this._visit(pe,c[ue],ie),de),{}):logger$l.throwArgumentError(`unknown type: ${n}`,"type",n)}visit(n,c){return this._visit(this.primaryType,n,c)}static from(n){return new TypedDataEncoder(n)}static getPrimaryType(n){return TypedDataEncoder.from(n).primaryType}static hashStruct(n,c,ie){return TypedDataEncoder.from(c).hashStruct(n,ie)}static hashDomain(n){const c=[];for(const ie in n){const se=domainFieldTypes[ie];se||logger$l.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(ie)}`,"domain",n),c.push({name:ie,type:se})}return c.sort((ie,se)=>domainFieldNames.indexOf(ie.name)-domainFieldNames.indexOf(se.name)),TypedDataEncoder.hashStruct("EIP712Domain",{EIP712Domain:c},n)}static encode(n,c,ie){return hexConcat(["0x1901",TypedDataEncoder.hashDomain(n),TypedDataEncoder.from(c).hash(ie)])}static hash(n,c,ie){return keccak256$1(TypedDataEncoder.encode(n,c,ie))}static resolveNames(n,c,ie,se){return __awaiter$k(this,void 0,void 0,function*(){n=shallowCopy(n);const ae={};n.verifyingContract&&!isHexString$1(n.verifyingContract,20)&&(ae[n.verifyingContract]="0x");const de=TypedDataEncoder.from(c);de.visit(ie,(ue,pe)=>(ue==="address"&&!isHexString$1(pe,20)&&(ae[pe]="0x"),pe));for(const ue in ae)ae[ue]=yield se(ue);return n.verifyingContract&&ae[n.verifyingContract]&&(n.verifyingContract=ae[n.verifyingContract]),ie=de.visit(ie,(ue,pe)=>ue==="address"&&ae[pe]?ae[pe]:pe),{domain:n,value:ie}})}static getPayload(n,c,ie){TypedDataEncoder.hashDomain(n);const se={},ae=[];domainFieldNames.forEach(pe=>{const ge=n[pe];ge!=null&&(se[pe]=domainChecks[pe](ge),ae.push({name:pe,type:domainFieldTypes[pe]}))});const de=TypedDataEncoder.from(c),ue=shallowCopy(c);return ue.EIP712Domain?logger$l.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",c):ue.EIP712Domain=ae,de.encode(ie),{types:ue,domain:se,primaryType:de.primaryType,message:de.visit(ie,(pe,ge)=>{if(pe.match(/^bytes(\d*)/))return hexlify$1(arrayify(ge));if(pe.match(/^u?int/))return BigNumber$1.from(ge).toString();switch(pe){case"address":return ge.toLowerCase();case"bool":return!!ge;case"string":return typeof ge!="string"&&logger$l.throwArgumentError("invalid string","value",ge),ge}return logger$l.throwArgumentError("unsupported type","type",pe)})}}}const lib_esm$c=Object.freeze(Object.defineProperty({__proto__:null,_TypedDataEncoder:TypedDataEncoder,dnsEncode,ensNormalize,hashMessage,id:id$1,isValidName,messagePrefix,namehash:namehash$1},Symbol.toStringTag,{value:"Module"})),logger$k=new Logger$1(version$q);class LogDescription extends Description$1{}class TransactionDescription extends Description$1{}class ErrorDescription extends Description$1{}class Indexed extends Description$1{static isIndexed(n){return!!(n&&n._isIndexed)}}const BuiltinErrors={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function wrapAccessError(t,n){const c=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return c.error=n,c}class Interface{constructor(n){let c=[];typeof n=="string"?c=JSON.parse(n):c=n,defineReadOnly(this,"fragments",c.map(ie=>Fragment.from(ie)).filter(ie=>ie!=null)),defineReadOnly(this,"_abiCoder",getStatic(new.target,"getAbiCoder")()),defineReadOnly(this,"functions",{}),defineReadOnly(this,"errors",{}),defineReadOnly(this,"events",{}),defineReadOnly(this,"structs",{}),this.fragments.forEach(ie=>{let se=null;switch(ie.type){case"constructor":if(this.deploy){logger$k.warn("duplicate definition - constructor");return}defineReadOnly(this,"deploy",ie);return;case"function":se=this.functions;break;case"event":se=this.events;break;case"error":se=this.errors;break;default:return}let ae=ie.format();if(se[ae]){logger$k.warn("duplicate definition - "+ae);return}se[ae]=ie}),this.deploy||defineReadOnly(this,"deploy",ConstructorFragment.from({payable:!1,type:"constructor"})),defineReadOnly(this,"_isInterface",!0)}format(n){n||(n=FormatTypes.full),n===FormatTypes.sighash&&logger$k.throwArgumentError("interface does not support formatting sighash","format",n);const c=this.fragments.map(ie=>ie.format(n));return n===FormatTypes.json?JSON.stringify(c.map(ie=>JSON.parse(ie))):c}static getAbiCoder(){return defaultAbiCoder}static getAddress(n){return getAddress$1(n)}static getSighash(n){return hexDataSlice(id$1(n.format()),0,4)}static getEventTopic(n){return id$1(n.format())}getFunction(n){if(isHexString$1(n)){for(const ie in this.functions)if(n===this.getSighash(ie))return this.functions[ie];logger$k.throwArgumentError("no matching function","sighash",n)}if(n.indexOf("(")===-1){const ie=n.trim(),se=Object.keys(this.functions).filter(ae=>ae.split("(")[0]===ie);return se.length===0?logger$k.throwArgumentError("no matching function","name",ie):se.length>1&&logger$k.throwArgumentError("multiple matching functions","name",ie),this.functions[se[0]]}const c=this.functions[FunctionFragment.fromString(n).format()];return c||logger$k.throwArgumentError("no matching function","signature",n),c}getEvent(n){if(isHexString$1(n)){const ie=n.toLowerCase();for(const se in this.events)if(ie===this.getEventTopic(se))return this.events[se];logger$k.throwArgumentError("no matching event","topichash",ie)}if(n.indexOf("(")===-1){const ie=n.trim(),se=Object.keys(this.events).filter(ae=>ae.split("(")[0]===ie);return se.length===0?logger$k.throwArgumentError("no matching event","name",ie):se.length>1&&logger$k.throwArgumentError("multiple matching events","name",ie),this.events[se[0]]}const c=this.events[EventFragment.fromString(n).format()];return c||logger$k.throwArgumentError("no matching event","signature",n),c}getError(n){if(isHexString$1(n)){const ie=getStatic(this.constructor,"getSighash");for(const se in this.errors){const ae=this.errors[se];if(n===ie(ae))return this.errors[se]}logger$k.throwArgumentError("no matching error","sighash",n)}if(n.indexOf("(")===-1){const ie=n.trim(),se=Object.keys(this.errors).filter(ae=>ae.split("(")[0]===ie);return se.length===0?logger$k.throwArgumentError("no matching error","name",ie):se.length>1&&logger$k.throwArgumentError("multiple matching errors","name",ie),this.errors[se[0]]}const c=this.errors[FunctionFragment.fromString(n).format()];return c||logger$k.throwArgumentError("no matching error","signature",n),c}getSighash(n){if(typeof n=="string")try{n=this.getFunction(n)}catch(c){try{n=this.getError(n)}catch{throw c}}return getStatic(this.constructor,"getSighash")(n)}getEventTopic(n){return typeof n=="string"&&(n=this.getEvent(n)),getStatic(this.constructor,"getEventTopic")(n)}_decodeParams(n,c){return this._abiCoder.decode(n,c)}_encodeParams(n,c){return this._abiCoder.encode(n,c)}encodeDeploy(n){return this._encodeParams(this.deploy.inputs,n||[])}decodeErrorResult(n,c){typeof n=="string"&&(n=this.getError(n));const ie=arrayify(c);return hexlify$1(ie.slice(0,4))!==this.getSighash(n)&&logger$k.throwArgumentError(`data signature does not match error ${n.name}.`,"data",hexlify$1(ie)),this._decodeParams(n.inputs,ie.slice(4))}encodeErrorResult(n,c){return typeof n=="string"&&(n=this.getError(n)),hexlify$1(concat$1([this.getSighash(n),this._encodeParams(n.inputs,c||[])]))}decodeFunctionData(n,c){typeof n=="string"&&(n=this.getFunction(n));const ie=arrayify(c);return hexlify$1(ie.slice(0,4))!==this.getSighash(n)&&logger$k.throwArgumentError(`data signature does not match function ${n.name}.`,"data",hexlify$1(ie)),this._decodeParams(n.inputs,ie.slice(4))}encodeFunctionData(n,c){return typeof n=="string"&&(n=this.getFunction(n)),hexlify$1(concat$1([this.getSighash(n),this._encodeParams(n.inputs,c||[])]))}decodeFunctionResult(n,c){typeof n=="string"&&(n=this.getFunction(n));let ie=arrayify(c),se=null,ae="",de=null,ue=null,pe=null;switch(ie.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(n.outputs,ie)}catch{}break;case 4:{const ge=hexlify$1(ie.slice(0,4)),be=BuiltinErrors[ge];if(be)de=this._abiCoder.decode(be.inputs,ie.slice(4)),ue=be.name,pe=be.signature,be.reason&&(se=de[0]),ue==="Error"?ae=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(de[0])}`:ue==="Panic"&&(ae=`; VM Exception while processing transaction: reverted with panic code ${de[0]}`);else try{const _e=this.getError(ge);de=this._abiCoder.decode(_e.inputs,ie.slice(4)),ue=_e.name,pe=_e.format()}catch{}break}}return logger$k.throwError("call revert exception"+ae,Logger$1.errors.CALL_EXCEPTION,{method:n.format(),data:hexlify$1(c),errorArgs:de,errorName:ue,errorSignature:pe,reason:se})}encodeFunctionResult(n,c){return typeof n=="string"&&(n=this.getFunction(n)),hexlify$1(this._abiCoder.encode(n.outputs,c||[]))}encodeFilterTopics(n,c){typeof n=="string"&&(n=this.getEvent(n)),c.length>n.inputs.length&&logger$k.throwError("too many arguments for "+n.format(),Logger$1.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:c});let ie=[];n.anonymous||ie.push(this.getEventTopic(n));const se=(ae,de)=>ae.type==="string"?id$1(de):ae.type==="bytes"?keccak256$1(hexlify$1(de)):(ae.type==="bool"&&typeof de=="boolean"&&(de=de?"0x01":"0x00"),ae.type.match(/^u?int/)&&(de=BigNumber$1.from(de).toHexString()),ae.type==="address"&&this._abiCoder.encode(["address"],[de]),hexZeroPad(hexlify$1(de),32));for(c.forEach((ae,de)=>{let ue=n.inputs[de];if(!ue.indexed){ae!=null&&logger$k.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+ue.name,ae);return}ae==null?ie.push(null):ue.baseType==="array"||ue.baseType==="tuple"?logger$k.throwArgumentError("filtering with tuples or arrays not supported","contract."+ue.name,ae):Array.isArray(ae)?ie.push(ae.map(pe=>se(ue,pe))):ie.push(se(ue,ae))});ie.length&&ie[ie.length-1]===null;)ie.pop();return ie}encodeEventLog(n,c){typeof n=="string"&&(n=this.getEvent(n));const ie=[],se=[],ae=[];return n.anonymous||ie.push(this.getEventTopic(n)),c.length!==n.inputs.length&&logger$k.throwArgumentError("event arguments/values mismatch","values",c),n.inputs.forEach((de,ue)=>{const pe=c[ue];if(de.indexed)if(de.type==="string")ie.push(id$1(pe));else if(de.type==="bytes")ie.push(keccak256$1(pe));else{if(de.baseType==="tuple"||de.baseType==="array")throw new Error("not implemented");ie.push(this._abiCoder.encode([de.type],[pe]))}else se.push(de),ae.push(pe)}),{data:this._abiCoder.encode(se,ae),topics:ie}}decodeEventLog(n,c,ie){if(typeof n=="string"&&(n=this.getEvent(n)),ie!=null&&!n.anonymous){let we=this.getEventTopic(n);(!isHexString$1(ie[0],32)||ie[0].toLowerCase()!==we)&&logger$k.throwError("fragment/topic mismatch",Logger$1.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:we,value:ie[0]}),ie=ie.slice(1)}let se=[],ae=[],de=[];n.inputs.forEach((we,qe)=>{we.indexed?we.type==="string"||we.type==="bytes"||we.baseType==="tuple"||we.baseType==="array"?(se.push(ParamType.fromObject({type:"bytes32",name:we.name})),de.push(!0)):(se.push(we),de.push(!1)):(ae.push(we),de.push(!1))});let ue=ie!=null?this._abiCoder.decode(se,concat$1(ie)):null,pe=this._abiCoder.decode(ae,c,!0),ge=[],be=0,_e=0;n.inputs.forEach((we,qe)=>{if(we.indexed)if(ue==null)ge[qe]=new Indexed({_isIndexed:!0,hash:null});else if(de[qe])ge[qe]=new Indexed({_isIndexed:!0,hash:ue[_e++]});else try{ge[qe]=ue[_e++]}catch(Ye){ge[qe]=Ye}else try{ge[qe]=pe[be++]}catch(Ye){ge[qe]=Ye}if(we.name&&ge[we.name]==null){const Ye=ge[qe];Ye instanceof Error?Object.defineProperty(ge,we.name,{enumerable:!0,get:()=>{throw wrapAccessError(`property ${JSON.stringify(we.name)}`,Ye)}}):ge[we.name]=Ye}});for(let we=0;we<ge.length;we++){const qe=ge[we];qe instanceof Error&&Object.defineProperty(ge,we,{enumerable:!0,get:()=>{throw wrapAccessError(`index ${we}`,qe)}})}return Object.freeze(ge)}parseTransaction(n){let c=this.getFunction(n.data.substring(0,10).toLowerCase());return c?new TransactionDescription({args:this._abiCoder.decode(c.inputs,"0x"+n.data.substring(10)),functionFragment:c,name:c.name,signature:c.format(),sighash:this.getSighash(c),value:BigNumber$1.from(n.value||"0")}):null}parseLog(n){let c=this.getEvent(n.topics[0]);return!c||c.anonymous?null:new LogDescription({eventFragment:c,name:c.name,signature:c.format(),topic:this.getEventTopic(c),args:this.decodeEventLog(c,n.data,n.topics)})}parseError(n){const c=hexlify$1(n);let ie=this.getError(c.substring(0,10).toLowerCase());return ie?new ErrorDescription({args:this._abiCoder.decode(ie.inputs,"0x"+c.substring(10)),errorFragment:ie,name:ie.name,signature:ie.format(),sighash:this.getSighash(ie)}):null}static isInterface(n){return!!(n&&n._isInterface)}}const lib_esm$b=Object.freeze(Object.defineProperty({__proto__:null,AbiCoder,ConstructorFragment,ErrorFragment,EventFragment,FormatTypes,Fragment,FunctionFragment,Indexed,Interface,LogDescription,ParamType,TransactionDescription,checkResultErrors,defaultAbiCoder},Symbol.toStringTag,{value:"Module"})),version$l="abstract-provider/5.8.0";var __awaiter$j=function(t,n,c,ie){function se(ae){return ae instanceof c?ae:new c(function(de){de(ae)})}return new(c||(c=Promise))(function(ae,de){function ue(be){try{ge(ie.next(be))}catch(_e){de(_e)}}function pe(be){try{ge(ie.throw(be))}catch(_e){de(_e)}}function ge(be){be.done?ae(be.value):se(be.value).then(ue,pe)}ge((ie=ie.apply(t,[])).next())})};const logger$j=new Logger$1(version$l);class ForkEvent extends Description$1{static isForkEvent(n){return!!(n&&n._isForkEvent)}}class Provider{constructor(){logger$j.checkAbstract(new.target,Provider),defineReadOnly(this,"_isProvider",!0)}getFeeData(){return __awaiter$j(this,void 0,void 0,function*(){const{block:n,gasPrice:c}=yield resolveProperties({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(de=>null)});let ie=null,se=null,ae=null;return n&&n.baseFeePerGas&&(ie=n.baseFeePerGas,ae=BigNumber$1.from("1500000000"),se=n.baseFeePerGas.mul(2).add(ae)),{lastBaseFeePerGas:ie,maxFeePerGas:se,maxPriorityFeePerGas:ae,gasPrice:c}})}addListener(n,c){return this.on(n,c)}removeListener(n,c){return this.off(n,c)}static isProvider(n){return!!(n&&n._isProvider)}}const version$k="abstract-signer/5.8.0";var __awaiter$i=function(t,n,c,ie){function se(ae){return ae instanceof c?ae:new c(function(de){de(ae)})}return new(c||(c=Promise))(function(ae,de){function ue(be){try{ge(ie.next(be))}catch(_e){de(_e)}}function pe(be){try{ge(ie.throw(be))}catch(_e){de(_e)}}function ge(be){be.done?ae(be.value):se(be.value).then(ue,pe)}ge((ie=ie.apply(t,[])).next())})};const logger$i=new Logger$1(version$k),allowedTransactionKeys$2=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],forwardErrors=[Logger$1.errors.INSUFFICIENT_FUNDS,Logger$1.errors.NONCE_EXPIRED,Logger$1.errors.REPLACEMENT_UNDERPRICED];class Signer{constructor(){logger$i.checkAbstract(new.target,Signer),defineReadOnly(this,"_isSigner",!0)}getBalance(n){return __awaiter$i(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),n)})}getTransactionCount(n){return __awaiter$i(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),n)})}estimateGas(n){return __awaiter$i(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const c=yield resolveProperties(this.checkTransaction(n));return yield this.provider.estimateGas(c)})}call(n,c){return __awaiter$i(this,void 0,void 0,function*(){this._checkProvider("call");const ie=yield resolveProperties(this.checkTransaction(n));return yield this.provider.call(ie,c)})}sendTransaction(n){return __awaiter$i(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const c=yield this.populateTransaction(n),ie=yield this.signTransaction(c);return yield this.provider.sendTransaction(ie)})}getChainId(){return __awaiter$i(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return __awaiter$i(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return __awaiter$i(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(n){return __awaiter$i(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(n)})}checkTransaction(n){for(const ie in n)allowedTransactionKeys$2.indexOf(ie)===-1&&logger$i.throwArgumentError("invalid transaction key: "+ie,"transaction",n);const c=shallowCopy(n);return c.from==null?c.from=this.getAddress():c.from=Promise.all([Promise.resolve(c.from),this.getAddress()]).then(ie=>(ie[0].toLowerCase()!==ie[1].toLowerCase()&&logger$i.throwArgumentError("from address mismatch","transaction",n),ie[0])),c}populateTransaction(n){return __awaiter$i(this,void 0,void 0,function*(){const c=yield resolveProperties(this.checkTransaction(n));c.to!=null&&(c.to=Promise.resolve(c.to).then(se=>__awaiter$i(this,void 0,void 0,function*(){if(se==null)return null;const ae=yield this.resolveName(se);return ae==null&&logger$i.throwArgumentError("provided ENS name resolves to null","tx.to",se),ae})),c.to.catch(se=>{}));const ie=c.maxFeePerGas!=null||c.maxPriorityFeePerGas!=null;if(c.gasPrice!=null&&(c.type===2||ie)?logger$i.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",n):(c.type===0||c.type===1)&&ie&&logger$i.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",n),(c.type===2||c.type==null)&&c.maxFeePerGas!=null&&c.maxPriorityFeePerGas!=null)c.type=2;else if(c.type===0||c.type===1)c.gasPrice==null&&(c.gasPrice=this.getGasPrice());else{const se=yield this.getFeeData();if(c.type==null)if(se.maxFeePerGas!=null&&se.maxPriorityFeePerGas!=null)if(c.type=2,c.gasPrice!=null){const ae=c.gasPrice;delete c.gasPrice,c.maxFeePerGas=ae,c.maxPriorityFeePerGas=ae}else c.maxFeePerGas==null&&(c.maxFeePerGas=se.maxFeePerGas),c.maxPriorityFeePerGas==null&&(c.maxPriorityFeePerGas=se.maxPriorityFeePerGas);else se.gasPrice!=null?(ie&&logger$i.throwError("network does not support EIP-1559",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),c.gasPrice==null&&(c.gasPrice=se.gasPrice),c.type=0):logger$i.throwError("failed to get consistent fee data",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else c.type===2&&(c.maxFeePerGas==null&&(c.maxFeePerGas=se.maxFeePerGas),c.maxPriorityFeePerGas==null&&(c.maxPriorityFeePerGas=se.maxPriorityFeePerGas))}return c.nonce==null&&(c.nonce=this.getTransactionCount("pending")),c.gasLimit==null&&(c.gasLimit=this.estimateGas(c).catch(se=>{if(forwardErrors.indexOf(se.code)>=0)throw se;return logger$i.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Logger$1.errors.UNPREDICTABLE_GAS_LIMIT,{error:se,tx:c})})),c.chainId==null?c.chainId=this.getChainId():c.chainId=Promise.all([Promise.resolve(c.chainId),this.getChainId()]).then(se=>(se[1]!==0&&se[0]!==se[1]&&logger$i.throwArgumentError("chainId address mismatch","transaction",n),se[0])),yield resolveProperties(c)})}_checkProvider(n){this.provider||logger$i.throwError("missing provider",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:n||"_checkProvider"})}static isSigner(n){return!!(n&&n._isSigner)}}class VoidSigner extends Signer{constructor(n,c){super(),defineReadOnly(this,"address",n),defineReadOnly(this,"provider",c||null)}getAddress(){return Promise.resolve(this.address)}_fail(n,c){return Promise.resolve().then(()=>{logger$i.throwError(n,Logger$1.errors.UNSUPPORTED_OPERATION,{operation:c})})}signMessage(n){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(n){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(n,c,ie){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(n){return new VoidSigner(this.address,n)}}var hash$4$1={},utils$o={},minimalisticAssert$1=assert$h;function assert$h(t,n){if(!t)throw new Error(n||"Assertion failed")}assert$h.equal=function(t,n,c){if(t!=n)throw new Error(c||"Assertion failed: "+t+" != "+n)};var inherits_browser$1={exports:{}};typeof Object.create=="function"?inherits_browser$1.exports=function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser$1.exports=function(t,n){if(n){t.super_=n;var c=function(){};c.prototype=n.prototype,t.prototype=new c,t.prototype.constructor=t}};var inherits_browserExports=inherits_browser$1.exports,assert$g=minimalisticAssert$1,inherits$3=inherits_browserExports;utils$o.inherits=inherits$3;function isSurrogatePair(t,n){return(t.charCodeAt(n)&64512)!==55296||n<0||n+1>=t.length?!1:(t.charCodeAt(n+1)&64512)===56320}function toArray$1(t,n){if(Array.isArray(t))return t.slice();if(!t)return[];var c=[];if(typeof t=="string")if(n){if(n==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),se=0;se<t.length;se+=2)c.push(parseInt(t[se]+t[se+1],16))}else for(var ie=0,se=0;se<t.length;se++){var ae=t.charCodeAt(se);ae<128?c[ie++]=ae:ae<2048?(c[ie++]=ae>>6|192,c[ie++]=ae&63|128):isSurrogatePair(t,se)?(ae=65536+((ae&1023)<<10)+(t.charCodeAt(++se)&1023),c[ie++]=ae>>18|240,c[ie++]=ae>>12&63|128,c[ie++]=ae>>6&63|128,c[ie++]=ae&63|128):(c[ie++]=ae>>12|224,c[ie++]=ae>>6&63|128,c[ie++]=ae&63|128)}else for(se=0;se<t.length;se++)c[se]=t[se]|0;return c}utils$o.toArray=toArray$1;function toHex$1(t){for(var n="",c=0;c<t.length;c++)n+=zero2(t[c].toString(16));return n}utils$o.toHex=toHex$1;function htonl(t){var n=t>>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return n>>>0}utils$o.htonl=htonl;function toHex32(t,n){for(var c="",ie=0;ie<t.length;ie++){var se=t[ie];n==="little"&&(se=htonl(se)),c+=zero8(se.toString(16))}return c}utils$o.toHex32=toHex32;function zero2(t){return t.length===1?"0"+t:t}utils$o.zero2=zero2;function zero8(t){return t.length===7?"0"+t:t.length===6?"00"+t:t.length===5?"000"+t:t.length===4?"0000"+t:t.length===3?"00000"+t:t.length===2?"000000"+t:t.length===1?"0000000"+t:t}utils$o.zero8=zero8;function join32(t,n,c,ie){var se=c-n;assert$g(se%4===0);for(var ae=new Array(se/4),de=0,ue=n;de<ae.length;de++,ue+=4){var pe;ie==="big"?pe=t[ue]<<24|t[ue+1]<<16|t[ue+2]<<8|t[ue+3]:pe=t[ue+3]<<24|t[ue+2]<<16|t[ue+1]<<8|t[ue],ae[de]=pe>>>0}return ae}utils$o.join32=join32;function split32(t,n){for(var c=new Array(t.length*4),ie=0,se=0;ie<t.length;ie++,se+=4){var ae=t[ie];n==="big"?(c[se]=ae>>>24,c[se+1]=ae>>>16&255,c[se+2]=ae>>>8&255,c[se+3]=ae&255):(c[se+3]=ae>>>24,c[se+2]=ae>>>16&255,c[se+1]=ae>>>8&255,c[se]=ae&255)}return c}utils$o.split32=split32;function rotr32$1(t,n){return t>>>n|t<<32-n}utils$o.rotr32=rotr32$1;function rotl32$2(t,n){return t<<n|t>>>32-n}utils$o.rotl32=rotl32$2;function sum32$3(t,n){return t+n>>>0}utils$o.sum32=sum32$3;function sum32_3$1(t,n,c){return t+n+c>>>0}utils$o.sum32_3=sum32_3$1;function sum32_4$2(t,n,c,ie){return t+n+c+ie>>>0}utils$o.sum32_4=sum32_4$2;function sum32_5$2(t,n,c,ie,se){return t+n+c+ie+se>>>0}utils$o.sum32_5=sum32_5$2;function sum64$1(t,n,c,ie){var se=t[n],ae=t[n+1],de=ie+ae>>>0,ue=(de<ie?1:0)+c+se;t[n]=ue>>>0,t[n+1]=de}utils$o.sum64=sum64$1;function sum64_hi$1(t,n,c,ie){var se=n+ie>>>0,ae=(se<n?1:0)+t+c;return ae>>>0}utils$o.sum64_hi=sum64_hi$1;function sum64_lo$1(t,n,c,ie){var se=n+ie;return se>>>0}utils$o.sum64_lo=sum64_lo$1;function sum64_4_hi$1(t,n,c,ie,se,ae,de,ue){var pe=0,ge=n;ge=ge+ie>>>0,pe+=ge<n?1:0,ge=ge+ae>>>0,pe+=ge<ae?1:0,ge=ge+ue>>>0,pe+=ge<ue?1:0;var be=t+c+se+de+pe;return be>>>0}utils$o.sum64_4_hi=sum64_4_hi$1;function sum64_4_lo$1(t,n,c,ie,se,ae,de,ue){var pe=n+ie+ae+ue;return pe>>>0}utils$o.sum64_4_lo=sum64_4_lo$1;function sum64_5_hi$1(t,n,c,ie,se,ae,de,ue,pe,ge){var be=0,_e=n;_e=_e+ie>>>0,be+=_e<n?1:0,_e=_e+ae>>>0,be+=_e<ae?1:0,_e=_e+ue>>>0,be+=_e<ue?1:0,_e=_e+ge>>>0,be+=_e<ge?1:0;var we=t+c+se+de+pe+be;return we>>>0}utils$o.sum64_5_hi=sum64_5_hi$1;function sum64_5_lo$1(t,n,c,ie,se,ae,de,ue,pe,ge){var be=n+ie+ae+ue+ge;return be>>>0}utils$o.sum64_5_lo=sum64_5_lo$1;function rotr64_hi$1(t,n,c){var ie=n<<32-c|t>>>c;return ie>>>0}utils$o.rotr64_hi=rotr64_hi$1;function rotr64_lo$1(t,n,c){var ie=t<<32-c|n>>>c;return ie>>>0}utils$o.rotr64_lo=rotr64_lo$1;function shr64_hi$1(t,n,c){return t>>>c}utils$o.shr64_hi=shr64_hi$1;function shr64_lo$1(t,n,c){var ie=t<<32-c|n>>>c;return ie>>>0}utils$o.shr64_lo=shr64_lo$1;var common$5={},utils$n=utils$o,assert$f=minimalisticAssert$1;function BlockHash$4(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}common$5.BlockHash=BlockHash$4;BlockHash$4.prototype.update=function(t,n){if(t=utils$n.toArray(t,n),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var c=t.length%this._delta8;this.pending=t.slice(t.length-c,t.length),this.pending.length===0&&(this.pending=null),t=utils$n.join32(t,0,t.length-c,this.endian);for(var ie=0;ie<t.length;ie+=this._delta32)this._update(t,ie,ie+this._delta32)}return this};BlockHash$4.prototype.digest=function(t){return this.update(this._pad()),assert$f(this.pending===null),this._digest(t)};BlockHash$4.prototype._pad=function(){var t=this.pendingTotal,n=this._delta8,c=n-(t+this.padLength)%n,ie=new Array(c+this.padLength);ie[0]=128;for(var se=1;se<c;se++)ie[se]=0;if(t<<=3,this.endian==="big"){for(var ae=8;ae<this.padLength;ae++)ie[se++]=0;ie[se++]=0,ie[se++]=0,ie[se++]=0,ie[se++]=0,ie[se++]=t>>>24&255,ie[se++]=t>>>16&255,ie[se++]=t>>>8&255,ie[se++]=t&255}else for(ie[se++]=t&255,ie[se++]=t>>>8&255,ie[se++]=t>>>16&255,ie[se++]=t>>>24&255,ie[se++]=0,ie[se++]=0,ie[se++]=0,ie[se++]=0,ae=8;ae<this.padLength;ae++)ie[se++]=0;return ie};var sha$1={},common$4={},utils$m=utils$o,rotr32=utils$m.rotr32;function ft_1$1(t,n,c,ie){if(t===0)return ch32$1(n,c,ie);if(t===1||t===3)return p32(n,c,ie);if(t===2)return maj32$1(n,c,ie)}common$4.ft_1=ft_1$1;function ch32$1(t,n,c){return t&n^~t&c}common$4.ch32=ch32$1;function maj32$1(t,n,c){return t&n^t&c^n&c}common$4.maj32=maj32$1;function p32(t,n,c){return t^n^c}common$4.p32=p32;function s0_256$1(t){return rotr32(t,2)^rotr32(t,13)^rotr32(t,22)}common$4.s0_256=s0_256$1;function s1_256$1(t){return rotr32(t,6)^rotr32(t,11)^rotr32(t,25)}common$4.s1_256=s1_256$1;function g0_256$1(t){return rotr32(t,7)^rotr32(t,18)^t>>>3}common$4.g0_256=g0_256$1;function g1_256$1(t){return rotr32(t,17)^rotr32(t,19)^t>>>10}common$4.g1_256=g1_256$1;var utils$l=utils$o,common$3=common$5,shaCommon$1=common$4,rotl32$1=utils$l.rotl32,sum32$2=utils$l.sum32,sum32_5$1=utils$l.sum32_5,ft_1=shaCommon$1.ft_1,BlockHash$3=common$3.BlockHash,sha1_K=[1518500249,1859775393,2400959708,3395469782];function SHA1(){if(!(this instanceof SHA1))return new SHA1;BlockHash$3.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}utils$l.inherits(SHA1,BlockHash$3);var _1=SHA1;SHA1.blockSize=512;SHA1.outSize=160;SHA1.hmacStrength=80;SHA1.padLength=64;SHA1.prototype._update=function(t,n){for(var c=this.W,ie=0;ie<16;ie++)c[ie]=t[n+ie];for(;ie<c.length;ie++)c[ie]=rotl32$1(c[ie-3]^c[ie-8]^c[ie-14]^c[ie-16],1);var se=this.h[0],ae=this.h[1],de=this.h[2],ue=this.h[3],pe=this.h[4];for(ie=0;ie<c.length;ie++){var ge=~~(ie/20),be=sum32_5$1(rotl32$1(se,5),ft_1(ge,ae,de,ue),pe,c[ie],sha1_K[ge]);pe=ue,ue=de,de=rotl32$1(ae,30),ae=se,se=be}this.h[0]=sum32$2(this.h[0],se),this.h[1]=sum32$2(this.h[1],ae),this.h[2]=sum32$2(this.h[2],de),this.h[3]=sum32$2(this.h[3],ue),this.h[4]=sum32$2(this.h[4],pe)};SHA1.prototype._digest=function(t){return t==="hex"?utils$l.toHex32(this.h,"big"):utils$l.split32(this.h,"big")};var utils$k=utils$o,common$2=common$5,shaCommon=common$4,assert$e=minimalisticAssert$1,sum32$1=utils$k.sum32,sum32_4$1=utils$k.sum32_4,sum32_5=utils$k.sum32_5,ch32=shaCommon.ch32,maj32=shaCommon.maj32,s0_256=shaCommon.s0_256,s1_256=shaCommon.s1_256,g0_256=shaCommon.g0_256,g1_256=shaCommon.g1_256,BlockHash$2=common$2.BlockHash,sha256_K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function SHA256$2(){if(!(this instanceof SHA256$2))return new SHA256$2;BlockHash$2.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=sha256_K,this.W=new Array(64)}utils$k.inherits(SHA256$2,BlockHash$2);var _256=SHA256$2;SHA256$2.blockSize=512;SHA256$2.outSize=256;SHA256$2.hmacStrength=192;SHA256$2.padLength=64;SHA256$2.prototype._update=function(t,n){for(var c=this.W,ie=0;ie<16;ie++)c[ie]=t[n+ie];for(;ie<c.length;ie++)c[ie]=sum32_4$1(g1_256(c[ie-2]),c[ie-7],g0_256(c[ie-15]),c[ie-16]);var se=this.h[0],ae=this.h[1],de=this.h[2],ue=this.h[3],pe=this.h[4],ge=this.h[5],be=this.h[6],_e=this.h[7];for(assert$e(this.k.length===c.length),ie=0;ie<c.length;ie++){var we=sum32_5(_e,s1_256(pe),ch32(pe,ge,be),this.k[ie],c[ie]),qe=sum32$1(s0_256(se),maj32(se,ae,de));_e=be,be=ge,ge=pe,pe=sum32$1(ue,we),ue=de,de=ae,ae=se,se=sum32$1(we,qe)}this.h[0]=sum32$1(this.h[0],se),this.h[1]=sum32$1(this.h[1],ae),this.h[2]=sum32$1(this.h[2],de),this.h[3]=sum32$1(this.h[3],ue),this.h[4]=sum32$1(this.h[4],pe),this.h[5]=sum32$1(this.h[5],ge),this.h[6]=sum32$1(this.h[6],be),this.h[7]=sum32$1(this.h[7],_e)};SHA256$2.prototype._digest=function(t){return t==="hex"?utils$k.toHex32(this.h,"big"):utils$k.split32(this.h,"big")};var utils$j=utils$o,SHA256$1=_256;function SHA224(){if(!(this instanceof SHA224))return new SHA224;SHA256$1.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}utils$j.inherits(SHA224,SHA256$1);var _224=SHA224;SHA224.blockSize=512;SHA224.outSize=224;SHA224.hmacStrength=192;SHA224.padLength=64;SHA224.prototype._digest=function(t){return t==="hex"?utils$j.toHex32(this.h.slice(0,7),"big"):utils$j.split32(this.h.slice(0,7),"big")};var utils$i=utils$o,common$1=common$5,assert$d=minimalisticAssert$1,rotr64_hi=utils$i.rotr64_hi,rotr64_lo=utils$i.rotr64_lo,shr64_hi=utils$i.shr64_hi,shr64_lo=utils$i.shr64_lo,sum64=utils$i.sum64,sum64_hi=utils$i.sum64_hi,sum64_lo=utils$i.sum64_lo,sum64_4_hi=utils$i.sum64_4_hi,sum64_4_lo=utils$i.sum64_4_lo,sum64_5_hi=utils$i.sum64_5_hi,sum64_5_lo=utils$i.sum64_5_lo,BlockHash$1=common$1.BlockHash,sha512_K=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function SHA512$2(){if(!(this instanceof SHA512$2))return new SHA512$2;BlockHash$1.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=sha512_K,this.W=new Array(160)}utils$i.inherits(SHA512$2,BlockHash$1);var _512=SHA512$2;SHA512$2.blockSize=1024;SHA512$2.outSize=512;SHA512$2.hmacStrength=192;SHA512$2.padLength=128;SHA512$2.prototype._prepareBlock=function(t,n){for(var c=this.W,ie=0;ie<32;ie++)c[ie]=t[n+ie];for(;ie<c.length;ie+=2){var se=g1_512_hi(c[ie-4],c[ie-3]),ae=g1_512_lo(c[ie-4],c[ie-3]),de=c[ie-14],ue=c[ie-13],pe=g0_512_hi(c[ie-30],c[ie-29]),ge=g0_512_lo(c[ie-30],c[ie-29]),be=c[ie-32],_e=c[ie-31];c[ie]=sum64_4_hi(se,ae,de,ue,pe,ge,be,_e),c[ie+1]=sum64_4_lo(se,ae,de,ue,pe,ge,be,_e)}};SHA512$2.prototype._update=function(t,n){this._prepareBlock(t,n);var c=this.W,ie=this.h[0],se=this.h[1],ae=this.h[2],de=this.h[3],ue=this.h[4],pe=this.h[5],ge=this.h[6],be=this.h[7],_e=this.h[8],we=this.h[9],qe=this.h[10],Ye=this.h[11],Ge=this.h[12],Ze=this.h[13],He=this.h[14],Ht=this.h[15];assert$d(this.k.length===c.length);for(var un=0;un<c.length;un+=2){var De=He,$e=Ht,me=s1_512_hi(_e,we),Gt=s1_512_lo(_e,we),mn=ch64_hi(_e,we,qe,Ye,Ge),dn=ch64_lo(_e,we,qe,Ye,Ge,Ze),jt=this.k[un],le=this.k[un+1],Pe=c[un],xe=c[un+1],ze=sum64_5_hi(De,$e,me,Gt,mn,dn,jt,le,Pe,xe),Ft=sum64_5_lo(De,$e,me,Gt,mn,dn,jt,le,Pe,xe);De=s0_512_hi(ie,se),$e=s0_512_lo(ie,se),me=maj64_hi(ie,se,ae,de,ue),Gt=maj64_lo(ie,se,ae,de,ue,pe);var yn=sum64_hi(De,$e,me,Gt),Zt=sum64_lo(De,$e,me,Gt);He=Ge,Ht=Ze,Ge=qe,Ze=Ye,qe=_e,Ye=we,_e=sum64_hi(ge,be,ze,Ft),we=sum64_lo(be,be,ze,Ft),ge=ue,be=pe,ue=ae,pe=de,ae=ie,de=se,ie=sum64_hi(ze,Ft,yn,Zt),se=sum64_lo(ze,Ft,yn,Zt)}sum64(this.h,0,ie,se),sum64(this.h,2,ae,de),sum64(this.h,4,ue,pe),sum64(this.h,6,ge,be),sum64(this.h,8,_e,we),sum64(this.h,10,qe,Ye),sum64(this.h,12,Ge,Ze),sum64(this.h,14,He,Ht)};SHA512$2.prototype._digest=function(t){return t==="hex"?utils$i.toHex32(this.h,"big"):utils$i.split32(this.h,"big")};function ch64_hi(t,n,c,ie,se){var ae=t&c^~t&se;return ae<0&&(ae+=4294967296),ae}function ch64_lo(t,n,c,ie,se,ae){var de=n&ie^~n&ae;return de<0&&(de+=4294967296),de}function maj64_hi(t,n,c,ie,se){var ae=t&c^t&se^c&se;return ae<0&&(ae+=4294967296),ae}function maj64_lo(t,n,c,ie,se,ae){var de=n&ie^n&ae^ie&ae;return de<0&&(de+=4294967296),de}function s0_512_hi(t,n){var c=rotr64_hi(t,n,28),ie=rotr64_hi(n,t,2),se=rotr64_hi(n,t,7),ae=c^ie^se;return ae<0&&(ae+=4294967296),ae}function s0_512_lo(t,n){var c=rotr64_lo(t,n,28),ie=rotr64_lo(n,t,2),se=rotr64_lo(n,t,7),ae=c^ie^se;return ae<0&&(ae+=4294967296),ae}function s1_512_hi(t,n){var c=rotr64_hi(t,n,14),ie=rotr64_hi(t,n,18),se=rotr64_hi(n,t,9),ae=c^ie^se;return ae<0&&(ae+=4294967296),ae}function s1_512_lo(t,n){var c=rotr64_lo(t,n,14),ie=rotr64_lo(t,n,18),se=rotr64_lo(n,t,9),ae=c^ie^se;return ae<0&&(ae+=4294967296),ae}function g0_512_hi(t,n){var c=rotr64_hi(t,n,1),ie=rotr64_hi(t,n,8),se=shr64_hi(t,n,7),ae=c^ie^se;return ae<0&&(ae+=4294967296),ae}function g0_512_lo(t,n){var c=rotr64_lo(t,n,1),ie=rotr64_lo(t,n,8),se=shr64_lo(t,n,7),ae=c^ie^se;return ae<0&&(ae+=4294967296),ae}function g1_512_hi(t,n){var c=rotr64_hi(t,n,19),ie=rotr64_hi(n,t,29),se=shr64_hi(t,n,6),ae=c^ie^se;return ae<0&&(ae+=4294967296),ae}function g1_512_lo(t,n){var c=rotr64_lo(t,n,19),ie=rotr64_lo(n,t,29),se=shr64_lo(t,n,6),ae=c^ie^se;return ae<0&&(ae+=4294967296),ae}var utils$h=utils$o,SHA512$1=_512;function SHA384(){if(!(this instanceof SHA384))return new SHA384;SHA512$1.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}utils$h.inherits(SHA384,SHA512$1);var _384=SHA384;SHA384.blockSize=1024;SHA384.outSize=384;SHA384.hmacStrength=192;SHA384.padLength=128;SHA384.prototype._digest=function(t){return t==="hex"?utils$h.toHex32(this.h.slice(0,12),"big"):utils$h.split32(this.h.slice(0,12),"big")};sha$1.sha1=_1;sha$1.sha224=_224;sha$1.sha256=_256;sha$1.sha384=_384;sha$1.sha512=_512;var ripemd$1={},utils$g=utils$o,common$6=common$5,rotl32=utils$g.rotl32,sum32=utils$g.sum32,sum32_3=utils$g.sum32_3,sum32_4=utils$g.sum32_4,BlockHash=common$6.BlockHash;function RIPEMD160$1(){if(!(this instanceof RIPEMD160$1))return new RIPEMD160$1;BlockHash.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}utils$g.inherits(RIPEMD160$1,BlockHash);ripemd$1.ripemd160=RIPEMD160$1;RIPEMD160$1.blockSize=512;RIPEMD160$1.outSize=160;RIPEMD160$1.hmacStrength=192;RIPEMD160$1.padLength=64;RIPEMD160$1.prototype._update=function(t,n){for(var c=this.h[0],ie=this.h[1],se=this.h[2],ae=this.h[3],de=this.h[4],ue=c,pe=ie,ge=se,be=ae,_e=de,we=0;we<80;we++){var qe=sum32(rotl32(sum32_4(c,f$2(we,ie,se,ae),t[r$1[we]+n],K$3(we)),s$2[we]),de);c=de,de=ae,ae=rotl32(se,10),se=ie,ie=qe,qe=sum32(rotl32(sum32_4(ue,f$2(79-we,pe,ge,be),t[rh[we]+n],Kh(we)),sh[we]),_e),ue=_e,_e=be,be=rotl32(ge,10),ge=pe,pe=qe}qe=sum32_3(this.h[1],se,be),this.h[1]=sum32_3(this.h[2],ae,_e),this.h[2]=sum32_3(this.h[3],de,ue),this.h[3]=sum32_3(this.h[4],c,pe),this.h[4]=sum32_3(this.h[0],ie,ge),this.h[0]=qe};RIPEMD160$1.prototype._digest=function(t){return t==="hex"?utils$g.toHex32(this.h,"little"):utils$g.split32(this.h,"little")};function f$2(t,n,c,ie){return t<=15?n^c^ie:t<=31?n&c|~n&ie:t<=47?(n|~c)^ie:t<=63?n&ie|c&~ie:n^(c|~ie)}function K$3(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function Kh(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}var r$1=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],rh=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],s$2=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],sh=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],utils$f=utils$o,assert$c=minimalisticAssert$1;function Hmac(t,n,c){if(!(this instanceof Hmac))return new Hmac(t,n,c);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(utils$f.toArray(n,c))}var hmac$1$1=Hmac;Hmac.prototype._init=function(t){t.length>this.blockSize&&(t=new this.Hash().update(t).digest()),assert$c(t.length<=this.blockSize);for(var n=t.length;n<this.blockSize;n++)t.push(0);for(n=0;n<t.length;n++)t[n]^=54;for(this.inner=new this.Hash().update(t),n=0;n<t.length;n++)t[n]^=106;this.outer=new this.Hash().update(t)};Hmac.prototype.update=function(t,n){return this.inner.update(t,n),this};Hmac.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)};(function(t){var n=t;n.utils=utils$o,n.common=common$5,n.sha=sha$1,n.ripemd=ripemd$1,n.hmac=hmac$1$1,n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160})(hash$4$1);const hash$3$1=getDefaultExportFromCjs$2(hash$4$1);function createCommonjsModule(t,n,c){return c={path:n,exports:{},require:function(ie,se){return commonjsRequire$1(ie,se??c.path)}},t(c,c.exports),c.exports}function commonjsRequire$1(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var minimalisticAssert=assert$b;function assert$b(t,n){if(!t)throw new Error(n||"Assertion failed")}assert$b.equal=function(t,n,c){if(t!=n)throw new Error(c||"Assertion failed: "+t+" != "+n)};var utils_1$7=createCommonjsModule(function(t,n){var c=n;function ie(de,ue){if(Array.isArray(de))return de.slice();if(!de)return[];var pe=[];if(typeof de!="string"){for(var ge=0;ge<de.length;ge++)pe[ge]=de[ge]|0;return pe}if(ue==="hex"){de=de.replace(/[^a-z0-9]+/ig,""),de.length%2!==0&&(de="0"+de);for(var ge=0;ge<de.length;ge+=2)pe.push(parseInt(de[ge]+de[ge+1],16))}else for(var ge=0;ge<de.length;ge++){var be=de.charCodeAt(ge),_e=be>>8,we=be&255;_e?pe.push(_e,we):pe.push(we)}return pe}c.toArray=ie;function se(de){return de.length===1?"0"+de:de}c.zero2=se;function ae(de){for(var ue="",pe=0;pe<de.length;pe++)ue+=se(de[pe].toString(16));return ue}c.toHex=ae,c.encode=function(de,ue){return ue==="hex"?ae(de):de}}),utils_1$1$1=createCommonjsModule(function(t,n){var c=n;c.assert=minimalisticAssert,c.toArray=utils_1$7.toArray,c.zero2=utils_1$7.zero2,c.toHex=utils_1$7.toHex,c.encode=utils_1$7.encode;function ie(pe,ge,be){var _e=new Array(Math.max(pe.bitLength(),be)+1),we;for(we=0;we<_e.length;we+=1)_e[we]=0;var qe=1<<ge+1,Ye=pe.clone();for(we=0;we<_e.length;we++){var Ge,Ze=Ye.andln(qe-1);Ye.isOdd()?(Ze>(qe>>1)-1?Ge=(qe>>1)-Ze:Ge=Ze,Ye.isubn(Ge)):Ge=0,_e[we]=Ge,Ye.iushrn(1)}return _e}c.getNAF=ie;function se(pe,ge){var be=[[],[]];pe=pe.clone(),ge=ge.clone();for(var _e=0,we=0,qe;pe.cmpn(-_e)>0||ge.cmpn(-we)>0;){var Ye=pe.andln(3)+_e&3,Ge=ge.andln(3)+we&3;Ye===3&&(Ye=-1),Ge===3&&(Ge=-1);var Ze;Ye&1?(qe=pe.andln(7)+_e&7,(qe===3||qe===5)&&Ge===2?Ze=-Ye:Ze=Ye):Ze=0,be[0].push(Ze);var He;Ge&1?(qe=ge.andln(7)+we&7,(qe===3||qe===5)&&Ye===2?He=-Ge:He=Ge):He=0,be[1].push(He),2*_e===Ze+1&&(_e=1-_e),2*we===He+1&&(we=1-we),pe.iushrn(1),ge.iushrn(1)}return be}c.getJSF=se;function ae(pe,ge,be){var _e="_"+ge;pe.prototype[ge]=function(){return this[_e]!==void 0?this[_e]:this[_e]=be.call(this)}}c.cachedProperty=ae;function de(pe){return typeof pe=="string"?c.toArray(pe,"hex"):pe}c.parseBytes=de;function ue(pe){return new BN$8(pe,"hex","le")}c.intFromLE=ue}),getNAF$1=utils_1$1$1.getNAF,getJSF$1=utils_1$1$1.getJSF,assert$1$1=utils_1$1$1.assert;function BaseCurve$1(t,n){this.type=t,this.p=new BN$8(n.p,16),this.red=n.prime?BN$8.red(n.prime):BN$8.mont(this.p),this.zero=new BN$8(0).toRed(this.red),this.one=new BN$8(1).toRed(this.red),this.two=new BN$8(2).toRed(this.red),this.n=n.n&&new BN$8(n.n,16),this.g=n.g&&this.pointFromJSON(n.g,n.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var c=this.n&&this.p.div(this.n);!c||c.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var base$5=BaseCurve$1;BaseCurve$1.prototype.point=function(){throw new Error("Not implemented")};BaseCurve$1.prototype.validate=function(){throw new Error("Not implemented")};BaseCurve$1.prototype._fixedNafMul=function(t,n){assert$1$1(t.precomputed);var c=t._getDoubles(),ie=getNAF$1(n,1,this._bitLength),se=(1<<c.step+1)-(c.step%2===0?2:1);se/=3;var ae=[],de,ue;for(de=0;de<ie.length;de+=c.step){ue=0;for(var pe=de+c.step-1;pe>=de;pe--)ue=(ue<<1)+ie[pe];ae.push(ue)}for(var ge=this.jpoint(null,null,null),be=this.jpoint(null,null,null),_e=se;_e>0;_e--){for(de=0;de<ae.length;de++)ue=ae[de],ue===_e?be=be.mixedAdd(c.points[de]):ue===-_e&&(be=be.mixedAdd(c.points[de].neg()));ge=ge.add(be)}return ge.toP()};BaseCurve$1.prototype._wnafMul=function(t,n){var c=4,ie=t._getNAFPoints(c);c=ie.wnd;for(var se=ie.points,ae=getNAF$1(n,c,this._bitLength),de=this.jpoint(null,null,null),ue=ae.length-1;ue>=0;ue--){for(var pe=0;ue>=0&&ae[ue]===0;ue--)pe++;if(ue>=0&&pe++,de=de.dblp(pe),ue<0)break;var ge=ae[ue];assert$1$1(ge!==0),t.type==="affine"?ge>0?de=de.mixedAdd(se[ge-1>>1]):de=de.mixedAdd(se[-ge-1>>1].neg()):ge>0?de=de.add(se[ge-1>>1]):de=de.add(se[-ge-1>>1].neg())}return t.type==="affine"?de.toP():de};BaseCurve$1.prototype._wnafMulAdd=function(t,n,c,ie,se){var ae=this._wnafT1,de=this._wnafT2,ue=this._wnafT3,pe=0,ge,be,_e;for(ge=0;ge<ie;ge++){_e=n[ge];var we=_e._getNAFPoints(t);ae[ge]=we.wnd,de[ge]=we.points}for(ge=ie-1;ge>=1;ge-=2){var qe=ge-1,Ye=ge;if(ae[qe]!==1||ae[Ye]!==1){ue[qe]=getNAF$1(c[qe],ae[qe],this._bitLength),ue[Ye]=getNAF$1(c[Ye],ae[Ye],this._bitLength),pe=Math.max(ue[qe].length,pe),pe=Math.max(ue[Ye].length,pe);continue}var Ge=[n[qe],null,null,n[Ye]];n[qe].y.cmp(n[Ye].y)===0?(Ge[1]=n[qe].add(n[Ye]),Ge[2]=n[qe].toJ().mixedAdd(n[Ye].neg())):n[qe].y.cmp(n[Ye].y.redNeg())===0?(Ge[1]=n[qe].toJ().mixedAdd(n[Ye]),Ge[2]=n[qe].add(n[Ye].neg())):(Ge[1]=n[qe].toJ().mixedAdd(n[Ye]),Ge[2]=n[qe].toJ().mixedAdd(n[Ye].neg()));var Ze=[-3,-1,-5,-7,0,7,5,1,3],He=getJSF$1(c[qe],c[Ye]);for(pe=Math.max(He[0].length,pe),ue[qe]=new Array(pe),ue[Ye]=new Array(pe),be=0;be<pe;be++){var Ht=He[0][be]|0,un=He[1][be]|0;ue[qe][be]=Ze[(Ht+1)*3+(un+1)],ue[Ye][be]=0,de[qe]=Ge}}var De=this.jpoint(null,null,null),$e=this._wnafT4;for(ge=pe;ge>=0;ge--){for(var me=0;ge>=0;){var Gt=!0;for(be=0;be<ie;be++)$e[be]=ue[be][ge]|0,$e[be]!==0&&(Gt=!1);if(!Gt)break;me++,ge--}if(ge>=0&&me++,De=De.dblp(me),ge<0)break;for(be=0;be<ie;be++){var mn=$e[be];mn!==0&&(mn>0?_e=de[be][mn-1>>1]:mn<0&&(_e=de[be][-mn-1>>1].neg()),_e.type==="affine"?De=De.mixedAdd(_e):De=De.add(_e))}}for(ge=0;ge<ie;ge++)de[ge]=null;return se?De:De.toP()};function BasePoint$1(t,n){this.curve=t,this.type=n,this.precomputed=null}BaseCurve$1.BasePoint=BasePoint$1;BasePoint$1.prototype.eq=function(){throw new Error("Not implemented")};BasePoint$1.prototype.validate=function(){return this.curve.validate(this)};BaseCurve$1.prototype.decodePoint=function(t,n){t=utils_1$1$1.toArray(t,n);var c=this.p.byteLength();if((t[0]===4||t[0]===6||t[0]===7)&&t.length-1===2*c){t[0]===6?assert$1$1(t[t.length-1]%2===0):t[0]===7&&assert$1$1(t[t.length-1]%2===1);var ie=this.point(t.slice(1,1+c),t.slice(1+c,1+2*c));return ie}else if((t[0]===2||t[0]===3)&&t.length-1===c)return this.pointFromX(t.slice(1,1+c),t[0]===3);throw new Error("Unknown point format")};BasePoint$1.prototype.encodeCompressed=function(t){return this.encode(t,!0)};BasePoint$1.prototype._encode=function(t){var n=this.curve.p.byteLength(),c=this.getX().toArray("be",n);return t?[this.getY().isEven()?2:3].concat(c):[4].concat(c,this.getY().toArray("be",n))};BasePoint$1.prototype.encode=function(t,n){return utils_1$1$1.encode(this._encode(n),t)};BasePoint$1.prototype.precompute=function(t){if(this.precomputed)return this;var n={doubles:null,naf:null,beta:null};return n.naf=this._getNAFPoints(8),n.doubles=this._getDoubles(4,t),n.beta=this._getBeta(),this.precomputed=n,this};BasePoint$1.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var n=this.precomputed.doubles;return n?n.points.length>=Math.ceil((t.bitLength()+1)/n.step):!1};BasePoint$1.prototype._getDoubles=function(t,n){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var c=[this],ie=this,se=0;se<n;se+=t){for(var ae=0;ae<t;ae++)ie=ie.dbl();c.push(ie)}return{step:t,points:c}};BasePoint$1.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var n=[this],c=(1<<t)-1,ie=c===1?null:this.dbl(),se=1;se<c;se++)n[se]=n[se-1].add(ie);return{wnd:t,points:n}};BasePoint$1.prototype._getBeta=function(){return null};BasePoint$1.prototype.dblp=function(t){for(var n=this,c=0;c<t;c++)n=n.dbl();return n};var inherits_browser=createCommonjsModule(function(t){typeof Object.create=="function"?t.exports=function(n,c){c&&(n.super_=c,n.prototype=Object.create(c.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(n,c){if(c){n.super_=c;var ie=function(){};ie.prototype=c.prototype,n.prototype=new ie,n.prototype.constructor=n}}}),assert$2$1=utils_1$1$1.assert;function ShortCurve$1(t){base$5.call(this,"short",t),this.a=new BN$8(t.a,16).toRed(this.red),this.b=new BN$8(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}inherits_browser(ShortCurve$1,base$5);var short_1=ShortCurve$1;ShortCurve$1.prototype._getEndomorphism=function(t){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var n,c;if(t.beta)n=new BN$8(t.beta,16).toRed(this.red);else{var ie=this._getEndoRoots(this.p);n=ie[0].cmp(ie[1])<0?ie[0]:ie[1],n=n.toRed(this.red)}if(t.lambda)c=new BN$8(t.lambda,16);else{var se=this._getEndoRoots(this.n);this.g.mul(se[0]).x.cmp(this.g.x.redMul(n))===0?c=se[0]:(c=se[1],assert$2$1(this.g.mul(c).x.cmp(this.g.x.redMul(n))===0))}var ae;return t.basis?ae=t.basis.map(function(de){return{a:new BN$8(de.a,16),b:new BN$8(de.b,16)}}):ae=this._getEndoBasis(c),{beta:n,lambda:c,basis:ae}}};ShortCurve$1.prototype._getEndoRoots=function(t){var n=t===this.p?this.red:BN$8.mont(t),c=new BN$8(2).toRed(n).redInvm(),ie=c.redNeg(),se=new BN$8(3).toRed(n).redNeg().redSqrt().redMul(c),ae=ie.redAdd(se).fromRed(),de=ie.redSub(se).fromRed();return[ae,de]};ShortCurve$1.prototype._getEndoBasis=function(t){for(var n=this.n.ushrn(Math.floor(this.n.bitLength()/2)),c=t,ie=this.n.clone(),se=new BN$8(1),ae=new BN$8(0),de=new BN$8(0),ue=new BN$8(1),pe,ge,be,_e,we,qe,Ye,Ge=0,Ze,He;c.cmpn(0)!==0;){var Ht=ie.div(c);Ze=ie.sub(Ht.mul(c)),He=de.sub(Ht.mul(se));var un=ue.sub(Ht.mul(ae));if(!be&&Ze.cmp(n)<0)pe=Ye.neg(),ge=se,be=Ze.neg(),_e=He;else if(be&&++Ge===2)break;Ye=Ze,ie=c,c=Ze,de=se,se=He,ue=ae,ae=un}we=Ze.neg(),qe=He;var De=be.sqr().add(_e.sqr()),$e=we.sqr().add(qe.sqr());return $e.cmp(De)>=0&&(we=pe,qe=ge),be.negative&&(be=be.neg(),_e=_e.neg()),we.negative&&(we=we.neg(),qe=qe.neg()),[{a:be,b:_e},{a:we,b:qe}]};ShortCurve$1.prototype._endoSplit=function(t){var n=this.endo.basis,c=n[0],ie=n[1],se=ie.b.mul(t).divRound(this.n),ae=c.b.neg().mul(t).divRound(this.n),de=se.mul(c.a),ue=ae.mul(ie.a),pe=se.mul(c.b),ge=ae.mul(ie.b),be=t.sub(de).sub(ue),_e=pe.add(ge).neg();return{k1:be,k2:_e}};ShortCurve$1.prototype.pointFromX=function(t,n){t=new BN$8(t,16),t.red||(t=t.toRed(this.red));var c=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),ie=c.redSqrt();if(ie.redSqr().redSub(c).cmp(this.zero)!==0)throw new Error("invalid point");var se=ie.fromRed().isOdd();return(n&&!se||!n&&se)&&(ie=ie.redNeg()),this.point(t,ie)};ShortCurve$1.prototype.validate=function(t){if(t.inf)return!0;var n=t.x,c=t.y,ie=this.a.redMul(n),se=n.redSqr().redMul(n).redIAdd(ie).redIAdd(this.b);return c.redSqr().redISub(se).cmpn(0)===0};ShortCurve$1.prototype._endoWnafMulAdd=function(t,n,c){for(var ie=this._endoWnafT1,se=this._endoWnafT2,ae=0;ae<t.length;ae++){var de=this._endoSplit(n[ae]),ue=t[ae],pe=ue._getBeta();de.k1.negative&&(de.k1.ineg(),ue=ue.neg(!0)),de.k2.negative&&(de.k2.ineg(),pe=pe.neg(!0)),ie[ae*2]=ue,ie[ae*2+1]=pe,se[ae*2]=de.k1,se[ae*2+1]=de.k2}for(var ge=this._wnafMulAdd(1,ie,se,ae*2,c),be=0;be<ae*2;be++)ie[be]=null,se[be]=null;return ge};function Point$3(t,n,c,ie){base$5.BasePoint.call(this,t,"affine"),n===null&&c===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new BN$8(n,16),this.y=new BN$8(c,16),ie&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}inherits_browser(Point$3,base$5.BasePoint);ShortCurve$1.prototype.point=function(t,n,c){return new Point$3(this,t,n,c)};ShortCurve$1.prototype.pointFromJSON=function(t,n){return Point$3.fromJSON(this,t,n)};Point$3.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var n=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var c=this.curve,ie=function(se){return c.point(se.x.redMul(c.endo.beta),se.y)};t.beta=n,n.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(ie)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(ie)}}}return n}};Point$3.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};Point$3.fromJSON=function(t,n,c){typeof n=="string"&&(n=JSON.parse(n));var ie=t.point(n[0],n[1],c);if(!n[2])return ie;function se(de){return t.point(de[0],de[1],c)}var ae=n[2];return ie.precomputed={beta:null,doubles:ae.doubles&&{step:ae.doubles.step,points:[ie].concat(ae.doubles.points.map(se))},naf:ae.naf&&{wnd:ae.naf.wnd,points:[ie].concat(ae.naf.points.map(se))}},ie};Point$3.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};Point$3.prototype.isInfinity=function(){return this.inf};Point$3.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var n=this.y.redSub(t.y);n.cmpn(0)!==0&&(n=n.redMul(this.x.redSub(t.x).redInvm()));var c=n.redSqr().redISub(this.x).redISub(t.x),ie=n.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,ie)};Point$3.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var n=this.curve.a,c=this.x.redSqr(),ie=t.redInvm(),se=c.redAdd(c).redIAdd(c).redIAdd(n).redMul(ie),ae=se.redSqr().redISub(this.x.redAdd(this.x)),de=se.redMul(this.x.redSub(ae)).redISub(this.y);return this.curve.point(ae,de)};Point$3.prototype.getX=function(){return this.x.fromRed()};Point$3.prototype.getY=function(){return this.y.fromRed()};Point$3.prototype.mul=function(t){return t=new BN$8(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)};Point$3.prototype.mulAdd=function(t,n,c){var ie=[this,n],se=[t,c];return this.curve.endo?this.curve._endoWnafMulAdd(ie,se):this.curve._wnafMulAdd(1,ie,se,2)};Point$3.prototype.jmulAdd=function(t,n,c){var ie=[this,n],se=[t,c];return this.curve.endo?this.curve._endoWnafMulAdd(ie,se,!0):this.curve._wnafMulAdd(1,ie,se,2,!0)};Point$3.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)};Point$3.prototype.neg=function(t){if(this.inf)return this;var n=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var c=this.precomputed,ie=function(se){return se.neg()};n.precomputed={naf:c.naf&&{wnd:c.naf.wnd,points:c.naf.points.map(ie)},doubles:c.doubles&&{step:c.doubles.step,points:c.doubles.points.map(ie)}}}return n};Point$3.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t};function JPoint$1(t,n,c,ie){base$5.BasePoint.call(this,t,"jacobian"),n===null&&c===null&&ie===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new BN$8(0)):(this.x=new BN$8(n,16),this.y=new BN$8(c,16),this.z=new BN$8(ie,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}inherits_browser(JPoint$1,base$5.BasePoint);ShortCurve$1.prototype.jpoint=function(t,n,c){return new JPoint$1(this,t,n,c)};JPoint$1.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),n=t.redSqr(),c=this.x.redMul(n),ie=this.y.redMul(n).redMul(t);return this.curve.point(c,ie)};JPoint$1.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};JPoint$1.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var n=t.z.redSqr(),c=this.z.redSqr(),ie=this.x.redMul(n),se=t.x.redMul(c),ae=this.y.redMul(n.redMul(t.z)),de=t.y.redMul(c.redMul(this.z)),ue=ie.redSub(se),pe=ae.redSub(de);if(ue.cmpn(0)===0)return pe.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var ge=ue.redSqr(),be=ge.redMul(ue),_e=ie.redMul(ge),we=pe.redSqr().redIAdd(be).redISub(_e).redISub(_e),qe=pe.redMul(_e.redISub(we)).redISub(ae.redMul(be)),Ye=this.z.redMul(t.z).redMul(ue);return this.curve.jpoint(we,qe,Ye)};JPoint$1.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var n=this.z.redSqr(),c=this.x,ie=t.x.redMul(n),se=this.y,ae=t.y.redMul(n).redMul(this.z),de=c.redSub(ie),ue=se.redSub(ae);if(de.cmpn(0)===0)return ue.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var pe=de.redSqr(),ge=pe.redMul(de),be=c.redMul(pe),_e=ue.redSqr().redIAdd(ge).redISub(be).redISub(be),we=ue.redMul(be.redISub(_e)).redISub(se.redMul(ge)),qe=this.z.redMul(de);return this.curve.jpoint(_e,we,qe)};JPoint$1.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var n;if(this.curve.zeroA||this.curve.threeA){var c=this;for(n=0;n<t;n++)c=c.dbl();return c}var ie=this.curve.a,se=this.curve.tinv,ae=this.x,de=this.y,ue=this.z,pe=ue.redSqr().redSqr(),ge=de.redAdd(de);for(n=0;n<t;n++){var be=ae.redSqr(),_e=ge.redSqr(),we=_e.redSqr(),qe=be.redAdd(be).redIAdd(be).redIAdd(ie.redMul(pe)),Ye=ae.redMul(_e),Ge=qe.redSqr().redISub(Ye.redAdd(Ye)),Ze=Ye.redISub(Ge),He=qe.redMul(Ze);He=He.redIAdd(He).redISub(we);var Ht=ge.redMul(ue);n+1<t&&(pe=pe.redMul(we)),ae=Ge,ue=Ht,ge=He}return this.curve.jpoint(ae,ge.redMul(se),ue)};JPoint$1.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};JPoint$1.prototype._zeroDbl=function(){var t,n,c;if(this.zOne){var ie=this.x.redSqr(),se=this.y.redSqr(),ae=se.redSqr(),de=this.x.redAdd(se).redSqr().redISub(ie).redISub(ae);de=de.redIAdd(de);var ue=ie.redAdd(ie).redIAdd(ie),pe=ue.redSqr().redISub(de).redISub(de),ge=ae.redIAdd(ae);ge=ge.redIAdd(ge),ge=ge.redIAdd(ge),t=pe,n=ue.redMul(de.redISub(pe)).redISub(ge),c=this.y.redAdd(this.y)}else{var be=this.x.redSqr(),_e=this.y.redSqr(),we=_e.redSqr(),qe=this.x.redAdd(_e).redSqr().redISub(be).redISub(we);qe=qe.redIAdd(qe);var Ye=be.redAdd(be).redIAdd(be),Ge=Ye.redSqr(),Ze=we.redIAdd(we);Ze=Ze.redIAdd(Ze),Ze=Ze.redIAdd(Ze),t=Ge.redISub(qe).redISub(qe),n=Ye.redMul(qe.redISub(t)).redISub(Ze),c=this.y.redMul(this.z),c=c.redIAdd(c)}return this.curve.jpoint(t,n,c)};JPoint$1.prototype._threeDbl=function(){var t,n,c;if(this.zOne){var ie=this.x.redSqr(),se=this.y.redSqr(),ae=se.redSqr(),de=this.x.redAdd(se).redSqr().redISub(ie).redISub(ae);de=de.redIAdd(de);var ue=ie.redAdd(ie).redIAdd(ie).redIAdd(this.curve.a),pe=ue.redSqr().redISub(de).redISub(de);t=pe;var ge=ae.redIAdd(ae);ge=ge.redIAdd(ge),ge=ge.redIAdd(ge),n=ue.redMul(de.redISub(pe)).redISub(ge),c=this.y.redAdd(this.y)}else{var be=this.z.redSqr(),_e=this.y.redSqr(),we=this.x.redMul(_e),qe=this.x.redSub(be).redMul(this.x.redAdd(be));qe=qe.redAdd(qe).redIAdd(qe);var Ye=we.redIAdd(we);Ye=Ye.redIAdd(Ye);var Ge=Ye.redAdd(Ye);t=qe.redSqr().redISub(Ge),c=this.y.redAdd(this.z).redSqr().redISub(_e).redISub(be);var Ze=_e.redSqr();Ze=Ze.redIAdd(Ze),Ze=Ze.redIAdd(Ze),Ze=Ze.redIAdd(Ze),n=qe.redMul(Ye.redISub(t)).redISub(Ze)}return this.curve.jpoint(t,n,c)};JPoint$1.prototype._dbl=function(){var t=this.curve.a,n=this.x,c=this.y,ie=this.z,se=ie.redSqr().redSqr(),ae=n.redSqr(),de=c.redSqr(),ue=ae.redAdd(ae).redIAdd(ae).redIAdd(t.redMul(se)),pe=n.redAdd(n);pe=pe.redIAdd(pe);var ge=pe.redMul(de),be=ue.redSqr().redISub(ge.redAdd(ge)),_e=ge.redISub(be),we=de.redSqr();we=we.redIAdd(we),we=we.redIAdd(we),we=we.redIAdd(we);var qe=ue.redMul(_e).redISub(we),Ye=c.redAdd(c).redMul(ie);return this.curve.jpoint(be,qe,Ye)};JPoint$1.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),n=this.y.redSqr(),c=this.z.redSqr(),ie=n.redSqr(),se=t.redAdd(t).redIAdd(t),ae=se.redSqr(),de=this.x.redAdd(n).redSqr().redISub(t).redISub(ie);de=de.redIAdd(de),de=de.redAdd(de).redIAdd(de),de=de.redISub(ae);var ue=de.redSqr(),pe=ie.redIAdd(ie);pe=pe.redIAdd(pe),pe=pe.redIAdd(pe),pe=pe.redIAdd(pe);var ge=se.redIAdd(de).redSqr().redISub(ae).redISub(ue).redISub(pe),be=n.redMul(ge);be=be.redIAdd(be),be=be.redIAdd(be);var _e=this.x.redMul(ue).redISub(be);_e=_e.redIAdd(_e),_e=_e.redIAdd(_e);var we=this.y.redMul(ge.redMul(pe.redISub(ge)).redISub(de.redMul(ue)));we=we.redIAdd(we),we=we.redIAdd(we),we=we.redIAdd(we);var qe=this.z.redAdd(de).redSqr().redISub(c).redISub(ue);return this.curve.jpoint(_e,we,qe)};JPoint$1.prototype.mul=function(t,n){return t=new BN$8(t,n),this.curve._wnafMul(this,t)};JPoint$1.prototype.eq=function(t){if(t.type==="affine")return this.eq(t.toJ());if(this===t)return!0;var n=this.z.redSqr(),c=t.z.redSqr();if(this.x.redMul(c).redISub(t.x.redMul(n)).cmpn(0)!==0)return!1;var ie=n.redMul(this.z),se=c.redMul(t.z);return this.y.redMul(se).redISub(t.y.redMul(ie)).cmpn(0)===0};JPoint$1.prototype.eqXToP=function(t){var n=this.z.redSqr(),c=t.toRed(this.curve.red).redMul(n);if(this.x.cmp(c)===0)return!0;for(var ie=t.clone(),se=this.curve.redN.redMul(n);;){if(ie.iadd(this.curve.n),ie.cmp(this.curve.p)>=0)return!1;if(c.redIAdd(se),this.x.cmp(c)===0)return!0}};JPoint$1.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};JPoint$1.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var curve_1=createCommonjsModule(function(t,n){var c=n;c.base=base$5,c.short=short_1,c.mont=null,c.edwards=null}),curves_1=createCommonjsModule(function(t,n){var c=n,ie=utils_1$1$1.assert;function se(ue){ue.type==="short"?this.curve=new curve_1.short(ue):ue.type==="edwards"?this.curve=new curve_1.edwards(ue):this.curve=new curve_1.mont(ue),this.g=this.curve.g,this.n=this.curve.n,this.hash=ue.hash,ie(this.g.validate(),"Invalid curve"),ie(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}c.PresetCurve=se;function ae(ue,pe){Object.defineProperty(c,ue,{configurable:!0,enumerable:!0,get:function(){var ge=new se(pe);return Object.defineProperty(c,ue,{configurable:!0,enumerable:!0,value:ge}),ge}})}ae("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:hash$3$1.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),ae("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:hash$3$1.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),ae("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:hash$3$1.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),ae("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:hash$3$1.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),ae("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:hash$3$1.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),ae("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hash$3$1.sha256,gRed:!1,g:["9"]}),ae("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hash$3$1.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var de;try{de=null.crash()}catch{de=void 0}ae("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:hash$3$1.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",de]})});function HmacDRBG$1(t){if(!(this instanceof HmacDRBG$1))return new HmacDRBG$1(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var n=utils_1$7.toArray(t.entropy,t.entropyEnc||"hex"),c=utils_1$7.toArray(t.nonce,t.nonceEnc||"hex"),ie=utils_1$7.toArray(t.pers,t.persEnc||"hex");minimalisticAssert(n.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(n,c,ie)}var hmacDrbg$1=HmacDRBG$1;HmacDRBG$1.prototype._init=function(t,n,c){var ie=t.concat(n).concat(c);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var se=0;se<this.V.length;se++)this.K[se]=0,this.V[se]=1;this._update(ie),this._reseed=1,this.reseedInterval=281474976710656};HmacDRBG$1.prototype._hmac=function(){return new hash$3$1.hmac(this.hash,this.K)};HmacDRBG$1.prototype._update=function(t){var n=this._hmac().update(this.V).update([0]);t&&(n=n.update(t)),this.K=n.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())};HmacDRBG$1.prototype.reseed=function(t,n,c,ie){typeof n!="string"&&(ie=c,c=n,n=null),t=utils_1$7.toArray(t,n),c=utils_1$7.toArray(c,ie),minimalisticAssert(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(c||[])),this._reseed=1};HmacDRBG$1.prototype.generate=function(t,n,c,ie){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof n!="string"&&(ie=c,c=n,n=null),c&&(c=utils_1$7.toArray(c,ie||"hex"),this._update(c));for(var se=[];se.length<t;)this.V=this._hmac().update(this.V).digest(),se=se.concat(this.V);var ae=se.slice(0,t);return this._update(c),this._reseed++,utils_1$7.encode(ae,n)};var assert$3$1=utils_1$1$1.assert;function KeyPair$3(t,n){this.ec=t,this.priv=null,this.pub=null,n.priv&&this._importPrivate(n.priv,n.privEnc),n.pub&&this._importPublic(n.pub,n.pubEnc)}var key$2=KeyPair$3;KeyPair$3.fromPublic=function(t,n,c){return n instanceof KeyPair$3?n:new KeyPair$3(t,{pub:n,pubEnc:c})};KeyPair$3.fromPrivate=function(t,n,c){return n instanceof KeyPair$3?n:new KeyPair$3(t,{priv:n,privEnc:c})};KeyPair$3.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};KeyPair$3.prototype.getPublic=function(t,n){return typeof t=="string"&&(n=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),n?this.pub.encode(n,t):this.pub};KeyPair$3.prototype.getPrivate=function(t){return t==="hex"?this.priv.toString(16,2):this.priv};KeyPair$3.prototype._importPrivate=function(t,n){this.priv=new BN$8(t,n||16),this.priv=this.priv.umod(this.ec.curve.n)};KeyPair$3.prototype._importPublic=function(t,n){if(t.x||t.y){this.ec.curve.type==="mont"?assert$3$1(t.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&assert$3$1(t.x&&t.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(t.x,t.y);return}this.pub=this.ec.curve.decodePoint(t,n)};KeyPair$3.prototype.derive=function(t){return t.validate()||assert$3$1(t.validate(),"public point not validated"),t.mul(this.priv).getX()};KeyPair$3.prototype.sign=function(t,n,c){return this.ec.sign(t,this,n,c)};KeyPair$3.prototype.verify=function(t,n,c){return this.ec.verify(t,n,this,void 0,c)};KeyPair$3.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var assert$4$1=utils_1$1$1.assert;function Signature$3(t,n){if(t instanceof Signature$3)return t;this._importDER(t,n)||(assert$4$1(t.r&&t.s,"Signature without r or s"),this.r=new BN$8(t.r,16),this.s=new BN$8(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var signature$3=Signature$3;function Position$1(){this.place=0}function getLength$1(t,n){var c=t[n.place++];if(!(c&128))return c;var ie=c&15;if(ie===0||ie>4||t[n.place]===0)return!1;for(var se=0,ae=0,de=n.place;ae<ie;ae++,de++)se<<=8,se|=t[de],se>>>=0;return se<=127?!1:(n.place=de,se)}function rmPadding$1(t){for(var n=0,c=t.length-1;!t[n]&&!(t[n+1]&128)&&n<c;)n++;return n===0?t:t.slice(n)}Signature$3.prototype._importDER=function(t,n){t=utils_1$1$1.toArray(t,n);var c=new Position$1;if(t[c.place++]!==48)return!1;var ie=getLength$1(t,c);if(ie===!1||ie+c.place!==t.length||t[c.place++]!==2)return!1;var se=getLength$1(t,c);if(se===!1||t[c.place]&128)return!1;var ae=t.slice(c.place,se+c.place);if(c.place+=se,t[c.place++]!==2)return!1;var de=getLength$1(t,c);if(de===!1||t.length!==de+c.place||t[c.place]&128)return!1;var ue=t.slice(c.place,de+c.place);if(ae[0]===0)if(ae[1]&128)ae=ae.slice(1);else return!1;if(ue[0]===0)if(ue[1]&128)ue=ue.slice(1);else return!1;return this.r=new BN$8(ae),this.s=new BN$8(ue),this.recoveryParam=null,!0};function constructLength$1(t,n){if(n<128){t.push(n);return}var c=1+(Math.log(n)/Math.LN2>>>3);for(t.push(c|128);--c;)t.push(n>>>(c<<3)&255);t.push(n)}Signature$3.prototype.toDER=function(t){var n=this.r.toArray(),c=this.s.toArray();for(n[0]&128&&(n=[0].concat(n)),c[0]&128&&(c=[0].concat(c)),n=rmPadding$1(n),c=rmPadding$1(c);!c[0]&&!(c[1]&128);)c=c.slice(1);var ie=[2];constructLength$1(ie,n.length),ie=ie.concat(n),ie.push(2),constructLength$1(ie,c.length);var se=ie.concat(c),ae=[48];return constructLength$1(ae,se.length),ae=ae.concat(se),utils_1$1$1.encode(ae,t)};var rand=(function(){throw new Error("unsupported")}),assert$5$1=utils_1$1$1.assert;function EC(t){if(!(this instanceof EC))return new EC(t);typeof t=="string"&&(assert$5$1(Object.prototype.hasOwnProperty.call(curves_1,t),"Unknown curve "+t),t=curves_1[t]),t instanceof curves_1.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var ec$1=EC;EC.prototype.keyPair=function(t){return new key$2(this,t)};EC.prototype.keyFromPrivate=function(t,n){return key$2.fromPrivate(this,t,n)};EC.prototype.keyFromPublic=function(t,n){return key$2.fromPublic(this,t,n)};EC.prototype.genKeyPair=function(t){t||(t={});for(var n=new hmacDrbg$1({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||rand(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),c=this.n.byteLength(),ie=this.n.sub(new BN$8(2));;){var se=new BN$8(n.generate(c));if(!(se.cmp(ie)>0))return se.iaddn(1),this.keyFromPrivate(se)}};EC.prototype._truncateToN=function(t,n,c){var ie;if(BN$8.isBN(t)||typeof t=="number")t=new BN$8(t,16),ie=t.byteLength();else if(typeof t=="object")ie=t.length,t=new BN$8(t,16);else{var se=t.toString();ie=se.length+1>>>1,t=new BN$8(se,16)}typeof c!="number"&&(c=ie*8);var ae=c-this.n.bitLength();return ae>0&&(t=t.ushrn(ae)),!n&&t.cmp(this.n)>=0?t.sub(this.n):t};EC.prototype.sign=function(t,n,c,ie){if(typeof c=="object"&&(ie=c,c=null),ie||(ie={}),typeof t!="string"&&typeof t!="number"&&!BN$8.isBN(t)){assert$5$1(typeof t=="object"&&t&&typeof t.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),assert$5$1(t.length>>>0===t.length);for(var se=0;se<t.length;se++)assert$5$1((t[se]&255)===t[se])}n=this.keyFromPrivate(n,c),t=this._truncateToN(t,!1,ie.msgBitLength),assert$5$1(!t.isNeg(),"Can not sign a negative message");var ae=this.n.byteLength(),de=n.getPrivate().toArray("be",ae),ue=t.toArray("be",ae);assert$5$1(new BN$8(ue).eq(t),"Can not sign message");for(var pe=new hmacDrbg$1({hash:this.hash,entropy:de,nonce:ue,pers:ie.pers,persEnc:ie.persEnc||"utf8"}),ge=this.n.sub(new BN$8(1)),be=0;;be++){var _e=ie.k?ie.k(be):new BN$8(pe.generate(this.n.byteLength()));if(_e=this._truncateToN(_e,!0),!(_e.cmpn(1)<=0||_e.cmp(ge)>=0)){var we=this.g.mul(_e);if(!we.isInfinity()){var qe=we.getX(),Ye=qe.umod(this.n);if(Ye.cmpn(0)!==0){var Ge=_e.invm(this.n).mul(Ye.mul(n.getPrivate()).iadd(t));if(Ge=Ge.umod(this.n),Ge.cmpn(0)!==0){var Ze=(we.getY().isOdd()?1:0)|(qe.cmp(Ye)!==0?2:0);return ie.canonical&&Ge.cmp(this.nh)>0&&(Ge=this.n.sub(Ge),Ze^=1),new signature$3({r:Ye,s:Ge,recoveryParam:Ze})}}}}}};EC.prototype.verify=function(t,n,c,ie,se){se||(se={}),t=this._truncateToN(t,!1,se.msgBitLength),c=this.keyFromPublic(c,ie),n=new signature$3(n,"hex");var ae=n.r,de=n.s;if(ae.cmpn(1)<0||ae.cmp(this.n)>=0||de.cmpn(1)<0||de.cmp(this.n)>=0)return!1;var ue=de.invm(this.n),pe=ue.mul(t).umod(this.n),ge=ue.mul(ae).umod(this.n),be;return this.curve._maxwellTrick?(be=this.g.jmulAdd(pe,c.getPublic(),ge),be.isInfinity()?!1:be.eqXToP(ae)):(be=this.g.mulAdd(pe,c.getPublic(),ge),be.isInfinity()?!1:be.getX().umod(this.n).cmp(ae)===0)};EC.prototype.recoverPubKey=function(t,n,c,ie){assert$5$1((3&c)===c,"The recovery param is more than two bits"),n=new signature$3(n,ie);var se=this.n,ae=new BN$8(t),de=n.r,ue=n.s,pe=c&1,ge=c>>1;if(de.cmp(this.curve.p.umod(this.curve.n))>=0&&ge)throw new Error("Unable to find sencond key candinate");ge?de=this.curve.pointFromX(de.add(this.curve.n),pe):de=this.curve.pointFromX(de,pe);var be=n.r.invm(se),_e=se.sub(ae).mul(be).umod(se),we=ue.mul(be).umod(se);return this.g.mulAdd(_e,de,we)};EC.prototype.getKeyRecoveryParam=function(t,n,c,ie){if(n=new signature$3(n,ie),n.recoveryParam!==null)return n.recoveryParam;for(var se=0;se<4;se++){var ae;try{ae=this.recoverPubKey(t,n,se)}catch{continue}if(ae.eq(c))return se}throw new Error("Unable to find valid recovery factor")};var elliptic_1=createCommonjsModule(function(t,n){var c=n;c.version="6.6.1",c.utils=utils_1$1$1,c.rand=function(){throw new Error("unsupported")},c.curve=curve_1,c.curves=curves_1,c.ec=ec$1,c.eddsa=null}),EC$1=elliptic_1.ec;const version$j="signing-key/5.8.0",logger$h=new Logger$1(version$j);let _curve=null;function getCurve(){return _curve||(_curve=new EC$1("secp256k1")),_curve}class SigningKey{constructor(n){defineReadOnly(this,"curve","secp256k1"),defineReadOnly(this,"privateKey",hexlify$1(n)),hexDataLength(this.privateKey)!==32&&logger$h.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const c=getCurve().keyFromPrivate(arrayify(this.privateKey));defineReadOnly(this,"publicKey","0x"+c.getPublic(!1,"hex")),defineReadOnly(this,"compressedPublicKey","0x"+c.getPublic(!0,"hex")),defineReadOnly(this,"_isSigningKey",!0)}_addPoint(n){const c=getCurve().keyFromPublic(arrayify(this.publicKey)),ie=getCurve().keyFromPublic(arrayify(n));return"0x"+c.pub.add(ie.pub).encodeCompressed("hex")}signDigest(n){const c=getCurve().keyFromPrivate(arrayify(this.privateKey)),ie=arrayify(n);ie.length!==32&&logger$h.throwArgumentError("bad digest length","digest",n);const se=c.sign(ie,{canonical:!0});return splitSignature({recoveryParam:se.recoveryParam,r:hexZeroPad("0x"+se.r.toString(16),32),s:hexZeroPad("0x"+se.s.toString(16),32)})}computeSharedSecret(n){const c=getCurve().keyFromPrivate(arrayify(this.privateKey)),ie=getCurve().keyFromPublic(arrayify(computePublicKey(n)));return hexZeroPad("0x"+c.derive(ie.getPublic()).toString(16),32)}static isSigningKey(n){return!!(n&&n._isSigningKey)}}function recoverPublicKey(t,n){const c=splitSignature(n),ie={r:arrayify(c.r),s:arrayify(c.s)};return"0x"+getCurve().recoverPubKey(arrayify(t),ie,c.recoveryParam).encode("hex",!1)}function computePublicKey(t,n){const c=arrayify(t);if(c.length===32){const ie=new SigningKey(c);return n?"0x"+getCurve().keyFromPrivate(c).getPublic(!0,"hex"):ie.publicKey}else{if(c.length===33)return n?hexlify$1(c):"0x"+getCurve().keyFromPublic(c).getPublic(!1,"hex");if(c.length===65)return n?"0x"+getCurve().keyFromPublic(c).getPublic(!0,"hex"):hexlify$1(c)}return logger$h.throwArgumentError("invalid public or private key","key","[REDACTED]")}const lib_esm$a=Object.freeze(Object.defineProperty({__proto__:null,SigningKey,computePublicKey,recoverPublicKey},Symbol.toStringTag,{value:"Module"})),version$i="transactions/5.8.0",logger$g=new Logger$1(version$i);var TransactionTypes;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(TransactionTypes||(TransactionTypes={}));function handleAddress(t){return t==="0x"?null:getAddress$1(t)}function handleNumber(t){return t==="0x"?Zero$1:BigNumber$1.from(t)}const transactionFields=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],allowedTransactionKeys$1={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function computeAddress(t){const n=computePublicKey(t);return getAddress$1(hexDataSlice(keccak256$1(hexDataSlice(n,1)),12))}function recoverAddress(t,n){return computeAddress(recoverPublicKey(arrayify(t),n))}function formatNumber(t,n){const c=stripZeros(BigNumber$1.from(t).toHexString());return c.length>32&&logger$g.throwArgumentError("invalid length for "+n,"transaction:"+n,t),c}function accessSetify(t,n){return{address:getAddress$1(t),storageKeys:(n||[]).map((c,ie)=>(hexDataLength(c)!==32&&logger$g.throwArgumentError("invalid access list storageKey",`accessList[${t}:${ie}]`,c),c.toLowerCase()))}}function accessListify(t){if(Array.isArray(t))return t.map((c,ie)=>Array.isArray(c)?(c.length>2&&logger$g.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${ie}]`,c),accessSetify(c[0],c[1])):accessSetify(c.address,c.storageKeys));const n=Object.keys(t).map(c=>{const ie=t[c].reduce((se,ae)=>(se[ae]=!0,se),{});return accessSetify(c,Object.keys(ie).sort())});return n.sort((c,ie)=>c.address.localeCompare(ie.address)),n}function formatAccessList(t){return accessListify(t).map(n=>[n.address,n.storageKeys])}function _serializeEip1559(t,n){if(t.gasPrice!=null){const ie=BigNumber$1.from(t.gasPrice),se=BigNumber$1.from(t.maxFeePerGas||0);ie.eq(se)||logger$g.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:ie,maxFeePerGas:se})}const c=[formatNumber(t.chainId||0,"chainId"),formatNumber(t.nonce||0,"nonce"),formatNumber(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),formatNumber(t.maxFeePerGas||0,"maxFeePerGas"),formatNumber(t.gasLimit||0,"gasLimit"),t.to!=null?getAddress$1(t.to):"0x",formatNumber(t.value||0,"value"),t.data||"0x",formatAccessList(t.accessList||[])];if(n){const ie=splitSignature(n);c.push(formatNumber(ie.recoveryParam,"recoveryParam")),c.push(stripZeros(ie.r)),c.push(stripZeros(ie.s))}return hexConcat(["0x02",encode$6(c)])}function _serializeEip2930(t,n){const c=[formatNumber(t.chainId||0,"chainId"),formatNumber(t.nonce||0,"nonce"),formatNumber(t.gasPrice||0,"gasPrice"),formatNumber(t.gasLimit||0,"gasLimit"),t.to!=null?getAddress$1(t.to):"0x",formatNumber(t.value||0,"value"),t.data||"0x",formatAccessList(t.accessList||[])];if(n){const ie=splitSignature(n);c.push(formatNumber(ie.recoveryParam,"recoveryParam")),c.push(stripZeros(ie.r)),c.push(stripZeros(ie.s))}return hexConcat(["0x01",encode$6(c)])}function _serialize(t,n){checkProperties(t,allowedTransactionKeys$1);const c=[];transactionFields.forEach(function(de){let ue=t[de.name]||[];const pe={};de.numeric&&(pe.hexPad="left"),ue=arrayify(hexlify$1(ue,pe)),de.length&&ue.length!==de.length&&ue.length>0&&logger$g.throwArgumentError("invalid length for "+de.name,"transaction:"+de.name,ue),de.maxLength&&(ue=stripZeros(ue),ue.length>de.maxLength&&logger$g.throwArgumentError("invalid length for "+de.name,"transaction:"+de.name,ue)),c.push(hexlify$1(ue))});let ie=0;if(t.chainId!=null?(ie=t.chainId,typeof ie!="number"&&logger$g.throwArgumentError("invalid transaction.chainId","transaction",t)):n&&!isBytesLike(n)&&n.v>28&&(ie=Math.floor((n.v-35)/2)),ie!==0&&(c.push(hexlify$1(ie)),c.push("0x"),c.push("0x")),!n)return encode$6(c);const se=splitSignature(n);let ae=27+se.recoveryParam;return ie!==0?(c.pop(),c.pop(),c.pop(),ae+=ie*2+8,se.v>28&&se.v!==ae&&logger$g.throwArgumentError("transaction.chainId/signature.v mismatch","signature",n)):se.v!==ae&&logger$g.throwArgumentError("transaction.chainId/signature.v mismatch","signature",n),c.push(hexlify$1(ae)),c.push(stripZeros(arrayify(se.r))),c.push(stripZeros(arrayify(se.s))),encode$6(c)}function serialize$1(t,n){if(t.type==null||t.type===0)return t.accessList!=null&&logger$g.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),_serialize(t,n);switch(t.type){case 1:return _serializeEip2930(t,n);case 2:return _serializeEip1559(t,n)}return logger$g.throwError(`unsupported transaction type: ${t.type}`,Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}function _parseEipSignature(t,n,c){try{const ie=handleNumber(n[0]).toNumber();if(ie!==0&&ie!==1)throw new Error("bad recid");t.v=ie}catch{logger$g.throwArgumentError("invalid v for transaction type: 1","v",n[0])}t.r=hexZeroPad(n[1],32),t.s=hexZeroPad(n[2],32);try{const ie=keccak256$1(c(t));t.from=recoverAddress(ie,{r:t.r,s:t.s,recoveryParam:t.v})}catch{}}function _parseEip1559(t){const n=decode$7(t.slice(1));n.length!==9&&n.length!==12&&logger$g.throwArgumentError("invalid component count for transaction type: 2","payload",hexlify$1(t));const c=handleNumber(n[2]),ie=handleNumber(n[3]),se={type:2,chainId:handleNumber(n[0]).toNumber(),nonce:handleNumber(n[1]).toNumber(),maxPriorityFeePerGas:c,maxFeePerGas:ie,gasPrice:null,gasLimit:handleNumber(n[4]),to:handleAddress(n[5]),value:handleNumber(n[6]),data:n[7],accessList:accessListify(n[8])};return n.length===9||(se.hash=keccak256$1(t),_parseEipSignature(se,n.slice(9),_serializeEip1559)),se}function _parseEip2930(t){const n=decode$7(t.slice(1));n.length!==8&&n.length!==11&&logger$g.throwArgumentError("invalid component count for transaction type: 1","payload",hexlify$1(t));const c={type:1,chainId:handleNumber(n[0]).toNumber(),nonce:handleNumber(n[1]).toNumber(),gasPrice:handleNumber(n[2]),gasLimit:handleNumber(n[3]),to:handleAddress(n[4]),value:handleNumber(n[5]),data:n[6],accessList:accessListify(n[7])};return n.length===8||(c.hash=keccak256$1(t),_parseEipSignature(c,n.slice(8),_serializeEip2930)),c}function _parse(t){const n=decode$7(t);n.length!==9&&n.length!==6&&logger$g.throwArgumentError("invalid raw transaction","rawTransaction",t);const c={nonce:handleNumber(n[0]).toNumber(),gasPrice:handleNumber(n[1]),gasLimit:handleNumber(n[2]),to:handleAddress(n[3]),value:handleNumber(n[4]),data:n[5],chainId:0};if(n.length===6)return c;try{c.v=BigNumber$1.from(n[6]).toNumber()}catch{return c}if(c.r=hexZeroPad(n[7],32),c.s=hexZeroPad(n[8],32),BigNumber$1.from(c.r).isZero()&&BigNumber$1.from(c.s).isZero())c.chainId=c.v,c.v=0;else{c.chainId=Math.floor((c.v-35)/2),c.chainId<0&&(c.chainId=0);let ie=c.v-27;const se=n.slice(0,6);c.chainId!==0&&(se.push(hexlify$1(c.chainId)),se.push("0x"),se.push("0x"),ie-=c.chainId*2+8);const ae=keccak256$1(encode$6(se));try{c.from=recoverAddress(ae,{r:hexlify$1(c.r),s:hexlify$1(c.s),recoveryParam:ie})}catch{}c.hash=keccak256$1(t)}return c.type=null,c}function parse$2(t){const n=arrayify(t);if(n[0]>127)return _parse(n);switch(n[0]){case 1:return _parseEip2930(n);case 2:return _parseEip1559(n)}return logger$g.throwError(`unsupported transaction type: ${n[0]}`,Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:n[0]})}const lib_esm$9=Object.freeze(Object.defineProperty({__proto__:null,get TransactionTypes(){return TransactionTypes},accessListify,computeAddress,parse:parse$2,recoverAddress,serialize:serialize$1},Symbol.toStringTag,{value:"Module"})),version$h="contracts/5.8.0";var __awaiter$h=function(t,n,c,ie){function se(ae){return ae instanceof c?ae:new c(function(de){de(ae)})}return new(c||(c=Promise))(function(ae,de){function ue(be){try{ge(ie.next(be))}catch(_e){de(_e)}}function pe(be){try{ge(ie.throw(be))}catch(_e){de(_e)}}function ge(be){be.done?ae(be.value):se(be.value).then(ue,pe)}ge((ie=ie.apply(t,[])).next())})};const logger$f=new Logger$1(version$h);function resolveName(t,n){return __awaiter$h(this,void 0,void 0,function*(){const c=yield n;typeof c!="string"&&logger$f.throwArgumentError("invalid address or ENS name","name",c);try{return getAddress$1(c)}catch{}t||logger$f.throwError("a provider or signer is needed to resolve ENS names",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const ie=yield t.resolveName(c);return ie==null&&logger$f.throwArgumentError("resolver or addr is not configured for ENS name","name",c),ie})}function resolveAddresses(t,n,c){return __awaiter$h(this,void 0,void 0,function*(){return Array.isArray(c)?yield Promise.all(c.map((ie,se)=>resolveAddresses(t,Array.isArray(n)?n[se]:n[ie.name],ie))):c.type==="address"?yield resolveName(t,n):c.type==="tuple"?yield resolveAddresses(t,n,c.components):c.baseType==="array"?Array.isArray(n)?yield Promise.all(n.map(ie=>resolveAddresses(t,ie,c.arrayChildren))):Promise.reject(logger$f.makeError("invalid value for array",Logger$1.errors.INVALID_ARGUMENT,{argument:"value",value:n})):n})}function populateTransaction(t,n,c){return __awaiter$h(this,void 0,void 0,function*(){let ie={};c.length===n.inputs.length+1&&typeof c[c.length-1]=="object"&&(ie=shallowCopy(c.pop())),logger$f.checkArgumentCount(c.length,n.inputs.length,"passed to contract"),t.signer?ie.from?ie.from=resolveProperties({override:resolveName(t.signer,ie.from),signer:t.signer.getAddress()}).then(ge=>__awaiter$h(this,void 0,void 0,function*(){return getAddress$1(ge.signer)!==ge.override&&logger$f.throwError("Contract with a Signer cannot override from",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),ge.override})):ie.from=t.signer.getAddress():ie.from&&(ie.from=resolveName(t.provider,ie.from));const se=yield resolveProperties({args:resolveAddresses(t.signer||t.provider,c,n.inputs),address:t.resolvedAddress,overrides:resolveProperties(ie)||{}}),ae=t.interface.encodeFunctionData(n,se.args),de={data:ae,to:se.address},ue=se.overrides;if(ue.nonce!=null&&(de.nonce=BigNumber$1.from(ue.nonce).toNumber()),ue.gasLimit!=null&&(de.gasLimit=BigNumber$1.from(ue.gasLimit)),ue.gasPrice!=null&&(de.gasPrice=BigNumber$1.from(ue.gasPrice)),ue.maxFeePerGas!=null&&(de.maxFeePerGas=BigNumber$1.from(ue.maxFeePerGas)),ue.maxPriorityFeePerGas!=null&&(de.maxPriorityFeePerGas=BigNumber$1.from(ue.maxPriorityFeePerGas)),ue.from!=null&&(de.from=ue.from),ue.type!=null&&(de.type=ue.type),ue.accessList!=null&&(de.accessList=accessListify(ue.accessList)),de.gasLimit==null&&n.gas!=null){let ge=21e3;const be=arrayify(ae);for(let _e=0;_e<be.length;_e++)ge+=4,be[_e]&&(ge+=64);de.gasLimit=BigNumber$1.from(n.gas).add(ge)}if(ue.value){const ge=BigNumber$1.from(ue.value);!ge.isZero()&&!n.payable&&logger$f.throwError("non-payable method cannot override value",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:ie.value}),de.value=ge}ue.customData&&(de.customData=shallowCopy(ue.customData)),ue.ccipReadEnabled&&(de.ccipReadEnabled=!!ue.ccipReadEnabled),delete ie.nonce,delete ie.gasLimit,delete ie.gasPrice,delete ie.from,delete ie.value,delete ie.type,delete ie.accessList,delete ie.maxFeePerGas,delete ie.maxPriorityFeePerGas,delete ie.customData,delete ie.ccipReadEnabled;const pe=Object.keys(ie).filter(ge=>ie[ge]!=null);return pe.length&&logger$f.throwError(`cannot override ${pe.map(ge=>JSON.stringify(ge)).join(",")}`,Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:pe}),de})}function buildPopulate(t,n){return function(...c){return populateTransaction(t,n,c)}}function buildEstimate(t,n){const c=t.signer||t.provider;return function(...ie){return __awaiter$h(this,void 0,void 0,function*(){c||logger$f.throwError("estimate require a provider or signer",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const se=yield populateTransaction(t,n,ie);return yield c.estimateGas(se)})}}function addContractWait(t,n){const c=n.wait.bind(n);n.wait=ie=>c(ie).then(se=>(se.events=se.logs.map(ae=>{let de=deepCopy(ae),ue=null;try{ue=t.interface.parseLog(ae)}catch{}return ue&&(de.args=ue.args,de.decode=(pe,ge)=>t.interface.decodeEventLog(ue.eventFragment,pe,ge),de.event=ue.name,de.eventSignature=ue.signature),de.removeListener=()=>t.provider,de.getBlock=()=>t.provider.getBlock(se.blockHash),de.getTransaction=()=>t.provider.getTransaction(se.transactionHash),de.getTransactionReceipt=()=>Promise.resolve(se),de}),se))}function buildCall(t,n,c){const ie=t.signer||t.provider;return function(...se){return __awaiter$h(this,void 0,void 0,function*(){let ae;if(se.length===n.inputs.length+1&&typeof se[se.length-1]=="object"){const pe=shallowCopy(se.pop());pe.blockTag!=null&&(ae=yield pe.blockTag),delete pe.blockTag,se.push(pe)}t.deployTransaction!=null&&(yield t._deployed(ae));const de=yield populateTransaction(t,n,se),ue=yield ie.call(de,ae);try{let pe=t.interface.decodeFunctionResult(n,ue);return c&&n.outputs.length===1&&(pe=pe[0]),pe}catch(pe){throw pe.code===Logger$1.errors.CALL_EXCEPTION&&(pe.address=t.address,pe.args=se,pe.transaction=de),pe}})}}function buildSend(t,n){return function(...c){return __awaiter$h(this,void 0,void 0,function*(){t.signer||logger$f.throwError("sending a transaction requires a signer",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.deployTransaction!=null&&(yield t._deployed());const ie=yield populateTransaction(t,n,c),se=yield t.signer.sendTransaction(ie);return addContractWait(t,se),se})}}function buildDefault(t,n,c){return n.constant?buildCall(t,n,c):buildSend(t,n)}function getEventTag$1(t){return t.address&&(t.topics==null||t.topics.length===0)?"*":(t.address||"*")+"@"+(t.topics?t.topics.map(n=>Array.isArray(n)?n.join("|"):n).join(":"):"")}class RunningEvent{constructor(n,c){defineReadOnly(this,"tag",n),defineReadOnly(this,"filter",c),this._listeners=[]}addListener(n,c){this._listeners.push({listener:n,once:c})}removeListener(n){let c=!1;this._listeners=this._listeners.filter(ie=>c||ie.listener!==n?!0:(c=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(n=>n.listener)}listenerCount(){return this._listeners.length}run(n){const c=this.listenerCount();return this._listeners=this._listeners.filter(ie=>{const se=n.slice();return setTimeout(()=>{ie.listener.apply(this,se)},0),!ie.once}),c}prepareEvent(n){}getEmit(n){return[n]}}class ErrorRunningEvent extends RunningEvent{constructor(){super("error",null)}}class FragmentRunningEvent extends RunningEvent{constructor(n,c,ie,se){const ae={address:n};let de=c.getEventTopic(ie);se?(de!==se[0]&&logger$f.throwArgumentError("topic mismatch","topics",se),ae.topics=se.slice()):ae.topics=[de],super(getEventTag$1(ae),ae),defineReadOnly(this,"address",n),defineReadOnly(this,"interface",c),defineReadOnly(this,"fragment",ie)}prepareEvent(n){super.prepareEvent(n),n.event=this.fragment.name,n.eventSignature=this.fragment.format(),n.decode=(c,ie)=>this.interface.decodeEventLog(this.fragment,c,ie);try{n.args=this.interface.decodeEventLog(this.fragment,n.data,n.topics)}catch(c){n.args=null,n.decodeError=c}}getEmit(n){const c=checkResultErrors(n.args);if(c.length)throw c[0].error;const ie=(n.args||[]).slice();return ie.push(n),ie}}class WildcardRunningEvent extends RunningEvent{constructor(n,c){super("*",{address:n}),defineReadOnly(this,"address",n),defineReadOnly(this,"interface",c)}prepareEvent(n){super.prepareEvent(n);try{const c=this.interface.parseLog(n);n.event=c.name,n.eventSignature=c.signature,n.decode=(ie,se)=>this.interface.decodeEventLog(c.eventFragment,ie,se),n.args=c.args}catch{}}}class BaseContract{constructor(n,c,ie){defineReadOnly(this,"interface",getStatic(new.target,"getInterface")(c)),ie==null?(defineReadOnly(this,"provider",null),defineReadOnly(this,"signer",null)):Signer.isSigner(ie)?(defineReadOnly(this,"provider",ie.provider||null),defineReadOnly(this,"signer",ie)):Provider.isProvider(ie)?(defineReadOnly(this,"provider",ie),defineReadOnly(this,"signer",null)):logger$f.throwArgumentError("invalid signer or provider","signerOrProvider",ie),defineReadOnly(this,"callStatic",{}),defineReadOnly(this,"estimateGas",{}),defineReadOnly(this,"functions",{}),defineReadOnly(this,"populateTransaction",{}),defineReadOnly(this,"filters",{});{const de={};Object.keys(this.interface.events).forEach(ue=>{const pe=this.interface.events[ue];defineReadOnly(this.filters,ue,(...ge)=>({address:this.address,topics:this.interface.encodeFilterTopics(pe,ge)})),de[pe.name]||(de[pe.name]=[]),de[pe.name].push(ue)}),Object.keys(de).forEach(ue=>{const pe=de[ue];pe.length===1?defineReadOnly(this.filters,ue,this.filters[pe[0]]):logger$f.warn(`Duplicate definition of ${ue} (${pe.join(", ")})`)})}if(defineReadOnly(this,"_runningEvents",{}),defineReadOnly(this,"_wrappedEmits",{}),n==null&&logger$f.throwArgumentError("invalid contract address or ENS name","addressOrName",n),defineReadOnly(this,"address",n),this.provider)defineReadOnly(this,"resolvedAddress",resolveName(this.provider,n));else try{defineReadOnly(this,"resolvedAddress",Promise.resolve(getAddress$1(n)))}catch{logger$f.throwError("provider is required to use ENS name as contract address",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(de=>{});const se={},ae={};Object.keys(this.interface.functions).forEach(de=>{const ue=this.interface.functions[de];if(ae[de]){logger$f.warn(`Duplicate ABI entry for ${JSON.stringify(de)}`);return}ae[de]=!0;{const pe=ue.name;se[`%${pe}`]||(se[`%${pe}`]=[]),se[`%${pe}`].push(de)}this[de]==null&&defineReadOnly(this,de,buildDefault(this,ue,!0)),this.functions[de]==null&&defineReadOnly(this.functions,de,buildDefault(this,ue,!1)),this.callStatic[de]==null&&defineReadOnly(this.callStatic,de,buildCall(this,ue,!0)),this.populateTransaction[de]==null&&defineReadOnly(this.populateTransaction,de,buildPopulate(this,ue)),this.estimateGas[de]==null&&defineReadOnly(this.estimateGas,de,buildEstimate(this,ue))}),Object.keys(se).forEach(de=>{const ue=se[de];if(ue.length>1)return;de=de.substring(1);const pe=ue[0];try{this[de]==null&&defineReadOnly(this,de,this[pe])}catch{}this.functions[de]==null&&defineReadOnly(this.functions,de,this.functions[pe]),this.callStatic[de]==null&&defineReadOnly(this.callStatic,de,this.callStatic[pe]),this.populateTransaction[de]==null&&defineReadOnly(this.populateTransaction,de,this.populateTransaction[pe]),this.estimateGas[de]==null&&defineReadOnly(this.estimateGas,de,this.estimateGas[pe])})}static getContractAddress(n){return getContractAddress(n)}static getInterface(n){return Interface.isInterface(n)?n:new Interface(n)}deployed(){return this._deployed()}_deployed(n){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,n).then(c=>(c==="0x"&&logger$f.throwError("contract not deployed",Logger$1.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(n){this.signer||logger$f.throwError("sending a transactions require a signer",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const c=shallowCopy(n||{});return["from","to"].forEach(function(ie){c[ie]!=null&&logger$f.throwError("cannot override "+ie,Logger$1.errors.UNSUPPORTED_OPERATION,{operation:ie})}),c.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(c))}connect(n){typeof n=="string"&&(n=new VoidSigner(n,this.provider));const c=new this.constructor(this.address,this.interface,n);return this.deployTransaction&&defineReadOnly(c,"deployTransaction",this.deployTransaction),c}attach(n){return new this.constructor(n,this.interface,this.signer||this.provider)}static isIndexed(n){return Indexed.isIndexed(n)}_normalizeRunningEvent(n){return this._runningEvents[n.tag]?this._runningEvents[n.tag]:n}_getRunningEvent(n){if(typeof n=="string"){if(n==="error")return this._normalizeRunningEvent(new ErrorRunningEvent);if(n==="event")return this._normalizeRunningEvent(new RunningEvent("event",null));if(n==="*")return this._normalizeRunningEvent(new WildcardRunningEvent(this.address,this.interface));const c=this.interface.getEvent(n);return this._normalizeRunningEvent(new FragmentRunningEvent(this.address,this.interface,c))}if(n.topics&&n.topics.length>0){try{const ie=n.topics[0];if(typeof ie!="string")throw new Error("invalid topic");const se=this.interface.getEvent(ie);return this._normalizeRunningEvent(new FragmentRunningEvent(this.address,this.interface,se,n.topics))}catch{}const c={address:this.address,topics:n.topics};return this._normalizeRunningEvent(new RunningEvent(getEventTag$1(c),c))}return this._normalizeRunningEvent(new WildcardRunningEvent(this.address,this.interface))}_checkRunningEvents(n){if(n.listenerCount()===0){delete this._runningEvents[n.tag];const c=this._wrappedEmits[n.tag];c&&n.filter&&(this.provider.off(n.filter,c),delete this._wrappedEmits[n.tag])}}_wrapEvent(n,c,ie){const se=deepCopy(c);return se.removeListener=()=>{ie&&(n.removeListener(ie),this._checkRunningEvents(n))},se.getBlock=()=>this.provider.getBlock(c.blockHash),se.getTransaction=()=>this.provider.getTransaction(c.transactionHash),se.getTransactionReceipt=()=>this.provider.getTransactionReceipt(c.transactionHash),n.prepareEvent(se),se}_addEventListener(n,c,ie){if(this.provider||logger$f.throwError("events require a provider or a signer with a provider",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"once"}),n.addListener(c,ie),this._runningEvents[n.tag]=n,!this._wrappedEmits[n.tag]){const se=ae=>{let de=this._wrapEvent(n,ae,c);if(de.decodeError==null)try{const ue=n.getEmit(de);this.emit(n.filter,...ue)}catch(ue){de.decodeError=ue.error}n.filter!=null&&this.emit("event",de),de.decodeError!=null&&this.emit("error",de.decodeError,de)};this._wrappedEmits[n.tag]=se,n.filter!=null&&this.provider.on(n.filter,se)}}queryFilter(n,c,ie){const se=this._getRunningEvent(n),ae=shallowCopy(se.filter);return typeof c=="string"&&isHexString$1(c,32)?(ie!=null&&logger$f.throwArgumentError("cannot specify toBlock with blockhash","toBlock",ie),ae.blockHash=c):(ae.fromBlock=c??0,ae.toBlock=ie??"latest"),this.provider.getLogs(ae).then(de=>de.map(ue=>this._wrapEvent(se,ue,null)))}on(n,c){return this._addEventListener(this._getRunningEvent(n),c,!1),this}once(n,c){return this._addEventListener(this._getRunningEvent(n),c,!0),this}emit(n,...c){if(!this.provider)return!1;const ie=this._getRunningEvent(n),se=ie.run(c)>0;return this._checkRunningEvents(ie),se}listenerCount(n){return this.provider?n==null?Object.keys(this._runningEvents).reduce((c,ie)=>c+this._runningEvents[ie].listenerCount(),0):this._getRunningEvent(n).listenerCount():0}listeners(n){if(!this.provider)return[];if(n==null){const c=[];for(let ie in this._runningEvents)this._runningEvents[ie].listeners().forEach(se=>{c.push(se)});return c}return this._getRunningEvent(n).listeners()}removeAllListeners(n){if(!this.provider)return this;if(n==null){for(const ie in this._runningEvents){const se=this._runningEvents[ie];se.removeAllListeners(),this._checkRunningEvents(se)}return this}const c=this._getRunningEvent(n);return c.removeAllListeners(),this._checkRunningEvents(c),this}off(n,c){if(!this.provider)return this;const ie=this._getRunningEvent(n);return ie.removeListener(c),this._checkRunningEvents(ie),this}removeListener(n,c){return this.off(n,c)}}class Contract extends BaseContract{}class BaseX{constructor(n){defineReadOnly(this,"alphabet",n),defineReadOnly(this,"base",n.length),defineReadOnly(this,"_alphabetMap",{}),defineReadOnly(this,"_leader",n.charAt(0));for(let c=0;c<n.length;c++)this._alphabetMap[n.charAt(c)]=c}encode(n){let c=arrayify(n);if(c.length===0)return"";let ie=[0];for(let ae=0;ae<c.length;++ae){let de=c[ae];for(let ue=0;ue<ie.length;++ue)de+=ie[ue]<<8,ie[ue]=de%this.base,de=de/this.base|0;for(;de>0;)ie.push(de%this.base),de=de/this.base|0}let se="";for(let ae=0;c[ae]===0&&ae<c.length-1;++ae)se+=this._leader;for(let ae=ie.length-1;ae>=0;--ae)se+=this.alphabet[ie[ae]];return se}decode(n){if(typeof n!="string")throw new TypeError("Expected String");let c=[];if(n.length===0)return new Uint8Array(c);c.push(0);for(let ie=0;ie<n.length;ie++){let se=this._alphabetMap[n[ie]];if(se===void 0)throw new Error("Non-base"+this.base+" character");let ae=se;for(let de=0;de<c.length;++de)ae+=c[de]*this.base,c[de]=ae&255,ae>>=8;for(;ae>0;)c.push(ae&255),ae>>=8}for(let ie=0;n[ie]===this._leader&&ie<n.length-1;++ie)c.push(0);return arrayify(new Uint8Array(c.reverse()))}}const Base32=new BaseX("abcdefghijklmnopqrstuvwxyz234567"),Base58=new BaseX("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),lib_esm$8=Object.freeze(Object.defineProperty({__proto__:null,Base32,Base58,BaseX},Symbol.toStringTag,{value:"Module"}));var SupportedAlgorithm;(function(t){t.sha256="sha256",t.sha512="sha512"})(SupportedAlgorithm||(SupportedAlgorithm={}));const version$g="sha2/5.8.0",logger$e=new Logger$1(version$g);function ripemd160$1(t){return"0x"+hash$3$1.ripemd160().update(arrayify(t)).digest("hex")}function sha256$7(t){return"0x"+hash$3$1.sha256().update(arrayify(t)).digest("hex")}function sha512$4(t){return"0x"+hash$3$1.sha512().update(arrayify(t)).digest("hex")}function computeHmac(t,n,c){return SupportedAlgorithm[t]||logger$e.throwError("unsupported algorithm "+t,Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:t}),"0x"+hash$3$1.hmac(hash$3$1[t],arrayify(n)).update(arrayify(c)).digest("hex")}const lib_esm$7=Object.freeze(Object.defineProperty({__proto__:null,get SupportedAlgorithm(){return SupportedAlgorithm},computeHmac,ripemd160:ripemd160$1,sha256:sha256$7,sha512:sha512$4},Symbol.toStringTag,{value:"Module"}));function pbkdf2$1$1(t,n,c,ie,se){t=arrayify(t),n=arrayify(n);let ae,de=1;const ue=new Uint8Array(ie),pe=new Uint8Array(n.length+4);pe.set(n);let ge,be;for(let _e=1;_e<=de;_e++){pe[n.length]=_e>>24&255,pe[n.length+1]=_e>>16&255,pe[n.length+2]=_e>>8&255,pe[n.length+3]=_e&255;let we=arrayify(computeHmac(se,t,pe));ae||(ae=we.length,be=new Uint8Array(ae),de=Math.ceil(ie/ae),ge=ie-(de-1)*ae),be.set(we);for(let Ge=1;Ge<c;Ge++){we=arrayify(computeHmac(se,t,we));for(let Ze=0;Ze<ae;Ze++)be[Ze]^=we[Ze]}const qe=(_e-1)*ae,Ye=_e===de?ge:ae;ue.set(arrayify(be).slice(0,Ye),qe)}return hexlify$1(ue)}const version$f="wordlists/5.8.0",logger$d=new Logger$1(version$f);class Wordlist{constructor(n){logger$d.checkAbstract(new.target,Wordlist),defineReadOnly(this,"locale",n)}split(n){return n.toLowerCase().split(/ +/g)}join(n){return n.join(" ")}static check(n){const c=[];for(let ie=0;ie<2048;ie++){const se=n.getWord(ie);if(ie!==n.getWordIndex(se))return"0x";c.push(se)}return id$1(c.join(`
|
|
25
25
|
`)+`
|
|
26
26
|
`)}static register(n,c){c||(c=n.locale)}}const words="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo";let wordlist=null;function loadWords(t){if(wordlist==null&&(wordlist=words.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),Wordlist.check(t)!=="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"))throw wordlist=null,new Error("BIP39 Wordlist for en (English) FAILED")}class LangEn extends Wordlist{constructor(){super("en")}getWord(n){return loadWords(this),wordlist[n]}getWordIndex(n){return loadWords(this),wordlist.indexOf(n)}}const langEn=new LangEn;Wordlist.register(langEn);const wordlists={en:langEn},version$e="hdnode/5.8.0",logger$c=new Logger$1(version$e),N$3=BigNumber$1.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),MasterSecret=toUtf8Bytes("Bitcoin seed"),HardenedBit=2147483648;function getUpperMask(t){return(1<<t)-1<<8-t}function getLowerMask(t){return(1<<t)-1}function bytes32(t){return hexZeroPad(hexlify$1(t),32)}function base58check(t){return Base58.encode(concat$1([t,hexDataSlice(sha256$7(sha256$7(t)),0,4)]))}function getWordlist(t){if(t==null)return wordlists.en;if(typeof t=="string"){const n=wordlists[t];return n==null&&logger$c.throwArgumentError("unknown locale","wordlist",t),n}return t}const _constructorGuard$1={},defaultPath="m/44'/60'/0'/0/0";class HDNode{constructor(n,c,ie,se,ae,de,ue,pe){if(n!==_constructorGuard$1)throw new Error("HDNode constructor cannot be called directly");if(c){const ge=new SigningKey(c);defineReadOnly(this,"privateKey",ge.privateKey),defineReadOnly(this,"publicKey",ge.compressedPublicKey)}else defineReadOnly(this,"privateKey",null),defineReadOnly(this,"publicKey",hexlify$1(ie));defineReadOnly(this,"parentFingerprint",se),defineReadOnly(this,"fingerprint",hexDataSlice(ripemd160$1(sha256$7(this.publicKey)),0,4)),defineReadOnly(this,"address",computeAddress(this.publicKey)),defineReadOnly(this,"chainCode",ae),defineReadOnly(this,"index",de),defineReadOnly(this,"depth",ue),pe==null?(defineReadOnly(this,"mnemonic",null),defineReadOnly(this,"path",null)):typeof pe=="string"?(defineReadOnly(this,"mnemonic",null),defineReadOnly(this,"path",pe)):(defineReadOnly(this,"mnemonic",pe),defineReadOnly(this,"path",pe.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return base58check(concat$1([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",hexlify$1(this.depth),this.parentFingerprint,hexZeroPad(hexlify$1(this.index),4),this.chainCode,this.privateKey!=null?concat$1(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new HDNode(_constructorGuard$1,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(n){if(n>4294967295)throw new Error("invalid index - "+String(n));let c=this.path;c&&(c+="/"+(n&~HardenedBit));const ie=new Uint8Array(37);if(n&HardenedBit){if(!this.privateKey)throw new Error("cannot derive child of neutered node");ie.set(arrayify(this.privateKey),1),c&&(c+="'")}else ie.set(arrayify(this.publicKey));for(let _e=24;_e>=0;_e-=8)ie[33+(_e>>3)]=n>>24-_e&255;const se=arrayify(computeHmac(SupportedAlgorithm.sha512,this.chainCode,ie)),ae=se.slice(0,32),de=se.slice(32);let ue=null,pe=null;this.privateKey?ue=bytes32(BigNumber$1.from(ae).add(this.privateKey).mod(N$3)):pe=new SigningKey(hexlify$1(ae))._addPoint(this.publicKey);let ge=c;const be=this.mnemonic;return be&&(ge=Object.freeze({phrase:be.phrase,path:c,locale:be.locale||"en"})),new HDNode(_constructorGuard$1,ue,pe,this.fingerprint,bytes32(de),n,this.depth+1,ge)}derivePath(n){const c=n.split("/");if(c.length===0||c[0]==="m"&&this.depth!==0)throw new Error("invalid path - "+n);c[0]==="m"&&c.shift();let ie=this;for(let se=0;se<c.length;se++){const ae=c[se];if(ae.match(/^[0-9]+'$/)){const de=parseInt(ae.substring(0,ae.length-1));if(de>=HardenedBit)throw new Error("invalid path index - "+ae);ie=ie._derive(HardenedBit+de)}else if(ae.match(/^[0-9]+$/)){const de=parseInt(ae);if(de>=HardenedBit)throw new Error("invalid path index - "+ae);ie=ie._derive(de)}else throw new Error("invalid path component - "+ae)}return ie}static _fromSeed(n,c){const ie=arrayify(n);if(ie.length<16||ie.length>64)throw new Error("invalid seed");const se=arrayify(computeHmac(SupportedAlgorithm.sha512,MasterSecret,ie));return new HDNode(_constructorGuard$1,bytes32(se.slice(0,32)),null,"0x00000000",bytes32(se.slice(32)),0,0,c)}static fromMnemonic(n,c,ie){return ie=getWordlist(ie),n=entropyToMnemonic(mnemonicToEntropy(n,ie),ie),HDNode._fromSeed(mnemonicToSeed(n,c),{phrase:n,path:"m",locale:ie.locale})}static fromSeed(n){return HDNode._fromSeed(n,null)}static fromExtendedKey(n){const c=Base58.decode(n);(c.length!==82||base58check(c.slice(0,78))!==n)&&logger$c.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const ie=c[4],se=hexlify$1(c.slice(5,9)),ae=parseInt(hexlify$1(c.slice(9,13)).substring(2),16),de=hexlify$1(c.slice(13,45)),ue=c.slice(45,78);switch(hexlify$1(c.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new HDNode(_constructorGuard$1,null,hexlify$1(ue),se,de,ae,ie,null);case"0x0488ade4":case"0x04358394 ":if(ue[0]!==0)break;return new HDNode(_constructorGuard$1,hexlify$1(ue.slice(1)),null,se,de,ae,ie,null)}return logger$c.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function mnemonicToSeed(t,n){n||(n="");const c=toUtf8Bytes("mnemonic"+n,UnicodeNormalizationForm.NFKD);return pbkdf2$1$1(toUtf8Bytes(t,UnicodeNormalizationForm.NFKD),c,2048,64,"sha512")}function mnemonicToEntropy(t,n){n=getWordlist(n),logger$c.checkNormalize();const c=n.split(t);if(c.length%3!==0)throw new Error("invalid mnemonic");const ie=arrayify(new Uint8Array(Math.ceil(11*c.length/8)));let se=0;for(let pe=0;pe<c.length;pe++){let ge=n.getWordIndex(c[pe].normalize("NFKD"));if(ge===-1)throw new Error("invalid mnemonic");for(let be=0;be<11;be++)ge&1<<10-be&&(ie[se>>3]|=1<<7-se%8),se++}const ae=32*c.length/3,de=c.length/3,ue=getUpperMask(de);if((arrayify(sha256$7(ie.slice(0,ae/8)))[0]&ue)!==(ie[ie.length-1]&ue))throw new Error("invalid checksum");return hexlify$1(ie.slice(0,ae/8))}function entropyToMnemonic(t,n){if(n=getWordlist(n),t=arrayify(t),t.length%4!==0||t.length<16||t.length>32)throw new Error("invalid entropy");const c=[0];let ie=11;for(let de=0;de<t.length;de++)ie>8?(c[c.length-1]<<=8,c[c.length-1]|=t[de],ie-=8):(c[c.length-1]<<=ie,c[c.length-1]|=t[de]>>8-ie,c.push(t[de]&getLowerMask(8-ie)),ie+=3);const se=t.length/4,ae=arrayify(sha256$7(t))[0]&getUpperMask(se);return c[c.length-1]<<=se,c[c.length-1]|=ae>>8-se,n.join(c.map(de=>n.getWord(de)))}function isValidMnemonic(t,n){try{return mnemonicToEntropy(t,n),!0}catch{}return!1}function getAccountPath(t){return(typeof t!="number"||t<0||t>=HardenedBit||t%1)&&logger$c.throwArgumentError("invalid account index","index",t),`m/44'/60'/${t}'/0/0`}const lib_esm$6=Object.freeze(Object.defineProperty({__proto__:null,HDNode,defaultPath,entropyToMnemonic,getAccountPath,isValidMnemonic,mnemonicToEntropy,mnemonicToSeed},Symbol.toStringTag,{value:"Module"})),version$d="random/5.8.0",logger$b=new Logger$1(version$d);function getGlobal$1(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof globalThis<"u")return globalThis;throw new Error("unable to locate global object")}const anyGlobal=getGlobal$1();let crypto$3=anyGlobal.crypto||anyGlobal.msCrypto;(!crypto$3||!crypto$3.getRandomValues)&&(logger$b.warn("WARNING: Missing strong random number source"),crypto$3={getRandomValues:function(t){return logger$b.throwError("no secure random source avaialble",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});function randomBytes$1(t){(t<=0||t>1024||t%1||t!=t)&&logger$b.throwArgumentError("invalid length","length",t);const n=new Uint8Array(t);return crypto$3.getRandomValues(n),arrayify(n)}function shuffled(t){t=t.slice();for(let n=t.length-1;n>0;n--){const c=Math.floor(Math.random()*(n+1)),ie=t[n];t[n]=t[c],t[c]=ie}return t}const lib_esm$5=Object.freeze(Object.defineProperty({__proto__:null,randomBytes:randomBytes$1,shuffled},Symbol.toStringTag,{value:"Module"}));var aesJs={exports:{}};(function(t,n){(function(c){function ie(We){return parseInt(We)===We}function se(We){if(!ie(We.length))return!1;for(var Vt=0;Vt<We.length;Vt++)if(!ie(We[Vt])||We[Vt]<0||We[Vt]>255)return!1;return!0}function ae(We,Vt){if(We.buffer&&ArrayBuffer.isView(We)&&We.name==="Uint8Array")return Vt&&(We.slice?We=We.slice():We=Array.prototype.slice.call(We)),We;if(Array.isArray(We)){if(!se(We))throw new Error("Array contains invalid value: "+We);return new Uint8Array(We)}if(ie(We.length)&&se(We))return new Uint8Array(We);throw new Error("unsupported array-like object")}function de(We){return new Uint8Array(We)}function ue(We,Vt,Sn,An,Cn){(An!=null||Cn!=null)&&(We.slice?We=We.slice(An,Cn):We=Array.prototype.slice.call(We,An,Cn)),Vt.set(We,Sn)}var pe=(function(){function We(Sn){var An=[],Cn=0;for(Sn=encodeURI(Sn);Cn<Sn.length;){var Qn=Sn.charCodeAt(Cn++);Qn===37?(An.push(parseInt(Sn.substr(Cn,2),16)),Cn+=2):An.push(Qn)}return ae(An)}function Vt(Sn){for(var An=[],Cn=0;Cn<Sn.length;){var Qn=Sn[Cn];Qn<128?(An.push(String.fromCharCode(Qn)),Cn++):Qn>191&&Qn<224?(An.push(String.fromCharCode((Qn&31)<<6|Sn[Cn+1]&63)),Cn+=2):(An.push(String.fromCharCode((Qn&15)<<12|(Sn[Cn+1]&63)<<6|Sn[Cn+2]&63)),Cn+=3)}return An.join("")}return{toBytes:We,fromBytes:Vt}})(),ge=(function(){function We(An){for(var Cn=[],Qn=0;Qn<An.length;Qn+=2)Cn.push(parseInt(An.substr(Qn,2),16));return Cn}var Vt="0123456789abcdef";function Sn(An){for(var Cn=[],Qn=0;Qn<An.length;Qn++){var En=An[Qn];Cn.push(Vt[(En&240)>>4]+Vt[En&15])}return Cn.join("")}return{toBytes:We,fromBytes:Sn}})(),be={16:10,24:12,32:14},_e=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],we=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],qe=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],Ye=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],Ge=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],Ze=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],He=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],Ht=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],un=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],De=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],$e=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],me=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],Gt=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],mn=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],dn=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function jt(We){for(var Vt=[],Sn=0;Sn<We.length;Sn+=4)Vt.push(We[Sn]<<24|We[Sn+1]<<16|We[Sn+2]<<8|We[Sn+3]);return Vt}var le=function(We){if(!(this instanceof le))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:ae(We,!0)}),this._prepare()};le.prototype._prepare=function(){var We=be[this.key.length];if(We==null)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var Vt=0;Vt<=We;Vt++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);for(var Sn=(We+1)*4,An=this.key.length/4,Cn=jt(this.key),Qn,Vt=0;Vt<An;Vt++)Qn=Vt>>2,this._Ke[Qn][Vt%4]=Cn[Vt],this._Kd[We-Qn][Vt%4]=Cn[Vt];for(var En=0,In=An,Mn;In<Sn;){if(Mn=Cn[An-1],Cn[0]^=we[Mn>>16&255]<<24^we[Mn>>8&255]<<16^we[Mn&255]<<8^we[Mn>>24&255]^_e[En]<<24,En+=1,An!=8)for(var Vt=1;Vt<An;Vt++)Cn[Vt]^=Cn[Vt-1];else{for(var Vt=1;Vt<An/2;Vt++)Cn[Vt]^=Cn[Vt-1];Mn=Cn[An/2-1],Cn[An/2]^=we[Mn&255]^we[Mn>>8&255]<<8^we[Mn>>16&255]<<16^we[Mn>>24&255]<<24;for(var Vt=An/2+1;Vt<An;Vt++)Cn[Vt]^=Cn[Vt-1]}for(var Vt=0,zn,Jn;Vt<An&&In<Sn;)zn=In>>2,Jn=In%4,this._Ke[zn][Jn]=Cn[Vt],this._Kd[We-zn][Jn]=Cn[Vt++],In++}for(var zn=1;zn<We;zn++)for(var Jn=0;Jn<4;Jn++)Mn=this._Kd[zn][Jn],this._Kd[zn][Jn]=me[Mn>>24&255]^Gt[Mn>>16&255]^mn[Mn>>8&255]^dn[Mn&255]},le.prototype.encrypt=function(We){if(We.length!=16)throw new Error("invalid plaintext size (must be 16 bytes)");for(var Vt=this._Ke.length-1,Sn=[0,0,0,0],An=jt(We),Cn=0;Cn<4;Cn++)An[Cn]^=this._Ke[0][Cn];for(var Qn=1;Qn<Vt;Qn++){for(var Cn=0;Cn<4;Cn++)Sn[Cn]=Ye[An[Cn]>>24&255]^Ge[An[(Cn+1)%4]>>16&255]^Ze[An[(Cn+2)%4]>>8&255]^He[An[(Cn+3)%4]&255]^this._Ke[Qn][Cn];An=Sn.slice()}for(var En=de(16),In,Cn=0;Cn<4;Cn++)In=this._Ke[Vt][Cn],En[4*Cn]=(we[An[Cn]>>24&255]^In>>24)&255,En[4*Cn+1]=(we[An[(Cn+1)%4]>>16&255]^In>>16)&255,En[4*Cn+2]=(we[An[(Cn+2)%4]>>8&255]^In>>8)&255,En[4*Cn+3]=(we[An[(Cn+3)%4]&255]^In)&255;return En},le.prototype.decrypt=function(We){if(We.length!=16)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var Vt=this._Kd.length-1,Sn=[0,0,0,0],An=jt(We),Cn=0;Cn<4;Cn++)An[Cn]^=this._Kd[0][Cn];for(var Qn=1;Qn<Vt;Qn++){for(var Cn=0;Cn<4;Cn++)Sn[Cn]=Ht[An[Cn]>>24&255]^un[An[(Cn+3)%4]>>16&255]^De[An[(Cn+2)%4]>>8&255]^$e[An[(Cn+1)%4]&255]^this._Kd[Qn][Cn];An=Sn.slice()}for(var En=de(16),In,Cn=0;Cn<4;Cn++)In=this._Kd[Vt][Cn],En[4*Cn]=(qe[An[Cn]>>24&255]^In>>24)&255,En[4*Cn+1]=(qe[An[(Cn+3)%4]>>16&255]^In>>16)&255,En[4*Cn+2]=(qe[An[(Cn+2)%4]>>8&255]^In>>8)&255,En[4*Cn+3]=(qe[An[(Cn+1)%4]&255]^In)&255;return En};var Pe=function(We){if(!(this instanceof Pe))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new le(We)};Pe.prototype.encrypt=function(We){if(We=ae(We),We.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var Vt=de(We.length),Sn=de(16),An=0;An<We.length;An+=16)ue(We,Sn,0,An,An+16),Sn=this._aes.encrypt(Sn),ue(Sn,Vt,An);return Vt},Pe.prototype.decrypt=function(We){if(We=ae(We),We.length%16!==0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var Vt=de(We.length),Sn=de(16),An=0;An<We.length;An+=16)ue(We,Sn,0,An,An+16),Sn=this._aes.decrypt(Sn),ue(Sn,Vt,An);return Vt};var xe=function(We,Vt){if(!(this instanceof xe))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",!Vt)Vt=de(16);else if(Vt.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");this._lastCipherblock=ae(Vt,!0),this._aes=new le(We)};xe.prototype.encrypt=function(We){if(We=ae(We),We.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var Vt=de(We.length),Sn=de(16),An=0;An<We.length;An+=16){ue(We,Sn,0,An,An+16);for(var Cn=0;Cn<16;Cn++)Sn[Cn]^=this._lastCipherblock[Cn];this._lastCipherblock=this._aes.encrypt(Sn),ue(this._lastCipherblock,Vt,An)}return Vt},xe.prototype.decrypt=function(We){if(We=ae(We),We.length%16!==0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var Vt=de(We.length),Sn=de(16),An=0;An<We.length;An+=16){ue(We,Sn,0,An,An+16),Sn=this._aes.decrypt(Sn);for(var Cn=0;Cn<16;Cn++)Vt[An+Cn]=Sn[Cn]^this._lastCipherblock[Cn];ue(We,this._lastCipherblock,0,An,An+16)}return Vt};var ze=function(We,Vt,Sn){if(!(this instanceof ze))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",!Vt)Vt=de(16);else if(Vt.length!=16)throw new Error("invalid initialation vector size (must be 16 size)");Sn||(Sn=1),this.segmentSize=Sn,this._shiftRegister=ae(Vt,!0),this._aes=new le(We)};ze.prototype.encrypt=function(We){if(We.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var Vt=ae(We,!0),Sn,An=0;An<Vt.length;An+=this.segmentSize){Sn=this._aes.encrypt(this._shiftRegister);for(var Cn=0;Cn<this.segmentSize;Cn++)Vt[An+Cn]^=Sn[Cn];ue(this._shiftRegister,this._shiftRegister,0,this.segmentSize),ue(Vt,this._shiftRegister,16-this.segmentSize,An,An+this.segmentSize)}return Vt},ze.prototype.decrypt=function(We){if(We.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var Vt=ae(We,!0),Sn,An=0;An<Vt.length;An+=this.segmentSize){Sn=this._aes.encrypt(this._shiftRegister);for(var Cn=0;Cn<this.segmentSize;Cn++)Vt[An+Cn]^=Sn[Cn];ue(this._shiftRegister,this._shiftRegister,0,this.segmentSize),ue(We,this._shiftRegister,16-this.segmentSize,An,An+this.segmentSize)}return Vt};var Ft=function(We,Vt){if(!(this instanceof Ft))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",!Vt)Vt=de(16);else if(Vt.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");this._lastPrecipher=ae(Vt,!0),this._lastPrecipherIndex=16,this._aes=new le(We)};Ft.prototype.encrypt=function(We){for(var Vt=ae(We,!0),Sn=0;Sn<Vt.length;Sn++)this._lastPrecipherIndex===16&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),Vt[Sn]^=this._lastPrecipher[this._lastPrecipherIndex++];return Vt},Ft.prototype.decrypt=Ft.prototype.encrypt;var yn=function(We){if(!(this instanceof yn))throw Error("Counter must be instanitated with `new`");We!==0&&!We&&(We=1),typeof We=="number"?(this._counter=de(16),this.setValue(We)):this.setBytes(We)};yn.prototype.setValue=function(We){if(typeof We!="number"||parseInt(We)!=We)throw new Error("invalid counter value (must be an integer)");for(var Vt=15;Vt>=0;--Vt)this._counter[Vt]=We%256,We=We>>8},yn.prototype.setBytes=function(We){if(We=ae(We,!0),We.length!=16)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=We},yn.prototype.increment=function(){for(var We=15;We>=0;We--)if(this._counter[We]===255)this._counter[We]=0;else{this._counter[We]++;break}};var Zt=function(We,Vt){if(!(this instanceof Zt))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",Vt instanceof yn||(Vt=new yn(Vt)),this._counter=Vt,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new le(We)};Zt.prototype.encrypt=function(We){for(var Vt=ae(We,!0),Sn=0;Sn<Vt.length;Sn++)this._remainingCounterIndex===16&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),Vt[Sn]^=this._remainingCounter[this._remainingCounterIndex++];return Vt},Zt.prototype.decrypt=Zt.prototype.encrypt;function Me(We){We=ae(We,!0);var Vt=16-We.length%16,Sn=de(We.length+Vt);ue(We,Sn);for(var An=We.length;An<Sn.length;An++)Sn[An]=Vt;return Sn}function ce(We){if(We=ae(We,!0),We.length<16)throw new Error("PKCS#7 invalid length");var Vt=We[We.length-1];if(Vt>16)throw new Error("PKCS#7 padding byte out of range");for(var Sn=We.length-Vt,An=0;An<Vt;An++)if(We[Sn+An]!==Vt)throw new Error("PKCS#7 invalid padding byte");var Cn=de(Sn);return ue(We,Cn,0,0,Sn),Cn}var Ne={AES:le,Counter:yn,ModeOfOperation:{ecb:Pe,cbc:xe,cfb:ze,ofb:Ft,ctr:Zt},utils:{hex:ge,utf8:pe},padding:{pkcs7:{pad:Me,strip:ce}},_arrayTest:{coerceArray:ae,createArray:de,copyArray:ue}};t.exports=Ne})()})(aesJs);var aesJsExports=aesJs.exports;const aes$1=getDefaultExportFromCjs$2(aesJsExports),version$c="json-wallets/5.8.0";function looseArrayify(t){return typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),arrayify(t)}function zpad(t,n){for(t=String(t);t.length<n;)t="0"+t;return t}function getPassword(t){return typeof t=="string"?toUtf8Bytes(t,UnicodeNormalizationForm.NFKC):arrayify(t)}function searchPath(t,n){let c=t;const ie=n.toLowerCase().split("/");for(let se=0;se<ie.length;se++){let ae=null;for(const de in c)if(de.toLowerCase()===ie[se]){ae=c[de];break}if(ae===null)return null;c=ae}return c}function uuidV4(t){const n=arrayify(t);n[6]=n[6]&15|64,n[8]=n[8]&63|128;const c=hexlify$1(n);return[c.substring(2,10),c.substring(10,14),c.substring(14,18),c.substring(18,22),c.substring(22,34)].join("-")}const logger$a=new Logger$1(version$c);class CrowdsaleAccount extends Description$1{isCrowdsaleAccount(n){return!!(n&&n._isCrowdsaleAccount)}}function decrypt$1(t,n){const c=JSON.parse(t);n=getPassword(n);const ie=getAddress$1(searchPath(c,"ethaddr")),se=looseArrayify(searchPath(c,"encseed"));(!se||se.length%16!==0)&&logger$a.throwArgumentError("invalid encseed","json",t);const ae=arrayify(pbkdf2$1$1(n,n,2e3,32,"sha256")).slice(0,16),de=se.slice(0,16),ue=se.slice(16),pe=new aes$1.ModeOfOperation.cbc(ae,de),ge=aes$1.padding.pkcs7.strip(arrayify(pe.decrypt(ue)));let be="";for(let qe=0;qe<ge.length;qe++)be+=String.fromCharCode(ge[qe]);const _e=toUtf8Bytes(be),we=keccak256$1(_e);return new CrowdsaleAccount({_isCrowdsaleAccount:!0,address:ie,privateKey:we})}function isCrowdsaleWallet(t){let n=null;try{n=JSON.parse(t)}catch{return!1}return n.encseed&&n.ethaddr}function isKeystoreWallet(t){let n=null;try{n=JSON.parse(t)}catch{return!1}return!(!n.version||parseInt(n.version)!==n.version||parseInt(n.version)!==3)}function getJsonWalletAddress(t){if(isCrowdsaleWallet(t))try{return getAddress$1(JSON.parse(t).ethaddr)}catch{return null}if(isKeystoreWallet(t))try{return getAddress$1(JSON.parse(t).address)}catch{return null}return null}var scrypt$1={exports:{}};(function(t,n){(function(c){function ie(Ye){const Ge=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);let Ze=1779033703,He=3144134277,Ht=1013904242,un=2773480762,De=1359893119,$e=2600822924,me=528734635,Gt=1541459225;const mn=new Uint32Array(64);function dn(yn){let Zt=0,Me=yn.length;for(;Me>=64;){let ce=Ze,Ne=He,We=Ht,Vt=un,Sn=De,An=$e,Cn=me,Qn=Gt,En,In,Mn,zn,Jn;for(In=0;In<16;In++)Mn=Zt+In*4,mn[In]=(yn[Mn]&255)<<24|(yn[Mn+1]&255)<<16|(yn[Mn+2]&255)<<8|yn[Mn+3]&255;for(In=16;In<64;In++)En=mn[In-2],zn=(En>>>17|En<<15)^(En>>>19|En<<13)^En>>>10,En=mn[In-15],Jn=(En>>>7|En<<25)^(En>>>18|En<<14)^En>>>3,mn[In]=(zn+mn[In-7]|0)+(Jn+mn[In-16]|0)|0;for(In=0;In<64;In++)zn=(((Sn>>>6|Sn<<26)^(Sn>>>11|Sn<<21)^(Sn>>>25|Sn<<7))+(Sn&An^~Sn&Cn)|0)+(Qn+(Ge[In]+mn[In]|0)|0)|0,Jn=((ce>>>2|ce<<30)^(ce>>>13|ce<<19)^(ce>>>22|ce<<10))+(ce&Ne^ce&We^Ne&We)|0,Qn=Cn,Cn=An,An=Sn,Sn=Vt+zn|0,Vt=We,We=Ne,Ne=ce,ce=zn+Jn|0;Ze=Ze+ce|0,He=He+Ne|0,Ht=Ht+We|0,un=un+Vt|0,De=De+Sn|0,$e=$e+An|0,me=me+Cn|0,Gt=Gt+Qn|0,Zt+=64,Me-=64}}dn(Ye);let jt,le=Ye.length%64,Pe=Ye.length/536870912|0,xe=Ye.length<<3,ze=le<56?56:120,Ft=Ye.slice(Ye.length-le,Ye.length);for(Ft.push(128),jt=le+1;jt<ze;jt++)Ft.push(0);return Ft.push(Pe>>>24&255),Ft.push(Pe>>>16&255),Ft.push(Pe>>>8&255),Ft.push(Pe>>>0&255),Ft.push(xe>>>24&255),Ft.push(xe>>>16&255),Ft.push(xe>>>8&255),Ft.push(xe>>>0&255),dn(Ft),[Ze>>>24&255,Ze>>>16&255,Ze>>>8&255,Ze>>>0&255,He>>>24&255,He>>>16&255,He>>>8&255,He>>>0&255,Ht>>>24&255,Ht>>>16&255,Ht>>>8&255,Ht>>>0&255,un>>>24&255,un>>>16&255,un>>>8&255,un>>>0&255,De>>>24&255,De>>>16&255,De>>>8&255,De>>>0&255,$e>>>24&255,$e>>>16&255,$e>>>8&255,$e>>>0&255,me>>>24&255,me>>>16&255,me>>>8&255,me>>>0&255,Gt>>>24&255,Gt>>>16&255,Gt>>>8&255,Gt>>>0&255]}function se(Ye,Ge,Ze){Ye=Ye.length<=64?Ye:ie(Ye);const He=64+Ge.length+4,Ht=new Array(He),un=new Array(64);let De,$e=[];for(De=0;De<64;De++)Ht[De]=54;for(De=0;De<Ye.length;De++)Ht[De]^=Ye[De];for(De=0;De<Ge.length;De++)Ht[64+De]=Ge[De];for(De=He-4;De<He;De++)Ht[De]=0;for(De=0;De<64;De++)un[De]=92;for(De=0;De<Ye.length;De++)un[De]^=Ye[De];function me(){for(let Gt=He-1;Gt>=He-4;Gt--){if(Ht[Gt]++,Ht[Gt]<=255)return;Ht[Gt]=0}}for(;Ze>=32;)me(),$e=$e.concat(ie(un.concat(ie(Ht)))),Ze-=32;return Ze>0&&(me(),$e=$e.concat(ie(un.concat(ie(Ht))).slice(0,Ze))),$e}function ae(Ye,Ge,Ze,He,Ht){let un;for(ge(Ye,(2*Ze-1)*16,Ht,0,16),un=0;un<2*Ze;un++)pe(Ye,un*16,Ht,16),ue(Ht,He),ge(Ht,0,Ye,Ge+un*16,16);for(un=0;un<Ze;un++)ge(Ye,Ge+un*2*16,Ye,un*16,16);for(un=0;un<Ze;un++)ge(Ye,Ge+(un*2+1)*16,Ye,(un+Ze)*16,16)}function de(Ye,Ge){return Ye<<Ge|Ye>>>32-Ge}function ue(Ye,Ge){ge(Ye,0,Ge,0,16);for(let Ze=8;Ze>0;Ze-=2)Ge[4]^=de(Ge[0]+Ge[12],7),Ge[8]^=de(Ge[4]+Ge[0],9),Ge[12]^=de(Ge[8]+Ge[4],13),Ge[0]^=de(Ge[12]+Ge[8],18),Ge[9]^=de(Ge[5]+Ge[1],7),Ge[13]^=de(Ge[9]+Ge[5],9),Ge[1]^=de(Ge[13]+Ge[9],13),Ge[5]^=de(Ge[1]+Ge[13],18),Ge[14]^=de(Ge[10]+Ge[6],7),Ge[2]^=de(Ge[14]+Ge[10],9),Ge[6]^=de(Ge[2]+Ge[14],13),Ge[10]^=de(Ge[6]+Ge[2],18),Ge[3]^=de(Ge[15]+Ge[11],7),Ge[7]^=de(Ge[3]+Ge[15],9),Ge[11]^=de(Ge[7]+Ge[3],13),Ge[15]^=de(Ge[11]+Ge[7],18),Ge[1]^=de(Ge[0]+Ge[3],7),Ge[2]^=de(Ge[1]+Ge[0],9),Ge[3]^=de(Ge[2]+Ge[1],13),Ge[0]^=de(Ge[3]+Ge[2],18),Ge[6]^=de(Ge[5]+Ge[4],7),Ge[7]^=de(Ge[6]+Ge[5],9),Ge[4]^=de(Ge[7]+Ge[6],13),Ge[5]^=de(Ge[4]+Ge[7],18),Ge[11]^=de(Ge[10]+Ge[9],7),Ge[8]^=de(Ge[11]+Ge[10],9),Ge[9]^=de(Ge[8]+Ge[11],13),Ge[10]^=de(Ge[9]+Ge[8],18),Ge[12]^=de(Ge[15]+Ge[14],7),Ge[13]^=de(Ge[12]+Ge[15],9),Ge[14]^=de(Ge[13]+Ge[12],13),Ge[15]^=de(Ge[14]+Ge[13],18);for(let Ze=0;Ze<16;++Ze)Ye[Ze]+=Ge[Ze]}function pe(Ye,Ge,Ze,He){for(let Ht=0;Ht<He;Ht++)Ze[Ht]^=Ye[Ge+Ht]}function ge(Ye,Ge,Ze,He,Ht){for(;Ht--;)Ze[He++]=Ye[Ge++]}function be(Ye){if(!Ye||typeof Ye.length!="number")return!1;for(let Ge=0;Ge<Ye.length;Ge++){const Ze=Ye[Ge];if(typeof Ze!="number"||Ze%1||Ze<0||Ze>=256)return!1}return!0}function _e(Ye,Ge){if(typeof Ye!="number"||Ye%1)throw new Error("invalid "+Ge);return Ye}function we(Ye,Ge,Ze,He,Ht,un,De){if(Ze=_e(Ze,"N"),He=_e(He,"r"),Ht=_e(Ht,"p"),un=_e(un,"dkLen"),Ze===0||Ze&Ze-1)throw new Error("N must be power of 2");if(Ze>2147483647/128/He)throw new Error("N too large");if(He>2147483647/128/Ht)throw new Error("r too large");if(!be(Ye))throw new Error("password must be an array or buffer");if(Ye=Array.prototype.slice.call(Ye),!be(Ge))throw new Error("salt must be an array or buffer");Ge=Array.prototype.slice.call(Ge);let $e=se(Ye,Ge,Ht*128*He);const me=new Uint32Array(Ht*32*He);for(let Sn=0;Sn<me.length;Sn++){const An=Sn*4;me[Sn]=($e[An+3]&255)<<24|($e[An+2]&255)<<16|($e[An+1]&255)<<8|($e[An+0]&255)<<0}const Gt=new Uint32Array(64*He),mn=new Uint32Array(32*He*Ze),dn=32*He,jt=new Uint32Array(16),le=new Uint32Array(16),Pe=Ht*Ze*2;let xe=0,ze=null,Ft=!1,yn=0,Zt=0,Me,ce;const Ne=De?parseInt(1e3/He):4294967295,We=typeof setImmediate<"u"?setImmediate:setTimeout,Vt=function(){if(Ft)return De(new Error("cancelled"),xe/Pe);let Sn;switch(yn){case 0:ce=Zt*32*He,ge(me,ce,Gt,0,dn),yn=1,Me=0;case 1:Sn=Ze-Me,Sn>Ne&&(Sn=Ne);for(let Cn=0;Cn<Sn;Cn++)ge(Gt,0,mn,(Me+Cn)*dn,dn),ae(Gt,dn,He,jt,le);if(Me+=Sn,xe+=Sn,De){const Cn=parseInt(1e3*xe/Pe);if(Cn!==ze){if(Ft=De(null,xe/Pe),Ft)break;ze=Cn}}if(Me<Ze)break;Me=0,yn=2;case 2:Sn=Ze-Me,Sn>Ne&&(Sn=Ne);for(let Cn=0;Cn<Sn;Cn++){const Qn=(2*He-1)*16,En=Gt[Qn]&Ze-1;pe(mn,En*dn,Gt,dn),ae(Gt,dn,He,jt,le)}if(Me+=Sn,xe+=Sn,De){const Cn=parseInt(1e3*xe/Pe);if(Cn!==ze){if(Ft=De(null,xe/Pe),Ft)break;ze=Cn}}if(Me<Ze)break;if(ge(Gt,0,me,ce,dn),Zt++,Zt<Ht){yn=0;break}$e=[];for(let Cn=0;Cn<me.length;Cn++)$e.push(me[Cn]>>0&255),$e.push(me[Cn]>>8&255),$e.push(me[Cn]>>16&255),$e.push(me[Cn]>>24&255);const An=se(Ye,$e,un);return De&&De(null,1,An),An}De&&We(Vt)};if(!De)for(;;){const Sn=Vt();if(Sn!=null)return Sn}Vt()}const qe={scrypt:function(Ye,Ge,Ze,He,Ht,un,De){return new Promise(function($e,me){let Gt=0;De&&De(0),we(Ye,Ge,Ze,He,Ht,un,function(mn,dn,jt){if(mn)me(mn);else if(jt)De&&Gt!==1&&De(1),$e(new Uint8Array(jt));else if(De&&dn!==Gt)return Gt=dn,De(dn)})})},syncScrypt:function(Ye,Ge,Ze,He,Ht,un){return new Uint8Array(we(Ye,Ge,Ze,He,Ht,un))}};t.exports=qe})()})(scrypt$1);var scryptExports=scrypt$1.exports;const scrypt$2=getDefaultExportFromCjs$2(scryptExports);var __awaiter$g=function(t,n,c,ie){function se(ae){return ae instanceof c?ae:new c(function(de){de(ae)})}return new(c||(c=Promise))(function(ae,de){function ue(be){try{ge(ie.next(be))}catch(_e){de(_e)}}function pe(be){try{ge(ie.throw(be))}catch(_e){de(_e)}}function ge(be){be.done?ae(be.value):se(be.value).then(ue,pe)}ge((ie=ie.apply(t,[])).next())})};const logger$9=new Logger$1(version$c);function hasMnemonic$1(t){return t!=null&&t.mnemonic&&t.mnemonic.phrase}class KeystoreAccount extends Description$1{isKeystoreAccount(n){return!!(n&&n._isKeystoreAccount)}}function _decrypt(t,n,c){if(searchPath(t,"crypto/cipher")==="aes-128-ctr"){const ie=looseArrayify(searchPath(t,"crypto/cipherparams/iv")),se=new aes$1.Counter(ie),ae=new aes$1.ModeOfOperation.ctr(n,se);return arrayify(ae.decrypt(c))}return null}function _getAccount(t,n){const c=looseArrayify(searchPath(t,"crypto/ciphertext"));if(hexlify$1(keccak256$1(concat$1([n.slice(16,32),c]))).substring(2)!==searchPath(t,"crypto/mac").toLowerCase())throw new Error("invalid password");const ie=_decrypt(t,n.slice(0,16),c);ie||logger$9.throwError("unsupported cipher",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const se=n.slice(32,64),ae=computeAddress(ie);if(t.address){let ue=t.address.toLowerCase();if(ue.substring(0,2)!=="0x"&&(ue="0x"+ue),getAddress$1(ue)!==ae)throw new Error("address mismatch")}const de={_isKeystoreAccount:!0,address:ae,privateKey:hexlify$1(ie)};if(searchPath(t,"x-ethers/version")==="0.1"){const ue=looseArrayify(searchPath(t,"x-ethers/mnemonicCiphertext")),pe=looseArrayify(searchPath(t,"x-ethers/mnemonicCounter")),ge=new aes$1.Counter(pe),be=new aes$1.ModeOfOperation.ctr(se,ge),_e=searchPath(t,"x-ethers/path")||defaultPath,we=searchPath(t,"x-ethers/locale")||"en",qe=arrayify(be.decrypt(ue));try{const Ye=entropyToMnemonic(qe,we),Ge=HDNode.fromMnemonic(Ye,null,we).derivePath(_e);if(Ge.privateKey!=de.privateKey)throw new Error("mnemonic mismatch");de.mnemonic=Ge.mnemonic}catch(Ye){if(Ye.code!==Logger$1.errors.INVALID_ARGUMENT||Ye.argument!=="wordlist")throw Ye}}return new KeystoreAccount(de)}function pbkdf2Sync(t,n,c,ie,se){return arrayify(pbkdf2$1$1(t,n,c,ie,se))}function pbkdf2$3(t,n,c,ie,se){return Promise.resolve(pbkdf2Sync(t,n,c,ie,se))}function _computeKdfKey(t,n,c,ie,se){const ae=getPassword(n),de=searchPath(t,"crypto/kdf");if(de&&typeof de=="string"){const ue=function(pe,ge){return logger$9.throwArgumentError("invalid key-derivation function parameters",pe,ge)};if(de.toLowerCase()==="scrypt"){const pe=looseArrayify(searchPath(t,"crypto/kdfparams/salt")),ge=parseInt(searchPath(t,"crypto/kdfparams/n")),be=parseInt(searchPath(t,"crypto/kdfparams/r")),_e=parseInt(searchPath(t,"crypto/kdfparams/p"));(!ge||!be||!_e)&&ue("kdf",de),ge&ge-1&&ue("N",ge);const we=parseInt(searchPath(t,"crypto/kdfparams/dklen"));return we!==32&&ue("dklen",we),ie(ae,pe,ge,be,_e,64,se)}else if(de.toLowerCase()==="pbkdf2"){const pe=looseArrayify(searchPath(t,"crypto/kdfparams/salt"));let ge=null;const be=searchPath(t,"crypto/kdfparams/prf");be==="hmac-sha256"?ge="sha256":be==="hmac-sha512"?ge="sha512":ue("prf",be);const _e=parseInt(searchPath(t,"crypto/kdfparams/c")),we=parseInt(searchPath(t,"crypto/kdfparams/dklen"));return we!==32&&ue("dklen",we),c(ae,pe,_e,we,ge)}}return logger$9.throwArgumentError("unsupported key-derivation function","kdf",de)}function decryptSync(t,n){const c=JSON.parse(t),ie=_computeKdfKey(c,n,pbkdf2Sync,scrypt$2.syncScrypt);return _getAccount(c,ie)}function decrypt(t,n,c){return __awaiter$g(this,void 0,void 0,function*(){const ie=JSON.parse(t),se=yield _computeKdfKey(ie,n,pbkdf2$3,scrypt$2.scrypt,c);return _getAccount(ie,se)})}function encrypt(t,n,c,ie){try{if(getAddress$1(t.address)!==computeAddress(t.privateKey))throw new Error("address/privateKey mismatch");if(hasMnemonic$1(t)){const Ze=t.mnemonic;if(HDNode.fromMnemonic(Ze.phrase,null,Ze.locale).derivePath(Ze.path||defaultPath).privateKey!=t.privateKey)throw new Error("mnemonic mismatch")}}catch(Ze){return Promise.reject(Ze)}typeof c=="function"&&!ie&&(ie=c,c={}),c||(c={});const se=arrayify(t.privateKey),ae=getPassword(n);let de=null,ue=null,pe=null;if(hasMnemonic$1(t)){const Ze=t.mnemonic;de=arrayify(mnemonicToEntropy(Ze.phrase,Ze.locale||"en")),ue=Ze.path||defaultPath,pe=Ze.locale||"en"}let ge=c.client;ge||(ge="ethers.js");let be=null;c.salt?be=arrayify(c.salt):be=randomBytes$1(32);let _e=null;if(c.iv){if(_e=arrayify(c.iv),_e.length!==16)throw new Error("invalid iv")}else _e=randomBytes$1(16);let we=null;if(c.uuid){if(we=arrayify(c.uuid),we.length!==16)throw new Error("invalid uuid")}else we=randomBytes$1(16);let qe=1<<17,Ye=8,Ge=1;return c.scrypt&&(c.scrypt.N&&(qe=c.scrypt.N),c.scrypt.r&&(Ye=c.scrypt.r),c.scrypt.p&&(Ge=c.scrypt.p)),scrypt$2.scrypt(ae,be,qe,Ye,Ge,64,ie).then(Ze=>{Ze=arrayify(Ze);const He=Ze.slice(0,16),Ht=Ze.slice(16,32),un=Ze.slice(32,64),De=new aes$1.Counter(_e),$e=new aes$1.ModeOfOperation.ctr(He,De),me=arrayify($e.encrypt(se)),Gt=keccak256$1(concat$1([Ht,me])),mn={address:t.address.substring(2).toLowerCase(),id:uuidV4(we),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:hexlify$1(_e).substring(2)},ciphertext:hexlify$1(me).substring(2),kdf:"scrypt",kdfparams:{salt:hexlify$1(be).substring(2),n:qe,dklen:32,p:Ge,r:Ye},mac:Gt.substring(2)}};if(de){const dn=randomBytes$1(16),jt=new aes$1.Counter(dn),le=new aes$1.ModeOfOperation.ctr(un,jt),Pe=arrayify(le.encrypt(de)),xe=new Date,ze=xe.getUTCFullYear()+"-"+zpad(xe.getUTCMonth()+1,2)+"-"+zpad(xe.getUTCDate(),2)+"T"+zpad(xe.getUTCHours(),2)+"-"+zpad(xe.getUTCMinutes(),2)+"-"+zpad(xe.getUTCSeconds(),2)+".0Z";mn["x-ethers"]={client:ge,gethFilename:"UTC--"+ze+"--"+mn.address,mnemonicCounter:hexlify$1(dn).substring(2),mnemonicCiphertext:hexlify$1(Pe).substring(2),path:ue,locale:pe,version:"0.1"}}return JSON.stringify(mn)})}function decryptJsonWallet(t,n,c){if(isCrowdsaleWallet(t)){c&&c(0);const ie=decrypt$1(t,n);return c&&c(1),Promise.resolve(ie)}return isKeystoreWallet(t)?decrypt(t,n,c):Promise.reject(new Error("invalid JSON wallet"))}function decryptJsonWalletSync(t,n){if(isCrowdsaleWallet(t))return decrypt$1(t,n);if(isKeystoreWallet(t))return decryptSync(t,n);throw new Error("invalid JSON wallet")}const lib_esm$4=Object.freeze(Object.defineProperty({__proto__:null,decryptCrowdsale:decrypt$1,decryptJsonWallet,decryptJsonWalletSync,decryptKeystore:decrypt,decryptKeystoreSync:decryptSync,encryptKeystore:encrypt,getJsonWalletAddress,isCrowdsaleWallet,isKeystoreWallet},Symbol.toStringTag,{value:"Module"})),version$b="wallet/5.8.0";var __awaiter$f=function(t,n,c,ie){function se(ae){return ae instanceof c?ae:new c(function(de){de(ae)})}return new(c||(c=Promise))(function(ae,de){function ue(be){try{ge(ie.next(be))}catch(_e){de(_e)}}function pe(be){try{ge(ie.throw(be))}catch(_e){de(_e)}}function ge(be){be.done?ae(be.value):se(be.value).then(ue,pe)}ge((ie=ie.apply(t,[])).next())})};const logger$8=new Logger$1(version$b);function isAccount(t){return t!=null&&isHexString$1(t.privateKey,32)&&t.address!=null}function hasMnemonic(t){const n=t.mnemonic;return n&&n.phrase}class Wallet extends Signer{constructor(n,c){if(super(),isAccount(n)){const ie=new SigningKey(n.privateKey);if(defineReadOnly(this,"_signingKey",()=>ie),defineReadOnly(this,"address",computeAddress(this.publicKey)),this.address!==getAddress$1(n.address)&&logger$8.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),hasMnemonic(n)){const se=n.mnemonic;defineReadOnly(this,"_mnemonic",()=>({phrase:se.phrase,path:se.path||defaultPath,locale:se.locale||"en"}));const ae=this.mnemonic,de=HDNode.fromMnemonic(ae.phrase,null,ae.locale).derivePath(ae.path);computeAddress(de.privateKey)!==this.address&&logger$8.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else defineReadOnly(this,"_mnemonic",()=>null)}else{if(SigningKey.isSigningKey(n))n.curve!=="secp256k1"&&logger$8.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),defineReadOnly(this,"_signingKey",()=>n);else{typeof n=="string"&&n.match(/^[0-9a-f]*$/i)&&n.length===64&&(n="0x"+n);const ie=new SigningKey(n);defineReadOnly(this,"_signingKey",()=>ie)}defineReadOnly(this,"_mnemonic",()=>null),defineReadOnly(this,"address",computeAddress(this.publicKey))}c&&!Provider.isProvider(c)&&logger$8.throwArgumentError("invalid provider","provider",c),defineReadOnly(this,"provider",c||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(n){return new Wallet(this,n)}signTransaction(n){return resolveProperties(n).then(c=>{c.from!=null&&(getAddress$1(c.from)!==this.address&&logger$8.throwArgumentError("transaction from address mismatch","transaction.from",n.from),delete c.from);const ie=this._signingKey().signDigest(keccak256$1(serialize$1(c)));return serialize$1(c,ie)})}signMessage(n){return __awaiter$f(this,void 0,void 0,function*(){return joinSignature(this._signingKey().signDigest(hashMessage(n)))})}_signTypedData(n,c,ie){return __awaiter$f(this,void 0,void 0,function*(){const se=yield TypedDataEncoder.resolveNames(n,c,ie,ae=>(this.provider==null&&logger$8.throwError("cannot resolve ENS names without a provider",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:ae}),this.provider.resolveName(ae)));return joinSignature(this._signingKey().signDigest(TypedDataEncoder.hash(se.domain,c,se.value)))})}encrypt(n,c,ie){if(typeof c=="function"&&!ie&&(ie=c,c={}),ie&&typeof ie!="function")throw new Error("invalid callback");return c||(c={}),encrypt(this,n,c,ie)}static createRandom(n){let c=randomBytes$1(16);n||(n={}),n.extraEntropy&&(c=arrayify(hexDataSlice(keccak256$1(concat$1([c,n.extraEntropy])),0,16)));const ie=entropyToMnemonic(c,n.locale);return Wallet.fromMnemonic(ie,n.path,n.locale)}static fromEncryptedJson(n,c,ie){return decryptJsonWallet(n,c,ie).then(se=>new Wallet(se))}static fromEncryptedJsonSync(n,c){return new Wallet(decryptJsonWalletSync(n,c))}static fromMnemonic(n,c,ie){return c||(c=defaultPath),new Wallet(HDNode.fromMnemonic(n,null,ie).derivePath(c))}}function verifyMessage(t,n){return recoverAddress(hashMessage(t),n)}function verifyTypedData(t,n,c,ie){return recoverAddress(TypedDataEncoder.hash(t,n,c),ie)}const lib_esm$3=Object.freeze(Object.defineProperty({__proto__:null,Wallet,verifyMessage,verifyTypedData},Symbol.toStringTag,{value:"Module"})),version$a="networks/5.8.0",logger$7=new Logger$1(version$a);function isRenetworkable(t){return t&&typeof t.renetwork=="function"}function ethDefaultProvider(t){const n=function(c,ie){ie==null&&(ie={});const se=[];if(c.InfuraProvider&&ie.infura!=="-")try{se.push(new c.InfuraProvider(t,ie.infura))}catch{}if(c.EtherscanProvider&&ie.etherscan!=="-")try{se.push(new c.EtherscanProvider(t,ie.etherscan))}catch{}if(c.AlchemyProvider&&ie.alchemy!=="-")try{se.push(new c.AlchemyProvider(t,ie.alchemy))}catch{}if(c.PocketProvider&&ie.pocket!=="-"){const ae=["goerli","ropsten","rinkeby","sepolia"];try{const de=new c.PocketProvider(t,ie.pocket);de.network&&ae.indexOf(de.network.name)===-1&&se.push(de)}catch{}}if(c.CloudflareProvider&&ie.cloudflare!=="-")try{se.push(new c.CloudflareProvider(t))}catch{}if(c.AnkrProvider&&ie.ankr!=="-")try{const ae=["ropsten"],de=new c.AnkrProvider(t,ie.ankr);de.network&&ae.indexOf(de.network.name)===-1&&se.push(de)}catch{}if(c.QuickNodeProvider&&ie.quicknode!=="-")try{se.push(new c.QuickNodeProvider(t,ie.quicknode))}catch{}if(se.length===0)return null;if(c.FallbackProvider){let ae=1;return ie.quorum!=null?ae=ie.quorum:t==="homestead"&&(ae=2),new c.FallbackProvider(se,ae)}return se[0]};return n.renetwork=function(c){return ethDefaultProvider(c)},n}function etcDefaultProvider(t,n){const c=function(ie,se){return ie.JsonRpcProvider?new ie.JsonRpcProvider(t,n):null};return c.renetwork=function(ie){return etcDefaultProvider(t,ie)},c}const homestead={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:ethDefaultProvider("homestead")},ropsten={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:ethDefaultProvider("ropsten")},classicMordor={chainId:63,name:"classicMordor",_defaultProvider:etcDefaultProvider("https://www.ethercluster.com/mordor","classicMordor")},networks$2={unspecified:{chainId:0,name:"unspecified"},homestead,mainnet:homestead,morden:{chainId:2,name:"morden"},ropsten,testnet:ropsten,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:ethDefaultProvider("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:ethDefaultProvider("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:ethDefaultProvider("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"sepolia",_defaultProvider:ethDefaultProvider("sepolia")},holesky:{chainId:17e3,name:"holesky",_defaultProvider:ethDefaultProvider("holesky")},classic:{chainId:61,name:"classic",_defaultProvider:etcDefaultProvider("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor,classicTestnet:classicMordor,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:etcDefaultProvider("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:ethDefaultProvider("matic")},maticmum:{chainId:80001,name:"maticmum",_defaultProvider:ethDefaultProvider("maticmum")},optimism:{chainId:10,name:"optimism",_defaultProvider:ethDefaultProvider("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},"optimism-sepolia":{chainId:11155420,name:"optimism-sepolia"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},"arbitrum-sepolia":{chainId:421614,name:"arbitrum-sepolia"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function getNetwork(t){if(t==null)return null;if(typeof t=="number"){for(const ie in networks$2){const se=networks$2[ie];if(se.chainId===t)return{name:se.name,chainId:se.chainId,ensAddress:se.ensAddress||null,_defaultProvider:se._defaultProvider||null}}return{chainId:t,name:"unknown"}}if(typeof t=="string"){const ie=networks$2[t];return ie==null?null:{name:ie.name,chainId:ie.chainId,ensAddress:ie.ensAddress,_defaultProvider:ie._defaultProvider||null}}const n=networks$2[t.name];if(!n)return typeof t.chainId!="number"&&logger$7.throwArgumentError("invalid network chainId","network",t),t;t.chainId!==0&&t.chainId!==n.chainId&&logger$7.throwArgumentError("network chainId mismatch","network",t);let c=t._defaultProvider||null;return c==null&&n._defaultProvider&&(isRenetworkable(n._defaultProvider)?c=n._defaultProvider.renetwork(t):c=n._defaultProvider),{name:t.name,chainId:n.chainId,ensAddress:t.ensAddress||n.ensAddress||null,_defaultProvider:c}}const version$9="web/5.8.0";var __awaiter$e=function(t,n,c,ie){function se(ae){return ae instanceof c?ae:new c(function(de){de(ae)})}return new(c||(c=Promise))(function(ae,de){function ue(be){try{ge(ie.next(be))}catch(_e){de(_e)}}function pe(be){try{ge(ie.throw(be))}catch(_e){de(_e)}}function ge(be){be.done?ae(be.value):se(be.value).then(ue,pe)}ge((ie=ie.apply(t,[])).next())})};function getUrl(t,n){return __awaiter$e(this,void 0,void 0,function*(){n==null&&(n={});const c={method:n.method||"GET",headers:n.headers||{},body:n.body||void 0};if(n.skipFetchSetup!==!0&&(c.mode="cors",c.cache="no-cache",c.credentials="same-origin",c.redirect="follow",c.referrer="client"),n.fetchOptions!=null){const de=n.fetchOptions;de.mode&&(c.mode=de.mode),de.cache&&(c.cache=de.cache),de.credentials&&(c.credentials=de.credentials),de.redirect&&(c.redirect=de.redirect),de.referrer&&(c.referrer=de.referrer)}const ie=yield fetch(t,c),se=yield ie.arrayBuffer(),ae={};return ie.headers.forEach?ie.headers.forEach((de,ue)=>{ae[ue.toLowerCase()]=de}):ie.headers.keys().forEach(de=>{ae[de.toLowerCase()]=ie.headers.get(de)}),{headers:ae,statusCode:ie.status,statusMessage:ie.statusText,body:arrayify(new Uint8Array(se))}})}var __awaiter$d=function(t,n,c,ie){function se(ae){return ae instanceof c?ae:new c(function(de){de(ae)})}return new(c||(c=Promise))(function(ae,de){function ue(be){try{ge(ie.next(be))}catch(_e){de(_e)}}function pe(be){try{ge(ie.throw(be))}catch(_e){de(_e)}}function ge(be){be.done?ae(be.value):se(be.value).then(ue,pe)}ge((ie=ie.apply(t,[])).next())})};const logger$6=new Logger$1(version$9);function staller(t){return new Promise(n=>{setTimeout(n,t)})}function bodyify(t,n){if(t==null)return null;if(typeof t=="string")return t;if(isBytesLike(t)){if(n&&(n.split("/")[0]==="text"||n.split(";")[0].trim()==="application/json"))try{return toUtf8String(t)}catch{}return hexlify$1(t)}return t}function unpercent(t){return toUtf8Bytes(t.replace(/%([0-9a-f][0-9a-f])/gi,(n,c)=>String.fromCharCode(parseInt(c,16))))}function _fetchData(t,n,c){const ie=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;logger$6.assertArgument(ie>0&&ie%1===0,"invalid connection throttle limit","connection.throttleLimit",ie);const se=typeof t=="object"?t.throttleCallback:null,ae=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;logger$6.assertArgument(ae>0&&ae%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",ae);const de=typeof t=="object"?!!t.errorPassThrough:!1,ue={};let pe=null;const ge={method:"GET"};let be=!1,_e=120*1e3;if(typeof t=="string")pe=t;else if(typeof t=="object"){if((t==null||t.url==null)&&logger$6.throwArgumentError("missing URL","connection.url",t),pe=t.url,typeof t.timeout=="number"&&t.timeout>0&&(_e=t.timeout),t.headers)for(const He in t.headers)ue[He.toLowerCase()]={key:He,value:String(t.headers[He])},["if-none-match","if-modified-since"].indexOf(He.toLowerCase())>=0&&(be=!0);if(ge.allowGzip=!!t.allowGzip,t.user!=null&&t.password!=null){pe.substring(0,6)!=="https:"&&t.allowInsecureAuthentication!==!0&&logger$6.throwError("basic authentication requires a secure https url",Logger$1.errors.INVALID_ARGUMENT,{argument:"url",url:pe,user:t.user,password:"[REDACTED]"});const He=t.user+":"+t.password;ue.authorization={key:"Authorization",value:"Basic "+encode$5(toUtf8Bytes(He))}}t.skipFetchSetup!=null&&(ge.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(ge.fetchOptions=shallowCopy(t.fetchOptions))}const we=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),qe=pe?pe.match(we):null;if(qe)try{const He={statusCode:200,statusMessage:"OK",headers:{"content-type":qe[1]||"text/plain"},body:qe[2]?decode$6(qe[3]):unpercent(qe[3])};let Ht=He.body;return c&&(Ht=c(He.body,He)),Promise.resolve(Ht)}catch(He){logger$6.throwError("processing response error",Logger$1.errors.SERVER_ERROR,{body:bodyify(qe[1],qe[2]),error:He,requestBody:null,requestMethod:"GET",url:pe})}n&&(ge.method="POST",ge.body=n,ue["content-type"]==null&&(ue["content-type"]={key:"Content-Type",value:"application/octet-stream"}),ue["content-length"]==null&&(ue["content-length"]={key:"Content-Length",value:String(n.length)}));const Ye={};Object.keys(ue).forEach(He=>{const Ht=ue[He];Ye[Ht.key]=Ht.value}),ge.headers=Ye;const Ge=(function(){let He=null;return{promise:new Promise(function(Ht,un){_e&&(He=setTimeout(()=>{He!=null&&(He=null,un(logger$6.makeError("timeout",Logger$1.errors.TIMEOUT,{requestBody:bodyify(ge.body,Ye["content-type"]),requestMethod:ge.method,timeout:_e,url:pe})))},_e))}),cancel:function(){He!=null&&(clearTimeout(He),He=null)}}})(),Ze=(function(){return __awaiter$d(this,void 0,void 0,function*(){for(let He=0;He<ie;He++){let Ht=null;try{if(Ht=yield getUrl(pe,ge),He<ie){if(Ht.statusCode===301||Ht.statusCode===302){const De=Ht.headers.location||"";if(ge.method==="GET"&&De.match(/^https:/)){pe=Ht.headers.location;continue}}else if(Ht.statusCode===429){let De=!0;if(se&&(De=yield se(He,pe)),De){let $e=0;const me=Ht.headers["retry-after"];typeof me=="string"&&me.match(/^[1-9][0-9]*$/)?$e=parseInt(me)*1e3:$e=ae*parseInt(String(Math.random()*Math.pow(2,He))),yield staller($e);continue}}}}catch(De){Ht=De.response,Ht==null&&(Ge.cancel(),logger$6.throwError("missing response",Logger$1.errors.SERVER_ERROR,{requestBody:bodyify(ge.body,Ye["content-type"]),requestMethod:ge.method,serverError:De,url:pe}))}let un=Ht.body;if(be&&Ht.statusCode===304?un=null:!de&&(Ht.statusCode<200||Ht.statusCode>=300)&&(Ge.cancel(),logger$6.throwError("bad response",Logger$1.errors.SERVER_ERROR,{status:Ht.statusCode,headers:Ht.headers,body:bodyify(un,Ht.headers?Ht.headers["content-type"]:null),requestBody:bodyify(ge.body,Ye["content-type"]),requestMethod:ge.method,url:pe})),c)try{const De=yield c(un,Ht);return Ge.cancel(),De}catch(De){if(De.throttleRetry&&He<ie){let $e=!0;if(se&&($e=yield se(He,pe)),$e){const me=ae*parseInt(String(Math.random()*Math.pow(2,He)));yield staller(me);continue}}Ge.cancel(),logger$6.throwError("processing response error",Logger$1.errors.SERVER_ERROR,{body:bodyify(un,Ht.headers?Ht.headers["content-type"]:null),error:De,requestBody:bodyify(ge.body,Ye["content-type"]),requestMethod:ge.method,url:pe})}return Ge.cancel(),un}return logger$6.throwError("failed response",Logger$1.errors.SERVER_ERROR,{requestBody:bodyify(ge.body,Ye["content-type"]),requestMethod:ge.method,url:pe})})})();return Promise.race([Ge.promise,Ze])}function fetchJson(t,n,c){let ie=(ae,de)=>{let ue=null;if(ae!=null)try{ue=JSON.parse(toUtf8String(ae))}catch(pe){logger$6.throwError("invalid JSON",Logger$1.errors.SERVER_ERROR,{body:ae,error:pe})}return c&&(ue=c(ue,de)),ue},se=null;if(n!=null){se=toUtf8Bytes(n);const ae=typeof t=="string"?{url:t}:shallowCopy(t);ae.headers?Object.keys(ae.headers).filter(de=>de.toLowerCase()==="content-type").length!==0||(ae.headers=shallowCopy(ae.headers),ae.headers["content-type"]="application/json"):ae.headers={"content-type":"application/json"},t=ae}return _fetchData(t,se,ie)}function poll(t,n){return n||(n={}),n=shallowCopy(n),n.floor==null&&(n.floor=0),n.ceiling==null&&(n.ceiling=1e4),n.interval==null&&(n.interval=250),new Promise(function(c,ie){let se=null,ae=!1;const de=()=>ae?!1:(ae=!0,se&&clearTimeout(se),!0);n.timeout&&(se=setTimeout(()=>{de()&&ie(new Error("timeout"))},n.timeout));const ue=n.retryLimit;let pe=0;function ge(){return t().then(function(be){if(be!==void 0)de()&&c(be);else if(n.oncePoll)n.oncePoll.once("poll",ge);else if(n.onceBlock)n.onceBlock.once("block",ge);else if(!ae){if(pe++,pe>ue){de()&&ie(new Error("retry limit reached"));return}let _e=n.interval*parseInt(String(Math.random()*Math.pow(2,pe)));_e<n.floor&&(_e=n.floor),_e>n.ceiling&&(_e=n.ceiling),setTimeout(ge,_e)}return null},function(be){de()&&ie(be)})}ge()})}const lib_esm$2=Object.freeze(Object.defineProperty({__proto__:null,_fetchData,fetchJson,poll},Symbol.toStringTag,{value:"Module"}));var ALPHABET$2="qpzry9x8gf2tvdw0s3jn54khce6mua7l",ALPHABET_MAP$1={};for(var z$3=0;z$3<ALPHABET$2.length;z$3++){var x$2=ALPHABET$2.charAt(z$3);if(ALPHABET_MAP$1[x$2]!==void 0)throw new TypeError(x$2+" is ambiguous");ALPHABET_MAP$1[x$2]=z$3}function polymodStep$1(t){var n=t>>25;return(t&33554431)<<5^-(n>>0&1)&996825010^-(n>>1&1)&642813549^-(n>>2&1)&513874426^-(n>>3&1)&1027748829^-(n>>4&1)&705979059}function prefixChk$1(t){for(var n=1,c=0;c<t.length;++c){var ie=t.charCodeAt(c);if(ie<33||ie>126)return"Invalid prefix ("+t+")";n=polymodStep$1(n)^ie>>5}for(n=polymodStep$1(n),c=0;c<t.length;++c){var se=t.charCodeAt(c);n=polymodStep$1(n)^se&31}return n}function encode$4(t,n,c){if(c=c||90,t.length+7+n.length>c)throw new TypeError("Exceeds length limit");t=t.toLowerCase();var ie=prefixChk$1(t);if(typeof ie=="string")throw new Error(ie);for(var se=t+"1",ae=0;ae<n.length;++ae){var de=n[ae];if(de>>5)throw new Error("Non 5-bit word");ie=polymodStep$1(ie)^de,se+=ALPHABET$2.charAt(de)}for(ae=0;ae<6;++ae)ie=polymodStep$1(ie);for(ie^=1,ae=0;ae<6;++ae){var ue=ie>>(5-ae)*5&31;se+=ALPHABET$2.charAt(ue)}return se}function __decode(t,n){if(n=n||90,t.length<8)return t+" too short";if(t.length>n)return"Exceeds length limit";var c=t.toLowerCase(),ie=t.toUpperCase();if(t!==c&&t!==ie)return"Mixed-case string "+t;t=c;var se=t.lastIndexOf("1");if(se===-1)return"No separator character for "+t;if(se===0)return"Missing prefix for "+t;var ae=t.slice(0,se),de=t.slice(se+1);if(de.length<6)return"Data too short";var ue=prefixChk$1(ae);if(typeof ue=="string")return ue;for(var pe=[],ge=0;ge<de.length;++ge){var be=de.charAt(ge),_e=ALPHABET_MAP$1[be];if(_e===void 0)return"Unknown character "+be;ue=polymodStep$1(ue)^_e,!(ge+6>=de.length)&&pe.push(_e)}return ue!==1?"Invalid checksum for "+t:{prefix:ae,words:pe}}function decodeUnsafe(){var t=__decode.apply(null,arguments);if(typeof t=="object")return t}function decode$5(t){var n=__decode.apply(null,arguments);if(typeof n=="object")return n;throw new Error(n)}function convert$1(t,n,c,ie){for(var se=0,ae=0,de=(1<<c)-1,ue=[],pe=0;pe<t.length;++pe)for(se=se<<n|t[pe],ae+=n;ae>=c;)ae-=c,ue.push(se>>ae&de);if(ie)ae>0&&ue.push(se<<c-ae&de);else{if(ae>=n)return"Excess padding";if(se<<c-ae&de)return"Non-zero padding"}return ue}function toWordsUnsafe(t){var n=convert$1(t,8,5,!0);if(Array.isArray(n))return n}function toWords$1(t){var n=convert$1(t,8,5,!0);if(Array.isArray(n))return n;throw new Error(n)}function fromWordsUnsafe$1(t){var n=convert$1(t,5,8,!1);if(Array.isArray(n))return n}function fromWords$1(t){var n=convert$1(t,5,8,!1);if(Array.isArray(n))return n;throw new Error(n)}var bech32$1$1={decodeUnsafe,decode:decode$5,encode:encode$4,toWordsUnsafe,toWords:toWords$1,fromWordsUnsafe:fromWordsUnsafe$1,fromWords:fromWords$1};const bech32$2=getDefaultExportFromCjs$2(bech32$1$1),version$8="providers/5.8.0",logger$5=new Logger$1(version$8);class Formatter{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const n={},c=this.address.bind(this),ie=this.bigNumber.bind(this),se=this.blockTag.bind(this),ae=this.data.bind(this),de=this.hash.bind(this),ue=this.hex.bind(this),pe=this.number.bind(this),ge=this.type.bind(this),be=_e=>this.data(_e,!0);return n.transaction={hash:de,type:ge,accessList:Formatter.allowNull(this.accessList.bind(this),null),blockHash:Formatter.allowNull(de,null),blockNumber:Formatter.allowNull(pe,null),transactionIndex:Formatter.allowNull(pe,null),confirmations:Formatter.allowNull(pe,null),from:c,gasPrice:Formatter.allowNull(ie),maxPriorityFeePerGas:Formatter.allowNull(ie),maxFeePerGas:Formatter.allowNull(ie),gasLimit:ie,to:Formatter.allowNull(c,null),value:ie,nonce:pe,data:ae,r:Formatter.allowNull(this.uint256),s:Formatter.allowNull(this.uint256),v:Formatter.allowNull(pe),creates:Formatter.allowNull(c,null),raw:Formatter.allowNull(ae)},n.transactionRequest={from:Formatter.allowNull(c),nonce:Formatter.allowNull(pe),gasLimit:Formatter.allowNull(ie),gasPrice:Formatter.allowNull(ie),maxPriorityFeePerGas:Formatter.allowNull(ie),maxFeePerGas:Formatter.allowNull(ie),to:Formatter.allowNull(c),value:Formatter.allowNull(ie),data:Formatter.allowNull(be),type:Formatter.allowNull(pe),accessList:Formatter.allowNull(this.accessList.bind(this),null)},n.receiptLog={transactionIndex:pe,blockNumber:pe,transactionHash:de,address:c,topics:Formatter.arrayOf(de),data:ae,logIndex:pe,blockHash:de},n.receipt={to:Formatter.allowNull(this.address,null),from:Formatter.allowNull(this.address,null),contractAddress:Formatter.allowNull(c,null),transactionIndex:pe,root:Formatter.allowNull(ue),gasUsed:ie,logsBloom:Formatter.allowNull(ae),blockHash:de,transactionHash:de,logs:Formatter.arrayOf(this.receiptLog.bind(this)),blockNumber:pe,confirmations:Formatter.allowNull(pe,null),cumulativeGasUsed:ie,effectiveGasPrice:Formatter.allowNull(ie),status:Formatter.allowNull(pe),type:ge},n.block={hash:Formatter.allowNull(de),parentHash:de,number:pe,timestamp:pe,nonce:Formatter.allowNull(ue),difficulty:this.difficulty.bind(this),gasLimit:ie,gasUsed:ie,miner:Formatter.allowNull(c),extraData:ae,transactions:Formatter.allowNull(Formatter.arrayOf(de)),baseFeePerGas:Formatter.allowNull(ie)},n.blockWithTransactions=shallowCopy(n.block),n.blockWithTransactions.transactions=Formatter.allowNull(Formatter.arrayOf(this.transactionResponse.bind(this))),n.filter={fromBlock:Formatter.allowNull(se,void 0),toBlock:Formatter.allowNull(se,void 0),blockHash:Formatter.allowNull(de,void 0),address:Formatter.allowNull(c,void 0),topics:Formatter.allowNull(this.topics.bind(this),void 0)},n.filterLog={blockNumber:Formatter.allowNull(pe),blockHash:Formatter.allowNull(de),transactionIndex:pe,removed:Formatter.allowNull(this.boolean.bind(this)),address:c,data:Formatter.allowFalsish(ae,"0x"),topics:Formatter.arrayOf(de),transactionHash:de,logIndex:pe},n}accessList(n){return accessListify(n||[])}number(n){return n==="0x"?0:BigNumber$1.from(n).toNumber()}type(n){return n==="0x"||n==null?0:BigNumber$1.from(n).toNumber()}bigNumber(n){return BigNumber$1.from(n)}boolean(n){if(typeof n=="boolean")return n;if(typeof n=="string"){if(n=n.toLowerCase(),n==="true")return!0;if(n==="false")return!1}throw new Error("invalid boolean - "+n)}hex(n,c){return typeof n=="string"&&(!c&&n.substring(0,2)!=="0x"&&(n="0x"+n),isHexString$1(n))?n.toLowerCase():logger$5.throwArgumentError("invalid hash","value",n)}data(n,c){const ie=this.hex(n,c);if(ie.length%2!==0)throw new Error("invalid data; odd-length - "+n);return ie}address(n){return getAddress$1(n)}callAddress(n){if(!isHexString$1(n,32))return null;const c=getAddress$1(hexDataSlice(n,12));return c===AddressZero?null:c}contractAddress(n){return getContractAddress(n)}blockTag(n){if(n==null)return"latest";if(n==="earliest")return"0x0";switch(n){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return n}if(typeof n=="number"||isHexString$1(n))return hexValue(n);throw new Error("invalid blockTag")}hash(n,c){const ie=this.hex(n,c);return hexDataLength(ie)!==32?logger$5.throwArgumentError("invalid hash","value",n):ie}difficulty(n){if(n==null)return null;const c=BigNumber$1.from(n);try{return c.toNumber()}catch{}return null}uint256(n){if(!isHexString$1(n))throw new Error("invalid uint256");return hexZeroPad(n,32)}_block(n,c){n.author!=null&&n.miner==null&&(n.miner=n.author);const ie=n._difficulty!=null?n._difficulty:n.difficulty,se=Formatter.check(c,n);return se._difficulty=ie==null?null:BigNumber$1.from(ie),se}block(n){return this._block(n,this.formats.block)}blockWithTransactions(n){return this._block(n,this.formats.blockWithTransactions)}transactionRequest(n){return Formatter.check(this.formats.transactionRequest,n)}transactionResponse(n){n.gas!=null&&n.gasLimit==null&&(n.gasLimit=n.gas),n.to&&BigNumber$1.from(n.to).isZero()&&(n.to="0x0000000000000000000000000000000000000000"),n.input!=null&&n.data==null&&(n.data=n.input),n.to==null&&n.creates==null&&(n.creates=this.contractAddress(n)),(n.type===1||n.type===2)&&n.accessList==null&&(n.accessList=[]);const c=Formatter.check(this.formats.transaction,n);if(n.chainId!=null){let ie=n.chainId;isHexString$1(ie)&&(ie=BigNumber$1.from(ie).toNumber()),c.chainId=ie}else{let ie=n.networkId;ie==null&&c.v==null&&(ie=n.chainId),isHexString$1(ie)&&(ie=BigNumber$1.from(ie).toNumber()),typeof ie!="number"&&c.v!=null&&(ie=(c.v-35)/2,ie<0&&(ie=0),ie=parseInt(ie)),typeof ie!="number"&&(ie=0),c.chainId=ie}return c.blockHash&&c.blockHash.replace(/0/g,"")==="x"&&(c.blockHash=null),c}transaction(n){return parse$2(n)}receiptLog(n){return Formatter.check(this.formats.receiptLog,n)}receipt(n){const c=Formatter.check(this.formats.receipt,n);if(c.root!=null)if(c.root.length<=4){const ie=BigNumber$1.from(c.root).toNumber();ie===0||ie===1?(c.status!=null&&c.status!==ie&&logger$5.throwArgumentError("alt-root-status/status mismatch","value",{root:c.root,status:c.status}),c.status=ie,delete c.root):logger$5.throwArgumentError("invalid alt-root-status","value.root",c.root)}else c.root.length!==66&&logger$5.throwArgumentError("invalid root hash","value.root",c.root);return c.status!=null&&(c.byzantium=!0),c}topics(n){return Array.isArray(n)?n.map(c=>this.topics(c)):n!=null?this.hash(n,!0):null}filter(n){return Formatter.check(this.formats.filter,n)}filterLog(n){return Formatter.check(this.formats.filterLog,n)}static check(n,c){const ie={};for(const se in n)try{const ae=n[se](c[se]);ae!==void 0&&(ie[se]=ae)}catch(ae){throw ae.checkKey=se,ae.checkValue=c[se],ae}return ie}static allowNull(n,c){return function(ie){return ie==null?c:n(ie)}}static allowFalsish(n,c){return function(ie){return ie?n(ie):c}}static arrayOf(n){return function(c){if(!Array.isArray(c))throw new Error("not an array");const ie=[];return c.forEach(function(se){ie.push(n(se))}),ie}}}var __awaiter$c=function(t,n,c,ie){function se(ae){return ae instanceof c?ae:new c(function(de){de(ae)})}return new(c||(c=Promise))(function(ae,de){function ue(be){try{ge(ie.next(be))}catch(_e){de(_e)}}function pe(be){try{ge(ie.throw(be))}catch(_e){de(_e)}}function ge(be){be.done?ae(be.value):se(be.value).then(ue,pe)}ge((ie=ie.apply(t,[])).next())})};const logger$4=new Logger$1(version$8),MAX_CCIP_REDIRECTS=10;function checkTopic(t){return t==null?"null":(hexDataLength(t)!==32&&logger$4.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function serializeTopics(t){for(t=t.slice();t.length>0&&t[t.length-1]==null;)t.pop();return t.map(n=>{if(Array.isArray(n)){const c={};n.forEach(se=>{c[checkTopic(se)]=!0});const ie=Object.keys(c);return ie.sort(),ie.join("|")}else return checkTopic(n)}).join("&")}function deserializeTopics(t){return t===""?[]:t.split(/&/g).map(n=>{if(n==="")return[];const c=n.split("|").map(ie=>ie==="null"?null:ie);return c.length===1?c[0]:c})}function getEventTag(t){if(typeof t=="string"){if(t=t.toLowerCase(),hexDataLength(t)===32)return"tx:"+t;if(t.indexOf(":")===-1)return t}else{if(Array.isArray(t))return"filter:*:"+serializeTopics(t);if(ForkEvent.isForkEvent(t))throw logger$4.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+serializeTopics(t.topics||[])}throw new Error("invalid event - "+t)}function getTime(){return new Date().getTime()}function stall(t){return new Promise(n=>{setTimeout(n,t)})}const PollableEvents=["block","network","pending","poll"];let Event$1=class{constructor(t,n,c){defineReadOnly(this,"tag",t),defineReadOnly(this,"listener",n),defineReadOnly(this,"once",c),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const t=this.tag.split(":");return t[0]!=="tx"?null:t[1]}get filter(){const t=this.tag.split(":");if(t[0]!=="filter")return null;const n=t[1],c=deserializeTopics(t[2]),ie={};return c.length>0&&(ie.topics=c),n&&n!=="*"&&(ie.address=n),ie}pollable(){return this.tag.indexOf(":")>=0||PollableEvents.indexOf(this.tag)>=0}};const coinInfos={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function bytes32ify(t){return hexZeroPad(BigNumber$1.from(t).toHexString(),32)}function base58Encode(t){return Base58.encode(concat$1([t,hexDataSlice(sha256$7(sha256$7(t)),0,4)]))}const matcherIpfs=new RegExp("^(ipfs)://(.*)$","i"),matchers=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),matcherIpfs,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function _parseString(t,n){try{return toUtf8String(_parseBytes(t,n))}catch{}return null}function _parseBytes(t,n){if(t==="0x")return null;const c=BigNumber$1.from(hexDataSlice(t,n,n+32)).toNumber(),ie=BigNumber$1.from(hexDataSlice(t,c,c+32)).toNumber();return hexDataSlice(t,c+32,c+32+ie)}function getIpfsLink(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):logger$4.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function numPad(t){const n=arrayify(t);if(n.length>32)throw new Error("internal; should not happen");const c=new Uint8Array(32);return c.set(n,32-n.length),c}function bytesPad(t){if(t.length%32===0)return t;const n=new Uint8Array(Math.ceil(t.length/32)*32);return n.set(t),n}function encodeBytes(t){const n=[];let c=0;for(let ie=0;ie<t.length;ie++)n.push(null),c+=32;for(let ie=0;ie<t.length;ie++){const se=arrayify(t[ie]);n[ie]=numPad(c),n.push(numPad(se.length)),n.push(bytesPad(se)),c+=32+Math.ceil(se.length/32)*32}return hexConcat(n)}class Resolver{constructor(n,c,ie,se){defineReadOnly(this,"provider",n),defineReadOnly(this,"name",ie),defineReadOnly(this,"address",n.formatter.address(c)),defineReadOnly(this,"_resolvedAddress",se)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then(n=>BigNumber$1.from(n).eq(1)).catch(n=>{if(n.code===Logger$1.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,n})),this._supportsEip2544}_fetch(n,c){return __awaiter$c(this,void 0,void 0,function*(){const ie={to:this.address,ccipReadEnabled:!0,data:hexConcat([n,namehash$1(this.name),c||"0x"])};let se=!1;(yield this.supportsWildcard())&&(se=!0,ie.data=hexConcat(["0x9061b923",encodeBytes([dnsEncode(this.name),ie.data])]));try{let ae=yield this.provider.call(ie);return arrayify(ae).length%32===4&&logger$4.throwError("resolver threw error",Logger$1.errors.CALL_EXCEPTION,{transaction:ie,data:ae}),se&&(ae=_parseBytes(ae,0)),ae}catch(ae){if(ae.code===Logger$1.errors.CALL_EXCEPTION)return null;throw ae}})}_fetchBytes(n,c){return __awaiter$c(this,void 0,void 0,function*(){const ie=yield this._fetch(n,c);return ie!=null?_parseBytes(ie,0):null})}_getAddress(n,c){const ie=coinInfos[String(n)];if(ie==null&&logger$4.throwError(`unsupported coin type: ${n}`,Logger$1.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${n})`}),ie.ilk==="eth")return this.provider.formatter.address(c);const se=arrayify(c);if(ie.p2pkh!=null){const ae=c.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(ae){const de=parseInt(ae[1],16);if(ae[2].length===de*2&&de>=1&&de<=75)return base58Encode(concat$1([[ie.p2pkh],"0x"+ae[2]]))}}if(ie.p2sh!=null){const ae=c.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(ae){const de=parseInt(ae[1],16);if(ae[2].length===de*2&&de>=1&&de<=75)return base58Encode(concat$1([[ie.p2sh],"0x"+ae[2]]))}}if(ie.prefix!=null){const ae=se[1];let de=se[0];if(de===0?ae!==20&&ae!==32&&(de=-1):de=-1,de>=0&&se.length===2+ae&&ae>=1&&ae<=75){const ue=bech32$2.toWords(se.slice(2));return ue.unshift(de),bech32$2.encode(ie.prefix,ue)}}return null}getAddress(n){return __awaiter$c(this,void 0,void 0,function*(){if(n==null&&(n=60),n===60)try{const se=yield this._fetch("0x3b3b57de");return se==="0x"||se===HashZero?null:this.provider.formatter.callAddress(se)}catch(se){if(se.code===Logger$1.errors.CALL_EXCEPTION)return null;throw se}const c=yield this._fetchBytes("0xf1cb7e06",bytes32ify(n));if(c==null||c==="0x")return null;const ie=this._getAddress(n,c);return ie==null&&logger$4.throwError("invalid or unsupported coin data",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${n})`,coinType:n,data:c}),ie})}getAvatar(){return __awaiter$c(this,void 0,void 0,function*(){const n=[{type:"name",content:this.name}];try{const c=yield this.getText("avatar");if(c==null)return null;for(let ie=0;ie<matchers.length;ie++){const se=c.match(matchers[ie]);if(se==null)continue;const ae=se[1].toLowerCase();switch(ae){case"https":return n.push({type:"url",content:c}),{linkage:n,url:c};case"data":return n.push({type:"data",content:c}),{linkage:n,url:c};case"ipfs":return n.push({type:"ipfs",content:c}),{linkage:n,url:getIpfsLink(c)};case"erc721":case"erc1155":{const de=ae==="erc721"?"0xc87b56dd":"0x0e89341c";n.push({type:ae,content:c});const ue=this._resolvedAddress||(yield this.getAddress()),pe=(se[2]||"").split("/");if(pe.length!==2)return null;const ge=yield this.provider.formatter.address(pe[0]),be=hexZeroPad(BigNumber$1.from(pe[1]).toHexString(),32);if(ae==="erc721"){const Ge=this.provider.formatter.callAddress(yield this.provider.call({to:ge,data:hexConcat(["0x6352211e",be])}));if(ue!==Ge)return null;n.push({type:"owner",content:Ge})}else if(ae==="erc1155"){const Ge=BigNumber$1.from(yield this.provider.call({to:ge,data:hexConcat(["0x00fdd58e",hexZeroPad(ue,32),be])}));if(Ge.isZero())return null;n.push({type:"balance",content:Ge.toString()})}const _e={to:this.provider.formatter.address(pe[0]),data:hexConcat([de,be])};let we=_parseString(yield this.provider.call(_e),0);if(we==null)return null;n.push({type:"metadata-url-base",content:we}),ae==="erc1155"&&(we=we.replace("{id}",be.substring(2)),n.push({type:"metadata-url-expanded",content:we})),we.match(/^ipfs:/i)&&(we=getIpfsLink(we)),n.push({type:"metadata-url",content:we});const qe=yield fetchJson(we);if(!qe)return null;n.push({type:"metadata",content:JSON.stringify(qe)});let Ye=qe.image;if(typeof Ye!="string")return null;if(!Ye.match(/^(https:\/\/|data:)/i)){if(Ye.match(matcherIpfs)==null)return null;n.push({type:"url-ipfs",content:Ye}),Ye=getIpfsLink(Ye)}return n.push({type:"url",content:Ye}),{linkage:n,url:Ye}}}}}catch{}return null})}getContentHash(){return __awaiter$c(this,void 0,void 0,function*(){const n=yield this._fetchBytes("0xbc1c58d1");if(n==null||n==="0x")return null;const c=n.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(c){const de=parseInt(c[3],16);if(c[4].length===de*2)return"ipfs://"+Base58.encode("0x"+c[1])}const ie=n.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(ie){const de=parseInt(ie[3],16);if(ie[4].length===de*2)return"ipns://"+Base58.encode("0x"+ie[1])}const se=n.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(se&&se[1].length===64)return"bzz://"+se[1];const ae=n.match(/^0x90b2c605([0-9a-f]*)$/);if(ae&&ae[1].length===68){const de={"=":"","+":"-","/":"_"};return"sia://"+encode$5("0x"+ae[1]).replace(/[=+\/]/g,ue=>de[ue])}return logger$4.throwError("invalid or unsupported content hash data",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:n})})}getText(n){return __awaiter$c(this,void 0,void 0,function*(){let c=toUtf8Bytes(n);c=concat$1([bytes32ify(64),bytes32ify(c.length),c]),c.length%32!==0&&(c=concat$1([c,hexZeroPad("0x",32-n.length%32)]));const ie=yield this._fetchBytes("0x59d1d43c",hexlify$1(c));return ie==null||ie==="0x"?null:toUtf8String(ie)})}}let defaultFormatter=null,nextPollId=1;class BaseProvider extends Provider{constructor(n){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),defineReadOnly(this,"anyNetwork",n==="any"),this.anyNetwork&&(n=this.detectNetwork()),n instanceof Promise)this._networkPromise=n,n.catch(c=>{}),this._ready().catch(c=>{});else{const c=getStatic(new.target,"getNetwork")(n);c?(defineReadOnly(this,"_network",c),this.emit("network",c,null)):logger$4.throwArgumentError("invalid network","network",n)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return __awaiter$c(this,void 0,void 0,function*(){if(this._network==null){let n=null;if(this._networkPromise)try{n=yield this._networkPromise}catch{}n==null&&(n=yield this.detectNetwork()),n||logger$4.throwError("no network detected",Logger$1.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=n:defineReadOnly(this,"_network",n),this.emit("network",n,null))}return this._network})}get ready(){return poll(()=>this._ready().then(n=>n,n=>{if(!(n.code===Logger$1.errors.NETWORK_ERROR&&n.event==="noNetwork"))throw n}))}static getFormatter(){return defaultFormatter==null&&(defaultFormatter=new Formatter),defaultFormatter}static getNetwork(n){return getNetwork(n??"homestead")}ccipReadFetch(n,c,ie){return __awaiter$c(this,void 0,void 0,function*(){if(this.disableCcipRead||ie.length===0)return null;const se=n.to.toLowerCase(),ae=c.toLowerCase(),de=[];for(let ue=0;ue<ie.length;ue++){const pe=ie[ue],ge=pe.replace("{sender}",se).replace("{data}",ae),be=pe.indexOf("{data}")>=0?null:JSON.stringify({data:ae,sender:se}),_e=yield fetchJson({url:ge,errorPassThrough:!0},be,(qe,Ye)=>(qe.status=Ye.statusCode,qe));if(_e.data)return _e.data;const we=_e.message||"unknown error";if(_e.status>=400&&_e.status<500)return logger$4.throwError(`response not found during CCIP fetch: ${we}`,Logger$1.errors.SERVER_ERROR,{url:pe,errorMessage:we});de.push(we)}return logger$4.throwError(`error encountered during CCIP fetch: ${de.map(ue=>JSON.stringify(ue)).join(", ")}`,Logger$1.errors.SERVER_ERROR,{urls:ie,errorMessages:de})})}_getInternalBlockNumber(n){return __awaiter$c(this,void 0,void 0,function*(){if(yield this._ready(),n>0)for(;this._internalBlockNumber;){const se=this._internalBlockNumber;try{const ae=yield se;if(getTime()-ae.respTime<=n)return ae.blockNumber;break}catch{if(this._internalBlockNumber===se)break}}const c=getTime(),ie=resolveProperties({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(se=>null,se=>se)}).then(({blockNumber:se,networkError:ae})=>{if(ae)throw this._internalBlockNumber===ie&&(this._internalBlockNumber=null),ae;const de=getTime();return se=BigNumber$1.from(se).toNumber(),se<this._maxInternalBlockNumber&&(se=this._maxInternalBlockNumber),this._maxInternalBlockNumber=se,this._setFastBlockNumber(se),{blockNumber:se,reqTime:c,respTime:de}});return this._internalBlockNumber=ie,ie.catch(se=>{this._internalBlockNumber===ie&&(this._internalBlockNumber=null)}),(yield ie).blockNumber})}poll(){return __awaiter$c(this,void 0,void 0,function*(){const n=nextPollId++,c=[];let ie=null;try{ie=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(se){this.emit("error",se);return}if(this._setFastBlockNumber(ie),this.emit("poll",n,ie),ie===this._lastBlockNumber){this.emit("didPoll",n);return}if(this._emitted.block===-2&&(this._emitted.block=ie-1),Math.abs(this._emitted.block-ie)>1e3)logger$4.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${ie})`),this.emit("error",logger$4.makeError("network block skew detected",Logger$1.errors.NETWORK_ERROR,{blockNumber:ie,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",ie);else for(let se=this._emitted.block+1;se<=ie;se++)this.emit("block",se);this._emitted.block!==ie&&(this._emitted.block=ie,Object.keys(this._emitted).forEach(se=>{if(se==="block")return;const ae=this._emitted[se];ae!=="pending"&&ie-ae>12&&delete this._emitted[se]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=ie-1),this._events.forEach(se=>{switch(se.type){case"tx":{const ae=se.hash;let de=this.getTransactionReceipt(ae).then(ue=>(!ue||ue.blockNumber==null||(this._emitted["t:"+ae]=ue.blockNumber,this.emit(ae,ue)),null)).catch(ue=>{this.emit("error",ue)});c.push(de);break}case"filter":{if(!se._inflight){se._inflight=!0,se._lastBlockNumber===-2&&(se._lastBlockNumber=ie-1);const ae=se.filter;ae.fromBlock=se._lastBlockNumber+1,ae.toBlock=ie;const de=ae.toBlock-this._maxFilterBlockRange;de>ae.fromBlock&&(ae.fromBlock=de),ae.fromBlock<0&&(ae.fromBlock=0);const ue=this.getLogs(ae).then(pe=>{se._inflight=!1,pe.length!==0&&pe.forEach(ge=>{ge.blockNumber>se._lastBlockNumber&&(se._lastBlockNumber=ge.blockNumber),this._emitted["b:"+ge.blockHash]=ge.blockNumber,this._emitted["t:"+ge.transactionHash]=ge.blockNumber,this.emit(ae,ge)})}).catch(pe=>{this.emit("error",pe),se._inflight=!1});c.push(ue)}break}}}),this._lastBlockNumber=ie,Promise.all(c).then(()=>{this.emit("didPoll",n)}).catch(se=>{this.emit("error",se)})})}resetEventsBlock(n){this._lastBlockNumber=n-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return __awaiter$c(this,void 0,void 0,function*(){return logger$4.throwError("provider does not support network detection",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return __awaiter$c(this,void 0,void 0,function*(){const n=yield this._ready(),c=yield this.detectNetwork();if(n.chainId!==c.chainId){if(this.anyNetwork)return this._network=c,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",c,n),yield stall(0),this._network;const ie=logger$4.makeError("underlying network changed",Logger$1.errors.NETWORK_ERROR,{event:"changed",network:n,detectedNetwork:c});throw this.emit("error",ie),ie}return n})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(n=>{this._setFastBlockNumber(n)},n=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(n){n&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!n&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(n){if(typeof n!="number"||n<=0||parseInt(String(n))!=n)throw new Error("invalid polling interval");this._pollingInterval=n,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const n=getTime();return n-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=n,this._fastBlockNumberPromise=this.getBlockNumber().then(c=>((this._fastBlockNumber==null||c>this._fastBlockNumber)&&(this._fastBlockNumber=c),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(n){this._fastBlockNumber!=null&&n<this._fastBlockNumber||(this._fastQueryDate=getTime(),(this._fastBlockNumber==null||n>this._fastBlockNumber)&&(this._fastBlockNumber=n,this._fastBlockNumberPromise=Promise.resolve(n)))}waitForTransaction(n,c,ie){return __awaiter$c(this,void 0,void 0,function*(){return this._waitForTransaction(n,c??1,ie||0,null)})}_waitForTransaction(n,c,ie,se){return __awaiter$c(this,void 0,void 0,function*(){const ae=yield this.getTransactionReceipt(n);return(ae?ae.confirmations:0)>=c?ae:new Promise((de,ue)=>{const pe=[];let ge=!1;const be=function(){return ge?!0:(ge=!0,pe.forEach(we=>{we()}),!1)},_e=we=>{we.confirmations<c||be()||de(we)};if(this.on(n,_e),pe.push(()=>{this.removeListener(n,_e)}),se){let we=se.startBlock,qe=null;const Ye=Ge=>__awaiter$c(this,void 0,void 0,function*(){ge||(yield stall(1e3),this.getTransactionCount(se.from).then(Ze=>__awaiter$c(this,void 0,void 0,function*(){if(!ge){if(Ze<=se.nonce)we=Ge;else{{const He=yield this.getTransaction(n);if(He&&He.blockNumber!=null)return}for(qe==null&&(qe=we-3,qe<se.startBlock&&(qe=se.startBlock));qe<=Ge;){if(ge)return;const He=yield this.getBlockWithTransactions(qe);for(let Ht=0;Ht<He.transactions.length;Ht++){const un=He.transactions[Ht];if(un.hash===n)return;if(un.from===se.from&&un.nonce===se.nonce){if(ge)return;const De=yield this.waitForTransaction(un.hash,c);if(be())return;let $e="replaced";un.data===se.data&&un.to===se.to&&un.value.eq(se.value)?$e="repriced":un.data==="0x"&&un.from===un.to&&un.value.isZero()&&($e="cancelled"),ue(logger$4.makeError("transaction was replaced",Logger$1.errors.TRANSACTION_REPLACED,{cancelled:$e==="replaced"||$e==="cancelled",reason:$e,replacement:this._wrapTransaction(un),hash:n,receipt:De}));return}}qe++}}ge||this.once("block",Ye)}}),Ze=>{ge||this.once("block",Ye)}))});if(ge)return;this.once("block",Ye),pe.push(()=>{this.removeListener("block",Ye)})}if(typeof ie=="number"&&ie>0){const we=setTimeout(()=>{be()||ue(logger$4.makeError("timeout exceeded",Logger$1.errors.TIMEOUT,{timeout:ie}))},ie);we.unref&&we.unref(),pe.push(()=>{clearTimeout(we)})}})})}getBlockNumber(){return __awaiter$c(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return __awaiter$c(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield this.perform("getGasPrice",{});try{return BigNumber$1.from(n)}catch(c){return logger$4.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"getGasPrice",result:n,error:c})}})}getBalance(n,c){return __awaiter$c(this,void 0,void 0,function*(){yield this.getNetwork();const ie=yield resolveProperties({address:this._getAddress(n),blockTag:this._getBlockTag(c)}),se=yield this.perform("getBalance",ie);try{return BigNumber$1.from(se)}catch(ae){return logger$4.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"getBalance",params:ie,result:se,error:ae})}})}getTransactionCount(n,c){return __awaiter$c(this,void 0,void 0,function*(){yield this.getNetwork();const ie=yield resolveProperties({address:this._getAddress(n),blockTag:this._getBlockTag(c)}),se=yield this.perform("getTransactionCount",ie);try{return BigNumber$1.from(se).toNumber()}catch(ae){return logger$4.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"getTransactionCount",params:ie,result:se,error:ae})}})}getCode(n,c){return __awaiter$c(this,void 0,void 0,function*(){yield this.getNetwork();const ie=yield resolveProperties({address:this._getAddress(n),blockTag:this._getBlockTag(c)}),se=yield this.perform("getCode",ie);try{return hexlify$1(se)}catch(ae){return logger$4.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"getCode",params:ie,result:se,error:ae})}})}getStorageAt(n,c,ie){return __awaiter$c(this,void 0,void 0,function*(){yield this.getNetwork();const se=yield resolveProperties({address:this._getAddress(n),blockTag:this._getBlockTag(ie),position:Promise.resolve(c).then(de=>hexValue(de))}),ae=yield this.perform("getStorageAt",se);try{return hexlify$1(ae)}catch(de){return logger$4.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"getStorageAt",params:se,result:ae,error:de})}})}_wrapTransaction(n,c,ie){if(c!=null&&hexDataLength(c)!==32)throw new Error("invalid response - sendTransaction");const se=n;return c!=null&&n.hash!==c&&logger$4.throwError("Transaction hash mismatch from Provider.sendTransaction.",Logger$1.errors.UNKNOWN_ERROR,{expectedHash:n.hash,returnedHash:c}),se.wait=(ae,de)=>__awaiter$c(this,void 0,void 0,function*(){ae==null&&(ae=1),de==null&&(de=0);let ue;ae!==0&&ie!=null&&(ue={data:n.data,from:n.from,nonce:n.nonce,to:n.to,value:n.value,startBlock:ie});const pe=yield this._waitForTransaction(n.hash,ae,de,ue);return pe==null&&ae===0?null:(this._emitted["t:"+n.hash]=pe.blockNumber,pe.status===0&&logger$4.throwError("transaction failed",Logger$1.errors.CALL_EXCEPTION,{transactionHash:n.hash,transaction:n,receipt:pe}),pe)}),se}sendTransaction(n){return __awaiter$c(this,void 0,void 0,function*(){yield this.getNetwork();const c=yield Promise.resolve(n).then(ae=>hexlify$1(ae)),ie=this.formatter.transaction(n);ie.confirmations==null&&(ie.confirmations=0);const se=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const ae=yield this.perform("sendTransaction",{signedTransaction:c});return this._wrapTransaction(ie,ae,se)}catch(ae){throw ae.transaction=ie,ae.transactionHash=ie.hash,ae}})}_getTransactionRequest(n){return __awaiter$c(this,void 0,void 0,function*(){const c=yield n,ie={};return["from","to"].forEach(se=>{c[se]!=null&&(ie[se]=Promise.resolve(c[se]).then(ae=>ae?this._getAddress(ae):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(se=>{c[se]!=null&&(ie[se]=Promise.resolve(c[se]).then(ae=>ae?BigNumber$1.from(ae):null))}),["type"].forEach(se=>{c[se]!=null&&(ie[se]=Promise.resolve(c[se]).then(ae=>ae??null))}),c.accessList&&(ie.accessList=this.formatter.accessList(c.accessList)),["data"].forEach(se=>{c[se]!=null&&(ie[se]=Promise.resolve(c[se]).then(ae=>ae?hexlify$1(ae):null))}),this.formatter.transactionRequest(yield resolveProperties(ie))})}_getFilter(n){return __awaiter$c(this,void 0,void 0,function*(){n=yield n;const c={};return n.address!=null&&(c.address=this._getAddress(n.address)),["blockHash","topics"].forEach(ie=>{n[ie]!=null&&(c[ie]=n[ie])}),["fromBlock","toBlock"].forEach(ie=>{n[ie]!=null&&(c[ie]=this._getBlockTag(n[ie]))}),this.formatter.filter(yield resolveProperties(c))})}_call(n,c,ie){return __awaiter$c(this,void 0,void 0,function*(){ie>=MAX_CCIP_REDIRECTS&&logger$4.throwError("CCIP read exceeded maximum redirections",Logger$1.errors.SERVER_ERROR,{redirects:ie,transaction:n});const se=n.to,ae=yield this.perform("call",{transaction:n,blockTag:c});if(ie>=0&&c==="latest"&&se!=null&&ae.substring(0,10)==="0x556f1830"&&hexDataLength(ae)%32===4)try{const de=hexDataSlice(ae,4),ue=hexDataSlice(de,0,32);BigNumber$1.from(ue).eq(se)||logger$4.throwError("CCIP Read sender did not match",Logger$1.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:n,data:ae});const pe=[],ge=BigNumber$1.from(hexDataSlice(de,32,64)).toNumber(),be=BigNumber$1.from(hexDataSlice(de,ge,ge+32)).toNumber(),_e=hexDataSlice(de,ge+32);for(let He=0;He<be;He++){const Ht=_parseString(_e,He*32);Ht==null&&logger$4.throwError("CCIP Read contained corrupt URL string",Logger$1.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:n,data:ae}),pe.push(Ht)}const we=_parseBytes(de,64);BigNumber$1.from(hexDataSlice(de,100,128)).isZero()||logger$4.throwError("CCIP Read callback selector included junk",Logger$1.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:n,data:ae});const qe=hexDataSlice(de,96,100),Ye=_parseBytes(de,128),Ge=yield this.ccipReadFetch(n,we,pe);Ge==null&&logger$4.throwError("CCIP Read disabled or provided no URLs",Logger$1.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:n,data:ae});const Ze={to:se,data:hexConcat([qe,encodeBytes([Ge,Ye])])};return this._call(Ze,c,ie+1)}catch(de){if(de.code===Logger$1.errors.SERVER_ERROR)throw de}try{return hexlify$1(ae)}catch(de){return logger$4.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"call",params:{transaction:n,blockTag:c},result:ae,error:de})}})}call(n,c){return __awaiter$c(this,void 0,void 0,function*(){yield this.getNetwork();const ie=yield resolveProperties({transaction:this._getTransactionRequest(n),blockTag:this._getBlockTag(c),ccipReadEnabled:Promise.resolve(n.ccipReadEnabled)});return this._call(ie.transaction,ie.blockTag,ie.ccipReadEnabled?0:-1)})}estimateGas(n){return __awaiter$c(this,void 0,void 0,function*(){yield this.getNetwork();const c=yield resolveProperties({transaction:this._getTransactionRequest(n)}),ie=yield this.perform("estimateGas",c);try{return BigNumber$1.from(ie)}catch(se){return logger$4.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"estimateGas",params:c,result:ie,error:se})}})}_getAddress(n){return __awaiter$c(this,void 0,void 0,function*(){n=yield n,typeof n!="string"&&logger$4.throwArgumentError("invalid address or ENS name","name",n);const c=yield this.resolveName(n);return c==null&&logger$4.throwError("ENS name not configured",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(n)})`}),c})}_getBlock(n,c){return __awaiter$c(this,void 0,void 0,function*(){yield this.getNetwork(),n=yield n;let ie=-128;const se={includeTransactions:!!c};if(isHexString$1(n,32))se.blockHash=n;else try{se.blockTag=yield this._getBlockTag(n),isHexString$1(se.blockTag)&&(ie=parseInt(se.blockTag.substring(2),16))}catch{logger$4.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",n)}return poll(()=>__awaiter$c(this,void 0,void 0,function*(){const ae=yield this.perform("getBlock",se);if(ae==null)return se.blockHash!=null&&this._emitted["b:"+se.blockHash]==null||se.blockTag!=null&&ie>this._emitted.block?null:void 0;if(c){let de=null;for(let pe=0;pe<ae.transactions.length;pe++){const ge=ae.transactions[pe];if(ge.blockNumber==null)ge.confirmations=0;else if(ge.confirmations==null){de==null&&(de=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let be=de-ge.blockNumber+1;be<=0&&(be=1),ge.confirmations=be}}const ue=this.formatter.blockWithTransactions(ae);return ue.transactions=ue.transactions.map(pe=>this._wrapTransaction(pe)),ue}return this.formatter.block(ae)}),{oncePoll:this})})}getBlock(n){return this._getBlock(n,!1)}getBlockWithTransactions(n){return this._getBlock(n,!0)}getTransaction(n){return __awaiter$c(this,void 0,void 0,function*(){yield this.getNetwork(),n=yield n;const c={transactionHash:this.formatter.hash(n,!0)};return poll(()=>__awaiter$c(this,void 0,void 0,function*(){const ie=yield this.perform("getTransaction",c);if(ie==null)return this._emitted["t:"+n]==null?null:void 0;const se=this.formatter.transactionResponse(ie);if(se.blockNumber==null)se.confirmations=0;else if(se.confirmations==null){let ae=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-se.blockNumber+1;ae<=0&&(ae=1),se.confirmations=ae}return this._wrapTransaction(se)}),{oncePoll:this})})}getTransactionReceipt(n){return __awaiter$c(this,void 0,void 0,function*(){yield this.getNetwork(),n=yield n;const c={transactionHash:this.formatter.hash(n,!0)};return poll(()=>__awaiter$c(this,void 0,void 0,function*(){const ie=yield this.perform("getTransactionReceipt",c);if(ie==null)return this._emitted["t:"+n]==null?null:void 0;if(ie.blockHash==null)return;const se=this.formatter.receipt(ie);if(se.blockNumber==null)se.confirmations=0;else if(se.confirmations==null){let ae=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-se.blockNumber+1;ae<=0&&(ae=1),se.confirmations=ae}return se}),{oncePoll:this})})}getLogs(n){return __awaiter$c(this,void 0,void 0,function*(){yield this.getNetwork();const c=yield resolveProperties({filter:this._getFilter(n)}),ie=yield this.perform("getLogs",c);return ie.forEach(se=>{se.removed==null&&(se.removed=!1)}),Formatter.arrayOf(this.formatter.filterLog.bind(this.formatter))(ie)})}getEtherPrice(){return __awaiter$c(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(n){return __awaiter$c(this,void 0,void 0,function*(){if(n=yield n,typeof n=="number"&&n<0){n%1&&logger$4.throwArgumentError("invalid BlockTag","blockTag",n);let c=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return c+=n,c<0&&(c=0),this.formatter.blockTag(c)}return this.formatter.blockTag(n)})}getResolver(n){return __awaiter$c(this,void 0,void 0,function*(){let c=n;for(;;){if(c===""||c==="."||n!=="eth"&&c==="eth")return null;const ie=yield this._getResolver(c,"getResolver");if(ie!=null){const se=new Resolver(this,ie,n);return c!==n&&!(yield se.supportsWildcard())?null:se}c=c.split(".").slice(1).join(".")}})}_getResolver(n,c){return __awaiter$c(this,void 0,void 0,function*(){c==null&&(c="ENS");const ie=yield this.getNetwork();ie.ensAddress||logger$4.throwError("network does not support ENS",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:c,network:ie.name});try{const se=yield this.call({to:ie.ensAddress,data:"0x0178b8bf"+namehash$1(n).substring(2)});return this.formatter.callAddress(se)}catch{}return null})}resolveName(n){return __awaiter$c(this,void 0,void 0,function*(){n=yield n;try{return Promise.resolve(this.formatter.address(n))}catch(ie){if(isHexString$1(n))throw ie}typeof n!="string"&&logger$4.throwArgumentError("invalid ENS name","name",n);const c=yield this.getResolver(n);return c?yield c.getAddress():null})}lookupAddress(n){return __awaiter$c(this,void 0,void 0,function*(){n=yield n,n=this.formatter.address(n);const c=n.substring(2).toLowerCase()+".addr.reverse",ie=yield this._getResolver(c,"lookupAddress");if(ie==null)return null;const se=_parseString(yield this.call({to:ie,data:"0x691f3431"+namehash$1(c).substring(2)}),0);return(yield this.resolveName(se))!=n?null:se})}getAvatar(n){return __awaiter$c(this,void 0,void 0,function*(){let c=null;if(isHexString$1(n)){const se=this.formatter.address(n).substring(2).toLowerCase()+".addr.reverse",ae=yield this._getResolver(se,"getAvatar");if(!ae)return null;c=new Resolver(this,ae,se);try{const de=yield c.getAvatar();if(de)return de.url}catch(de){if(de.code!==Logger$1.errors.CALL_EXCEPTION)throw de}try{const de=_parseString(yield this.call({to:ae,data:"0x691f3431"+namehash$1(se).substring(2)}),0);c=yield this.getResolver(de)}catch(de){if(de.code!==Logger$1.errors.CALL_EXCEPTION)throw de;return null}}else if(c=yield this.getResolver(n),!c)return null;const ie=yield c.getAvatar();return ie==null?null:ie.url})}perform(n,c){return logger$4.throwError(n+" not implemented",Logger$1.errors.NOT_IMPLEMENTED,{operation:n})}_startEvent(n){this.polling=this._events.filter(c=>c.pollable()).length>0}_stopEvent(n){this.polling=this._events.filter(c=>c.pollable()).length>0}_addEventListener(n,c,ie){const se=new Event$1(getEventTag(n),c,ie);return this._events.push(se),this._startEvent(se),this}on(n,c){return this._addEventListener(n,c,!1)}once(n,c){return this._addEventListener(n,c,!0)}emit(n,...c){let ie=!1,se=[],ae=getEventTag(n);return this._events=this._events.filter(de=>de.tag!==ae?!0:(setTimeout(()=>{de.listener.apply(this,c)},0),ie=!0,de.once?(se.push(de),!1):!0)),se.forEach(de=>{this._stopEvent(de)}),ie}listenerCount(n){if(!n)return this._events.length;let c=getEventTag(n);return this._events.filter(ie=>ie.tag===c).length}listeners(n){if(n==null)return this._events.map(ie=>ie.listener);let c=getEventTag(n);return this._events.filter(ie=>ie.tag===c).map(ie=>ie.listener)}off(n,c){if(c==null)return this.removeAllListeners(n);const ie=[];let se=!1,ae=getEventTag(n);return this._events=this._events.filter(de=>de.tag!==ae||de.listener!=c||se?!0:(se=!0,ie.push(de),!1)),ie.forEach(de=>{this._stopEvent(de)}),this}removeAllListeners(n){let c=[];if(n==null)c=this._events,this._events=[];else{const ie=getEventTag(n);this._events=this._events.filter(se=>se.tag!==ie?!0:(c.push(se),!1))}return c.forEach(ie=>{this._stopEvent(ie)}),this}}var __awaiter$b=function(t,n,c,ie){function se(ae){return ae instanceof c?ae:new c(function(de){de(ae)})}return new(c||(c=Promise))(function(ae,de){function ue(be){try{ge(ie.next(be))}catch(_e){de(_e)}}function pe(be){try{ge(ie.throw(be))}catch(_e){de(_e)}}function ge(be){be.done?ae(be.value):se(be.value).then(ue,pe)}ge((ie=ie.apply(t,[])).next())})};const logger$3=new Logger$1(version$8),errorGas=["call","estimateGas"];function spelunk(t,n){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){const c=isHexString$1(t.data)?t.data:null;if(!n||c)return{message:t.message,data:c}}if(typeof t=="object"){for(const c in t){const ie=spelunk(t[c],n);if(ie)return ie}return null}if(typeof t=="string")try{return spelunk(JSON.parse(t),n)}catch{}return null}function checkError(t,n,c){const ie=c.transaction||c.signedTransaction;if(t==="call"){const ae=spelunk(n,!0);if(ae)return ae.data;logger$3.throwError("missing revert data in call exception; Transaction reverted without a reason string",Logger$1.errors.CALL_EXCEPTION,{data:"0x",transaction:ie,error:n})}if(t==="estimateGas"){let ae=spelunk(n.body,!1);ae==null&&(ae=spelunk(n,!1)),ae&&logger$3.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Logger$1.errors.UNPREDICTABLE_GAS_LIMIT,{reason:ae.message,method:t,transaction:ie,error:n})}let se=n.message;throw n.code===Logger$1.errors.SERVER_ERROR&&n.error&&typeof n.error.message=="string"?se=n.error.message:typeof n.body=="string"?se=n.body:typeof n.responseText=="string"&&(se=n.responseText),se=(se||"").toLowerCase(),se.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&logger$3.throwError("insufficient funds for intrinsic transaction cost",Logger$1.errors.INSUFFICIENT_FUNDS,{error:n,method:t,transaction:ie}),se.match(/nonce (is )?too low/i)&&logger$3.throwError("nonce has already been used",Logger$1.errors.NONCE_EXPIRED,{error:n,method:t,transaction:ie}),se.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&logger$3.throwError("replacement fee too low",Logger$1.errors.REPLACEMENT_UNDERPRICED,{error:n,method:t,transaction:ie}),se.match(/only replay-protected/i)&&logger$3.throwError("legacy pre-eip-155 transactions not supported",Logger$1.errors.UNSUPPORTED_OPERATION,{error:n,method:t,transaction:ie}),errorGas.indexOf(t)>=0&&se.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&logger$3.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Logger$1.errors.UNPREDICTABLE_GAS_LIMIT,{error:n,method:t,transaction:ie}),n}function timer(t){return new Promise(function(n){setTimeout(n,t)})}function getResult(t){if(t.error){const n=new Error(t.error.message);throw n.code=t.error.code,n.data=t.error.data,n}return t.result}function getLowerCase(t){return t&&t.toLowerCase()}const _constructorGuard$5={};class JsonRpcSigner extends Signer{constructor(n,c,ie){if(super(),n!==_constructorGuard$5)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");defineReadOnly(this,"provider",c),ie==null&&(ie=0),typeof ie=="string"?(defineReadOnly(this,"_address",this.provider.formatter.address(ie)),defineReadOnly(this,"_index",null)):typeof ie=="number"?(defineReadOnly(this,"_index",ie),defineReadOnly(this,"_address",null)):logger$3.throwArgumentError("invalid address or index","addressOrIndex",ie)}connect(n){return logger$3.throwError("cannot alter JSON-RPC Signer connection",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new UncheckedJsonRpcSigner(_constructorGuard$5,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(n=>(n.length<=this._index&&logger$3.throwError("unknown account #"+this._index,Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(n[this._index])))}sendUncheckedTransaction(n){n=shallowCopy(n);const c=this.getAddress().then(ie=>(ie&&(ie=ie.toLowerCase()),ie));if(n.gasLimit==null){const ie=shallowCopy(n);ie.from=c,n.gasLimit=this.provider.estimateGas(ie)}return n.to!=null&&(n.to=Promise.resolve(n.to).then(ie=>__awaiter$b(this,void 0,void 0,function*(){if(ie==null)return null;const se=yield this.provider.resolveName(ie);return se==null&&logger$3.throwArgumentError("provided ENS name resolves to null","tx.to",ie),se}))),resolveProperties({tx:resolveProperties(n),sender:c}).then(({tx:ie,sender:se})=>{ie.from!=null?ie.from.toLowerCase()!==se&&logger$3.throwArgumentError("from address mismatch","transaction",n):ie.from=se;const ae=this.provider.constructor.hexlifyTransaction(ie,{from:!0});return this.provider.send("eth_sendTransaction",[ae]).then(de=>de,de=>(typeof de.message=="string"&&de.message.match(/user denied/i)&&logger$3.throwError("user rejected transaction",Logger$1.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:ie}),checkError("sendTransaction",de,ae)))})}signTransaction(n){return logger$3.throwError("signing transactions is unsupported",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(n){return __awaiter$b(this,void 0,void 0,function*(){const c=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),ie=yield this.sendUncheckedTransaction(n);try{return yield poll(()=>__awaiter$b(this,void 0,void 0,function*(){const se=yield this.provider.getTransaction(ie);if(se!==null)return this.provider._wrapTransaction(se,ie,c)}),{oncePoll:this.provider})}catch(se){throw se.transactionHash=ie,se}})}signMessage(n){return __awaiter$b(this,void 0,void 0,function*(){const c=typeof n=="string"?toUtf8Bytes(n):n,ie=yield this.getAddress();try{return yield this.provider.send("personal_sign",[hexlify$1(c),ie.toLowerCase()])}catch(se){throw typeof se.message=="string"&&se.message.match(/user denied/i)&&logger$3.throwError("user rejected signing",Logger$1.errors.ACTION_REJECTED,{action:"signMessage",from:ie,messageData:n}),se}})}_legacySignMessage(n){return __awaiter$b(this,void 0,void 0,function*(){const c=typeof n=="string"?toUtf8Bytes(n):n,ie=yield this.getAddress();try{return yield this.provider.send("eth_sign",[ie.toLowerCase(),hexlify$1(c)])}catch(se){throw typeof se.message=="string"&&se.message.match(/user denied/i)&&logger$3.throwError("user rejected signing",Logger$1.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:ie,messageData:n}),se}})}_signTypedData(n,c,ie){return __awaiter$b(this,void 0,void 0,function*(){const se=yield TypedDataEncoder.resolveNames(n,c,ie,de=>this.provider.resolveName(de)),ae=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[ae.toLowerCase(),JSON.stringify(TypedDataEncoder.getPayload(se.domain,c,se.value))])}catch(de){throw typeof de.message=="string"&&de.message.match(/user denied/i)&&logger$3.throwError("user rejected signing",Logger$1.errors.ACTION_REJECTED,{action:"_signTypedData",from:ae,messageData:{domain:se.domain,types:c,value:se.value}}),de}})}unlock(n){return __awaiter$b(this,void 0,void 0,function*(){const c=this.provider,ie=yield this.getAddress();return c.send("personal_unlockAccount",[ie.toLowerCase(),n,null])})}}class UncheckedJsonRpcSigner extends JsonRpcSigner{sendTransaction(n){return this.sendUncheckedTransaction(n).then(c=>({hash:c,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:ie=>this.provider.waitForTransaction(c,ie)}))}}const allowedTransactionKeys={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class JsonRpcProvider extends BaseProvider{constructor(n,c){let ie=c;ie==null&&(ie=new Promise((se,ae)=>{setTimeout(()=>{this.detectNetwork().then(de=>{se(de)},de=>{ae(de)})},0)})),super(ie),n||(n=getStatic(this.constructor,"defaultUrl")()),typeof n=="string"?defineReadOnly(this,"connection",Object.freeze({url:n})):defineReadOnly(this,"connection",Object.freeze(shallowCopy(n))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return __awaiter$b(this,void 0,void 0,function*(){yield timer(0);let n=null;try{n=yield this.send("eth_chainId",[])}catch{try{n=yield this.send("net_version",[])}catch{}}if(n!=null){const c=getStatic(this.constructor,"getNetwork");try{return c(BigNumber$1.from(n).toNumber())}catch(ie){return logger$3.throwError("could not detect network",Logger$1.errors.NETWORK_ERROR,{chainId:n,event:"invalidNetwork",serverError:ie})}}return logger$3.throwError("could not detect network",Logger$1.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(n){return new JsonRpcSigner(_constructorGuard$5,this,n)}getUncheckedSigner(n){return this.getSigner(n).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(n=>n.map(c=>this.formatter.address(c)))}send(n,c){const ie={method:n,params:c,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:deepCopy(ie),provider:this});const se=["eth_chainId","eth_blockNumber"].indexOf(n)>=0;if(se&&this._cache[n])return this._cache[n];const ae=fetchJson(this.connection,JSON.stringify(ie),getResult).then(de=>(this.emit("debug",{action:"response",request:ie,response:de,provider:this}),de),de=>{throw this.emit("debug",{action:"response",error:de,request:ie,provider:this}),de});return se&&(this._cache[n]=ae,setTimeout(()=>{this._cache[n]=null},0)),ae}prepareRequest(n,c){switch(n){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[getLowerCase(c.address),c.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[getLowerCase(c.address),c.blockTag]];case"getCode":return["eth_getCode",[getLowerCase(c.address),c.blockTag]];case"getStorageAt":return["eth_getStorageAt",[getLowerCase(c.address),hexZeroPad(c.position,32),c.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[c.signedTransaction]];case"getBlock":return c.blockTag?["eth_getBlockByNumber",[c.blockTag,!!c.includeTransactions]]:c.blockHash?["eth_getBlockByHash",[c.blockHash,!!c.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[c.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[c.transactionHash]];case"call":return["eth_call",[getStatic(this.constructor,"hexlifyTransaction")(c.transaction,{from:!0}),c.blockTag]];case"estimateGas":return["eth_estimateGas",[getStatic(this.constructor,"hexlifyTransaction")(c.transaction,{from:!0})]];case"getLogs":return c.filter&&c.filter.address!=null&&(c.filter.address=getLowerCase(c.filter.address)),["eth_getLogs",[c.filter]]}return null}perform(n,c){return __awaiter$b(this,void 0,void 0,function*(){if(n==="call"||n==="estimateGas"){const se=c.transaction;if(se&&se.type!=null&&BigNumber$1.from(se.type).isZero()&&se.maxFeePerGas==null&&se.maxPriorityFeePerGas==null){const ae=yield this.getFeeData();ae.maxFeePerGas==null&&ae.maxPriorityFeePerGas==null&&(c=shallowCopy(c),c.transaction=shallowCopy(se),delete c.transaction.type)}}const ie=this.prepareRequest(n,c);ie==null&&logger$3.throwError(n+" not implemented",Logger$1.errors.NOT_IMPLEMENTED,{operation:n});try{return yield this.send(ie[0],ie[1])}catch(se){return checkError(n,se,c)}})}_startEvent(n){n.tag==="pending"&&this._startPending(),super._startEvent(n)}_startPending(){if(this._pendingFilter!=null)return;const n=this,c=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=c,c.then(function(ie){function se(){n.send("eth_getFilterChanges",[ie]).then(function(ae){if(n._pendingFilter!=c)return null;let de=Promise.resolve();return ae.forEach(function(ue){n._emitted["t:"+ue.toLowerCase()]="pending",de=de.then(function(){return n.getTransaction(ue).then(function(pe){return n.emit("pending",pe),null})})}),de.then(function(){return timer(1e3)})}).then(function(){if(n._pendingFilter!=c){n.send("eth_uninstallFilter",[ie]);return}return setTimeout(function(){se()},0),null}).catch(ae=>{})}return se(),ie}).catch(ie=>{})}_stopEvent(n){n.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(n)}static hexlifyTransaction(n,c){const ie=shallowCopy(allowedTransactionKeys);if(c)for(const ae in c)c[ae]&&(ie[ae]=!0);checkProperties(n,ie);const se={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(ae){if(n[ae]==null)return;const de=hexValue(BigNumber$1.from(n[ae]));ae==="gasLimit"&&(ae="gas"),se[ae]=de}),["from","to","data"].forEach(function(ae){n[ae]!=null&&(se[ae]=hexlify$1(n[ae]))}),n.accessList&&(se.accessList=accessListify(n.accessList)),se}}const logger$2=new Logger$1(version$8);let _nextId=1;function buildWeb3LegacyFetcher(t,n){const c="Web3LegacyFetcher";return function(ie,se){const ae={method:ie,params:se,id:_nextId++,jsonrpc:"2.0"};return new Promise((de,ue)=>{this.emit("debug",{action:"request",fetcher:c,request:deepCopy(ae),provider:this}),n(ae,(pe,ge)=>{if(pe)return this.emit("debug",{action:"response",fetcher:c,error:pe,request:ae,provider:this}),ue(pe);if(this.emit("debug",{action:"response",fetcher:c,request:ae,response:ge,provider:this}),ge.error){const be=new Error(ge.error.message);return be.code=ge.error.code,be.data=ge.error.data,ue(be)}de(ge.result)})})}}function buildEip1193Fetcher(t){return function(n,c){c==null&&(c=[]);const ie={method:n,params:c};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:deepCopy(ie),provider:this}),t.request(ie).then(se=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:ie,response:se,provider:this}),se),se=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:ie,error:se,provider:this}),se})}}class Web3Provider extends JsonRpcProvider{constructor(n,c){n==null&&logger$2.throwArgumentError("missing provider","provider",n);let ie=null,se=null,ae=null;typeof n=="function"?(ie="unknown:",se=n):(ie=n.host||n.path||"",!ie&&n.isMetaMask&&(ie="metamask"),ae=n,n.request?(ie===""&&(ie="eip-1193:"),se=buildEip1193Fetcher(n)):n.sendAsync?se=buildWeb3LegacyFetcher(n,n.sendAsync.bind(n)):n.send?se=buildWeb3LegacyFetcher(n,n.send.bind(n)):logger$2.throwArgumentError("unsupported provider","provider",n),ie||(ie="unknown:")),super(ie,c),defineReadOnly(this,"jsonRpcFetchFunc",se),defineReadOnly(this,"provider",ae)}send(n,c){return this.jsonRpcFetchFunc(n,c)}}const version$7="solidity/5.8.0",regexBytes=new RegExp("^bytes([0-9]+)$"),regexNumber=new RegExp("^(u?int)([0-9]*)$"),regexArray=new RegExp("^(.*)\\[([0-9]*)\\]$"),Zeros="0000000000000000000000000000000000000000000000000000000000000000",logger$1$1=new Logger$1(version$7);function _pack(t,n,c){switch(t){case"address":return c?zeroPad(n,32):arrayify(n);case"string":return toUtf8Bytes(n);case"bytes":return arrayify(n);case"bool":return n=n?"0x01":"0x00",c?zeroPad(n,32):arrayify(n)}let ie=t.match(regexNumber);if(ie){let se=parseInt(ie[2]||"256");return(ie[2]&&String(se)!==ie[2]||se%8!==0||se===0||se>256)&&logger$1$1.throwArgumentError("invalid number type","type",t),c&&(se=256),n=BigNumber$1.from(n).toTwos(se),zeroPad(n,se/8)}if(ie=t.match(regexBytes),ie){const se=parseInt(ie[1]);return(String(se)!==ie[1]||se===0||se>32)&&logger$1$1.throwArgumentError("invalid bytes type","type",t),arrayify(n).byteLength!==se&&logger$1$1.throwArgumentError(`invalid value for ${t}`,"value",n),c?arrayify((n+Zeros).substring(0,66)):n}if(ie=t.match(regexArray),ie&&Array.isArray(n)){const se=ie[1];parseInt(ie[2]||String(n.length))!=n.length&&logger$1$1.throwArgumentError(`invalid array length for ${t}`,"value",n);const ae=[];return n.forEach(function(de){ae.push(_pack(se,de,!0))}),concat$1(ae)}return logger$1$1.throwArgumentError("invalid type","type",t)}function pack(t,n){t.length!=n.length&&logger$1$1.throwArgumentError("wrong number of values; expected ${ types.length }","values",n);const c=[];return t.forEach(function(ie,se){c.push(_pack(ie,n[se]))}),hexlify$1(concat$1(c))}function keccak256(t,n){return keccak256$1(pack(t,n))}function sha256$6(t,n){return sha256$7(pack(t,n))}const lib_esm$1=Object.freeze(Object.defineProperty({__proto__:null,keccak256,pack,sha256:sha256$6},Symbol.toStringTag,{value:"Module"})),version$6="units/5.8.0",logger$y=new Logger$1(version$6),names$2=["wei","kwei","mwei","gwei","szabo","finney","ether"];function commify(t){const n=String(t).split(".");(n.length>2||!n[0].match(/^-?[0-9]*$/)||n[1]&&!n[1].match(/^[0-9]*$/)||t==="."||t==="-.")&&logger$y.throwArgumentError("invalid value","value",t);let c=n[0],ie="";for(c.substring(0,1)==="-"&&(ie="-",c=c.substring(1));c.substring(0,1)==="0";)c=c.substring(1);c===""&&(c="0");let se="";for(n.length===2&&(se="."+(n[1]||"0"));se.length>2&&se[se.length-1]==="0";)se=se.substring(0,se.length-1);const ae=[];for(;c.length;)if(c.length<=3){ae.unshift(c);break}else{const de=c.length-3;ae.unshift(c.substring(de)),c=c.substring(0,de)}return ie+ae.join(",")+se}function formatUnits(t,n){if(typeof n=="string"){const c=names$2.indexOf(n);c!==-1&&(n=3*c)}return formatFixed(t,n??18)}function parseUnits(t,n){if(typeof t!="string"&&logger$y.throwArgumentError("value must be a string","value",t),typeof n=="string"){const c=names$2.indexOf(n);c!==-1&&(n=3*c)}return parseFixed(t,n??18)}function formatEther(t){return formatUnits(t,18)}function parseEther(t){return parseUnits(t,18)}const lib_esm=Object.freeze(Object.defineProperty({__proto__:null,commify,formatEther,formatUnits,parseEther,parseUnits},Symbol.toStringTag,{value:"Module"}));var NFTType=(t=>(t[t.ERC1155=0]="ERC1155",t[t.ERC721=1]="ERC721",t))(NFTType||{}),ProductType=(t=>(t[t.DIGITAL=0]="DIGITAL",t[t.POD=1]="POD",t[t.PHYSICAL=2]="PHYSICAL",t))(ProductType||{});class HTTPError extends Error{constructor(n,c,ie){const se=n.status||n.status===0?n.status:"",ae=n.statusText??"",de=`${se} ${ae}`.trim(),ue=de?`status code ${de}`:"an unknown error";super(`Request failed with ${ue}: ${c.method} ${c.url}`),Xn(this,"response"),Xn(this,"request"),Xn(this,"options"),this.name="HTTPError",this.response=n,this.request=c,this.options=ie}}class TimeoutError extends Error{constructor(n){super(`Request timed out: ${n.method} ${n.url}`),Xn(this,"request"),this.name="TimeoutError",this.request=n}}const supportsRequestStreams=(()=>{let t=!1,n=!1;const c=typeof globalThis.ReadableStream=="function",ie=typeof globalThis.Request=="function";if(c&&ie)try{n=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(se){if(se instanceof Error&&se.message==="unsupported BodyInit type")return!1;throw se}return t&&!n})(),supportsAbortController=typeof globalThis.AbortController=="function",supportsAbortSignal=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",supportsResponseStreams=typeof globalThis.ReadableStream=="function",supportsFormData=typeof globalThis.FormData=="function",requestMethods=["get","post","put","patch","head","delete"],responseTypes={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},maxSafeTimeout=2147483647,usualFormBoundarySize=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,stop=Symbol("stop"),kyOptionKeys={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0},requestOptionsRegistry={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0},getBodySize=t=>{if(!t)return 0;if(t instanceof FormData){let n=0;for(const[c,ie]of t)n+=usualFormBoundarySize,n+=new TextEncoder().encode(`Content-Disposition: form-data; name="${c}"`).length,n+=typeof ie=="string"?new TextEncoder().encode(ie).length:ie.size;return n}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength;if(typeof t=="string")return new TextEncoder().encode(t).length;if(t instanceof URLSearchParams)return new TextEncoder().encode(t.toString()).length;if("byteLength"in t)return t.byteLength;if(typeof t=="object"&&t!==null)try{const n=JSON.stringify(t);return new TextEncoder().encode(n).length}catch{return 0}return 0},withProgress=(t,n,c)=>{let ie,se=0;return t.pipeThrough(new TransformStream({transform(ae,de){if(de.enqueue(ae),ie){se+=ie.byteLength;let ue=n===0?0:se/n;ue>=1&&(ue=1-Number.EPSILON),c?.({percent:ue,totalBytes:Math.max(n,se),transferredBytes:se},ie)}ie=ae},flush(){ie&&(se+=ie.byteLength,c?.({percent:1,totalBytes:Math.max(n,se),transferredBytes:se},ie))}}))},streamResponse=(t,n)=>{if(!t.body)return t;if(t.status===204)return new Response(null,{status:t.status,statusText:t.statusText,headers:t.headers});const c=Number(t.headers.get("content-length"))||0;return new Response(withProgress(t.body,c,n),{status:t.status,statusText:t.statusText,headers:t.headers})},streamRequest=(t,n,c)=>{if(!t.body)return t;const ie=getBodySize(c??t.body);return new Request(t,{duplex:"half",body:withProgress(t.body,ie,n)})},isObject$2=t=>t!==null&&typeof t=="object",validateAndMerge=(...t)=>{for(const n of t)if((!isObject$2(n)||Array.isArray(n))&&n!==void 0)throw new TypeError("The `options` argument must be an object");return deepMerge({},...t)},mergeHeaders=(t={},n={})=>{const c=new globalThis.Headers(t),ie=n instanceof globalThis.Headers,se=new globalThis.Headers(n);for(const[ae,de]of se.entries())ie&&de==="undefined"||de===void 0?c.delete(ae):c.set(ae,de);return c};function newHookValue(t,n,c){return Object.hasOwn(n,c)&&n[c]===void 0?[]:deepMerge(t[c]??[],n[c]??[])}const mergeHooks=(t={},n={})=>({beforeRequest:newHookValue(t,n,"beforeRequest"),beforeRetry:newHookValue(t,n,"beforeRetry"),afterResponse:newHookValue(t,n,"afterResponse"),beforeError:newHookValue(t,n,"beforeError")}),deepMerge=(...t)=>{let n={},c={},ie={};for(const se of t)if(Array.isArray(se))Array.isArray(n)||(n=[]),n=[...n,...se];else if(isObject$2(se)){for(let[ae,de]of Object.entries(se))isObject$2(de)&&ae in n&&(de=deepMerge(n[ae],de)),n={...n,[ae]:de};isObject$2(se.hooks)&&(ie=mergeHooks(ie,se.hooks),n.hooks=ie),isObject$2(se.headers)&&(c=mergeHeaders(c,se.headers),n.headers=c)}return n},normalizeRequestMethod=t=>requestMethods.includes(t)?t.toUpperCase():t,retryMethods=["get","put","head","delete","options","trace"],retryStatusCodes=[408,413,429,500,502,503,504],retryAfterStatusCodes=[413,429,503],defaultRetryOptions={limit:2,methods:retryMethods,statusCodes:retryStatusCodes,afterStatusCodes:retryAfterStatusCodes,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3},normalizeRetryOptions=(t={})=>{if(typeof t=="number")return{...defaultRetryOptions,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return{...defaultRetryOptions,...t}};async function timeout(t,n,c,ie){return new Promise((se,ae)=>{const de=setTimeout(()=>{c&&c.abort(),ae(new TimeoutError(t))},ie.timeout);ie.fetch(t,n).then(se).catch(ae).then(()=>{clearTimeout(de)})})}async function delay(t,{signal:n}){return new Promise((c,ie)=>{n&&(n.throwIfAborted(),n.addEventListener("abort",se,{once:!0}));function se(){clearTimeout(ae),ie(n.reason)}const ae=setTimeout(()=>{n?.removeEventListener("abort",se),c()},t)})}const findUnknownOptions=(t,n)=>{const c={};for(const ie in n)!(ie in requestOptionsRegistry)&&!(ie in kyOptionKeys)&&!(ie in t)&&(c[ie]=n[ie]);return c},hasSearchParameters=t=>t===void 0?!1:Array.isArray(t)?t.length>0:t instanceof URLSearchParams?t.size>0:typeof t=="object"?Object.keys(t).length>0:typeof t=="string"?t.trim().length>0:!!t;var ei,oi;const Yn=class po{constructor(n,c={}){Xn(this,"request"),Xn(this,"abortController"),Xn(this,"_retryCount",0),Xn(this,"_input"),Xn(this,"_options"),Xn(this,"_originalRequest");var ie,se,ae;if(this._input=n,this._options={...c,headers:mergeHeaders(this._input.headers,c.headers),hooks:mergeHooks({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},c.hooks),method:normalizeRequestMethod(c.method??this._input.method??"GET"),prefixUrl:String(c.prefixUrl||""),retry:normalizeRetryOptions(c.retry),throwHttpErrors:c.throwHttpErrors!==!1,timeout:c.timeout??1e4,fetch:c.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(supportsAbortController&&supportsAbortSignal){const de=this._options.signal??this._input.signal;this.abortController=new globalThis.AbortController,this._options.signal=de?AbortSignal.any([de,this.abortController.signal]):this.abortController.signal}if(supportsRequestStreams&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=((se=(ie=this._options).stringifyJson)==null?void 0:se.call(ie,this._options.json))??JSON.stringify(this._options.json),this._options.headers.set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.Request(this._input,this._options),hasSearchParameters(this._options.searchParams)){const de="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(ai(ae=po,ei,oi).call(ae,this._options.searchParams)).toString()),ue=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,de);(supportsFormData&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(ue,{...this.request}),this._options)}if(this._options.onUploadProgress){if(typeof this._options.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!supportsRequestStreams)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request.body&&(this.request=streamRequest(this.request,this._options.onUploadProgress,this._options.body))}}static create(n,c){var ie,se;const ae=new po(n,c),de=async()=>{if(typeof ae._options.timeout=="number"&&ae._options.timeout>maxSafeTimeout)throw new RangeError(`The \`timeout\` option cannot be greater than ${maxSafeTimeout}`);await Promise.resolve();let pe=await ae._fetch();for(const ge of ae._options.hooks.afterResponse){const be=await ge(ae.request,ae._options,ae._decorateResponse(pe.clone()));be instanceof globalThis.Response&&(pe=be)}if(ae._decorateResponse(pe),!pe.ok&&ae._options.throwHttpErrors){let ge=new HTTPError(pe,ae.request,ae._options);for(const be of ae._options.hooks.beforeError)ge=await be(ge);throw ge}if(ae._options.onDownloadProgress){if(typeof ae._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!supportsResponseStreams)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return streamResponse(pe.clone(),ae._options.onDownloadProgress)}return pe},ue=(ae._options.retry.methods.includes(ae.request.method.toLowerCase())?ae._retry(de):de()).finally(async()=>{var pe,ge;const be=ae._originalRequest,_e=[];be&&!be.bodyUsed&&_e.push((pe=be.body)==null?void 0:pe.cancel()),ae.request.bodyUsed||_e.push((ge=ae.request.body)==null?void 0:ge.cancel()),await Promise.all(_e)});for(const[pe,ge]of Object.entries(responseTypes))pe==="bytes"&&typeof((se=(ie=globalThis.Response)==null?void 0:ie.prototype)==null?void 0:se.bytes)!="function"||(ue[pe]=async()=>{ae.request.headers.set("accept",ae.request.headers.get("accept")||ge);const be=await ue;if(pe==="json"){if(be.status===204)return"";const _e=await be.text();return _e===""?"":c.parseJson?c.parseJson(_e):JSON.parse(_e)}return be[pe]()});return ue}_calculateRetryDelay(n){if(this._retryCount++,this._retryCount>this._options.retry.limit||n instanceof TimeoutError)throw n;if(n instanceof HTTPError){if(!this._options.retry.statusCodes.includes(n.response.status))throw n;const ie=n.response.headers.get("Retry-After")??n.response.headers.get("RateLimit-Reset")??n.response.headers.get("X-RateLimit-Reset")??n.response.headers.get("X-Rate-Limit-Reset");if(ie&&this._options.retry.afterStatusCodes.includes(n.response.status)){let se=Number(ie)*1e3;Number.isNaN(se)?se=Date.parse(ie)-Date.now():se>=Date.parse("2024-01-01")&&(se-=Date.now());const ae=this._options.retry.maxRetryAfter??se;return se<ae?se:ae}if(n.response.status===413)throw n}const c=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,c)}_decorateResponse(n){return this._options.parseJson&&(n.json=async()=>this._options.parseJson(await n.text())),n}async _retry(n){try{return await n()}catch(c){const ie=Math.min(this._calculateRetryDelay(c),maxSafeTimeout);if(this._retryCount<1)throw c;await delay(ie,{signal:this._options.signal});for(const se of this._options.hooks.beforeRetry)if(await se({request:this.request,options:this._options,error:c,retryCount:this._retryCount})===stop)return;return this._retry(n)}}async _fetch(){for(const c of this._options.hooks.beforeRequest){const ie=await c(this.request,this._options);if(ie instanceof Request){this.request=ie;break}if(ie instanceof Response)return ie}const n=findUnknownOptions(this.request,this._options);return this._originalRequest=this.request,this.request=this._originalRequest.clone(),this._options.timeout===!1?this._options.fetch(this._originalRequest,n):timeout(this._originalRequest,n,this.abortController,this._options)}};ei=new WeakSet,oi=function(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof URLSearchParams)?Object.fromEntries(Object.entries(t).filter(([,n])=>n!==void 0)):t},ii(Yn,ei);let Ky=Yn;const createInstance$1=t=>{const n=(c,ie)=>Ky.create(c,validateAndMerge(t,ie));for(const c of requestMethods)n[c]=(ie,se)=>Ky.create(ie,validateAndMerge(t,se,{method:c}));return n.create=c=>createInstance$1(validateAndMerge(c)),n.extend=c=>(typeof c=="function"&&(c=c(t??{})),createInstance$1(validateAndMerge(t,c))),n.stop=stop,n},ky=createInstance$1();async function uploadMetadata(t,n,c){return(await(await c.post("uploader/cdn-upload-json",{json:{data:t,key:`record-metadata/${n}.json`}})).json()).url}async function startRecord(t,n,c,ie,se,ae){return(await(await ae.post("web3/record/transactions",{json:{uris:se,network:ie,data:{productId:t,skuIds:n},productId:t,skuIds:n,metadata:{},shopId:c,txType:"RECORD"}})).json()).data.id}async function getShopInfo(t,n,c){const ie=(await(await c.get(`shops/v2/public/${n}`)).json()).data.deployedContracts.filter(se=>se.type===t);return ie.length===0?{nftContractAddress:"",shopContractAddress:""}:{nftContractAddress:ie[0].deployedNFTAddress,shopContractAddress:ie[0].deployedShopAddress}}async function deleteRecordTransaction(t,n){await n.delete(`web3/record/transactions/${t}`)}async function web3Callback$1(t,n,c,ie){const se={"X-API-KEY":"ho8homr9e8p4fwii7tjiz41xs4hlbl2h4i"};return(await(await ky.create({headers:se,prefixUrl:c==="TESTNET"?"https://web3dev.droplinked.com/":"https://web3.droplinked.com/"}).post("transactions",{json:{transaction_id:t,callback_url:ie,chain:n,network:c},headers:se})).json()).data}async function getProductData(t,n){return(await(await n.get(`product-v2/public/${t}`)).json()).data}async function transformProductData(t,n){const c=await getProductData(t,n);if(!c||c.skus.length===0)throw new Error("Product not found or no SKUs available");return{productData:{acceptsManageWallet:!0,commission:c.affiliate.commissionPercent||0,description:c.description,productTitle:c.title,royalty:c.skus[0].royalty||0,type:ProductType[c.type.toUpperCase()]||ProductType.DIGITAL},skuData:c.skus.map(ie=>{var se;return{amount:ie.inventory.quantity,imageUrl:((se=c.images[c.defaultImageIndex])==null?void 0:se.original)||"",skuID:ie.id,skuProperties:ie}})}}async function updateUris(t,n,c){return(await(await c.put(`web3/record/transactions/${t}/uris`,{json:{uris:n}})).json()).data}async function updateHash(t,n,c,ie){return(await(await ie.put(`web3/${t}/transactions/${n}/hash`,{json:{transactionHash:c}})).json()).data}async function getProductDataForRecord(t,n){if(!t)throw new InvalidParametersException(Chains.BASE,"Product ID is required");let c,ie=[];try{const{productData:se,skuData:ae}=await transformProductData(t,n);c=se,ie=ae}catch(se){throw new Error(`Failed to fetch product data: ${se}`)}if(!c||ie.length===0)throw new Error("Product not found or no SKUs available");return{productData:c,skuData:ie}}async function getNonce$1(t,n){return await(await n.get(`web3/auth/nonce?wallet=${t}`)).json()}async function getAddress(t,n,c){const ie=se=>se.charAt(0).toUpperCase()+se.slice(1).toLowerCase();try{const se=n===Network.TESTNET?"apiv3dev":"apiv3",ae=ie(t),de=ie(Network[n]),ue=`https://${se}.droplinked.com/storage/${ae}${de}ContractAddress${c}`;return(await await ky.get(ue).json()).value}catch(se){throw console.error(`Failed to fetch ${c.toLowerCase()} address:`,se),new Error(`Unable to get ${c.toLowerCase()} address`)}}async function getDeployerAddress(t,n){return getAddress(t,n,"Deployer")}async function getProxyAddress(t,n){return getAddress(t,n,"Proxy")}async function startPayment$1(t,n,c,ie,se){return(await(await se.post("web3/payment/transactions",{json:{network:c,token:n,shopId:ie,orderId:t}})).json()).data.id}async function getCartData$1(t,n,c,ie){const se=await(await ie.get(`web3/payment/distribution/${t}/${n}/${c}`)).json();return{paymentData:se.data,orderID:se.orderID}}async function getPurchaseSignature(t,n,c){const ie=await(await c.get(`nfts/by-order?orderId=${t}&skuId=${n}`)).json();return console.log("Purchase signature response:",ie),{signature:ie.purchaseSignature,shopContractAddress:ie.shopContractAddress,networkName:ie.networkName,nftId:ie._id,claimed:ie.claimed}}async function sendClaim(t,n,c){return await(await c.post("nfts/transfer",{json:{transactionId:n,nftId:t}})).json()}async function getShopByteCode(){try{return String((await await ky.get("https://apiv3dev.droplinked.com/storage/shopByteCodeType0").json()).value)}catch(t){throw console.error(`Failed to get shop bytecode: ${t}`),new Error("Unable to get shop bytecode")}}async function getShopDeployInfo(t,n){const c=(await(await n.get(`shops/v2/public/${t}`)).json()).data;return{name:c.name,description:c.description,logo:c.logo,url:c.url,deployedContracts:c.deployedContracts}}const shopABI=[{inputs:[{internalType:"string",name:"_shopName",type:"string"},{internalType:"string",name:"_shopAddress",type:"string"},{internalType:"address",name:"_shopOwner",type:"address"},{internalType:"string",name:"_shopLogo",type:"string"},{internalType:"string",name:"_shopDescription",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"AccessDenied",type:"error"},{inputs:[],name:"AffiliatePOD",type:"error"},{inputs:[],name:"AlreadyClaimed",type:"error"},{inputs:[{internalType:"address",name:"requester",type:"address"},{internalType:"uint256",name:"productId",type:"uint256"}],name:"AlreadyRequested",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"producer",type:"address"}],name:"NotEnoughTokens",type:"error"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"OwnableInvalidOwner",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"OwnableUnauthorizedAccount",type:"error"},{inputs:[{internalType:"uint256",name:"productId",type:"uint256"}],name:"ProductDoesntExist",type:"error"},{inputs:[{internalType:"uint256",name:"productId",type:"uint256"}],name:"ProductExists",type:"error"},{inputs:[],name:"ReentrancyGuardReentrantCall",type:"error"},{inputs:[{internalType:"uint256",name:"requestId",type:"uint256"}],name:"RequestAlreadyConfirmed",type:"error"},{inputs:[{internalType:"uint256",name:"requestId",type:"uint256"}],name:"RequestDoesntExist",type:"error"},{inputs:[{internalType:"uint256",name:"requestId",type:"uint256"}],name:"RequestNotConfirmed",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"nftAddress",type:"address"}],name:"ShopDoesNotOwnToken",type:"error"},{inputs:[],name:"oldPrice",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"requestId",type:"uint256"},{indexed:!0,internalType:"address",name:"approver",type:"address"}],name:"AffiliateRequestApproved",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"requestId",type:"uint256"},{indexed:!0,internalType:"address",name:"disapprover",type:"address"}],name:"AffiliateRequestDisapproved",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"requestId",type:"uint256"},{indexed:!0,internalType:"uint256",name:"productId",type:"uint256"},{indexed:!1,internalType:"address",name:"requester",type:"address"}],name:"AffiliateRequested",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"count",type:"uint256"}],name:"BatchProductRegistered",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"productId",type:"uint256"},{indexed:!0,internalType:"address",name:"claimer",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"ProductClaimed",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"productId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!1,internalType:"string",name:"uri",type:"string"}],name:"ProductRegistered",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"productId",type:"uint256"},{indexed:!0,internalType:"address",name:"owner",type:"address"}],name:"ProductUnregistered",type:"event"},{inputs:[],name:"affiliateRequestCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"requestId",type:"uint256"}],name:"affiliateRequests",outputs:[{internalType:"address",name:"publisher",type:"address"},{internalType:"uint256",name:"productId",type:"uint256"},{internalType:"bool",name:"isConfirmed",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"requestId",type:"uint256"}],name:"approveRequest",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"manager",type:"address"},{internalType:"bytes",name:"signature",type:"bytes"},{components:[{components:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"productId",type:"uint256"},{internalType:"uint256",name:"nullifier",type:"uint256"}],internalType:"struct PurchasedItem[]",name:"cart",type:"tuple[]"},{internalType:"address",name:"shop",type:"address"}],internalType:"struct PurchaseSignature",name:"purchaseSignature",type:"tuple"}],name:"claimPurchase",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"requestId",type:"uint256"}],name:"disapproveRequest",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"droplinkedManagerWallet",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"requestId",type:"uint256"}],name:"getAffiliate",outputs:[{components:[{internalType:"address",name:"publisher",type:"address"},{internalType:"uint256",name:"productId",type:"uint256"},{internalType:"bool",name:"isConfirmed",type:"bool"}],internalType:"struct AffiliateRequest",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"getAffiliateRequestCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"messageHash",type:"bytes32"}],name:"getEthSignedMessageHash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"pure",type:"function"},{inputs:[{components:[{components:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"productId",type:"uint256"},{internalType:"uint256",name:"nullifier",type:"uint256"}],internalType:"struct PurchasedItem[]",name:"cart",type:"tuple[]"},{internalType:"address",name:"shop",type:"address"}],internalType:"struct PurchaseSignature",name:"data",type:"tuple"}],name:"getMessageHash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"productId",type:"uint256"}],name:"getProduct",outputs:[{components:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"nftAddress",type:"address"},{internalType:"enum NFTType",name:"nftType",type:"uint8"},{internalType:"enum ProductType",name:"productType",type:"uint8"},{internalType:"uint256",name:"affiliatePercentage",type:"uint256"}],internalType:"struct Product",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"getProductCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"nftAddress",type:"address"},{internalType:"enum NFTType",name:"nftType",type:"uint8"},{internalType:"enum ProductType",name:"productType",type:"uint8"},{internalType:"uint256",name:"affiliatePercentage",type:"uint256"}],internalType:"struct Product",name:"product",type:"tuple"}],name:"getProductId",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"nftAddress",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getProductIdV2",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"affiliateId",type:"uint256"}],name:"getProductViaAffiliateId",outputs:[{components:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"nftAddress",type:"address"},{internalType:"enum NFTType",name:"nftType",type:"uint8"},{internalType:"enum ProductType",name:"productType",type:"uint8"},{internalType:"uint256",name:"affiliatePercentage",type:"uint256"}],internalType:"struct Product",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"getShopAddress",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"getShopDescription",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"getShopLogo",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"getShopName",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"getShopOwner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"productId",type:"uint256"},{internalType:"address",name:"requester",type:"address"}],name:"isRequestSubmited",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"managers",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"nftAddress",type:"address"},{internalType:"string",name:"uri",type:"string"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bool",name:"accepted",type:"bool"},{internalType:"uint256",name:"affiliatePercentage",type:"uint256"},{internalType:"uint256",name:"royalty",type:"uint256"},{internalType:"enum NFTType",name:"nftType",type:"uint8"},{internalType:"enum ProductType",name:"productType",type:"uint8"}],internalType:"struct RecordData",name:"mintData",type:"tuple"}],name:"mintAndRegister",outputs:[{internalType:"uint256",name:"productId",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"nftAddress",type:"address"},{internalType:"string",name:"uri",type:"string"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bool",name:"accepted",type:"bool"},{internalType:"uint256",name:"affiliatePercentage",type:"uint256"},{internalType:"uint256",name:"royalty",type:"uint256"},{internalType:"enum NFTType",name:"nftType",type:"uint8"},{internalType:"enum ProductType",name:"productType",type:"uint8"}],internalType:"struct RecordData[]",name:"recordData",type:"tuple[]"}],name:"mintAndRegisterBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"nullifiers",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256[]",name:"",type:"uint256[]"},{internalType:"uint256[]",name:"",type:"uint256[]"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC1155BatchReceived",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC1155Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC721Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"productCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"productId",type:"uint256"}],name:"products",outputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"nftAddress",type:"address"},{internalType:"enum NFTType",name:"nftType",type:"uint8"},{internalType:"enum ProductType",name:"productType",type:"uint8"},{internalType:"uint256",name:"affiliatePercentage",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"ethSignedMessageHash",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"recoverSigner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"pure",type:"function"},{inputs:[{components:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"nftAddress",type:"address"},{internalType:"enum NFTType",name:"nftType",type:"uint8"},{internalType:"enum ProductType",name:"productType",type:"uint8"},{internalType:"uint256",name:"affiliatePercentage",type:"uint256"}],internalType:"struct Product",name:"p",type:"tuple"}],name:"registerProduct",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"productId",type:"uint256"}],name:"requestAffiliate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"manager",type:"address"}],name:"revokeManager",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"manager",type:"address"}],name:"setManager",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"shopInfo",outputs:[{internalType:"string",name:"shopName",type:"string"},{internalType:"string",name:"shopAddress",type:"string"},{internalType:"string",name:"shopLogo",type:"string"},{internalType:"string",name:"shopDescription",type:"string"},{internalType:"address",name:"shopOwner",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"sig",type:"bytes"}],name:"splitSignature",outputs:[{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"newManager",type:"address"}],name:"transferManagerShip",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"productId",type:"uint256"}],name:"unregisterProduct",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newManagerWallet",type:"address"}],name:"updateDroplinkedManagerWallet",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"signer",type:"address"},{internalType:"bytes",name:"signature",type:"bytes"},{components:[{components:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"productId",type:"uint256"},{internalType:"uint256",name:"nullifier",type:"uint256"}],internalType:"struct PurchasedItem[]",name:"cart",type:"tuple[]"},{internalType:"address",name:"shop",type:"address"}],internalType:"struct PurchaseSignature",name:"data",type:"tuple"}],name:"verifyPurchase",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"pure",type:"function"}];function getTransactionLink({blockchain:t,transactionHash:n,isTestnet:c=!1}){const ie=n.trim();switch(t.toUpperCase()){case"CASPER":return`https://${c?"testnet.":""}cspr.live/deploy/${ie}`;case"STACKS":return`https://explorer.hiro.so/txid/${ie}?chain=${c?"testnet":"mainnet"}`;case"POLYGON":return`https://${c?"amoy.":""}polygonscan.com/tx/${ie}`;case"XRPLSIDECHAIN":return`https://evm-sidechain.xrpl.org/tx/${ie}`;case"BINANCE":return`https://${c?"testnet.":""}bscscan.com/tx/${ie}`;case"NEAR":return`https://explorer.${c?"testnet":"mainnet"}.aurora.dev/tx/${ie}`;case"BASE":return`https://base${c?"-sepolia":""}.blockscout.com/tx/${ie}`;case"LINEA":return`https://${c?"sepolia.":""}lineascan.build/tx/${ie}`;case"ETH":return`https://${c?"sepolia.":""}etherscan.io/tx/${ie}`;case"SOLANA":return`https://explorer.solana.com/tx/${ie}?cluster=${c?"devnet":"mainnet"}`;case"REDBELLY":return c?`https://redbelly.testnet.routescan.io/tx/${ie}`:`https://redbelly.routescan.io/tx/${ie}`;case"SKALE":return`https://${c?"giant-half-dual-testnet.explorer.testnet.skalenodes.com":"honorable-steel-rasalhague.explorer.mainnet.skalenodes.com"}/tx/${ie}`;case"BITLAYER":return c?`https://testnet.btrscan.com/tx/${ie}`:`https://www.btrscan.com/tx/${ie}`;default:return""}}async function ensureWalletOnChainFromConfig(t,n,c){const ie=n[c];if(!ie)throw new Error(`Network config not found for ${n.name} (${c})`);const se=t.provider;if(!(se!=null&&se.request))throw new Error("Provider does not support network switching");const ae=await t.getNetwork(),de=Number(ie.chainId);if(ae.chainId!==de){try{await se.request({method:"wallet_switchEthereumChain",params:[{chainId:ie.chainId}]})}catch(ue){if(ue.code===4902)await se.request({method:"wallet_addEthereumChain",params:[{chainId:ie.chainId,chainName:ie.chainName,rpcUrls:ie.rpcUrls,nativeCurrency:ie.nativeCurrency}]});else throw ue}if((await t.getNetwork()).chainId!==de)throw new Error(`Failed to switch to ${n.name} (${c})`)}}function getBaseUrl$1(t){return t===Network.MAINNET?"https://apiv3.droplinked.com":t===Network.TESTNET?"https://apiv3dev.droplinked.com":"http://127.0.0.1:3000"}async function getGasPrice(t){return(await t.getGasPrice()).toBigInt()}const deployerABI=[{inputs:[],name:"InvalidInitialization",type:"error"},{inputs:[],name:"NotInitializing",type:"error"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"OwnableInvalidOwner",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"OwnableUnauthorizedAccount",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"newFee",type:"uint256"}],name:"DroplinkedFeeUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"newHeartBeat",type:"uint256"}],name:"HeartBeatUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint64",name:"version",type:"uint64"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"shop",type:"address"},{indexed:!1,internalType:"address",name:"nftContract",type:"address"}],name:"ShopDeployed",type:"event"},{inputs:[{internalType:"bytes",name:"bytecode",type:"bytes"},{internalType:"bytes32",name:"salt",type:"bytes32"}],name:"deployShop",outputs:[{internalType:"address",name:"shop",type:"address"},{internalType:"address",name:"nftContract",type:"address"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"droplinkedFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"droplinkedWallet",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"getDroplinkedFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getHeartBeat",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"heartBeat",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_heartBeat",type:"uint256"},{internalType:"address",name:"_droplinkedWallet",type:"address"},{internalType:"uint256",name:"_droplinkedFee",type:"uint256"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"nftContracts",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"shopOwner",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"nftOwners",outputs:[{internalType:"address",name:"nftContracts",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"newFee",type:"uint256"}],name:"setDroplinkedFee",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"newHeartBeat",type:"uint256"}],name:"setHeartBeat",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"shopAddresses",outputs:[{internalType:"contract IDropShop",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"shopCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"shopOwner",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"shopOwners",outputs:[{internalType:"address",name:"shops",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}],sixify=t=>t.toString().padStart(6,"0");async function getConstructorArgs(t,n,c){return[t.shopName||"",t.shopAddress||"",c,t.shopLogo||"",t.shopDescription||"",n]}async function deployEVMShop(t,n,c){console.log({...t,...n,...c});const{modalInterface:ie}=n,{chain:se,network:ae,provider:de}=t,ue=de.getSigner(),pe=await getDeployerAddress(se,ae),ge=new Contract(pe,deployerABI,ue),be=await getShopByteCode(),_e=await ue.getAddress(),we="0x"+_e.split("0x")[1]+"000000000000000000"+sixify(Math.floor(Math.random()*1e6)+1),qe=await getConstructorArgs(c,pe,_e),Ye=defaultAbiCoder.encode(["string","string","address","string","string","address"],qe);try{let Ge;const Ze=be+Ye.split("0x")[1];console.log({fullBytecode:Ze}),t.chain!==Chains.SKALE?(await ge.callStatic.deployShop(Ze,we),Ge=await ge.deployShop(Ze,we,{})):Ge=await ge.deployShop(Ze,we);const He=(await Ge.wait()).logs.map(De=>{try{return ge.interface.parseLog(De)}catch{return null}}).filter(De=>De!=null).find(De=>De.name==="ShopDeployed"),Ht=He.args.shop,un=He.args.nftContract;return{transactionHash:Ge.hash,deployedShopAddress:Ht,deployedNFTAddress:un}}catch(Ge){if(ie.error("Error during shop deployment",`${Ge.message||Ge}`),Ge.code.toString()==="ACTION_REJECTED")throw new UserDeniedException("Deployer");try{const Ze=ge.interface.parseError(Ge.data);throw ie.error("Contract error",`${Ze}`),Ze}catch(Ze){throw ie.error("Unhandled error during shop deployment.",`${Ze||Ge}`),new Error(Ze||"Unknown error occurred.")}}}function getRecordData(t,n,c){const{acceptsManageWallet:ie,amount:se,royalty:ae,type:de}=t;return{nftAddress:c,uri:n,amount:se,accepted:ie,affiliatePercentage:ae,royalty:ae,nftType:NFTType.ERC1155,productType:de}}async function prepareRecordData(t,n,c,ie){const{nftContract:se}=ie;if(!se)throw new InvalidParametersException(t.chain,"nftContract");const{description:ae}=c,{skuID:de}=n,ue={...n,...c},pe={...ue.skuProperties},ge={name:ue.productTitle,description:ae,image:ue.imageUrl,properties:pe},be=await uploadMetadata(ge,de,ie.axiosInstance);return getRecordData(ue,be,se)}async function doRecordProduct(t,n,c,ie){const{modalInterface:se,nftContract:ae,shopContractAddress:de}=n;if(!ae||!de)throw se.error("Invalid Parameters","nftContract||shopContractAddress"),new InvalidParametersException(t.chain,"nftContract||shopContractAddress");se.changeStep("Connecting to wallet");const ue=t.provider.getSigner(),pe=new Contract(de,shopABI,ue);try{se.changeStep("Preparing products for recording");const ge=await Promise.all(ie.map(_e=>prepareRecordData(t,_e,c,n)));let be;return t.chain!==Chains.SKALE?(await pe.callStatic.mintAndRegisterBatch(ge),se.changeStep("Recording products on blockchain"),be=await pe.mintAndRegisterBatch(ge)):(se.changeStep("Recording products on blockchain"),be=await pe.mintAndRegisterBatch(ge)),se.changeStep("Waiting for transaction confirmation"),await be.wait(),{transactionHash:be.hash,metadataUrls:ge.map(_e=>_e.uri)}}catch(ge){if(ge.code&&ge.code.toString()==="ACTION_REJECTED")throw n.modalInterface.error("Transaction Rejected","ACTION_REJECTED"),new Error("Transaction Rejected");try{if(ge.data&&ge.data!=="0x"){const be=pe.interface.parseError(ge.data);throw be.name==="OwnableUnauthorizedAccount"?(n.modalInterface.error("Unauthorized","OwnableUnauthorizedAccount"),new Unauthorized(t.chain,"record",await ue.getAddress(),de)):(n.modalInterface.error(be.name,be.args.join(", ")),n.modalInterface.error(ge,be.name),ge)}else throw se.error("Transaction reverted without reason",`${ge}`),ge}catch(be){throw se.error("Unexpected error",`${be}`),be}}}async function recordProduct({productId:t,chain:n,axiosInstance:c,shopId:ie,network:se,stepizer:ae,provider:de}){let ue="",pe="";if(ae.changeStep("Starting record process"),ie!==""){const qe=await getShopInfo(n,ie,c);ue=qe.nftContractAddress,pe=qe.shopContractAddress}const ge=new Web3Provider(de,"any");if(!ue||!pe){ae.changeStep("Deploying shop contract");const qe={chain:n,network:se,provider:ge},Ye={axiosInstance:c,modalInterface:ae,nftContract:"",shopContractAddress:""},{description:Ge,logo:Ze,name:He,url:Ht,deployedContracts:un}=await getShopDeployInfo(ie,c),{deployedNFTAddress:De,deployedShopAddress:$e,transactionHash:me}=await deployEVMShop(qe,Ye,{shopName:He,shopAddress:Ht,shopLogo:Ze,shopDescription:Ge}),Gt=[...un||[],{type:n,deployedShopAddress:$e,transactionId:me,deployedNFTAddress:De,isCircle:!1,platform:"DROPLINKED",status:"SUCCESS"}];console.log({newDeployedContracts:Gt}),ue=De,pe=$e,ae.changeStep("Shop deployed successfully")}await ensureWalletOnChainFromConfig(ge,getChainByName(n),se);const{productData:be,skuData:_e}=await getProductDataForRecord(t,c);if(!ie)throw new InvalidParametersException(n,"shopId");const we=await startRecord(t,_e.map(qe=>qe.skuID),ie,n,[],c);try{const qe=await doRecordProduct({chain:n,network:se,provider:ge},{axiosInstance:c,modalInterface:ae,nftContract:ue,shopContractAddress:pe},be,_e);await updateUris(we,qe.metadataUrls,c),await updateHash("record",we,qe.transactionHash,c);const Ye=`${getBaseUrl$1(se)}/web3/record/callback/events/${we}`;if(!await web3Callback$1(qe.transactionHash,n,Network[se],Ye))throw new Web3CallbackFailedException("Record");return{...qe,transactionId:we,transactionHashUrl:getTransactionLink({blockchain:n,transactionHash:qe.transactionHash,isTestnet:se!==Network.MAINNET})}}catch(qe){throw console.error("Error during recording process:",qe),await deleteRecordTransaction(we,c),qe}}var utils$e={};const require$$0$3=getAugmentedNamespace(lib_esm$b),require$$1$2=getAugmentedNamespace(lib_esm$f),require$$2$3=getAugmentedNamespace(lib_esm$d),require$$3$1=getAugmentedNamespace(lib_esm$8),require$$4$3=getAugmentedNamespace(lib_esm$j),require$$5=getAugmentedNamespace(lib_esm$c),require$$6$2=getAugmentedNamespace(lib_esm$6),require$$7=getAugmentedNamespace(lib_esm$4),require$$8=getAugmentedNamespace(lib_esm$h),require$$9=getAugmentedNamespace(lib_esm$k),require$$10=getAugmentedNamespace(lib_esm$7),require$$11$1=getAugmentedNamespace(lib_esm$1),require$$12=getAugmentedNamespace(lib_esm$5),require$$13=getAugmentedNamespace(lib_esm$i),require$$14=getAugmentedNamespace(lib_esm$g),require$$15=getAugmentedNamespace(lib_esm$a),require$$16=getAugmentedNamespace(lib_esm$e),require$$17$1=getAugmentedNamespace(lib_esm$9),require$$18=getAugmentedNamespace(lib_esm),require$$19=getAugmentedNamespace(lib_esm$3),require$$20=getAugmentedNamespace(lib_esm$2);(function(t){var n=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(le,Pe,xe,ze){ze===void 0&&(ze=xe),Object.defineProperty(le,ze,{enumerable:!0,get:function(){return Pe[xe]}})}:function(le,Pe,xe,ze){ze===void 0&&(ze=xe),le[ze]=Pe[xe]}),c=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(le,Pe){Object.defineProperty(le,"default",{enumerable:!0,value:Pe})}:function(le,Pe){le.default=Pe}),ie=commonjsGlobal&&commonjsGlobal.__importStar||function(le){if(le&&le.__esModule)return le;var Pe={};if(le!=null)for(var xe in le)xe!=="default"&&Object.prototype.hasOwnProperty.call(le,xe)&&n(Pe,le,xe);return c(Pe,le),Pe};Object.defineProperty(t,"__esModule",{value:!0}),t.formatBytes32String=t.Utf8ErrorFuncs=t.toUtf8String=t.toUtf8CodePoints=t.toUtf8Bytes=t._toEscapedUtf8String=t.nameprep=t.hexDataSlice=t.hexDataLength=t.hexZeroPad=t.hexValue=t.hexStripZeros=t.hexConcat=t.isHexString=t.hexlify=t.base64=t.base58=t.TransactionDescription=t.LogDescription=t.Interface=t.SigningKey=t.HDNode=t.defaultPath=t.isBytesLike=t.isBytes=t.zeroPad=t.stripZeros=t.concat=t.arrayify=t.shallowCopy=t.resolveProperties=t.getStatic=t.defineReadOnly=t.deepCopy=t.checkProperties=t.poll=t.fetchJson=t._fetchData=t.RLP=t.Logger=t.checkResultErrors=t.FormatTypes=t.ParamType=t.FunctionFragment=t.EventFragment=t.ErrorFragment=t.ConstructorFragment=t.Fragment=t.defaultAbiCoder=t.AbiCoder=void 0,t.Indexed=t.Utf8ErrorReason=t.UnicodeNormalizationForm=t.SupportedAlgorithm=t.mnemonicToSeed=t.isValidMnemonic=t.entropyToMnemonic=t.mnemonicToEntropy=t.getAccountPath=t.verifyTypedData=t.verifyMessage=t.recoverPublicKey=t.computePublicKey=t.recoverAddress=t.computeAddress=t.getJsonWalletAddress=t.TransactionTypes=t.serializeTransaction=t.parseTransaction=t.accessListify=t.joinSignature=t.splitSignature=t.soliditySha256=t.solidityKeccak256=t.solidityPack=t.shuffled=t.randomBytes=t.sha512=t.sha256=t.ripemd160=t.keccak256=t.computeHmac=t.commify=t.parseUnits=t.formatUnits=t.parseEther=t.formatEther=t.isAddress=t.getCreate2Address=t.getContractAddress=t.getIcapAddress=t.getAddress=t._TypedDataEncoder=t.id=t.isValidName=t.namehash=t.hashMessage=t.dnsEncode=t.parseBytes32String=void 0;var se=require$$0$3;Object.defineProperty(t,"AbiCoder",{enumerable:!0,get:function(){return se.AbiCoder}}),Object.defineProperty(t,"checkResultErrors",{enumerable:!0,get:function(){return se.checkResultErrors}}),Object.defineProperty(t,"ConstructorFragment",{enumerable:!0,get:function(){return se.ConstructorFragment}}),Object.defineProperty(t,"defaultAbiCoder",{enumerable:!0,get:function(){return se.defaultAbiCoder}}),Object.defineProperty(t,"ErrorFragment",{enumerable:!0,get:function(){return se.ErrorFragment}}),Object.defineProperty(t,"EventFragment",{enumerable:!0,get:function(){return se.EventFragment}}),Object.defineProperty(t,"FormatTypes",{enumerable:!0,get:function(){return se.FormatTypes}}),Object.defineProperty(t,"Fragment",{enumerable:!0,get:function(){return se.Fragment}}),Object.defineProperty(t,"FunctionFragment",{enumerable:!0,get:function(){return se.FunctionFragment}}),Object.defineProperty(t,"Indexed",{enumerable:!0,get:function(){return se.Indexed}}),Object.defineProperty(t,"Interface",{enumerable:!0,get:function(){return se.Interface}}),Object.defineProperty(t,"LogDescription",{enumerable:!0,get:function(){return se.LogDescription}}),Object.defineProperty(t,"ParamType",{enumerable:!0,get:function(){return se.ParamType}}),Object.defineProperty(t,"TransactionDescription",{enumerable:!0,get:function(){return se.TransactionDescription}});var ae=require$$1$2;Object.defineProperty(t,"getAddress",{enumerable:!0,get:function(){return ae.getAddress}}),Object.defineProperty(t,"getCreate2Address",{enumerable:!0,get:function(){return ae.getCreate2Address}}),Object.defineProperty(t,"getContractAddress",{enumerable:!0,get:function(){return ae.getContractAddress}}),Object.defineProperty(t,"getIcapAddress",{enumerable:!0,get:function(){return ae.getIcapAddress}}),Object.defineProperty(t,"isAddress",{enumerable:!0,get:function(){return ae.isAddress}});var de=ie(require$$2$3);t.base64=de;var ue=require$$3$1;Object.defineProperty(t,"base58",{enumerable:!0,get:function(){return ue.Base58}});var pe=require$$4$3;Object.defineProperty(t,"arrayify",{enumerable:!0,get:function(){return pe.arrayify}}),Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return pe.concat}}),Object.defineProperty(t,"hexConcat",{enumerable:!0,get:function(){return pe.hexConcat}}),Object.defineProperty(t,"hexDataSlice",{enumerable:!0,get:function(){return pe.hexDataSlice}}),Object.defineProperty(t,"hexDataLength",{enumerable:!0,get:function(){return pe.hexDataLength}}),Object.defineProperty(t,"hexlify",{enumerable:!0,get:function(){return pe.hexlify}}),Object.defineProperty(t,"hexStripZeros",{enumerable:!0,get:function(){return pe.hexStripZeros}}),Object.defineProperty(t,"hexValue",{enumerable:!0,get:function(){return pe.hexValue}}),Object.defineProperty(t,"hexZeroPad",{enumerable:!0,get:function(){return pe.hexZeroPad}}),Object.defineProperty(t,"isBytes",{enumerable:!0,get:function(){return pe.isBytes}}),Object.defineProperty(t,"isBytesLike",{enumerable:!0,get:function(){return pe.isBytesLike}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return pe.isHexString}}),Object.defineProperty(t,"joinSignature",{enumerable:!0,get:function(){return pe.joinSignature}}),Object.defineProperty(t,"zeroPad",{enumerable:!0,get:function(){return pe.zeroPad}}),Object.defineProperty(t,"splitSignature",{enumerable:!0,get:function(){return pe.splitSignature}}),Object.defineProperty(t,"stripZeros",{enumerable:!0,get:function(){return pe.stripZeros}});var ge=require$$5;Object.defineProperty(t,"_TypedDataEncoder",{enumerable:!0,get:function(){return ge._TypedDataEncoder}}),Object.defineProperty(t,"dnsEncode",{enumerable:!0,get:function(){return ge.dnsEncode}}),Object.defineProperty(t,"hashMessage",{enumerable:!0,get:function(){return ge.hashMessage}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return ge.id}}),Object.defineProperty(t,"isValidName",{enumerable:!0,get:function(){return ge.isValidName}}),Object.defineProperty(t,"namehash",{enumerable:!0,get:function(){return ge.namehash}});var be=require$$6$2;Object.defineProperty(t,"defaultPath",{enumerable:!0,get:function(){return be.defaultPath}}),Object.defineProperty(t,"entropyToMnemonic",{enumerable:!0,get:function(){return be.entropyToMnemonic}}),Object.defineProperty(t,"getAccountPath",{enumerable:!0,get:function(){return be.getAccountPath}}),Object.defineProperty(t,"HDNode",{enumerable:!0,get:function(){return be.HDNode}}),Object.defineProperty(t,"isValidMnemonic",{enumerable:!0,get:function(){return be.isValidMnemonic}}),Object.defineProperty(t,"mnemonicToEntropy",{enumerable:!0,get:function(){return be.mnemonicToEntropy}}),Object.defineProperty(t,"mnemonicToSeed",{enumerable:!0,get:function(){return be.mnemonicToSeed}});var _e=require$$7;Object.defineProperty(t,"getJsonWalletAddress",{enumerable:!0,get:function(){return _e.getJsonWalletAddress}});var we=require$$8;Object.defineProperty(t,"keccak256",{enumerable:!0,get:function(){return we.keccak256}});var qe=require$$9;Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return qe.Logger}});var Ye=require$$10;Object.defineProperty(t,"computeHmac",{enumerable:!0,get:function(){return Ye.computeHmac}}),Object.defineProperty(t,"ripemd160",{enumerable:!0,get:function(){return Ye.ripemd160}}),Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return Ye.sha256}}),Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return Ye.sha512}});var Ge=require$$11$1;Object.defineProperty(t,"solidityKeccak256",{enumerable:!0,get:function(){return Ge.keccak256}}),Object.defineProperty(t,"solidityPack",{enumerable:!0,get:function(){return Ge.pack}}),Object.defineProperty(t,"soliditySha256",{enumerable:!0,get:function(){return Ge.sha256}});var Ze=require$$12;Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return Ze.randomBytes}}),Object.defineProperty(t,"shuffled",{enumerable:!0,get:function(){return Ze.shuffled}});var He=require$$13;Object.defineProperty(t,"checkProperties",{enumerable:!0,get:function(){return He.checkProperties}}),Object.defineProperty(t,"deepCopy",{enumerable:!0,get:function(){return He.deepCopy}}),Object.defineProperty(t,"defineReadOnly",{enumerable:!0,get:function(){return He.defineReadOnly}}),Object.defineProperty(t,"getStatic",{enumerable:!0,get:function(){return He.getStatic}}),Object.defineProperty(t,"resolveProperties",{enumerable:!0,get:function(){return He.resolveProperties}}),Object.defineProperty(t,"shallowCopy",{enumerable:!0,get:function(){return He.shallowCopy}});var Ht=ie(require$$14);t.RLP=Ht;var un=require$$15;Object.defineProperty(t,"computePublicKey",{enumerable:!0,get:function(){return un.computePublicKey}}),Object.defineProperty(t,"recoverPublicKey",{enumerable:!0,get:function(){return un.recoverPublicKey}}),Object.defineProperty(t,"SigningKey",{enumerable:!0,get:function(){return un.SigningKey}});var De=require$$16;Object.defineProperty(t,"formatBytes32String",{enumerable:!0,get:function(){return De.formatBytes32String}}),Object.defineProperty(t,"nameprep",{enumerable:!0,get:function(){return De.nameprep}}),Object.defineProperty(t,"parseBytes32String",{enumerable:!0,get:function(){return De.parseBytes32String}}),Object.defineProperty(t,"_toEscapedUtf8String",{enumerable:!0,get:function(){return De._toEscapedUtf8String}}),Object.defineProperty(t,"toUtf8Bytes",{enumerable:!0,get:function(){return De.toUtf8Bytes}}),Object.defineProperty(t,"toUtf8CodePoints",{enumerable:!0,get:function(){return De.toUtf8CodePoints}}),Object.defineProperty(t,"toUtf8String",{enumerable:!0,get:function(){return De.toUtf8String}}),Object.defineProperty(t,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return De.Utf8ErrorFuncs}});var $e=require$$17$1;Object.defineProperty(t,"accessListify",{enumerable:!0,get:function(){return $e.accessListify}}),Object.defineProperty(t,"computeAddress",{enumerable:!0,get:function(){return $e.computeAddress}}),Object.defineProperty(t,"parseTransaction",{enumerable:!0,get:function(){return $e.parse}}),Object.defineProperty(t,"recoverAddress",{enumerable:!0,get:function(){return $e.recoverAddress}}),Object.defineProperty(t,"serializeTransaction",{enumerable:!0,get:function(){return $e.serialize}}),Object.defineProperty(t,"TransactionTypes",{enumerable:!0,get:function(){return $e.TransactionTypes}});var me=require$$18;Object.defineProperty(t,"commify",{enumerable:!0,get:function(){return me.commify}}),Object.defineProperty(t,"formatEther",{enumerable:!0,get:function(){return me.formatEther}}),Object.defineProperty(t,"parseEther",{enumerable:!0,get:function(){return me.parseEther}}),Object.defineProperty(t,"formatUnits",{enumerable:!0,get:function(){return me.formatUnits}}),Object.defineProperty(t,"parseUnits",{enumerable:!0,get:function(){return me.parseUnits}});var Gt=require$$19;Object.defineProperty(t,"verifyMessage",{enumerable:!0,get:function(){return Gt.verifyMessage}}),Object.defineProperty(t,"verifyTypedData",{enumerable:!0,get:function(){return Gt.verifyTypedData}});var mn=require$$20;Object.defineProperty(t,"_fetchData",{enumerable:!0,get:function(){return mn._fetchData}}),Object.defineProperty(t,"fetchJson",{enumerable:!0,get:function(){return mn.fetchJson}}),Object.defineProperty(t,"poll",{enumerable:!0,get:function(){return mn.poll}});var dn=require$$10;Object.defineProperty(t,"SupportedAlgorithm",{enumerable:!0,get:function(){return dn.SupportedAlgorithm}});var jt=require$$16;Object.defineProperty(t,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return jt.UnicodeNormalizationForm}}),Object.defineProperty(t,"Utf8ErrorReason",{enumerable:!0,get:function(){return jt.Utf8ErrorReason}})})(utils$e);const ZERO_ADDRESS="0x0000000000000000000000000000000000000000",SkaleUsdcAddressForTestnet="0x2aebcdc4f9f9149a50422fff86198cb0939ea165",SkaleUsdcAddressForMainnet="0x7Cf76E740Cb23b99337b21F392F22c47Ad910c67",erc20ABI=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"allowance",type:"uint256"},{internalType:"uint256",name:"needed",type:"uint256"}],name:"ERC20InsufficientAllowance",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"needed",type:"uint256"}],name:"ERC20InsufficientBalance",type:"error"},{inputs:[{internalType:"address",name:"approver",type:"address"}],name:"ERC20InvalidApprover",type:"error"},{inputs:[{internalType:"address",name:"receiver",type:"address"}],name:"ERC20InvalidReceiver",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"ERC20InvalidSender",type:"error"},{inputs:[{internalType:"address",name:"spender",type:"address"}],name:"ERC20InvalidSpender",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}],paymentProxyABI=[{inputs:[{internalType:"uint256",name:"_heartBeat",type:"uint256"},{internalType:"address",name:"_chainLinkProvider",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"OwnableInvalidOwner",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"OwnableUnauthorizedAccount",type:"error"},{inputs:[{internalType:"uint256",name:"priceTimestamp",type:"uint256"},{internalType:"uint256",name:"currentTimestamp",type:"uint256"}],name:"oldPrice",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"newHeartBeat",type:"uint256"}],name:"HeartBeatChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"ProductPurchased",type:"event"},{inputs:[{internalType:"uint256",name:"_heartBeat",type:"uint256"}],name:"changeHeartBeat",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"tbdValues",type:"uint256[]"},{internalType:"address[]",name:"tbdReceivers",type:"address[]"},{internalType:"address",name:"currency",type:"address"},{internalType:"uint80",name:"roundId",type:"uint80"},{internalType:"string",name:"memo",type:"string"}],name:"droplinkedPurchase",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"heartBeat",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}];async function handleCustomTokenApproval(t,n,c,ie,se){if(!t.tokenAddress)throw new InvalidParametersException(Chains.BASE,"Token address is not set");try{const ae=new Contract(t.tokenAddress,erc20ABI,c),de=await ae.balanceOf(ie),ue=t.tbdValues.reduce((ge,be)=>ge.add(BigNumber$1.from(be)),BigNumber$1.from(0));if(de.lt(ue))throw new InsufficientBalanceException;se.changeStep("Approving token");const pe=await ae.approve(n,MaxUint256$1);se.changeStep("awaiting confirmation"),await pe.wait(),se.changeStep("Token approval confirmed")}catch(ae){handleError(ae,se)}}const droplinkedPayment=async function(t,n,c){const{modalInterface:ie}=n,{provider:se,chain:ae,network:de}=t;if(!c.tbdReceivers.every(utils$e.isAddress))throw new InvalidParametersException(ae,"Invalid receiver address found");c.chainLinkRoundId=c.chainLinkRoundId||"0";const ue=c.tokenAddress&&c.tokenAddress!==ZERO_ADDRESS;if(ue){if(!c.tbdValues.every(we=>BigNumber$1.from(we).gt(0)))throw new InvalidParametersException(ae,"tbdValues must be positive numbers")}else if(!c.tbdValues.every(we=>we>0))throw new InvalidParametersException(ae,"tbdValues must be positive numbers");const pe=se.getSigner(),ge=await pe.getAddress();if(!c.tbdValues)throw new InvalidParametersException(ae,`Invalid tbdValues: ${c.tbdValues}`);if(!c.tbdReceivers)throw new InvalidParametersException(ae,`Invalid tbdReceivers: ${c.tbdReceivers}`);if(!c.memo)throw new InvalidParametersException(ae,`Memo is required for payment, current memo: ${c.memo}`);if(c.tbdReceivers.length!==c.tbdValues.length)throw new InvalidParametersException(ae,"tbdReceivers and tbdValues must be the same length");let be;try{be=await getProxyAddress(ae,de)}catch(we){throw new Error("Failed to get contract address: "+we.message)}let _e;try{_e=new Contract(be,paymentProxyABI,pe)}catch(we){throw new Error("Failed to create contract instance: "+we.message)}try{if(console.log(`
|