O.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(A,E,F,K){if(A=+A,E=E>>>0,F=F>>>0,!K){const Be=Math.pow(2,8*F)-1;m(this,A,E,F,Be,0)}let Q=1,ee=0;for(this[E]=A&255;++ee>>0,F=F>>>0,!K){const Be=Math.pow(2,8*F)-1;m(this,A,E,F,Be,0)}let Q=F-1,ee=1;for(this[E+Q]=A&255;--Q>=0&&(ee*=256);)this[E+Q]=A/ee&255;return E+F},a.prototype.writeUint8=a.prototype.writeUInt8=function(A,E,F){return A=+A,E=E>>>0,F||m(this,A,E,1,255,0),this[E]=A&255,E+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(A,E,F){return A=+A,E=E>>>0,F||m(this,A,E,2,65535,0),this[E]=A&255,this[E+1]=A>>>8,E+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(A,E,F){return A=+A,E=E>>>0,F||m(this,A,E,2,65535,0),this[E]=A>>>8,this[E+1]=A&255,E+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(A,E,F){return A=+A,E=E>>>0,F||m(this,A,E,4,4294967295,0),this[E+3]=A>>>24,this[E+2]=A>>>16,this[E+1]=A>>>8,this[E]=A&255,E+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(A,E,F){return A=+A,E=E>>>0,F||m(this,A,E,4,4294967295,0),this[E]=A>>>24,this[E+1]=A>>>16,this[E+2]=A>>>8,this[E+3]=A&255,E+4};function R(O,A,E,F,K){pe(A,F,K,O,E,7);let Q=Number(A&BigInt(4294967295));O[E++]=Q,Q=Q>>8,O[E++]=Q,Q=Q>>8,O[E++]=Q,Q=Q>>8,O[E++]=Q;let ee=Number(A>>BigInt(32)&BigInt(4294967295));return O[E++]=ee,ee=ee>>8,O[E++]=ee,ee=ee>>8,O[E++]=ee,ee=ee>>8,O[E++]=ee,E}function W(O,A,E,F,K){pe(A,F,K,O,E,7);let Q=Number(A&BigInt(4294967295));O[E+7]=Q,Q=Q>>8,O[E+6]=Q,Q=Q>>8,O[E+5]=Q,Q=Q>>8,O[E+4]=Q;let ee=Number(A>>BigInt(32)&BigInt(4294967295));return O[E+3]=ee,ee=ee>>8,O[E+2]=ee,ee=ee>>8,O[E+1]=ee,ee=ee>>8,O[E]=ee,E+8}a.prototype.writeBigUInt64LE=Bt(function(A,E=0){return R(this,A,E,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Bt(function(A,E=0){return W(this,A,E,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(A,E,F,K){if(A=+A,E=E>>>0,!K){const Te=Math.pow(2,8*F-1);m(this,A,E,F,Te-1,-Te)}let Q=0,ee=1,Be=0;for(this[E]=A&255;++Q >0)-Be&255;return E+F},a.prototype.writeIntBE=function(A,E,F,K){if(A=+A,E=E>>>0,!K){const Te=Math.pow(2,8*F-1);m(this,A,E,F,Te-1,-Te)}let Q=F-1,ee=1,Be=0;for(this[E+Q]=A&255;--Q>=0&&(ee*=256);)A<0&&Be===0&&this[E+Q+1]!==0&&(Be=1),this[E+Q]=(A/ee>>0)-Be&255;return E+F},a.prototype.writeInt8=function(A,E,F){return A=+A,E=E>>>0,F||m(this,A,E,1,127,-128),A<0&&(A=255+A+1),this[E]=A&255,E+1},a.prototype.writeInt16LE=function(A,E,F){return A=+A,E=E>>>0,F||m(this,A,E,2,32767,-32768),this[E]=A&255,this[E+1]=A>>>8,E+2},a.prototype.writeInt16BE=function(A,E,F){return A=+A,E=E>>>0,F||m(this,A,E,2,32767,-32768),this[E]=A>>>8,this[E+1]=A&255,E+2},a.prototype.writeInt32LE=function(A,E,F){return A=+A,E=E>>>0,F||m(this,A,E,4,2147483647,-2147483648),this[E]=A&255,this[E+1]=A>>>8,this[E+2]=A>>>16,this[E+3]=A>>>24,E+4},a.prototype.writeInt32BE=function(A,E,F){return A=+A,E=E>>>0,F||m(this,A,E,4,2147483647,-2147483648),A<0&&(A=4294967295+A+1),this[E]=A>>>24,this[E+1]=A>>>16,this[E+2]=A>>>8,this[E+3]=A&255,E+4},a.prototype.writeBigInt64LE=Bt(function(A,E=0){return R(this,A,E,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Bt(function(A,E=0){return W(this,A,E,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function C(O,A,E,F,K,Q){if(E+F>O.length)throw new RangeError("Index out of range");if(E<0)throw new RangeError("Index out of range")}function H(O,A,E,F,K){return A=+A,E=E>>>0,K||C(O,A,E,4),r.write(O,A,E,F,23,4),E+4}a.prototype.writeFloatLE=function(A,E,F){return H(this,A,E,!0,F)},a.prototype.writeFloatBE=function(A,E,F){return H(this,A,E,!1,F)};function X(O,A,E,F,K){return A=+A,E=E>>>0,K||C(O,A,E,8),r.write(O,A,E,F,52,8),E+8}a.prototype.writeDoubleLE=function(A,E,F){return X(this,A,E,!0,F)},a.prototype.writeDoubleBE=function(A,E,F){return X(this,A,E,!1,F)},a.prototype.copy=function(A,E,F,K){if(!a.isBuffer(A))throw new TypeError("argument should be a Buffer");if(F||(F=0),!K&&K!==0&&(K=this.length),E>=A.length&&(E=A.length),E||(E=0),K>0&&K =this.length)throw new RangeError("Index out of range");if(K<0)throw new RangeError("sourceEnd out of bounds");K>this.length&&(K=this.length),A.length-E >>0,F=F===void 0?this.length:F>>>0,A||(A=0);let Q;if(typeof A=="number")for(Q=E;Q 2**32?K=ge(String(E)):typeof E=="bigint"&&(K=String(E),(E>BigInt(2)**BigInt(32)||E<-(BigInt(2)**BigInt(32)))&&(K=ge(K)),K+="n"),F+=` It must be ${A}. Received ${K}`,F},RangeError);function ge(O){let A="",E=O.length;const F=O[0]==="-"?1:0;for(;E>=F+4;E-=3)A=`_${O.slice(E-3,E)}${A}`;return`${O.slice(0,E)}${A}`}function he(O,A,E){Qe(A,"offset"),(O[A]===void 0||O[A+E]===void 0)&&ve(A,O.length-(E+1))}function pe(O,A,E,F,K,Q){if(O>E||O3?A===0||A===BigInt(0)?Be=`>= 0${ee} and < 2${ee} ** ${(Q+1)*8}${ee}`:Be=`>= -(2${ee} ** ${(Q+1)*8-1}${ee}) and < 2 ** ${(Q+1)*8-1}${ee}`:Be=`>= ${A}${ee} and <= ${E}${ee}`,new Y.ERR_OUT_OF_RANGE("value",Be,O)}he(F,K,Q)}function Qe(O,A){if(typeof O!="number")throw new Y.ERR_INVALID_ARG_TYPE(A,"number",O)}function ve(O,A,E){throw Math.floor(O)!==O?(Qe(O,E),new Y.ERR_OUT_OF_RANGE(E||"offset","an integer",O)):A<0?new Y.ERR_BUFFER_OUT_OF_BOUNDS:new Y.ERR_OUT_OF_RANGE(E||"offset",`>= ${E?1:0} and <= ${A}`,O)}const Ie=/[^+/0-9A-Za-z-_]/g;function V(O){if(O=O.split("=")[0],O=O.trim().replace(Ie,""),O.length<2)return"";for(;O.length%4!==0;)O=O+"=";return O}function J(O,A){A=A||1/0;let E;const F=O.length;let K=null;const Q=[];for(let ee=0;ee 55295&&E<57344){if(!K){if(E>56319){(A-=3)>-1&&Q.push(239,191,189);continue}else if(ee+1===F){(A-=3)>-1&&Q.push(239,191,189);continue}K=E;continue}if(E<56320){(A-=3)>-1&&Q.push(239,191,189),K=E;continue}E=(K-55296<<10|E-56320)+65536}else K&&(A-=3)>-1&&Q.push(239,191,189);if(K=null,E<128){if((A-=1)<0)break;Q.push(E)}else if(E<2048){if((A-=2)<0)break;Q.push(E>>6|192,E&63|128)}else if(E<65536){if((A-=3)<0)break;Q.push(E>>12|224,E>>6&63|128,E&63|128)}else if(E<1114112){if((A-=4)<0)break;Q.push(E>>18|240,E>>12&63|128,E>>6&63|128,E&63|128)}else throw new Error("Invalid code point")}return Q}function re(O){const A=[];for(let E=0;E >8,K=E%256,Q.push(K),Q.push(F);return Q}function le(O){return e.toByteArray(V(O))}function se(O,A,E,F){let K;for(K=0;K =A.length||K>=O.length);++K)A[K+E]=O[K];return K}function ye(O,A){return O instanceof A||O!=null&&O.constructor!=null&&O.constructor.name!=null&&O.constructor.name===A.name}function Se(O){return O!==O}const Pe=function(){const O="0123456789abcdef",A=new Array(256);for(let E=0;E<16;++E){const F=E*16;for(let K=0;K<16;++K)A[F+K]=O[E]+O[K]}return A}();function Bt(O){return typeof BigInt>"u"?Ze:O}function Ze(){throw new Error("BigInt not supported")}})(K3);window.global=window.global??window;window.Buffer=window.Buffer??K3.Buffer;window.process=window.process??{env:{}};const D9="modulepreload",Bx={},L9="/",Le=function(e,r){return!r||r.length===0?e():Promise.all(r.map(n=>{if(n=`${L9}${n}`,n in Bx)return;Bx[n]=!0;const i=n.endsWith(".css"),o=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${n}"]${o}`))return;const s=document.createElement("link");if(s.rel=i?"stylesheet":D9,i||(s.as="script",s.crossOrigin=""),s.href=n,document.head.appendChild(s),i)return new Promise((a,l)=>{s.addEventListener("load",a),s.addEventListener("error",()=>l(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>e())};var Ox='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',U9={rounded:`SFRounded, ui-rounded, "SF Pro Rounded", ${Ox}`,system:Ox},Ql={large:{actionButton:"9999px",connectButton:"12px",modal:"24px",modalMobile:"28px"},medium:{actionButton:"10px",connectButton:"8px",modal:"16px",modalMobile:"18px"},none:{actionButton:"0px",connectButton:"0px",modal:"0px",modalMobile:"0px"},small:{actionButton:"4px",connectButton:"4px",modal:"8px",modalMobile:"8px"}},z9={large:{modalOverlay:"blur(20px)"},none:{modalOverlay:"blur(0px)"},small:{modalOverlay:"blur(4px)"}},q9=({borderRadius:t="large",fontStack:e="rounded",overlayBlur:r="none"})=>({blurs:{modalOverlay:z9[r].modalOverlay},fonts:{body:U9[e]},radii:{actionButton:Ql[t].actionButton,connectButton:Ql[t].connectButton,menuButton:Ql[t].connectButton,modal:Ql[t].modal,modalMobile:Ql[t].modalMobile}}),J3={blue:{accentColor:"#0E76FD",accentColorForeground:"#FFF"},green:{accentColor:"#1DB847",accentColorForeground:"#FFF"},orange:{accentColor:"#FF801F",accentColorForeground:"#FFF"},pink:{accentColor:"#FF5CA0",accentColorForeground:"#FFF"},purple:{accentColor:"#5F5AFA",accentColorForeground:"#FFF"},red:{accentColor:"#FA423C",accentColorForeground:"#FFF"}},Mx=J3.blue,Y3=({accentColor:t=Mx.accentColor,accentColorForeground:e=Mx.accentColorForeground,...r}={})=>({...q9(r),colors:{accentColor:t,accentColorForeground:e,actionButtonBorder:"rgba(0, 0, 0, 0.04)",actionButtonBorderMobile:"rgba(0, 0, 0, 0.06)",actionButtonSecondaryBackground:"rgba(0, 0, 0, 0.06)",closeButton:"rgba(60, 66, 66, 0.8)",closeButtonBackground:"rgba(0, 0, 0, 0.06)",connectButtonBackground:"#FFF",connectButtonBackgroundError:"#FF494A",connectButtonInnerBackground:"linear-gradient(0deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.06))",connectButtonText:"#25292E",connectButtonTextError:"#FFF",connectionIndicator:"#30E000",downloadBottomCardBackground:"linear-gradient(126deg, rgba(255, 255, 255, 0) 9.49%, rgba(171, 171, 171, 0.04) 71.04%), #FFFFFF",downloadTopCardBackground:"linear-gradient(126deg, rgba(171, 171, 171, 0.2) 9.49%, rgba(255, 255, 255, 0) 71.04%), #FFFFFF",error:"#FF494A",generalBorder:"rgba(0, 0, 0, 0.06)",generalBorderDim:"rgba(0, 0, 0, 0.03)",menuItemBackground:"rgba(60, 66, 66, 0.1)",modalBackdrop:"rgba(0, 0, 0, 0.3)",modalBackground:"#FFF",modalBorder:"transparent",modalText:"#25292E",modalTextDim:"rgba(60, 66, 66, 0.3)",modalTextSecondary:"rgba(60, 66, 66, 0.6)",profileAction:"#FFF",profileActionHover:"rgba(255, 255, 255, 0.5)",profileForeground:"rgba(60, 66, 66, 0.06)",selectedOptionBorder:"rgba(60, 66, 66, 0.1)",standby:"#FFD641"},shadows:{connectButton:"0px 4px 12px rgba(0, 0, 0, 0.1)",dialog:"0px 8px 32px rgba(0, 0, 0, 0.32)",profileDetailsAction:"0px 2px 6px rgba(37, 41, 46, 0.04)",selectedOption:"0px 2px 6px rgba(0, 0, 0, 0.24)",selectedWallet:"0px 2px 6px rgba(0, 0, 0, 0.12)",walletLogo:"0px 2px 16px rgba(0, 0, 0, 0.16)"}});Y3.accentColors=J3;var G={exports:{}},ze={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Hu=Symbol.for("react.element"),$9=Symbol.for("react.portal"),H9=Symbol.for("react.fragment"),W9=Symbol.for("react.strict_mode"),G9=Symbol.for("react.profiler"),V9=Symbol.for("react.provider"),K9=Symbol.for("react.context"),Q9=Symbol.for("react.forward_ref"),J9=Symbol.for("react.suspense"),Y9=Symbol.for("react.memo"),X9=Symbol.for("react.lazy"),Rx=Symbol.iterator;function Z9(t){return t===null||typeof t!="object"?null:(t=Rx&&t[Rx]||t["@@iterator"],typeof t=="function"?t:null)}var X3={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Z3=Object.assign,eA={};function Pl(t,e,r){this.props=t,this.context=e,this.refs=eA,this.updater=r||X3}Pl.prototype.isReactComponent={};Pl.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};Pl.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function tA(){}tA.prototype=Pl.prototype;function qv(t,e,r){this.props=t,this.context=e,this.refs=eA,this.updater=r||X3}var $v=qv.prototype=new tA;$v.constructor=qv;Z3($v,Pl.prototype);$v.isPureReactComponent=!0;var Nx=Array.isArray,rA=Object.prototype.hasOwnProperty,Hv={current:null},nA={key:!0,ref:!0,__self:!0,__source:!0};function iA(t,e,r){var n,i={},o=null,s=null;if(e!=null)for(n in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(o=""+e.key),e)rA.call(e,n)&&!nA.hasOwnProperty(n)&&(i[n]=e[n]);var a=arguments.length-2;if(a===1)i.children=r;else if(1function(){for(var e=arguments.length,r=new Array(e),n=0;n l.styles)),o=Object.keys(i),s=o.filter(l=>"mappings"in i[l]),a=l=>{var c=[],u={},f=sm({},l),h=!1;for(var p of s){var g=l[p];if(g!=null){var v=i[p];h=!0;for(var x of v.mappings)u[x]=g,f[x]==null&&delete f[x]}}var y=h?sm(sm({},u),f):l;for(var w in y){var _=y[w],I=i[w];try{if(I.mappings)continue;if(typeof _=="string"||typeof _=="number")c.push(I.values[_].defaultClass);else if(Array.isArray(_))for(var M=0;M<_.length;M++){var D=_[M];if(D!=null){var U=I.responsiveArray[M];c.push(I.values[D].conditions[U])}}else for(var z in _){var Z=_[z];Z!=null&&c.push(I.values[Z].conditions[z])}}catch(ne){throw ne}}return t(c.join(" "))};return Object.assign(a,{properties:new Set(o)})},lS=t=>t,cS=function(){return aS(lS)(...arguments)};function uS({storage:t,key:e="REACT_QUERY_OFFLINE_CACHE",throttleTime:r=1e3,serialize:n=JSON.stringify,deserialize:i=JSON.parse,retry:o}){if(t){const s=a=>{try{t.setItem(e,n(a));return}catch(l){return l}};return{persistClient:fS(a=>{let l=a,c=s(l),u=0;for(;c&&l;)u++,l=o?.({persistedClient:l,error:c,errorCount:u}),l&&(c=s(l))},r),restoreClient:()=>{const a=t.getItem(e);if(!!a)return i(a)},removeClient:()=>{t.removeItem(e)}}}return{persistClient:Dx,restoreClient:()=>{},removeClient:Dx}}function fS(t,e=100){let r=null,n;return function(...i){n=i,r===null&&(r=setTimeout(()=>{t(...n),r=null},e))}}function Dx(){}class Tl{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){const r={listener:e};return this.listeners.add(r),this.onSubscribe(),()=>{this.listeners.delete(r),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const Yc=typeof window>"u"||"Deno"in window;function bn(){}function dS(t,e){return typeof t=="function"?t(e):t}function Fg(t){return typeof t=="number"&&t>=0&&t!==1/0}function aA(t,e){return Math.max(t+(e||0)-Date.now(),0)}function kf(t,e,r){return Wu(t)?typeof e=="function"?{...r,queryKey:t,queryFn:e}:{...e,queryKey:t}:t}function lA(t,e,r){return Wu(t)?typeof e=="function"?{...r,mutationKey:t,mutationFn:e}:{...e,mutationKey:t}:typeof t=="function"?{...e,mutationFn:t}:{...t}}function ho(t,e,r){return Wu(t)?[{...e,queryKey:t},r]:[t||{},e]}function Lx(t,e){const{type:r="all",exact:n,fetchStatus:i,predicate:o,queryKey:s,stale:a}=t;if(Wu(s)){if(n){if(e.queryHash!==Gv(s,e.options))return!1}else if(!Yd(e.queryKey,s))return!1}if(r!=="all"){const l=e.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||typeof i<"u"&&i!==e.state.fetchStatus||o&&!o(e))}function Ux(t,e){const{exact:r,fetching:n,predicate:i,mutationKey:o}=t;if(Wu(o)){if(!e.options.mutationKey)return!1;if(r){if(As(e.options.mutationKey)!==As(o))return!1}else if(!Yd(e.options.mutationKey,o))return!1}return!(typeof n=="boolean"&&e.state.status==="loading"!==n||i&&!i(e))}function Gv(t,e){return(e?.queryKeyHashFn||As)(t)}function As(t){return JSON.stringify(t,(e,r)=>Lg(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Yd(t,e){return cA(t,e)}function cA(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(r=>!cA(t[r],e[r])):!1}function Vv(t,e){if(t===e)return t;const r=zx(t)&&zx(e);if(r||Lg(t)&&Lg(e)){const n=r?t.length:Object.keys(t).length,i=r?e:Object.keys(e),o=i.length,s=r?[]:{};let a=0;for(let l=0;l "u")return!0;const r=e.prototype;return!(!qx(r)||!r.hasOwnProperty("isPrototypeOf"))}function qx(t){return Object.prototype.toString.call(t)==="[object Object]"}function Wu(t){return Array.isArray(t)}function uA(t){return new Promise(e=>{setTimeout(e,t)})}function $x(t){uA(0).then(t)}function hS(){if(typeof AbortController=="function")return new AbortController}function Ug(t,e,r){return r.isDataEqual!=null&&r.isDataEqual(t,e)?t:typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?Vv(t,e):e}class pS extends Tl{constructor(){super(),this.setup=e=>{if(!Yc&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),window.addEventListener("focus",r,!1),()=>{window.removeEventListener("visibilitychange",r),window.removeEventListener("focus",r)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.cleanup)==null||e.call(this),this.cleanup=void 0}}setEventListener(e){var r;this.setup=e,(r=this.cleanup)==null||r.call(this),this.cleanup=e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(e){this.focused=e,e&&this.onFocus()}onFocus(){this.listeners.forEach(({listener:e})=>{e()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const Xd=new pS,Hx=["online","offline"];class mS extends Tl{constructor(){super(),this.setup=e=>{if(!Yc&&window.addEventListener){const r=()=>e();return Hx.forEach(n=>{window.addEventListener(n,r,!1)}),()=>{Hx.forEach(n=>{window.removeEventListener(n,r)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.cleanup)==null||e.call(this),this.cleanup=void 0}}setEventListener(e){var r;this.setup=e,(r=this.cleanup)==null||r.call(this),this.cleanup=e(n=>{typeof n=="boolean"?this.setOnline(n):this.onOnline()})}setOnline(e){this.online=e,e&&this.onOnline()}onOnline(){this.listeners.forEach(({listener:e})=>{e()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const Zd=new mS;function gS(t){return Math.min(1e3*2**t,3e4)}function p0(t){return(t??"online")==="online"?Zd.isOnline():!0}class fA{constructor(e){this.revert=e?.revert,this.silent=e?.silent}}function Cd(t){return t instanceof fA}function dA(t){let e=!1,r=0,n=!1,i,o,s;const a=new Promise((x,y)=>{o=x,s=y}),l=x=>{n||(p(new fA(x)),t.abort==null||t.abort())},c=()=>{e=!0},u=()=>{e=!1},f=()=>!Xd.isFocused()||t.networkMode!=="always"&&!Zd.isOnline(),h=x=>{n||(n=!0,t.onSuccess==null||t.onSuccess(x),i?.(),o(x))},p=x=>{n||(n=!0,t.onError==null||t.onError(x),i?.(),s(x))},g=()=>new Promise(x=>{i=y=>{const w=n||!f();return w&&x(y),w},t.onPause==null||t.onPause()}).then(()=>{i=void 0,n||t.onContinue==null||t.onContinue()}),v=()=>{if(n)return;let x;try{x=t.fn()}catch(y){x=Promise.reject(y)}Promise.resolve(x).then(h).catch(y=>{var w,_;if(n)return;const I=(w=t.retry)!=null?w:3,M=(_=t.retryDelay)!=null?_:gS,D=typeof M=="function"?M(r,y):M,U=I===!0||typeof I=="number"&&r{if(f())return g()}).then(()=>{e?p(y):v()})})};return p0(t.networkMode)?v():g().then(v),{promise:a,cancel:l,continue:()=>i?.()?a:Promise.resolve(),cancelRetry:c,continueRetry:u}}const Kv=console;function vS(){let t=[],e=0,r=u=>{u()},n=u=>{u()};const i=u=>{let f;e++;try{f=u()}finally{e--,e||a()}return f},o=u=>{e?t.push(u):$x(()=>{r(u)})},s=u=>(...f)=>{o(()=>{u(...f)})},a=()=>{const u=t;t=[],u.length&&$x(()=>{n(()=>{u.forEach(f=>{r(f)})})})};return{batch:i,batchCalls:s,schedule:o,setNotifyFunction:u=>{r=u},setBatchNotifyFunction:u=>{n=u}}}const zt=vS();class hA{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Fg(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(e){this.cacheTime=Math.max(this.cacheTime||0,e??(Yc?1/0:5*60*1e3))}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class yS extends hA{constructor(e){super(),this.abortSignalConsumed=!1,this.defaultOptions=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.cache=e.cache,this.logger=e.logger||Kv,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.initialState=e.state||bS(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(e,r){const n=Ug(this.state.data,e,this.options);return this.dispatch({data:n,type:"success",dataUpdatedAt:r?.updatedAt,manual:r?.manual}),n}setState(e,r){this.dispatch({type:"setState",state:e,setStateOptions:r})}cancel(e){var r;const n=this.promise;return(r=this.retryer)==null||r.cancel(e),n?n.then(bn).catch(bn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(e=>e.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(e=>e.getCurrentResult().isStale)}isStaleByTime(e=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!aA(this.state.dataUpdatedAt,e)}onFocus(){var e;const r=this.observers.find(n=>n.shouldFetchOnWindowFocus());r&&r.refetch({cancelRefetch:!1}),(e=this.retryer)==null||e.continue()}onOnline(){var e;const r=this.observers.find(n=>n.shouldFetchOnReconnect());r&&r.refetch({cancelRefetch:!1}),(e=this.retryer)==null||e.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(r=>r!==e),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(e,r){var n,i;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&r!=null&&r.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var o;return(o=this.retryer)==null||o.continueRetry(),this.promise}}if(e&&this.setOptions(e),!this.options.queryFn){const p=this.observers.find(g=>g.options.queryFn);p&&this.setOptions(p.options)}Array.isArray(this.options.queryKey);const s=hS(),a={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},l=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>{if(s)return this.abortSignalConsumed=!0,s.signal}})};l(a);const c=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(a)):Promise.reject("Missing queryFn"),u={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:c};if(l(u),(n=this.options.behavior)==null||n.onFetch(u),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=u.fetchOptions)==null?void 0:i.meta)){var f;this.dispatch({type:"fetch",meta:(f=u.fetchOptions)==null?void 0:f.meta})}const h=p=>{if(Cd(p)&&p.silent||this.dispatch({type:"error",error:p}),!Cd(p)){var g,v,x,y;(g=(v=this.cache.config).onError)==null||g.call(v,p,this),(x=(y=this.cache.config).onSettled)==null||x.call(y,this.state.data,p,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=dA({fn:u.fetchFn,abort:s?.abort.bind(s),onSuccess:p=>{var g,v,x,y;if(typeof p>"u"){h(new Error(this.queryHash+" data is undefined"));return}this.setData(p),(g=(v=this.cache.config).onSuccess)==null||g.call(v,p,this),(x=(y=this.cache.config).onSettled)==null||x.call(y,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:h,onFail:(p,g)=>{this.dispatch({type:"failed",failureCount:p,error:g})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(e){const r=n=>{var i,o;switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(i=e.meta)!=null?i:null,fetchStatus:p0(this.options.networkMode)?"fetching":"paused",...!n.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:(o=e.dataUpdatedAt)!=null?o:Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=e.error;return Cd(s)&&s.revert&&this.revertState?{...this.revertState}:{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=r(this.state),zt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate(e)}),this.cache.notify({query:this,type:"updated",action:e})})}}function bS(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=typeof e<"u",n=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"loading",fetchStatus:"idle"}}class xS extends Tl{constructor(e){super(),this.config=e||{},this.queries=[],this.queriesMap={}}build(e,r,n){var i;const o=r.queryKey,s=(i=r.queryHash)!=null?i:Gv(o,r);let a=this.get(s);return a||(a=new yS({cache:this,logger:e.getLogger(),queryKey:o,queryHash:s,options:e.defaultQueryOptions(r),state:n,defaultOptions:e.getQueryDefaults(o)}),this.add(a)),a}add(e){this.queriesMap[e.queryHash]||(this.queriesMap[e.queryHash]=e,this.queries.push(e),this.notify({type:"added",query:e}))}remove(e){const r=this.queriesMap[e.queryHash];r&&(e.destroy(),this.queries=this.queries.filter(n=>n!==e),r===e&&delete this.queriesMap[e.queryHash],this.notify({type:"removed",query:e}))}clear(){zt.batch(()=>{this.queries.forEach(e=>{this.remove(e)})})}get(e){return this.queriesMap[e]}getAll(){return this.queries}find(e,r){const[n]=ho(e,r);return typeof n.exact>"u"&&(n.exact=!0),this.queries.find(i=>Lx(n,i))}findAll(e,r){const[n]=ho(e,r);return Object.keys(n).length>0?this.queries.filter(i=>Lx(n,i)):this.queries}notify(e){zt.batch(()=>{this.listeners.forEach(({listener:r})=>{r(e)})})}onFocus(){zt.batch(()=>{this.queries.forEach(e=>{e.onFocus()})})}onOnline(){zt.batch(()=>{this.queries.forEach(e=>{e.onOnline()})})}}class wS extends hA{constructor(e){super(),this.defaultOptions=e.defaultOptions,this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.logger=e.logger||Kv,this.observers=[],this.state=e.state||pA(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(e){this.dispatch({type:"setState",state:e})}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.observers=this.observers.filter(r=>r!==e),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var e,r;return(e=(r=this.retryer)==null?void 0:r.continue())!=null?e:this.execute()}async execute(){const e=()=>{var U;return this.retryer=dA({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(z,Z)=>{this.dispatch({type:"failed",failureCount:z,error:Z})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(U=this.options.retry)!=null?U:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},r=this.state.status==="loading";try{var n,i,o,s,a,l,c,u;if(!r){var f,h,p,g;this.dispatch({type:"loading",variables:this.options.variables}),await((f=(h=this.mutationCache.config).onMutate)==null?void 0:f.call(h,this.state.variables,this));const z=await((p=(g=this.options).onMutate)==null?void 0:p.call(g,this.state.variables));z!==this.state.context&&this.dispatch({type:"loading",context:z,variables:this.state.variables})}const U=await e();return await((n=(i=this.mutationCache.config).onSuccess)==null?void 0:n.call(i,U,this.state.variables,this.state.context,this)),await((o=(s=this.options).onSuccess)==null?void 0:o.call(s,U,this.state.variables,this.state.context)),await((a=(l=this.mutationCache.config).onSettled)==null?void 0:a.call(l,U,null,this.state.variables,this.state.context,this)),await((c=(u=this.options).onSettled)==null?void 0:c.call(u,U,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:U}),U}catch(U){try{var v,x,y,w,_,I,M,D;throw await((v=(x=this.mutationCache.config).onError)==null?void 0:v.call(x,U,this.state.variables,this.state.context,this)),await((y=(w=this.options).onError)==null?void 0:y.call(w,U,this.state.variables,this.state.context)),await((_=(I=this.mutationCache.config).onSettled)==null?void 0:_.call(I,void 0,U,this.state.variables,this.state.context,this)),await((M=(D=this.options).onSettled)==null?void 0:M.call(D,void 0,U,this.state.variables,this.state.context)),U}finally{this.dispatch({type:"error",error:U})}}}dispatch(e){const r=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"loading":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!p0(this.options.networkMode),status:"loading",variables:e.variables};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"};case"setState":return{...n,...e.state}}};this.state=r(this.state),zt.batch(()=>{this.observers.forEach(n=>{n.onMutationUpdate(e)}),this.mutationCache.notify({mutation:this,type:"updated",action:e})})}}function pA(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class AS extends Tl{constructor(e){super(),this.config=e||{},this.mutations=[],this.mutationId=0}build(e,r,n){const i=new wS({mutationCache:this,logger:e.getLogger(),mutationId:++this.mutationId,options:e.defaultMutationOptions(r),state:n,defaultOptions:r.mutationKey?e.getMutationDefaults(r.mutationKey):void 0});return this.add(i),i}add(e){this.mutations.push(e),this.notify({type:"added",mutation:e})}remove(e){this.mutations=this.mutations.filter(r=>r!==e),this.notify({type:"removed",mutation:e})}clear(){zt.batch(()=>{this.mutations.forEach(e=>{this.remove(e)})})}getAll(){return this.mutations}find(e){return typeof e.exact>"u"&&(e.exact=!0),this.mutations.find(r=>Ux(e,r))}findAll(e){return this.mutations.filter(r=>Ux(e,r))}notify(e){zt.batch(()=>{this.listeners.forEach(({listener:r})=>{r(e)})})}resumePausedMutations(){var e;return this.resuming=((e=this.resuming)!=null?e:Promise.resolve()).then(()=>{const r=this.mutations.filter(n=>n.state.isPaused);return zt.batch(()=>r.reduce((n,i)=>n.then(()=>i.continue().catch(bn)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function ES(){return{onFetch:t=>{t.fetchFn=()=>{var e,r,n,i,o,s;const a=(e=t.fetchOptions)==null||(r=e.meta)==null?void 0:r.refetchPage,l=(n=t.fetchOptions)==null||(i=n.meta)==null?void 0:i.fetchMore,c=l?.pageParam,u=l?.direction==="forward",f=l?.direction==="backward",h=((o=t.state.data)==null?void 0:o.pages)||[],p=((s=t.state.data)==null?void 0:s.pageParams)||[];let g=p,v=!1;const x=D=>{Object.defineProperty(D,"signal",{enumerable:!0,get:()=>{var U;if((U=t.signal)!=null&&U.aborted)v=!0;else{var z;(z=t.signal)==null||z.addEventListener("abort",()=>{v=!0})}return t.signal}})},y=t.options.queryFn||(()=>Promise.reject("Missing queryFn")),w=(D,U,z,Z)=>(g=Z?[U,...g]:[...g,U],Z?[z,...D]:[...D,z]),_=(D,U,z,Z)=>{if(v)return Promise.reject("Cancelled");if(typeof z>"u"&&!U&&D.length)return Promise.resolve(D);const ne={queryKey:t.queryKey,pageParam:z,meta:t.options.meta};x(ne);const oe=y(ne);return Promise.resolve(oe).then(N=>w(D,z,N,Z))};let I;if(!h.length)I=_([]);else if(u){const D=typeof c<"u",U=D?c:Wx(t.options,h);I=_(h,D,U)}else if(f){const D=typeof c<"u",U=D?c:CS(t.options,h);I=_(h,D,U,!0)}else{g=[];const D=typeof t.options.getNextPageParam>"u";I=(a&&h[0]?a(h[0],0,h):!0)?_([],D,p[0]):Promise.resolve(w([],p[0],h[0]));for(let z=1;z {if(a&&h[z]?a(h[z],z,h):!0){const oe=D?p[z]:Wx(t.options,Z);return _(Z,D,oe)}return Promise.resolve(w(Z,p[z],h[z]))})}return I.then(D=>({pages:D,pageParams:g}))}}}}function Wx(t,e){return t.getNextPageParam==null?void 0:t.getNextPageParam(e[e.length-1],e)}function CS(t,e){return t.getPreviousPageParam==null?void 0:t.getPreviousPageParam(e[0],e)}class _S{constructor(e={}){this.queryCache=e.queryCache||new xS,this.mutationCache=e.mutationCache||new AS,this.logger=e.logger||Kv,this.defaultOptions=e.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=Xd.subscribe(()=>{Xd.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=Zd.subscribe(()=>{Zd.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var e,r;this.mountCount--,this.mountCount===0&&((e=this.unsubscribeFocus)==null||e.call(this),this.unsubscribeFocus=void 0,(r=this.unsubscribeOnline)==null||r.call(this),this.unsubscribeOnline=void 0)}isFetching(e,r){const[n]=ho(e,r);return n.fetchStatus="fetching",this.queryCache.findAll(n).length}isMutating(e){return this.mutationCache.findAll({...e,fetching:!0}).length}getQueryData(e,r){var n;return(n=this.queryCache.find(e,r))==null?void 0:n.state.data}ensureQueryData(e,r,n){const i=kf(e,r,n),o=this.getQueryData(i.queryKey);return o?Promise.resolve(o):this.fetchQuery(i)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:r,state:n})=>{const i=n.data;return[r,i]})}setQueryData(e,r,n){const i=this.queryCache.find(e),o=i?.state.data,s=dS(r,o);if(typeof s>"u")return;const a=kf(e),l=this.defaultQueryOptions(a);return this.queryCache.build(this,l).setData(s,{...n,manual:!0})}setQueriesData(e,r,n){return zt.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,r,n)]))}getQueryState(e,r){var n;return(n=this.queryCache.find(e,r))==null?void 0:n.state}removeQueries(e,r){const[n]=ho(e,r),i=this.queryCache;zt.batch(()=>{i.findAll(n).forEach(o=>{i.remove(o)})})}resetQueries(e,r,n){const[i,o]=ho(e,r,n),s=this.queryCache,a={type:"active",...i};return zt.batch(()=>(s.findAll(i).forEach(l=>{l.reset()}),this.refetchQueries(a,o)))}cancelQueries(e,r,n){const[i,o={}]=ho(e,r,n);typeof o.revert>"u"&&(o.revert=!0);const s=zt.batch(()=>this.queryCache.findAll(i).map(a=>a.cancel(o)));return Promise.all(s).then(bn).catch(bn)}invalidateQueries(e,r,n){const[i,o]=ho(e,r,n);return zt.batch(()=>{var s,a;if(this.queryCache.findAll(i).forEach(c=>{c.invalidate()}),i.refetchType==="none")return Promise.resolve();const l={...i,type:(s=(a=i.refetchType)!=null?a:i.type)!=null?s:"active"};return this.refetchQueries(l,o)})}refetchQueries(e,r,n){const[i,o]=ho(e,r,n),s=zt.batch(()=>this.queryCache.findAll(i).filter(l=>!l.isDisabled()).map(l=>{var c;return l.fetch(void 0,{...o,cancelRefetch:(c=o?.cancelRefetch)!=null?c:!0,meta:{refetchPage:i.refetchPage}})}));let a=Promise.all(s).then(bn);return o!=null&&o.throwOnError||(a=a.catch(bn)),a}fetchQuery(e,r,n){const i=kf(e,r,n),o=this.defaultQueryOptions(i);typeof o.retry>"u"&&(o.retry=!1);const s=this.queryCache.build(this,o);return s.isStaleByTime(o.staleTime)?s.fetch(o):Promise.resolve(s.state.data)}prefetchQuery(e,r,n){return this.fetchQuery(e,r,n).then(bn).catch(bn)}fetchInfiniteQuery(e,r,n){const i=kf(e,r,n);return i.behavior=ES(),this.fetchQuery(i)}prefetchInfiniteQuery(e,r,n){return this.fetchInfiniteQuery(e,r,n).then(bn).catch(bn)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(e){this.defaultOptions=e}setQueryDefaults(e,r){const n=this.queryDefaults.find(i=>As(e)===As(i.queryKey));n?n.defaultOptions=r:this.queryDefaults.push({queryKey:e,defaultOptions:r})}getQueryDefaults(e){if(!e)return;const r=this.queryDefaults.find(n=>Yd(e,n.queryKey));return r?.defaultOptions}setMutationDefaults(e,r){const n=this.mutationDefaults.find(i=>As(e)===As(i.mutationKey));n?n.defaultOptions=r:this.mutationDefaults.push({mutationKey:e,defaultOptions:r})}getMutationDefaults(e){if(!e)return;const r=this.mutationDefaults.find(n=>Yd(e,n.mutationKey));return r?.defaultOptions}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const r={...this.defaultOptions.queries,...this.getQueryDefaults(e?.queryKey),...e,_defaulted:!0};return!r.queryHash&&r.queryKey&&(r.queryHash=Gv(r.queryKey,r)),typeof r.refetchOnReconnect>"u"&&(r.refetchOnReconnect=r.networkMode!=="always"),typeof r.useErrorBoundary>"u"&&(r.useErrorBoundary=!!r.suspense),r}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...this.defaultOptions.mutations,...this.getMutationDefaults(e?.mutationKey),...e,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class SS extends Tl{constructor(e,r){super(),this.client=e,this.options=r,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(r)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),Gx(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return zg(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return zg(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(e,r){const n=this.options,i=this.currentQuery;if(this.options=this.client.defaultQueryOptions(e),Dg(n,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=n.queryKey),this.updateQuery();const o=this.hasListeners();o&&Vx(this.currentQuery,i,this.options,n)&&this.executeFetch(),this.updateResult(r),o&&(this.currentQuery!==i||this.options.enabled!==n.enabled||this.options.staleTime!==n.staleTime)&&this.updateStaleTimeout();const s=this.computeRefetchInterval();o&&(this.currentQuery!==i||this.options.enabled!==n.enabled||s!==this.currentRefetchInterval)&&this.updateRefetchInterval(s)}getOptimisticResult(e){const r=this.client.getQueryCache().build(this.client,e);return this.createResult(r,e)}getCurrentResult(){return this.currentResult}trackResult(e){const r={};return Object.keys(e).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(n),e[n])})}),r}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:e,...r}={}){return this.fetch({...r,meta:{refetchPage:e}})}fetchOptimistic(e){const r=this.client.defaultQueryOptions(e),n=this.client.getQueryCache().build(this.client,r);return n.isFetchingOptimistic=!0,n.fetch().then(()=>this.createResult(n,r))}fetch(e){var r;return this.executeFetch({...e,cancelRefetch:(r=e.cancelRefetch)!=null?r:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(e){this.updateQuery();let r=this.currentQuery.fetch(this.options,e);return e!=null&&e.throwOnError||(r=r.catch(bn)),r}updateStaleTimeout(){if(this.clearStaleTimeout(),Yc||this.currentResult.isStale||!Fg(this.options.staleTime))return;const r=aA(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},r)}computeRefetchInterval(){var e;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(e=this.options.refetchInterval)!=null?e:!1}updateRefetchInterval(e){this.clearRefetchInterval(),this.currentRefetchInterval=e,!(Yc||this.options.enabled===!1||!Fg(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||Xd.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(e,r){const n=this.currentQuery,i=this.options,o=this.currentResult,s=this.currentResultState,a=this.currentResultOptions,l=e!==n,c=l?e.state:this.currentQueryInitialState,u=l?this.currentResult:this.previousQueryResult,{state:f}=e;let{dataUpdatedAt:h,error:p,errorUpdatedAt:g,fetchStatus:v,status:x}=f,y=!1,w=!1,_;if(r._optimisticResults){const z=this.hasListeners(),Z=!z&&Gx(e,r),ne=z&&Vx(e,n,r,i);(Z||ne)&&(v=p0(e.options.networkMode)?"fetching":"paused",h||(x="loading")),r._optimisticResults==="isRestoring"&&(v="idle")}if(r.keepPreviousData&&!f.dataUpdatedAt&&u!=null&&u.isSuccess&&x!=="error")_=u.data,h=u.dataUpdatedAt,x=u.status,y=!0;else if(r.select&&typeof f.data<"u")if(o&&f.data===s?.data&&r.select===this.selectFn)_=this.selectResult;else try{this.selectFn=r.select,_=r.select(f.data),_=Ug(o?.data,_,r),this.selectResult=_,this.selectError=null}catch(z){this.selectError=z}else _=f.data;if(typeof r.placeholderData<"u"&&typeof _>"u"&&x==="loading"){let z;if(o!=null&&o.isPlaceholderData&&r.placeholderData===a?.placeholderData)z=o.data;else if(z=typeof r.placeholderData=="function"?r.placeholderData():r.placeholderData,r.select&&typeof z<"u")try{z=r.select(z),this.selectError=null}catch(Z){this.selectError=Z}typeof z<"u"&&(x="success",_=Ug(o?.data,z,r),w=!0)}this.selectError&&(p=this.selectError,_=this.selectResult,g=Date.now(),x="error");const I=v==="fetching",M=x==="loading",D=x==="error";return{status:x,fetchStatus:v,isLoading:M,isSuccess:x==="success",isError:D,isInitialLoading:M&&I,data:_,dataUpdatedAt:h,error:p,errorUpdatedAt:g,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:I,isRefetching:I&&!M,isLoadingError:D&&f.dataUpdatedAt===0,isPaused:v==="paused",isPlaceholderData:w,isPreviousData:y,isRefetchError:D&&f.dataUpdatedAt!==0,isStale:Qv(e,r),refetch:this.refetch,remove:this.remove}}updateResult(e){const r=this.currentResult,n=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,Dg(n,r))return;this.currentResult=n;const i={cache:!0},o=()=>{if(!r)return!0;const{notifyOnChangeProps:s}=this.options;if(s==="all"||!s&&!this.trackedProps.size)return!0;const a=new Set(s??this.trackedProps);return this.options.useErrorBoundary&&a.add("error"),Object.keys(this.currentResult).some(l=>{const c=l;return this.currentResult[c]!==r[c]&&a.has(c)})};e?.listeners!==!1&&o()&&(i.listeners=!0),this.notify({...i,...e})}updateQuery(){const e=this.client.getQueryCache().build(this.client,this.options);if(e===this.currentQuery)return;const r=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(r?.removeObserver(this),e.addObserver(this))}onQueryUpdate(e){const r={};e.type==="success"?r.onSuccess=!e.manual:e.type==="error"&&!Cd(e.error)&&(r.onError=!0),this.updateResult(r),this.hasListeners()&&this.updateTimers()}notify(e){zt.batch(()=>{if(e.onSuccess){var r,n,i,o;(r=(n=this.options).onSuccess)==null||r.call(n,this.currentResult.data),(i=(o=this.options).onSettled)==null||i.call(o,this.currentResult.data,null)}else if(e.onError){var s,a,l,c;(s=(a=this.options).onError)==null||s.call(a,this.currentResult.error),(l=(c=this.options).onSettled)==null||l.call(c,void 0,this.currentResult.error)}e.listeners&&this.listeners.forEach(({listener:u})=>{u(this.currentResult)}),e.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function kS(t,e){return e.enabled!==!1&&!t.state.dataUpdatedAt&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Gx(t,e){return kS(t,e)||t.state.dataUpdatedAt>0&&zg(t,e,e.refetchOnMount)}function zg(t,e,r){if(e.enabled!==!1){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&Qv(t,e)}return!1}function Vx(t,e,r,n){return r.enabled!==!1&&(t!==e||n.enabled===!1)&&(!r.suspense||t.state.status!=="error")&&Qv(t,r)}function Qv(t,e){return t.isStaleByTime(e.staleTime)}class PS extends Tl{constructor(e,r){super(),this.client=e,this.setOptions(r),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var r;const n=this.options;this.options=this.client.defaultMutationOptions(e),Dg(n,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),(r=this.currentMutation)==null||r.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.currentMutation)==null||e.removeObserver(this)}}onMutationUpdate(e){this.updateResult();const r={listeners:!0};e.type==="success"?r.onSuccess=!0:e.type==="error"&&(r.onError=!0),this.notify(r)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(e,r){return this.mutateOptions=r,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:typeof e<"u"?e:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){const e=this.currentMutation?this.currentMutation.state:pA(),r={...e,isLoading:e.status==="loading",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset};this.currentResult=r}notify(e){zt.batch(()=>{if(this.mutateOptions&&this.hasListeners()){if(e.onSuccess){var r,n,i,o;(r=(n=this.mutateOptions).onSuccess)==null||r.call(n,this.currentResult.data,this.currentResult.variables,this.currentResult.context),(i=(o=this.mutateOptions).onSettled)==null||i.call(o,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)}else if(e.onError){var s,a,l,c;(s=(a=this.mutateOptions).onError)==null||s.call(a,this.currentResult.error,this.currentResult.variables,this.currentResult.context),(l=(c=this.mutateOptions).onSettled)==null||l.call(c,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context)}}e.listeners&&this.listeners.forEach(({listener:u})=>{u(this.currentResult)})})}}function TS(t){return{mutationKey:t.options.mutationKey,state:t.state}}function IS(t){return{state:t.state,queryKey:t.queryKey,queryHash:t.queryHash}}function BS(t){return t.state.isPaused}function OS(t){return t.state.status==="success"}function MS(t,e={}){const r=[],n=[];if(e.dehydrateMutations!==!1){const i=e.shouldDehydrateMutation||BS;t.getMutationCache().getAll().forEach(o=>{i(o)&&r.push(TS(o))})}if(e.dehydrateQueries!==!1){const i=e.shouldDehydrateQuery||OS;t.getQueryCache().getAll().forEach(o=>{i(o)&&n.push(IS(o))})}return{mutations:r,queries:n}}function RS(t,e,r){if(typeof e!="object"||e===null)return;const n=t.getMutationCache(),i=t.getQueryCache(),o=e.mutations||[],s=e.queries||[];o.forEach(a=>{var l;n.build(t,{...r==null||(l=r.defaultOptions)==null?void 0:l.mutations,mutationKey:a.mutationKey},a.state)}),s.forEach(a=>{var l;const c=i.get(a.queryHash),u={...a.state,fetchStatus:"idle"};if(c){c.state.dataUpdatedAt >>1,m=B[S];if(0>>1;S i(C,L))H i(X,C)?(B[S]=X,B[H]=L,S=H):(B[S]=C,B[W]=L,S=W);else if(H i(X,L))B[S]=X,B[H]=L,S=H;else break e}}return j}function i(B,j){var L=B.sortIndex-j.sortIndex;return L!==0?L:B.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();t.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,f=null,h=3,p=!1,g=!1,v=!1,x=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(B){for(var j=r(c);j!==null;){if(j.callback===null)n(c);else if(j.startTime<=B)n(c),j.sortIndex=j.expirationTime,e(l,j);else break;j=r(c)}}function I(B){if(v=!1,_(B),!g)if(r(l)!==null)g=!0,P(M);else{var j=r(c);j!==null&&T(I,j.startTime-B)}}function M(B,j){g=!1,v&&(v=!1,y(z),z=-1),p=!0;var L=h;try{for(_(j),f=r(l);f!==null&&(!(f.expirationTime>j)||B&&!oe());){var S=f.callback;if(typeof S=="function"){f.callback=null,h=f.priorityLevel;var m=S(f.expirationTime<=j);j=t.unstable_now(),typeof m=="function"?f.callback=m:f===r(l)&&n(l),_(j)}else n(l);f=r(l)}if(f!==null)var R=!0;else{var W=r(c);W!==null&&T(I,W.startTime-j),R=!1}return R}finally{f=null,h=L,p=!1}}var D=!1,U=null,z=-1,Z=5,ne=-1;function oe(){return!(t.unstable_now()-ne B||125S?(B.sortIndex=L,e(c,B),r(l)===null&&B===r(c)&&(v?(y(z),z=-1):v=!0,T(I,L-S))):(B.sortIndex=m,e(l,B),g||p||(g=!0,P(M))),B},t.unstable_shouldYield=oe,t.unstable_wrapCallback=function(B){var j=h;return function(){var L=h;h=j;try{return B.apply(this,arguments)}finally{h=L}}}})(gA);mA.exports=gA;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var vA=G.exports,ln=mA.exports;function fe(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r "u"||typeof window.document>"u"||typeof window.document.createElement>"u"),qg=Object.prototype.hasOwnProperty,NS=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Kx={},Qx={};function jS(t){return qg.call(Qx,t)?!0:qg.call(Kx,t)?!1:NS.test(t)?Qx[t]=!0:(Kx[t]=!0,!1)}function FS(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function DS(t,e,r,n){if(e===null||typeof e>"u"||FS(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Fr(t,e,r,n,i,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var dr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){dr[t]=new Fr(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];dr[e]=new Fr(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){dr[t]=new Fr(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){dr[t]=new Fr(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){dr[t]=new Fr(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){dr[t]=new Fr(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){dr[t]=new Fr(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){dr[t]=new Fr(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){dr[t]=new Fr(t,5,!1,t.toLowerCase(),null,!1,!1)});var Jv=/[\-:]([a-z])/g;function Yv(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(Jv,Yv);dr[e]=new Fr(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Jv,Yv);dr[e]=new Fr(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Jv,Yv);dr[e]=new Fr(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){dr[t]=new Fr(t,1,!1,t.toLowerCase(),null,!1,!1)});dr.xlinkHref=new Fr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){dr[t]=new Fr(t,1,!1,t.toLowerCase(),null,!0,!0)});function Xv(t,e,r,n){var i=dr.hasOwnProperty(e)?dr[e]:null;(i!==null?i.type!==0:n||!(2 a||i[s]!==o[a]){var l=` -`+i[s].replace(" at new "," at ");return t.displayName&&l.includes(" ")&&(l=l.replace(" ",t.displayName)),l}while(1<=s&&0<=a);break}}}finally{lm=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?mc(t):""}function LS(t){switch(t.tag){case 5:return mc(t.type);case 16:return mc("Lazy");case 13:return mc("Suspense");case 19:return mc("SuspenseList");case 0:case 2:case 15:return t=cm(t.type,!1),t;case 11:return t=cm(t.type.render,!1),t;case 1:return t=cm(t.type,!0),t;default:return""}}function Gg(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case ka:return"Fragment";case Sa:return"Portal";case $g:return"Profiler";case Zv:return"StrictMode";case Hg:return"Suspense";case Wg:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case xA:return(t.displayName||"Context")+".Consumer";case bA:return(t._context.displayName||"Context")+".Provider";case ey:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case ty:return e=t.displayName||null,e!==null?e:Gg(t.type)||"Memo";case po:e=t._payload,t=t._init;try{return Gg(t(e))}catch{}}return null}function US(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Gg(e);case 8:return e===Zv?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Uo(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function AA(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function zS(t){var e=AA(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,o=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){n=""+s,o.call(this,s)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Tf(t){t._valueTracker||(t._valueTracker=zS(t))}function EA(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=AA(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function eh(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Vg(t,e){var r=e.checked;return jt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function Yx(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=Uo(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function CA(t,e){e=e.checked,e!=null&&Xv(t,"checked",e,!1)}function Kg(t,e){CA(t,e);var r=Uo(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Qg(t,e.type,r):e.hasOwnProperty("defaultValue")&&Qg(t,e.type,Uo(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Xx(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function Qg(t,e,r){(e!=="number"||eh(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var gc=Array.isArray;function $a(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i "+e.valueOf().toString()+"",e=If.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Zc(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var kc={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qS=["Webkit","ms","Moz","O"];Object.keys(kc).forEach(function(t){qS.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),kc[e]=kc[t]})});function PA(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||kc.hasOwnProperty(t)&&kc[t]?(""+e).trim():e+"px"}function TA(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=PA(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var $S=jt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Xg(t,e){if(e){if($S[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(fe(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(fe(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(fe(61))}if(e.style!=null&&typeof e.style!="object")throw Error(fe(62))}}function Zg(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var e1=null;function ry(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var t1=null,Ha=null,Wa=null;function tw(t){if(t=Ku(t)){if(typeof t1!="function")throw Error(fe(280));var e=t.stateNode;e&&(e=x0(e),t1(t.stateNode,t.type,e))}}function IA(t){Ha?Wa?Wa.push(t):Wa=[t]:Ha=t}function BA(){if(Ha){var t=Ha,e=Wa;if(Wa=Ha=null,tw(t),e)for(t=0;t >>=0,t===0?32:31-(ek(t)/tk|0)|0}var Bf=64,Of=4194304;function vc(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function ih(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,o=t.pingedLanes,s=r&268435455;if(s!==0){var a=s&~i;a!==0?n=vc(a):(o&=s,o!==0&&(n=vc(o)))}else s=r&~i,s!==0?n=vc(s):o!==0&&(n=vc(o));if(n===0)return 0;if(e!==0&&e!==n&&(e&i)===0&&(i=n&-n,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if((n&4)!==0&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0 r;r++)e.push(t);return e}function Gu(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Wn(e),t[e]=r}function ok(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0 =Tc),uw=String.fromCharCode(32),fw=!1;function YA(t,e){switch(t){case"keyup":return Mk.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function XA(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Pa=!1;function Nk(t,e){switch(t){case"compositionend":return XA(e);case"keypress":return e.which!==32?null:(fw=!0,uw);case"textInput":return t=e.data,t===uw&&fw?null:t;default:return null}}function jk(t,e){if(Pa)return t==="compositionend"||!uy&&YA(t,e)?(t=QA(),Sd=ay=Ao=null,Pa=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1 =e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=mw(r)}}function rE(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?rE(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function nE(){for(var t=window,e=eh();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=eh(t.document)}return e}function fy(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function Wk(t){var e=nE(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&rE(r.ownerDocument.documentElement,r)){if(n!==null&&fy(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=r.textContent.length,o=Math.min(n.start,i);n=n.end===void 0?o:Math.min(n.end,i),!t.extend&&o>n&&(i=n,n=o,o=i),i=gw(r,o);var s=gw(r,n);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>n?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r =document.documentMode,Ta=null,a1=null,Bc=null,l1=!1;function vw(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;l1||Ta==null||Ta!==eh(n)||(n=Ta,"selectionStart"in n&&fy(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Bc&&ou(Bc,n)||(Bc=n,n=ah(a1,"onSelect"),0 Oa||(t.current=p1[Oa],p1[Oa]=null,Oa--)}function lt(t,e){Oa++,p1[Oa]=t.current,t.current=e}var zo={},Er=Qo(zo),Wr=Qo(!1),Rs=zo;function il(t,e){var r=t.type.contextTypes;if(!r)return zo;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in r)i[o]=e[o];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Gr(t){return t=t.childContextTypes,t!=null}function ch(){Pt(Wr),Pt(Er)}function Cw(t,e,r){if(Er.current!==zo)throw Error(fe(168));lt(Er,e),lt(Wr,r)}function dE(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(fe(108,US(t)||"Unknown",i));return jt({},r,n)}function uh(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||zo,Rs=Er.current,lt(Er,t),lt(Wr,Wr.current),!0}function _w(t,e,r){var n=t.stateNode;if(!n)throw Error(fe(169));r?(t=dE(t,e,Rs),n.__reactInternalMemoizedMergedChildContext=t,Pt(Wr),Pt(Er),lt(Er,t)):Pt(Wr),lt(Wr,r)}var Oi=null,w0=!1,Em=!1;function hE(t){Oi===null?Oi=[t]:Oi.push(t)}function nP(t){w0=!0,hE(t)}function Jo(){if(!Em&&Oi!==null){Em=!0;var t=0,e=et;try{var r=Oi;for(et=1;t >=s,i-=s,Ni=1<<32-Wn(e)+i|r<z?(Z=U,U=null):Z=U.sibling;var ne=h(y,U,_[z],I);if(ne===null){U===null&&(U=Z);break}t&&U&&ne.alternate===null&&e(y,U),w=o(ne,w,z),D===null?M=ne:D.sibling=ne,D=ne,U=Z}if(z===_.length)return r(y,U),It&&ps(y,z),M;if(U===null){for(;z<_.length;z++)U=f(y,_[z],I),U!==null&&(w=o(U,w,z),D===null?M=U:D.sibling=U,D=U);return It&&ps(y,z),M}for(U=n(y,U);z<_.length;z++)Z=p(U,y,z,_[z],I),Z!==null&&(t&&Z.alternate!==null&&U.delete(Z.key===null?z:Z.key),w=o(Z,w,z),D===null?M=Z:D.sibling=Z,D=Z);return t&&U.forEach(function(oe){return e(y,oe)}),It&&ps(y,z),M}function v(y,w,_,I){var M=Jl(_);if(typeof M!="function")throw Error(fe(150));if(_=M.call(_),_==null)throw Error(fe(151));for(var D=M=null,U=w,z=w=0,Z=null,ne=_.next();U!==null&&!ne.done;z++,ne=_.next()){U.index>z?(Z=U,U=null):Z=U.sibling;var oe=h(y,U,ne.value,I);if(oe===null){U===null&&(U=Z);break}t&&U&&oe.alternate===null&&e(y,U),w=o(oe,w,z),D===null?M=oe:D.sibling=oe,D=oe,U=Z}if(ne.done)return r(y,U),It&&ps(y,z),M;if(U===null){for(;!ne.done;z++,ne=_.next())ne=f(y,ne.value,I),ne!==null&&(w=o(ne,w,z),D===null?M=ne:D.sibling=ne,D=ne);return It&&ps(y,z),M}for(U=n(y,U);!ne.done;z++,ne=_.next())ne=p(U,y,z,ne.value,I),ne!==null&&(t&&ne.alternate!==null&&U.delete(ne.key===null?z:ne.key),w=o(ne,w,z),D===null?M=ne:D.sibling=ne,D=ne);return t&&U.forEach(function(ae){return e(y,ae)}),It&&ps(y,z),M}function x(y,w,_,I){if(typeof _=="object"&&_!==null&&_.type===ka&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Pf:e:{for(var M=_.key,D=w;D!==null;){if(D.key===M){if(M=_.type,M===ka){if(D.tag===7){r(y,D.sibling),w=i(D,_.props.children),w.return=y,y=w;break e}}else if(D.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===po&&Ow(M)===D.type){r(y,D.sibling),w=i(D,_.props),w.ref=tc(y,D,_),w.return=y,y=w;break e}r(y,D);break}else e(y,D);D=D.sibling}_.type===ka?(w=Ts(_.props.children,y.mode,I,_.key),w.return=y,y=w):(I=Rd(_.type,_.key,_.props,null,y.mode,I),I.ref=tc(y,w,_),I.return=y,y=I)}return s(y);case Sa:e:{for(D=_.key;w!==null;){if(w.key===D)if(w.tag===4&&w.stateNode.containerInfo===_.containerInfo&&w.stateNode.implementation===_.implementation){r(y,w.sibling),w=i(w,_.children||[]),w.return=y,y=w;break e}else{r(y,w);break}else e(y,w);w=w.sibling}w=Bm(_,y.mode,I),w.return=y,y=w}return s(y);case po:return D=_._init,x(y,w,D(_._payload),I)}if(gc(_))return g(y,w,_,I);if(Jl(_))return v(y,w,_,I);Lf(y,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,w!==null&&w.tag===6?(r(y,w.sibling),w=i(w,_),w.return=y,y=w):(r(y,w),w=Im(_,y.mode,I),w.return=y,y=w),s(y)):r(y,w)}return x}var sl=wE(!0),AE=wE(!1),Qu={},pi=Qo(Qu),cu=Qo(Qu),uu=Qo(Qu);function _s(t){if(t===Qu)throw Error(fe(174));return t}function xy(t,e){switch(lt(uu,e),lt(cu,t),lt(pi,Qu),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Yg(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Yg(e,t)}Pt(pi),lt(pi,e)}function al(){Pt(pi),Pt(cu),Pt(uu)}function EE(t){_s(uu.current);var e=_s(pi.current),r=Yg(e,t.type);e!==r&&(lt(cu,t),lt(pi,r))}function wy(t){cu.current===t&&(Pt(pi),Pt(cu))}var Rt=Qo(0);function gh(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Cm=[];function Ay(){for(var t=0;t r?r:4,t(!0);var n=_m.transition;_m.transition={};try{t(!1),e()}finally{et=r,_m.transition=n}}function LE(){return Pn().memoizedState}function aP(t,e,r){var n=No(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},UE(t))zE(e,r);else if(r=vE(t,e,r,n),r!==null){var i=Br();Gn(r,t,n,i),qE(r,e,n)}}function lP(t,e,r){var n=No(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(UE(t))zE(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,r);if(i.hasEagerState=!0,i.eagerState=a,Kn(a,s)){var l=e.interleaved;l===null?(i.next=i,yy(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}r=vE(t,e,i,n),r!==null&&(i=Br(),Gn(r,t,n,i),qE(r,e,n))}}function UE(t){var e=t.alternate;return t===Nt||e!==null&&e===Nt}function zE(t,e){Oc=vh=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function qE(t,e,r){if((r&4194240)!==0){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,iy(t,r)}}var yh={readContext:kn,useCallback:mr,useContext:mr,useEffect:mr,useImperativeHandle:mr,useInsertionEffect:mr,useLayoutEffect:mr,useMemo:mr,useReducer:mr,useRef:mr,useState:mr,useDebugValue:mr,useDeferredValue:mr,useTransition:mr,useMutableSource:mr,useSyncExternalStore:mr,useId:mr,unstable_isNewReconciler:!1},cP={readContext:kn,useCallback:function(t,e){return ni().memoizedState=[t,e===void 0?null:e],t},useContext:kn,useEffect:Rw,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,Id(4194308,4,RE.bind(null,e,t),r)},useLayoutEffect:function(t,e){return Id(4194308,4,t,e)},useInsertionEffect:function(t,e){return Id(4,2,t,e)},useMemo:function(t,e){var r=ni();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=ni();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=aP.bind(null,Nt,t),[n.memoizedState,t]},useRef:function(t){var e=ni();return t={current:t},e.memoizedState=t},useState:Mw,useDebugValue:ky,useDeferredValue:function(t){return ni().memoizedState=t},useTransition:function(){var t=Mw(!1),e=t[0];return t=sP.bind(null,t[1]),ni().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=Nt,i=ni();if(It){if(r===void 0)throw Error(fe(407));r=r()}else{if(r=e(),ir===null)throw Error(fe(349));(js&30)!==0||SE(n,e,r)}i.memoizedState=r;var o={value:r,getSnapshot:e};return i.queue=o,Rw(PE.bind(null,n,o,t),[t]),n.flags|=2048,hu(9,kE.bind(null,n,o,r,e),void 0,null),r},useId:function(){var t=ni(),e=ir.identifierPrefix;if(It){var r=ji,n=Ni;r=(n&~(1<<32-Wn(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=fu++,0 <\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=s.createElement(r,{is:n.is}):(t=s.createElement(r),r==="select"&&(s=t,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):t=s.createElementNS(t,r),t[ai]=e,t[lu]=n,YE(t,e,!1,!1),e.stateNode=t;e:{switch(s=Zg(r,n),r){case"dialog":kt("cancel",t),kt("close",t),i=n;break;case"iframe":case"object":case"embed":kt("load",t),i=n;break;case"video":case"audio":for(i=0;i cl&&(e.flags|=128,n=!0,rc(o,!1),e.lanes=4194304)}else{if(!n)if(t=gh(s),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),rc(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!It)return gr(e),null}else 2*Ht()-o.renderingStartTime>cl&&r!==1073741824&&(e.flags|=128,n=!0,rc(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(r=o.last,r!==null?r.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Ht(),e.sibling=null,r=Rt.current,lt(Rt,n?r&1|2:r&1),e):(gr(e),null);case 22:case 23:return My(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&(e.mode&1)!==0?(Zr&1073741824)!==0&&(gr(e),e.subtreeFlags&6&&(e.flags|=8192)):gr(e),null;case 24:return null;case 25:return null}throw Error(fe(156,e.tag))}function vP(t,e){switch(hy(e),e.tag){case 1:return Gr(e.type)&&ch(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return al(),Pt(Wr),Pt(Er),Ay(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 5:return wy(e),null;case 13:if(Pt(Rt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(fe(340));ol()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Pt(Rt),null;case 4:return al(),null;case 10:return vy(e.type._context),null;case 22:case 23:return My(),null;case 24:return null;default:return null}}var zf=!1,br=!1,yP=typeof WeakSet=="function"?WeakSet:Set,we=null;function ja(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Ut(t,e,n)}else r.current=null}function S1(t,e,r){try{r()}catch(n){Ut(t,e,n)}}var $w=!1;function bP(t,e){if(c1=oh,t=nE(),fy(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var s=0,a=-1,l=-1,c=0,u=0,f=t,h=null;t:for(;;){for(var p;f!==r||i!==0&&f.nodeType!==3||(a=s+i),f!==o||n!==0&&f.nodeType!==3||(l=s+n),f.nodeType===3&&(s+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===t)break t;if(h===r&&++c===i&&(a=s),h===o&&++u===n&&(l=s),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(u1={focusedElem:t,selectionRange:r},oh=!1,we=e;we!==null;)if(e=we,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,we=t;else for(;we!==null;){e=we;try{var g=e.alternate;if((e.flags&1024)!==0)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var v=g.memoizedProps,x=g.memoizedState,y=e.stateNode,w=y.getSnapshotBeforeUpdate(e.elementType===e.type?v:jn(e.type,v),x);y.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var _=e.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(fe(163))}}catch(I){Ut(e,e.return,I)}if(t=e.sibling,t!==null){t.return=e.return,we=t;break}we=e.return}return g=$w,$w=!1,g}function Mc(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&S1(e,r,o)}i=i.next}while(i!==n)}}function C0(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function k1(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function e4(t){var e=t.alternate;e!==null&&(t.alternate=null,e4(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[ai],delete e[lu],delete e[h1],delete e[tP],delete e[rP])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function t4(t){return t.tag===5||t.tag===3||t.tag===4}function Hw(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||t4(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function P1(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=lh));else if(n!==4&&(t=t.child,t!==null))for(P1(t,e,r),t=t.sibling;t!==null;)P1(t,e,r),t=t.sibling}function T1(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(T1(t,e,r),t=t.sibling;t!==null;)T1(t,e,r),t=t.sibling}var lr=null,Dn=!1;function oo(t,e,r){for(r=r.child;r!==null;)r4(t,e,r),r=r.sibling}function r4(t,e,r){if(hi&&typeof hi.onCommitFiberUnmount=="function")try{hi.onCommitFiberUnmount(g0,r)}catch{}switch(r.tag){case 5:br||ja(r,e);case 6:var n=lr,i=Dn;lr=null,oo(t,e,r),lr=n,Dn=i,lr!==null&&(Dn?(t=lr,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):lr.removeChild(r.stateNode));break;case 18:lr!==null&&(Dn?(t=lr,r=r.stateNode,t.nodeType===8?Am(t.parentNode,r):t.nodeType===1&&Am(t,r),nu(t)):Am(lr,r.stateNode));break;case 4:n=lr,i=Dn,lr=r.stateNode.containerInfo,Dn=!0,oo(t,e,r),lr=n,Dn=i;break;case 0:case 11:case 14:case 15:if(!br&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&((o&2)!==0||(o&4)!==0)&&S1(r,e,s),i=i.next}while(i!==n)}oo(t,e,r);break;case 1:if(!br&&(ja(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){Ut(r,e,a)}oo(t,e,r);break;case 21:oo(t,e,r);break;case 22:r.mode&1?(br=(n=br)||r.memoizedState!==null,oo(t,e,r),br=n):oo(t,e,r);break;default:oo(t,e,r)}}function Ww(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new yP),e.forEach(function(n){var i=PP.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function On(t,e){var r=e.deletions;if(r!==null)for(var n=0;n i&&(i=s),n&=~o}if(n=i,n=Ht()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*wP(n/1960))-n,10 t?16:t,Eo===null)var n=!1;else{if(t=Eo,Eo=null,wh=0,(Ve&6)!==0)throw Error(fe(331));var i=Ve;for(Ve|=4,we=t.current;we!==null;){var o=we,s=o.child;if((we.flags&16)!==0){var a=o.deletions;if(a!==null){for(var l=0;l Ht()-By?Ps(t,0):Iy|=r),Vr(t,e)}function u4(t,e){e===0&&((t.mode&1)===0?e=1:(e=Of,Of<<=1,(Of&130023424)===0&&(Of=4194304)));var r=Br();t=zi(t,e),t!==null&&(Gu(t,e,r),Vr(t,r))}function kP(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),u4(t,r)}function PP(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(fe(314))}n!==null&&n.delete(e),u4(t,r)}var f4;f4=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Wr.current)$r=!0;else{if((t.lanes&r)===0&&(e.flags&128)===0)return $r=!1,mP(t,e,r);$r=(t.flags&131072)!==0}else $r=!1,It&&(e.flags&1048576)!==0&&pE(e,dh,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;Bd(t,e),t=e.pendingProps;var i=il(e,Er.current);Va(e,r),i=Cy(null,e,n,t,i,r);var o=_y();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Gr(n)?(o=!0,uh(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,by(e),i.updater=A0,e.stateNode=i,i._reactInternals=e,b1(e,n,t,r),e=A1(null,e,n,!0,o,r)):(e.tag=0,It&&o&&dy(e),_r(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(Bd(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=IP(n),t=jn(n,t),i){case 0:e=w1(null,e,n,t,r);break e;case 1:e=Uw(null,e,n,t,r);break e;case 11:e=Dw(null,e,n,t,r);break e;case 14:e=Lw(null,e,n,jn(n.type,t),r);break e}throw Error(fe(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:jn(n,i),w1(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:jn(n,i),Uw(t,e,n,i,r);case 3:e:{if(KE(e),t===null)throw Error(fe(387));n=e.pendingProps,o=e.memoizedState,i=o.element,yE(t,e),mh(e,n,null,r);var s=e.memoizedState;if(n=s.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=ll(Error(fe(423)),e),e=zw(t,e,n,r,i);break e}else if(n!==i){i=ll(Error(fe(424)),e),e=zw(t,e,n,r,i);break e}else for(nn=Oo(e.stateNode.containerInfo.firstChild),on=e,It=!0,Un=null,r=AE(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ol(),n===i){e=qi(t,e,r);break e}_r(t,e,n,r)}e=e.child}return e;case 5:return EE(e),t===null&&g1(e),n=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,s=i.children,f1(n,i)?s=null:o!==null&&f1(n,o)&&(e.flags|=32),VE(t,e),_r(t,e,s,r),e.child;case 6:return t===null&&g1(e),null;case 13:return QE(t,e,r);case 4:return xy(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=sl(e,null,n,r):_r(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:jn(n,i),Dw(t,e,n,i,r);case 7:return _r(t,e,e.pendingProps,r),e.child;case 8:return _r(t,e,e.pendingProps.children,r),e.child;case 12:return _r(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,o=e.memoizedProps,s=i.value,lt(hh,n._currentValue),n._currentValue=s,o!==null)if(Kn(o.value,s)){if(o.children===i.children&&!Wr.current){e=qi(t,e,r);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(o.tag===1){l=Fi(-1,r&-r),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),v1(o.return,r,e),a.lanes|=r;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(fe(341));s.lanes|=r,a=s.alternate,a!==null&&(a.lanes|=r),v1(s,r,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}_r(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,Va(e,r),i=kn(i),n=n(i),e.flags|=1,_r(t,e,n,r),e.child;case 14:return n=e.type,i=jn(n,e.pendingProps),i=jn(n.type,i),Lw(t,e,n,i,r);case 15:return WE(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:jn(n,i),Bd(t,e),e.tag=1,Gr(n)?(t=!0,uh(e)):t=!1,Va(e,r),xE(e,n,i),b1(e,n,i,r),A1(null,e,n,!0,t,r);case 19:return JE(t,e,r);case 22:return GE(t,e,r)}throw Error(fe(156,e.tag))};function d4(t,e){return DA(t,e)}function TP(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Cn(t,e,r,n){return new TP(t,e,r,n)}function Ny(t){return t=t.prototype,!(!t||!t.isReactComponent)}function IP(t){if(typeof t=="function")return Ny(t)?1:0;if(t!=null){if(t=t.$$typeof,t===ey)return 11;if(t===ty)return 14}return 2}function jo(t,e){var r=t.alternate;return r===null?(r=Cn(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function Rd(t,e,r,n,i,o){var s=2;if(n=t,typeof t=="function")Ny(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case ka:return Ts(r.children,i,o,e);case Zv:s=8,i|=8;break;case $g:return t=Cn(12,r,e,i|2),t.elementType=$g,t.lanes=o,t;case Hg:return t=Cn(13,r,e,i),t.elementType=Hg,t.lanes=o,t;case Wg:return t=Cn(19,r,e,i),t.elementType=Wg,t.lanes=o,t;case wA:return S0(r,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case bA:s=10;break e;case xA:s=9;break e;case ey:s=11;break e;case ty:s=14;break e;case po:s=16,n=null;break e}throw Error(fe(130,t==null?t:typeof t,""))}return e=Cn(s,r,e,i),e.elementType=t,e.type=n,e.lanes=o,e}function Ts(t,e,r,n){return t=Cn(7,t,n,e),t.lanes=r,t}function S0(t,e,r,n){return t=Cn(22,t,n,e),t.elementType=wA,t.lanes=r,t.stateNode={isHidden:!1},t}function Im(t,e,r){return t=Cn(6,t,null,e),t.lanes=r,t}function Bm(t,e,r){return e=Cn(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function BP(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=fm(0),this.expirationTimes=fm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fm(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function jy(t,e,r,n,i,o,s,a,l){return t=new BP(t,e,r,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Cn(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},by(o),t}function OP(t,e,r){var n=3 "u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(g4)}catch(t){console.error(t)}}g4(),m0.exports=un;var B0={exports:{}},v4={};/** - * @license React - * use-sync-external-store-shim.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var ul=G.exports;function FP(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var DP=typeof Object.is=="function"?Object.is:FP,LP=ul.useState,UP=ul.useEffect,zP=ul.useLayoutEffect,qP=ul.useDebugValue;function $P(t,e){var r=e(),n=LP({inst:{value:r,getSnapshot:e}}),i=n[0].inst,o=n[1];return zP(function(){i.value=r,i.getSnapshot=e,Om(i)&&o({inst:i})},[t,r,e]),UP(function(){return Om(i)&&o({inst:i}),t(function(){Om(i)&&o({inst:i})})},[t]),qP(r),r}function Om(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!DP(t,r)}catch{return!0}}function HP(t,e){return e()}var WP=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?HP:$P;v4.useSyncExternalStore=ul.useSyncExternalStore!==void 0?ul.useSyncExternalStore:WP;B0.exports=v4;const GP=B0.exports.useSyncExternalStore,Zw=G.exports.createContext(void 0),y4=G.exports.createContext(!1);function b4(t,e){return t||(e&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=Zw),window.ReactQueryClientContext):Zw)}const Uy=({context:t}={})=>{const e=G.exports.useContext(b4(t,G.exports.useContext(y4)));if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},VP=({client:t,children:e,context:r,contextSharing:n=!1})=>{G.exports.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]);const i=b4(r,n);return G.exports.createElement(y4.Provider,{value:!r&&n},G.exports.createElement(i.Provider,{value:t},e))},x4=G.exports.createContext(!1),KP=()=>G.exports.useContext(x4);x4.Provider;function QP(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const JP=G.exports.createContext(QP()),YP=()=>G.exports.useContext(JP);function XP(t,e){return typeof t=="function"?t(...e):!!t}function ZP(t,e,r){const n=lA(t,e,r),i=Uy({context:n.context}),[o]=G.exports.useState(()=>new PS(i,n));G.exports.useEffect(()=>{o.setOptions(n)},[o,n]);const s=GP(G.exports.useCallback(l=>o.subscribe(zt.batchCalls(l)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),a=G.exports.useCallback((l,c)=>{o.mutate(l,c).catch(eT)},[o]);if(s.error&&XP(o.options.useErrorBoundary,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}function eT(){}const tT=["added","removed","updated"];function e2(t){return tT.includes(t)}async function rT({queryClient:t,persister:e,maxAge:r=1e3*60*60*24,buster:n="",hydrateOptions:i}){try{const o=await e.restoreClient();if(o)if(o.timestamp){const s=Date.now()-o.timestamp>r,a=o.buster!==n;s||a?e.removeClient():RS(t,o.clientState,i)}else e.removeClient()}catch{e.removeClient()}}async function t2({queryClient:t,persister:e,buster:r="",dehydrateOptions:n}){const i={buster:r,timestamp:Date.now(),clientState:MS(t,n)};await e.persistClient(i)}function nT(t){const e=t.queryClient.getQueryCache().subscribe(n=>{e2(n.type)&&t2(t)}),r=t.queryClient.getMutationCache().subscribe(n=>{e2(n.type)&&t2(t)});return()=>{e(),r()}}function iT(t){let e=!1,r;const n=()=>{e=!0,r?.()},i=rT(t).then(()=>{e||(r=nT(t))});return[n,i]}var w4={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function o(l,c,u,f,h){if(typeof u!="function")throw new TypeError("The listener must be a function");var p=new i(u,f||l,h),g=r?r+c:c;return l._events[g]?l._events[g].fn?l._events[g]=[l._events[g],p]:l._events[g].push(p):(l._events[g]=p,l._eventsCount++),l}function s(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var c=[],u,f;if(this._eventsCount===0)return c;for(f in u=this._events)e.call(u,f)&&c.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},a.prototype.listeners=function(c){var u=r?r+c:c,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,p=f.length,g=new Array(p);h t,O0=t=>t,hT=()=>`viem@${fT}`;var A4=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ch,E4;class me extends Error{constructor(e,r={}){super(),Ch.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ViemError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:hT()});const n=r.cause instanceof me?r.cause.details:r.cause?.message?r.cause.message:r.details,i=r.cause instanceof me&&r.cause.docsPath||r.docsPath;this.message=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: https://viem.sh${i}.html${r.docsSlug?`#${r.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join(` -`),r.cause&&(this.cause=r.cause),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.shortMessage=e}walk(e){return A4(this,Ch,"m",E4).call(this,this,e)}}Ch=new WeakSet,E4=function t(e,r){return r?.(e)?e:e.cause?A4(this,Ch,"m",t).call(this,e.cause,r):e};class R1 extends me{constructor({blockNumber:e,chain:r,contract:n}){super(`Chain "${r.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}}class pT extends me{constructor({chain:e,currentChainId:r}){super(`The current chain of the wallet (id: ${r}) does not match the target chain for the transaction (id: ${e.id} \u2013 ${e.name}).`,{metaMessages:[`Current Chain ID: ${r}`,`Expected Chain ID: ${e.id} \u2013 ${e.name}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainMismatchError"})}}class mT extends me{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotFoundError"})}}class C4 extends me{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}}function gT({chain:t,currentChainId:e}){if(!t)throw new mT;if(e!==t.id)throw new pT({chain:t,currentChainId:e})}function Ol({blockNumber:t,chain:e,contract:r}){const n=e?.contracts?.[r];if(!n)throw new R1({chain:e,contract:{name:r}});if(t&&n.blockCreated&&n.blockCreated>t)throw new R1({blockNumber:t,chain:e,contract:{name:r,blockCreated:n.blockCreated}});return n.address}function Ml(t,{formatter:e}){return e(t)}function M0({format:t}){return({exclude:e,format:r})=>n=>{const i=t(n);if(e)for(const o of e)delete i[o];return{...i,...r?.(n)}}}class vT extends me{constructor({max:e,min:r,signed:n,size:i,value:o}){super(`Number "${o}" is not in safe ${i?`${i*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${r} to ${e})`:`(above ${r})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}}class yT extends me{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidHexBooleanError"})}}class bT extends me{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}}function $i(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function Gt(t){return $i(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}function Is(t,{dir:e="left"}={}){let r=typeof t=="string"?t.replace("0x",""):t,n=0;for(let i=0;i
r*2)throw new S4({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](r*2,"0")}`}function xT(t,{dir:e,size:r=32}={}){if(r===null)return t;if(t.length>r)throw new S4({size:t.length,targetSize:r,type:"bytes"});const n=new Uint8Array(r);for(let i=0;i e.toString(16).padStart(2,"0"));function Qi(t,e={}){return typeof t=="number"||typeof t=="bigint"?Fe(t,e):typeof t=="string"?qy(t,e):typeof t=="boolean"?k4(t,e):mu(t,e)}function k4(t,e={}){const r=`0x${Number(t)}`;return typeof e.size=="number"?(Yo(r,{size:e.size}),Rl(r,{size:e.size})):r}function mu(t,e={}){let r="";for(let i=0;i o||i e)throw new bT({givenSize:Gt(t),maxSize:e})}function Hy(t,e={}){const{signed:r}=e;e.size&&Yo(t,{size:e.size});const n=BigInt(t);if(!r)return n;const i=(t.length-2)/2,o=(1n<typeof r=="string"?r:Wy(r));return{...t,baseFeePerGas:t.baseFeePerGas?BigInt(t.baseFeePerGas):null,difficulty:t.difficulty?BigInt(t.difficulty):void 0,gasLimit:t.gasLimit?BigInt(t.gasLimit):void 0,gasUsed:t.gasUsed?BigInt(t.gasUsed):void 0,hash:t.hash?t.hash:null,logsBloom:t.logsBloom?t.logsBloom:null,nonce:t.nonce?t.nonce:null,number:t.number?BigInt(t.number):null,size:t.size?BigInt(t.size):void 0,timestamp:t.timestamp?BigInt(t.timestamp):void 0,transactions:e,totalDifficulty:t.totalDifficulty?BigInt(t.totalDifficulty):null}}const PT=M0({format:I4});function Us(t,{args:e,eventName:r}={}){return{...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,logIndex:t.logIndex?Number(t.logIndex):null,transactionHash:t.transactionHash?t.transactionHash:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,...r?{args:e,eventName:r}:{}}}const TT={"0x0":"reverted","0x1":"success"};function B4(t){return{...t,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,contractAddress:t.contractAddress?t.contractAddress:null,cumulativeGasUsed:t.cumulativeGasUsed?BigInt(t.cumulativeGasUsed):null,effectiveGasPrice:t.effectiveGasPrice?BigInt(t.effectiveGasPrice):null,gasUsed:t.gasUsed?BigInt(t.gasUsed):null,logs:t.logs?t.logs.map(e=>Us(e)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Or(t.transactionIndex):null,status:t.status?TT[t.status]:null,type:t.type?T4[t.type]:null}}const IT=M0({format:B4});function R0(t){return{...t,gas:typeof t.gas<"u"?Fe(t.gas):void 0,gasPrice:typeof t.gasPrice<"u"?Fe(t.gasPrice):void 0,maxFeePerGas:typeof t.maxFeePerGas<"u"?Fe(t.maxFeePerGas):void 0,maxPriorityFeePerGas:typeof t.maxPriorityFeePerGas<"u"?Fe(t.maxPriorityFeePerGas):void 0,nonce:typeof t.nonce<"u"?Fe(t.nonce):void 0,value:typeof t.value<"u"?Fe(t.value):void 0}}const BT=M0({format:R0});PT({exclude:["difficulty","gasLimit","mixHash","nonce","uncles"],format:t=>({randomness:t.randomness})}),kT({format:t=>({feeCurrency:t.feeCurrency,gatewayFee:t.gatewayFee?BigInt(t.gatewayFee):null,gatewayFeeRecipient:t.gatewayFeeRecipient})}),IT({format:t=>({feeCurrency:t.feeCurrency,gatewayFee:t.gatewayFee?BigInt(t.gatewayFee):null,gatewayFeeRecipient:t.gatewayFeeRecipient})}),BT({format:t=>({feeCurrency:t.feeCurrency,gatewayFee:t.gatewayFee,gatewayFeeRecipient:t.gatewayFeeRecipient})});const OT=aT,MT=zy;var RT=Object.defineProperty,NT=(t,e,r)=>e in t?RT(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ye=(t,e,r)=>(NT(t,typeof e!="symbol"?e+"":e,r),r),Gy=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},Pr=(t,e,r)=>(Gy(t,e,"read from private field"),r?r.call(t):e.get(t)),qo=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},zs=(t,e,r,n)=>(Gy(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),jT=(t,e,r)=>(Gy(t,e,"access private method"),r),N0=class extends oT{constructor({chains:t=[MT,OT],options:e}){super(),Ye(this,"chains"),Ye(this,"options"),Ye(this,"storage"),this.chains=t,this.options=e}getBlockExplorerUrls(t){const{default:e,...r}=t.blockExplorers??{};if(e)return[e.url,...Object.values(r).map(n=>n.url)]}isChainUnsupported(t){return!this.chains.some(e=>e.id===t)}setStorage(t){this.storage=t}},O4=class extends Error{constructor({chainId:t,connectorId:e}){super(`Chain "${t}" not configured for connector "${e}".`),Ye(this,"name","ChainNotConfiguredForConnectorError")}},qr=class extends Error{constructor(){super(...arguments),Ye(this,"name","ConnectorNotFoundError"),Ye(this,"message","Connector not found")}};function qs(t){return typeof t=="string"?Number.parseInt(t,t.trim().substring(0,2)==="0x"?16:10):typeof t=="bigint"?Number(t):t}function Ys(t,{includeName:e=!1}={}){if(t.type!=="function"&&t.type!=="event"&&t.type!=="error")throw new JT(t.type);return`${t.name}(${j0(t.inputs,{includeName:e})})`}function j0(t,{includeName:e=!1}={}){return t?t.map(r=>FT(r,{includeName:e})).join(e?", ":","):""}function FT(t,{includeName:e}){return t.type.startsWith("tuple")?`(${j0(t.components,{includeName:e})})${t.type.slice(5)}`:t.type+(e&&t.name?` ${t.name}`:"")}class DT extends me{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(` -`),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorNotFoundError"})}}class r2 extends me{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(` -`),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorParamsNotFoundError"})}}class Vy extends me{constructor({data:e,params:r,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(` -`),{metaMessages:[`Params: (${j0(r,{includeName:!0})})`,`Data: ${e} (${n} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=r,this.size=n}}class F0 extends me{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}}class LT extends me{constructor({expectedLength:e,givenLength:r,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${r}`].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}}class UT extends me{constructor({expectedSize:e,value:r}){super(`Size of bytes "${r}" (bytes${Gt(r)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class zT extends me{constructor({expectedLength:e,givenLength:r}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${r}`].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}}class qT extends me{constructor(e,{docsPath:r}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiErrorSignatureNotFoundError"})}}class $T extends me{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureEmptyTopicsError"})}}class HT extends me{constructor(e,{docsPath:r}){super([`Encoded event signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureNotFoundError"})}}class n2 extends me{constructor(e,{docsPath:r}={}){super([`Event ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventNotFoundError"})}}class _h extends me{constructor(e,{docsPath:r}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}}class WT extends me{constructor(e,{docsPath:r}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionOutputsNotFoundError"})}}class GT extends me{constructor({expectedSize:e,givenSize:r}){super(`Expected bytes${e}, got bytes${r}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}}class gu extends me{constructor({abiItem:e,data:r,params:n,size:i}){super([`Data size of ${i} bytes is too small for non-indexed event parameters.`].join(` -`),{metaMessages:[`Params: (${j0(n,{includeName:!0})})`,`Data: ${r} (${i} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=r,this.params=n,this.size=i}}class D0 extends me{constructor({abiItem:e,param:r}){super([`Expected a topic for indexed event parameter${r.name?` "${r.name}"`:""} on event "${Ys(e,{includeName:!0})}".`].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class VT extends me{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}}class KT extends me{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}}class QT extends me{constructor(e){super([`Value "${e}" is not a valid array.`].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}}class JT extends me{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}}class YT extends me{constructor(e){super(`Filter type "${e}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}}const XT=/((function|event)\s)?(.*)(\((.*)\))/;function M4(t){const e=t.match(XT),r=e?.[2]||void 0,n=e?.[3],i=e?.[5]||void 0;return{type:r,name:n,params:i}}function ZT(t){return M4(t).name}function eI(t){return M4(t).params?.split(",").map(n=>n.trim().split(" "))?.map(n=>({type:n[0],name:n[1]==="indexed"?n[2]:n[1],...n[1]==="indexed"?{indexed:!0}:{}}))}function N1(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function tI(t){if(typeof t!="boolean")throw new Error(`Expected boolean, not ${t}`)}function R4(t,...e){if(!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new TypeError(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function rI(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");N1(t.outputLen),N1(t.blockLen)}function nI(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function iI(t,e){R4(t);const r=e.outputLen;if(t.length >j1&Hf)}:{h:Number(t>>j1&Hf)|0,l:Number(t&Hf)|0}}function oI(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;i BigInt(t>>>0)< >>0),aI=(t,e,r)=>t>>>r,lI=(t,e,r)=>t<<32-r|e>>>r,cI=(t,e,r)=>t>>>r|e<<32-r,uI=(t,e,r)=>t<<32-r|e>>>r,fI=(t,e,r)=>t<<64-r|e>>>r-32,dI=(t,e,r)=>t>>>r-32|e<<64-r,hI=(t,e)=>e,pI=(t,e)=>t,mI=(t,e,r)=>t< >>32-r,gI=(t,e,r)=>e< >>32-r,vI=(t,e,r)=>e< >>64-r,yI=(t,e,r)=>t< >>64-r;function bI(t,e,r,n){const i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}const xI=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),wI=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,AI=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),EI=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,CI=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),_I=(t,e,r,n,i,o)=>e+r+n+i+o+(t/2**32|0)|0,vu={fromBig:N4,split:oI,toBig:sI,shrSH:aI,shrSL:lI,rotrSH:cI,rotrSL:uI,rotrBH:fI,rotrBL:dI,rotr32H:hI,rotr32L:pI,rotlSH:mI,rotlSL:gI,rotlBH:vI,rotlBL:yI,add:bI,add3L:xI,add3H:wI,add4L:AI,add4H:EI,add5H:_I,add5L:CI};/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const SI=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),kI=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!kI)throw new Error("Non little-endian hardware is not supported");Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function PI(t){if(typeof t!="string")throw new TypeError(`utf8ToBytes expected string, got ${typeof t}`);return new TextEncoder().encode(t)}function Ky(t){if(typeof t=="string"&&(t=PI(t)),!(t instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof t})`);return t}class TI{clone(){return this._cloneInto()}}function II(t){const e=n=>t().update(Ky(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function BI(t){const e=(n,i)=>t(i).update(Ky(n)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}const[j4,F4,D4]=[[],[],[]],OI=BigInt(0),ic=BigInt(1),MI=BigInt(2),RI=BigInt(7),NI=BigInt(256),jI=BigInt(113);for(let t=0,e=ic,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],j4.push(2*(5*n+r)),F4.push((t+1)*(t+2)/2%64);let i=OI;for(let o=0;o<7;o++)e=(e< >RI)*jI)%NI,e&MI&&(i^=ic<<(ic< r>32?vu.rotlBH(t,e,r):vu.rotlSH(t,e,r),o2=(t,e,r)=>r>32?vu.rotlBL(t,e,r):vu.rotlSL(t,e,r);function LI(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let s=0;s<10;s++)r[s]=t[s]^t[s+10]^t[s+20]^t[s+30]^t[s+40];for(let s=0;s<10;s+=2){const a=(s+8)%10,l=(s+2)%10,c=r[l],u=r[l+1],f=i2(c,u,1)^r[a],h=o2(c,u,1)^r[a+1];for(let p=0;p<50;p+=10)t[s+p]^=f,t[s+p+1]^=h}let i=t[2],o=t[3];for(let s=0;s<24;s++){const a=F4[s],l=i2(i,o,a),c=o2(i,o,a),u=j4[s];i=t[u],o=t[u+1],t[u]=l,t[u+1]=c}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)r[a]=t[s+a];for(let a=0;a<10;a++)t[s+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=FI[n],t[1]^=DI[n]}r.fill(0)}class L0 extends TI{constructor(e,r,n,i=!1,o=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,ca.number(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=SI(this.state)}keccak(){LI(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){ca.exists(this);const{blockLen:r,state:n}=this;e=Ky(e);const i=e.length;for(let o=0;o=n&&this.keccak();const s=Math.min(n-this.posOut,o-i);e.set(r.subarray(this.posOut,this.posOut+s),i),this.posOut+=s,i+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return ca.number(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(ca.output(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:o,enableXOF:s}=this;return e||(e=new L0(r,n,i,s,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=n,e.outputLen=i,e.enableXOF=s,e.destroyed=this.destroyed,e}}const Xo=(t,e,r)=>II(()=>new L0(e,t,r));Xo(6,144,224/8);Xo(6,136,256/8);Xo(6,104,384/8);Xo(6,72,512/8);Xo(1,144,224/8);const UI=Xo(1,136,256/8);Xo(1,104,384/8);Xo(1,72,512/8);const L4=(t,e,r)=>BI((n={})=>new L0(e,t,n.dkLen===void 0?r:n.dkLen,!0));L4(31,168,128/8);L4(31,136,256/8);function Hr(t,e){const r=e||"hex",n=UI($i(t,{strict:!1})?Ls(t):t);return r==="bytes"?n:Qi(n)}const zI=t=>Hr(Ls(t));function U4(t){const e=ZT(t),r=eI(t)||[];return zI(`${e}(${r.map(({type:n})=>n).join(",")})`)}const z4=t=>U4(t);class yu extends me{constructor({address:e}){super(`Address "${e}" is invalid.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}const qI=/^0x[a-fA-F0-9]{40}$/;function fl(t){return qI.test(t)}function Hi(t){return typeof t[0]=="string"?Qy(t):$I(t)}function $I(t){let e=0;for(const i of t)e+=i.length;const r=new Uint8Array(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function Qy(t){return`0x${t.reduce((e,r)=>e+r.replace("0x",""),"")}`}function Wt(t,e,r,{strict:n}={}){return $i(t,{strict:!1})?WI(t,e,r,{strict:n}):HI(t,e,r,{strict:n})}function q4(t,e){if(typeof e=="number"&&e>0&&e>Gt(t)-1)throw new _4({offset:e,position:"start",size:Gt(t)})}function $4(t,e,r){if(typeof e=="number"&&typeof r=="number"&&Gt(t)!==r-e)throw new _4({offset:r,position:"end",size:Gt(t)})}function HI(t,e,r,{strict:n}={}){q4(t,e);const i=t.slice(e,r);return n&&$4(i,e,r),i}function WI(t,e,r,{strict:n}={}){q4(t,e);const i=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return n&&$4(i,e,r),i}function Ju(t,e){if(t.length!==e.length)throw new zT({expectedLength:t.length,givenLength:e.length});const r=GI({params:t,values:e}),n=Yy(r);return n.length===0?"0x":n}function GI({params:t,values:e}){const r=[];for(let n=0;n 0?Hi([a,s]):a}}if(i)return{dynamic:!0,encoded:s}}return{dynamic:!1,encoded:Hi(o.map(({encoded:s})=>s))}}function QI(t,{param:e}){const[r,n]=e.type.split("bytes");if(!n){const i=Math.ceil(Gt(t)/32),o=[];for(let s=0;si))}}function U0(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}function Yu({abi:t,args:e=[],name:r}){const n=t.filter(i=>"name"in i&&i.name===r);if(n.length!==0){if(n.length===1)return n[0];for(const i of n){if(!("inputs"in i))continue;if(!e||e.length===0){if(!i.inputs||i.inputs.length===0)return i;continue}if(!i.inputs||i.inputs.length===0||i.inputs.length!==e.length)continue;if(e.every((s,a)=>{const l="inputs"in i&&i.inputs[a];return l?F1(s,l):!1}))return i}return n[0]}}function F1(t,e){const r=typeof t,n=e.type;switch(n){case"address":return fl(t);case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in e?Object.values(e.components).every((i,o)=>F1(Object.values(t)[o],i)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||t instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(t)&&t.every(i=>F1(i,{...e,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function Xy({abi:t,eventName:e,args:r}){let n=t[0];if(e&&(n=Yu({abi:t,args:r,name:e}),!n))throw new n2(e,{docsPath:"/docs/contract/encodeEventTopics"});if(n.type!=="event")throw new n2(void 0,{docsPath:"/docs/contract/encodeEventTopics"});const i=Ys(n),o=z4(i);let s=[];if(r&&"inputs"in n){const a=n.inputs?.filter(c=>"indexed"in c&&c.indexed),l=Array.isArray(r)?r:Object.values(r).length>0?a?.map(c=>r[c.name])??[]:[];l.length>0&&(s=a?.map((c,u)=>Array.isArray(l[u])?l[u].map((f,h)=>s2({param:c,value:l[u][h]})):l[u]?s2({param:c,value:l[u]}):null)??[])}return[o,...s]}function s2({param:t,value:e}){if(t.type==="string"||t.type==="bytes")return Hr(Ls(e));if(t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/))throw new YT(t.type);return Ju([t],[e])}function z0(t,{method:e}){const r={};return t.transport.type==="fallback"&&t.transport.onResponse?.(({method:n,response:i,status:o,transport:s})=>{o==="success"&&e===n&&(r[i]=s.request)}),n=>r[n]||t.request}async function H4(t,{address:e,abi:r,args:n,eventName:i,fromBlock:o,strict:s,toBlock:a}){const l=z0(t,{method:"eth_newFilter"}),c=i?Xy({abi:r,args:n,eventName:i}):void 0,u=await t.request({method:"eth_newFilter",params:[{address:e,fromBlock:typeof o=="bigint"?Fe(o):o,toBlock:typeof a=="bigint"?Fe(a):a,topics:c}]});return{abi:r,args:n,eventName:i,id:u,request:l(u),strict:s,type:"event"}}function Yn(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}const W4=t=>Wt(U4(t),0,4);function Zo({abi:t,args:e,functionName:r}){let n=t[0];if(r&&(n=Yu({abi:t,args:e,name:r}),!n))throw new _h(r,{docsPath:"/docs/contract/encodeFunctionData"});if(n.type!=="function")throw new _h(void 0,{docsPath:"/docs/contract/encodeFunctionData"});const i=Ys(n),o=W4(i),s="inputs"in n&&n.inputs?Ju(n.inputs,e??[]):void 0;return Qy([o,s??"0x"])}const G4={1:"An `assert` condition failed.",17:"Arithmic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},eB={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},tB={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function Zy(t,e){const r=e?`${e}${t.toLowerCase()}`:t.substring(2).toLowerCase(),n=Hr(Di(r),"bytes"),i=(e?r.substring(`${e}0x`.length):r).split("");for(let o=0;o<40;o+=2)n[o>>1]>>4>=8&&i[o]&&(i[o]=i[o].toUpperCase()),(n[o>>1]&15)>=8&&i[o+1]&&(i[o+1]=i[o+1].toUpperCase());return`0x${i.join("")}`}function sn(t,e){if(!fl(t))throw new yu({address:t});return Zy(t,e)}function q0(t,e){if(e==="0x"&&t.length>0)throw new F0;if(Gt(e)&&Gt(e)<32)throw new Vy({data:e,params:t,size:Gt(e)});return rB({data:e,params:t})}function rB({data:t,params:e}){const r=[];let n=0;for(let i=0;i =Gt(t))throw new Vy({data:t,params:e,size:Gt(t)});const o=e[i],{consumed:s,value:a}=Qa({data:t,param:o,position:n});r.push(a),n+=s}return r}function Qa({data:t,param:e,position:r}){const n=U0(e.type);if(n){const[o,s]=n;return iB(t,{length:o,param:{...e,type:s},position:r})}if(e.type==="tuple")return cB(t,{param:e,position:r});if(e.type==="string")return lB(t,{position:r});if(e.type.startsWith("bytes"))return sB(t,{param:e,position:r});const i=Wt(t,r,r+32,{strict:!0});if(e.type.startsWith("uint")||e.type.startsWith("int"))return aB(i,{param:e});if(e.type==="address")return nB(i);if(e.type==="bool")return oB(i);throw new KT(e.type,{docsPath:"/docs/contract/decodeAbiParameters"})}function nB(t){return{consumed:32,value:Zy(Wt(t,-20))}}function iB(t,{param:e,length:r,position:n}){if(!r){const s=Or(Wt(t,n,n+32,{strict:!0})),a=Or(Wt(t,s,s+32,{strict:!0}));let l=0;const c=[];for(let u=0;u48?Hy(t,{signed:r}):Or(t,{signed:r})}}function lB(t,{position:e}){const r=Or(Wt(t,e,e+32,{strict:!0})),n=Or(Wt(t,r,r+32,{strict:!0}));if(n===0)return{consumed:32,value:""};const i=P4(Is(Wt(t,r+32,r+32+n,{strict:!0})));return{consumed:32,value:i}}function cB(t,{param:e,position:r}){const n=e.components.length===0||e.components.some(({name:s})=>!s),i=n?[]:{};let o=0;if(Sh(e)){const s=Or(Wt(t,r,r+32,{strict:!0}));for(let a=0;a o.type==="error"&&r===W4(Ys(o)));if(!i)throw new qT(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:i,args:"inputs"in i&&i.inputs&&i.inputs.length>0?q0(i.inputs,Wt(e,4)):void 0,errorName:i.name}}const Mr=(t,e,r)=>JSON.stringify(t,(n,i)=>{const o=typeof i=="bigint"?i.toString():i;return typeof e=="function"?e(n,o):o},r);function V4({abiItem:t,args:e,includeFunctionName:r=!0,includeName:n=!1}){if("name"in t&&"inputs"in t&&!!t.inputs)return`${r?t.name:""}(${t.inputs.map((i,o)=>`${n&&i.name?`${i.name}: `:""}${typeof e[o]=="object"?Mr(e[o]):e[o]}`).join(", ")})`}const fB={gwei:9,wei:18},dB={ether:-9,wei:9},hB={ether:-18,gwei:-9};function kh(t,e){let r=t.toString();const n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(e,"0");let[i,o]=[r.slice(0,r.length-e),r.slice(r.length-e)];return o=o.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${o?`.${o}`:""}`}function eb(t,e="wei"){return kh(t,fB[e])}function an(t,e="wei"){return kh(t,dB[e])}function $0(t){const e=Object.entries(t).map(([n,i])=>i===void 0||i===!1?null:[n,i]).filter(Boolean),r=e.reduce((n,[i])=>Math.max(n,i.length),0);return e.map(([n,i])=>` ${`${n}:`.padEnd(r+1)} ${i}`).join(` -`)}class pB extends me{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeConflictError"})}}class mB extends me{constructor(e,{account:r,docsPath:n,chain:i,data:o,gas:s,gasPrice:a,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:f,value:h}){const p=$0({chain:i&&`${i?.name} (id: ${i?.id})`,from:r?.address,to:f,value:typeof h<"u"&&`${eb(h)} ${i?.nativeCurrency.symbol||"ETH"}`,data:o,gas:s,gasPrice:typeof a<"u"&&`${an(a)} gwei`,maxFeePerGas:typeof l<"u"&&`${an(l)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${an(c)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",p].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionExecutionError"}),this.cause=e}}class K4 extends me{constructor({blockHash:e,blockNumber:r,blockTag:n,hash:i,index:o}){let s="Transaction";n&&o!==void 0&&(s=`Transaction at block time "${n}" at index "${o}"`),e&&o!==void 0&&(s=`Transaction at block hash "${e}" at index "${o}"`),r&&o!==void 0&&(s=`Transaction at block number "${r}" at index "${o}"`),i&&(s=`Transaction with hash "${i}"`),super(`${s} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionNotFoundError"})}}class Q4 extends me{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionReceiptNotFoundError"})}}class gB extends me{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WaitForTransactionReceiptTimeoutError"})}}class J4 extends me{constructor(e,{account:r,docsPath:n,chain:i,data:o,gas:s,gasPrice:a,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:f,value:h}){const p=r?Yn(r):void 0,g=$0({from:p?.address,to:f,value:typeof h<"u"&&`${eb(h)} ${i?.nativeCurrency.symbol||"ETH"}`,data:o,gas:s,gasPrice:typeof a<"u"&&`${an(a)} gwei`,maxFeePerGas:typeof l<"u"&&`${an(l)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${an(c)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",g].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CallExecutionError"}),this.cause=e}}class Xu extends me{constructor(e,{abi:r,args:n,contractAddress:i,docsPath:o,functionName:s,sender:a}){const l=Yu({abi:r,args:n,name:s}),c=l?V4({abiItem:l,args:n,includeFunctionName:!1,includeName:!1}):void 0,u=l?Ys(l,{includeName:!0}):void 0,f=$0({address:i&&dT(i),function:u,args:c&&c!=="()"&&`${[...Array(s?.length??0).keys()].map(()=>" ").join("")}${c}`,sender:a});super(e.shortMessage||`An unknown error occurred while executing the contract function "${s}".`,{cause:e,docsPath:o,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Contract Call:",f].filter(Boolean)}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionExecutionError"}),this.abi=r,this.args=n,this.cause=e,this.contractAddress=i,this.functionName=s,this.sender=a}}class vB extends me{constructor({abi:e,data:r,functionName:n,message:i}){let o,s,a;if(r&&r!=="0x"){o=uB({abi:e,data:r});const{abiItem:l,errorName:c,args:u}=o;if(c==="Error")a=u[0];else if(c==="Panic"){const[f]=u;a=G4[f]}else{const f=l?Ys(l,{includeName:!0}):void 0,h=l&&u?V4({abiItem:l,args:u,includeFunctionName:!1,includeName:!1}):void 0;s=[f?`Error: ${f}`:"",h&&h!=="()"?` ${[...Array(c?.length??0).keys()].map(()=>" ").join("")}${h}`:""]}}else i&&(a=i);super(a&&a!=="execution reverted"?[`The contract function "${n}" reverted with the following reason:`,a].join(` -`):`The contract function "${n}" reverted.`,{metaMessages:s}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.reason=a,this.data=o}}class yB extends me{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionZeroDataError"})}}class tb extends me{constructor({data:e,message:r}){super(r||""),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RawContractError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}const bB=3;function bu(t,{abi:e,address:r,args:n,docsPath:i,functionName:o,sender:s}){const{code:a,data:l,message:c,shortMessage:u}=t instanceof tb?t:t instanceof me?t.walk(h=>"data"in h):{};let f=t;return t instanceof F0?f=new yB({functionName:o}):a===bB&&(l||c||u)&&(f=new vB({abi:e,data:typeof l=="object"?l.data:l,functionName:o,message:u??c})),new Xu(f,{abi:e,args:n,contractAddress:r,docsPath:i,functionName:o,sender:s})}class Zu extends me{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the WalletClient."].join(` -`),{docsPath:e,docsSlug:"account"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountNotFoundError"})}}class xB extends me{constructor(e,{account:r,docsPath:n,chain:i,data:o,gas:s,gasPrice:a,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:f,value:h}){const p=$0({from:r?.address,to:f,value:typeof h<"u"&&`${eb(h)} ${i?.nativeCurrency.symbol||"ETH"}`,data:o,gas:s,gasPrice:typeof a<"u"&&`${an(a)} gwei`,maxFeePerGas:typeof l<"u"&&`${an(l)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${an(c)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",p].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EstimateGasExecutionError"}),this.cause=e}}class Ja extends me{constructor({cause:e,message:r}={}){const n=r?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}}Object.defineProperty(Ja,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(Ja,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class Ph extends me{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${an(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}}Object.defineProperty(Ph,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class D1 extends me{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${an(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}}Object.defineProperty(D1,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class L1 extends me{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}is higher than the next one expected.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}}Object.defineProperty(L1,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class U1 extends me{constructor({cause:e,nonce:r}={}){super([`Nonce provided for the transaction ${r?`(${r}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(` -`),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}}Object.defineProperty(U1,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported/});class z1 extends me{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}}Object.defineProperty(z1,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class q1 extends me{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` -`),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}}Object.defineProperty(q1,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});class $1 extends me{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}}Object.defineProperty($1,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class H1 extends me{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction is too low.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}}Object.defineProperty(H1,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class W1 extends me{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}}Object.defineProperty(W1,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class Th extends me{constructor({cause:e,maxPriorityFeePerGas:r,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${an(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${an(n)} gwei`:""}).`].join(` -`),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(Th,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class wB extends me{constructor({cause:e}){super(`An error occurred while executing: ${e?.message}`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}}class jc extends me{constructor({body:e,details:r,headers:n,status:i,url:o}){super("HTTP request failed.",{details:r,metaMessages:[i&&`Status: ${i}`,`URL: ${O0(o)}`,e&&`Request body: ${Mr(e)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=n,this.status=i,this.url=o}}class AB extends me{constructor({body:e,details:r,url:n}){super("WebSocket request failed.",{details:r,metaMessages:[`URL: ${O0(n)}`,`Request body: ${Mr(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WebSocketRequestError"})}}class H0 extends me{constructor({body:e,error:r,url:n}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${O0(n)}`,`Request body: ${Mr(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=r.code}}class G1 extends me{constructor({body:e,url:r}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${O0(r)}`,`Request body: ${Mr(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}}const EB=-1;class Jr extends me{constructor(e,{code:r,docsPath:n,metaMessages:i,shortMessage:o}){super(o,{cause:e,docsPath:n,metaMessages:i||e?.metaMessages}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.code=e instanceof H0?e.code:r??EB}}class Nl extends Jr{constructor(e,r){super(e,r),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=r.data}}class CB extends Jr{constructor(e){super(e,{code:-32700,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}}class _B extends Jr{constructor(e){super(e,{code:-32600,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}class SB extends Jr{constructor(e){super(e,{code:-32601,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}class kB extends Jr{constructor(e){super(e,{code:-32602,shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` -`)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}}class PB extends Jr{constructor(e){super(e,{code:-32603,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}class Y4 extends Jr{constructor(e){super(e,{code:-32e3,shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` -`)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}}class TB extends Jr{constructor(e){super(e,{code:-32001,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}class Ih extends Jr{constructor(e){super(e,{code:-32002,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}class X4 extends Jr{constructor(e){super(e,{code:-32003,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}class a2 extends Jr{constructor(e){super(e,{code:-32004,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}class IB extends Jr{constructor(e){super(e,{code:-32005,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}class BB extends Jr{constructor(e){super(e,{code:-32006,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}class _n extends Nl{constructor(e){super(e,{code:4001,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}class OB extends Nl{constructor(e){super(e,{code:4100,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}}class MB extends Nl{constructor(e){super(e,{code:4200,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}class RB extends Nl{constructor(e){super(e,{code:4900,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}class NB extends Nl{constructor(e){super(e,{code:4901,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}}class W0 extends Nl{constructor(e){super(e,{code:4902,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}class jB extends Jr{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}function rb(t){return t instanceof X4||t instanceof Y4||t instanceof H0&&t.code===Ja.code}function nb(t,e){const r=t.details.toLowerCase();return Ph.nodeMessage.test(r)?new Ph({cause:t,maxFeePerGas:e?.maxFeePerGas}):D1.nodeMessage.test(r)?new D1({cause:t,maxFeePerGas:e?.maxFeePerGas}):L1.nodeMessage.test(r)?new L1({cause:t,nonce:e?.nonce}):U1.nodeMessage.test(r)?new U1({cause:t,nonce:e?.nonce}):z1.nodeMessage.test(r)?new z1({cause:t,nonce:e?.nonce}):q1.nodeMessage.test(r)?new q1({cause:t}):$1.nodeMessage.test(r)?new $1({cause:t,gas:e?.gas}):H1.nodeMessage.test(r)?new H1({cause:t,gas:e?.gas}):W1.nodeMessage.test(r)?new W1({cause:t}):Th.nodeMessage.test(r)?new Th({cause:t,maxFeePerGas:e?.maxFeePerGas,maxPriorityFeePerGas:e?.maxPriorityFeePerGas}):r.match(Ja.nodeMessage)||"code"in t.cause&&t.cause?.code===Ja.code?new Ja({cause:t,message:t.cause.details||t.details}):new wB({cause:t.cause.cause})}function FB(t,{docsPath:e,...r}){let n=t;return rb(t)&&(n=nb(t,r)),new xB(n,{docsPath:e,...r})}function ib(t,{formatter:e}){return e?Object.keys(e({})).reduce((n,i)=>(t?.hasOwnProperty(i)&&(n[i]=t[i]),n),{}):{}}function G0(t){const{account:e,gasPrice:r,maxFeePerGas:n,maxPriorityFeePerGas:i,to:o}=t,s=e?Yn(e):void 0;if(s&&!fl(s.address))throw new yu({address:s.address});if(o&&!fl(o))throw new yu({address:o});if(typeof r<"u"&&(typeof n<"u"||typeof i<"u"))throw new pB;if(n&&n>2n**256n-1n)throw new Ph({maxFeePerGas:n});if(i&&n&&i>n)throw new Th({maxFeePerGas:n,maxPriorityFeePerGas:i})}class DB extends me{constructor({blockHash:e,blockNumber:r}){let n="Block";e&&(n=`Block at hash "${e}"`),r&&(n=`Block at number "${r}"`),super(`${n} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}}async function xu(t,{blockHash:e,blockNumber:r,blockTag:n="latest",includeTransactions:i=!1}={}){const o=r!==void 0?Fe(r):void 0;let s=null;if(e?s=await t.request({method:"eth_getBlockByHash",params:[e,i]}):s=await t.request({method:"eth_getBlockByNumber",params:[o||n,i]}),!s)throw new DB({blockHash:e,blockNumber:r});return Ml(s,{formatter:t.chain?.formatters?.block||I4})}async function Z4(t){const e=await t.request({method:"eth_gasPrice"});return BigInt(e)}async function e8(t,{address:e,blockTag:r="latest",blockNumber:n}){const i=await t.request({method:"eth_getTransactionCount",params:[e,n?Fe(n):r]});return Or(i)}const Mm=1500000000n;async function t8(t,e){const{account:r,gas:n,gasPrice:i,maxFeePerGas:o,maxPriorityFeePerGas:s,nonce:a}=e;if(!r)throw new Zu;const l=Yn(r),c=await xu(t,{blockTag:"latest"}),u={...e,from:l.address};if(typeof a>"u"&&(u.nonce=await e8(t,{address:l.address,blockTag:"pending"})),c.baseFeePerGas){if(typeof i<"u")throw new me("Chain does not support legacy `gasPrice`.");if(typeof o>"u")u.maxPriorityFeePerGas=s??Mm,u.maxFeePerGas=c.baseFeePerGas*120n/100n+u.maxPriorityFeePerGas;else{if(typeof s>"u"&&o "u"&&(u.gasPrice=await Z4(t)*120n/100n)}return typeof n>"u"&&(u.gas=await ob(t,{...u,account:{address:l.address,type:"json-rpc"}})),G0(u),u}async function ob(t,e){const r=e.account??t.account;if(!r)throw new Zu({docsPath:"/docs/actions/public/estimateGas"});const n=Yn(r);try{const{accessList:i,blockNumber:o,blockTag:s,data:a,gas:l,gasPrice:c,maxFeePerGas:u,maxPriorityFeePerGas:f,nonce:h,to:p,value:g,...v}=n.type==="local"?await t8(t,e):e,y=(o?Fe(o):void 0)||s;G0(e);const w=t.chain?.formatters?.transactionRequest,_=Ml({from:n.address,accessList:i,data:a,gas:l,gasPrice:c,maxFeePerGas:u,maxPriorityFeePerGas:f,nonce:h,to:p,value:g,...ib(v,{formatter:w})},{formatter:w||R0}),I=await t.request({method:"eth_estimateGas",params:y?[_,y]:[_]});return BigInt(I)}catch(i){throw FB(i,{...e,account:n,chain:t.chain})}}async function LB(t,{abi:e,address:r,args:n,functionName:i,...o}){const s=Zo({abi:e,args:n,functionName:i});try{return await ob(t,{data:s,to:r,...o})}catch(a){const l=o.account?Yn(o.account):void 0;throw bu(a,{abi:e,address:r,args:n,docsPath:"/docs/contract/simulateContract",functionName:i,sender:l?.address})}}const Rm="/docs/contract/decodeFunctionResult";function jl({abi:t,args:e,functionName:r,data:n}){let i=t[0];if(r&&(i=Yu({abi:t,args:e,name:r}),!i))throw new _h(r,{docsPath:Rm});if(i.type!=="function")throw new _h(void 0,{docsPath:Rm});if(!i.outputs)throw new WT(i.name,{docsPath:Rm});const o=q0(i.outputs,n);if(o&&o.length>1)return o;if(o&&o.length===1)return o[0]}const V1=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],r8=[{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],l2=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],c2=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]}],UB=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}],zB="0x82ad56cb";function qB(t,{docsPath:e,...r}){let n=t;return rb(t)&&(n=nb(t,r)),new J4(n,{docsPath:e,...r})}const Nm=new Map;function sb({fn:t,id:e,shouldSplitBatch:r,wait:n=0}){const i=async()=>{const c=a();o();const u=c.map(({args:f})=>f);u.length!==0&&t(u).then(f=>{c.forEach(({pendingPromise:h},p)=>h.resolve?.([f[p],f]))}).catch(f=>{c.forEach(({pendingPromise:h})=>h.reject?.(f))})},o=()=>Nm.delete(e),s=()=>a().map(({args:c})=>c),a=()=>Nm.get(e)||[],l=c=>Nm.set(e,[...a(),c]);return{flush:o,async schedule(c){const u={},f=new Promise((g,v)=>{u.resolve=g,u.reject=v});return r?.([...s(),c])&&i(),a().length>0?(l({args:c,pendingPromise:u}),f):(l({args:c,pendingPromise:u}),setTimeout(i,n),f)}}}async function V0(t,e){const{account:r,batch:n=Boolean(t.batch?.multicall),blockNumber:i,blockTag:o="latest",accessList:s,data:a,gas:l,gasPrice:c,maxFeePerGas:u,maxPriorityFeePerGas:f,nonce:h,to:p,value:g,...v}=e,x=r?Yn(r):void 0;try{G0(e);const w=(i?Fe(i):void 0)||o,_=t.chain?.formatters?.transactionRequest,I=Ml({from:x?.address,accessList:s,data:a,gas:l,gasPrice:c,maxFeePerGas:u,maxPriorityFeePerGas:f,nonce:h,to:p,value:g,...ib(v,{formatter:_})},{formatter:_||R0});if(n&&$B({request:I}))try{return await HB(t,{...I,blockNumber:i,blockTag:o})}catch(D){if(!(D instanceof C4)&&!(D instanceof R1))throw D}const M=await t.request({method:"eth_call",params:w?[I,w]:[I]});return M==="0x"?{data:void 0}:{data:M}}catch(y){const w=WB(y),{offchainLookup:_,offchainLookupSignature:I}=await Le(()=>import("./ccip.18b432b8.js"),[]);if(w?.slice(0,10)===I&&p)return{data:await _(t,{data:w,to:p})};throw qB(y,{...e,account:x,chain:t.chain})}}function $B({request:t}){const{data:e,to:r,...n}=t;return!(!e||e.startsWith(zB)||!r||Object.values(n).filter(i=>typeof i<"u").length>0)}async function HB(t,e){const{batchSize:r=1024,wait:n=0}=typeof t.batch?.multicall=="object"?t.batch.multicall:{},{blockNumber:i,blockTag:o="latest",data:s,multicallAddress:a,to:l}=e;let c=a;if(!c){if(!t.chain)throw new C4;c=Ol({blockNumber:i,chain:t.chain,contract:"multicall3"})}const f=(i?Fe(i):void 0)||o,{schedule:h}=sb({id:`${t.uid}.${f}`,wait:n,shouldSplitBatch(v){return v.reduce((y,{data:w})=>y+(w.length-2),0)>r*2},fn:async v=>{const x=v.map(_=>({allowFailure:!0,callData:_.data,target:_.to})),y=Zo({abi:V1,args:[x],functionName:"aggregate3"}),w=await t.request({method:"eth_call",params:[{data:y,to:c},f]});return jl({abi:V1,args:[x],functionName:"aggregate3",data:w||"0x"})}}),[{returnData:p,success:g}]=await h({data:s,to:l});if(!g)throw new tb({data:p});return p==="0x"?{data:void 0}:{data:p}}function WB(t){if(!(t instanceof me))return;const e=t.walk();return typeof e.data=="object"?e.data.data:e.data}async function $o(t,{abi:e,address:r,args:n,functionName:i,...o}){const s=Zo({abi:e,args:n,functionName:i});try{const{data:a}=await V0(t,{data:s,to:r,...o});return jl({abi:e,args:n,functionName:i,data:a||"0x"})}catch(a){throw bu(a,{abi:e,address:r,args:n,docsPath:"/docs/contract/readContract",functionName:i})}}async function GB(t,{abi:e,address:r,args:n,dataSuffix:i,functionName:o,...s}){const a=s.account?Yn(s.account):void 0,l=Zo({abi:e,args:n,functionName:o});try{const{data:c}=await V0(t,{batch:!1,data:`${l}${i?i.replace("0x",""):""}`,to:r,...s});return{result:jl({abi:e,args:n,functionName:o,data:c||"0x"}),request:{abi:e,address:r,args:n,functionName:o,...s}}}catch(c){throw bu(c,{abi:e,address:r,args:n,docsPath:"/docs/contract/simulateContract",functionName:o,sender:a?.address})}}const jm=new Map,u2=new Map;let VB=0;function Fl(t,e,r){const n=++VB,i=()=>jm.get(t)||[],o=()=>{const u=i();jm.set(t,u.filter(f=>f.id!==n))},s=()=>{const u=u2.get(t);i().length===1&&u&&u(),o()},a=i();if(jm.set(t,[...a,{id:n,fns:e}]),a&&a.length>0)return s;const l={};for(const u in e)l[u]=(...f)=>{const h=i();h.length!==0&&h.forEach(p=>p.fns[u]?.(...f))};const c=r(l);return typeof c=="function"&&u2.set(t,c),s}async function Bh(t){return new Promise(e=>setTimeout(e,t))}function ef(t,{emitOnBegin:e,initialWaitTime:r,interval:n}){let i=!0;const o=()=>i=!1;return(async()=>{let a;e&&(a=await t({unpoll:o}));const l=await r?.(a)??n;await Bh(l);const c=async()=>{!i||(await t({unpoll:o}),await Bh(n),c())};c()})(),o}const KB=new Map,QB=new Map;function JB(t){const e=(i,o)=>({clear:()=>o.delete(i),get:()=>o.get(i),set:s=>o.set(i,s)}),r=e(t,KB),n=e(t,QB);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function YB(t,{cacheKey:e,maxAge:r=1/0}){const n=JB(e),i=n.response.get();if(i&&r>0&&new Date().getTime()-i.created.getTime() `blockNumber.${t}`;async function tf(t,{maxAge:e=t.pollingInterval}={}){const r=await YB(()=>t.request({method:"eth_blockNumber"}),{cacheKey:XB(t.uid),maxAge:e});return BigInt(r)}const f2="/docs/contract/decodeEventLog";function ab({abi:t,data:e,strict:r,topics:n}){const i=r??!0,[o,...s]=n;if(!o)throw new $T({docsPath:f2});const a=t.find(g=>g.type==="event"&&o===z4(Ys(g)));if(!(a&&"name"in a)||a.type!=="event")throw new HT(o,{docsPath:f2});const{name:l,inputs:c}=a,u=c?.some(g=>!("name"in g&&g.name));let f=u?[]:{};const h=c.filter(g=>"indexed"in g&&g.indexed);if(s.length>0)for(let g=0;g !("indexed"in g&&g.indexed));if(p.length>0){if(e&&e!=="0x")try{const g=q0(p,e);if(g)if(u)f=[...f,...g];else for(let v=0;v 0?f:void 0}}function ZB({param:t,value:e}){return t.type==="string"||t.type==="bytes"||t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/)?e:(q0([t],e)||[])[0]}async function K0(t,{filter:e}){const r="strict"in e&&e.strict;return(await e.request({method:"eth_getFilterChanges",params:[e.id]})).map(i=>{if(typeof i=="string")return i;try{const{eventName:o,args:s}="abi"in e&&e.abi?ab({abi:e.abi,data:i.data,topics:i.topics,strict:r}):{eventName:void 0,args:void 0};return Us(i,{args:s,eventName:o})}catch(o){let s,a;if(o instanceof gu||o instanceof D0){if("strict"in e&&e.strict)return;s=o.abiItem.name,a=o.abiItem.inputs?.some(l=>!("name"in l&&l.name))}return Us(i,{args:a?[]:{},eventName:s})}}).filter(Boolean)}async function lb(t,{address:e,blockHash:r,fromBlock:n,toBlock:i,event:o,args:s,strict:a}={}){const l=a??!1;let c=[];o&&(c=Xy({abi:[o],eventName:o.name,args:s}));let u;return r?u=await t.request({method:"eth_getLogs",params:[{address:e,topics:c,blockHash:r}]}):u=await t.request({method:"eth_getLogs",params:[{address:e,topics:c,fromBlock:typeof n=="bigint"?Fe(n):n,toBlock:typeof i=="bigint"?Fe(i):i}]}),u.map(f=>{try{const{eventName:h,args:p}=o?ab({abi:[o],data:f.data,topics:f.topics,strict:l}):{eventName:void 0,args:void 0};return Us(f,{args:p,eventName:h})}catch(h){let p,g;if(h instanceof gu||h instanceof D0){if(l)return;p=h.abiItem.name,g=h.abiItem.inputs?.some(v=>!("name"in v&&v.name))}return Us(f,{args:g?[]:{},eventName:p})}}).filter(Boolean)}async function Q0(t,{filter:e}){return e.request({method:"eth_uninstallFilter",params:[e.id]})}function eO(t,{abi:e,address:r,args:n,batch:i=!0,eventName:o,onError:s,onLogs:a,pollingInterval:l=t.pollingInterval,strict:c}){const u=Mr(["watchContractEvent",r,n,i,t.uid,o,l]),f=c??!1;return Fl(u,{onLogs:a,onError:s},h=>{let p,g,v=!1;const x=ef(async()=>{if(!v){try{g=await H4(t,{abi:e,address:r,args:n,eventName:o,strict:f})}catch{}v=!0;return}try{let y;if(g)y=await K0(t,{filter:g});else{const w=await tf(t);p&&p!==w?y=await lb(t,{address:r,args:n,fromBlock:p+1n,toBlock:w,event:Yu({abi:e,name:o})}):y=[],p=w}if(y.length===0)return;i?h.onLogs(y):y.forEach(w=>h.onLogs([w]))}catch(y){h.onError?.(y)}},{emitOnBegin:!0,interval:l});return async()=>{g&&await Q0(t,{filter:g}),x()}})}function tO(t,{docsPath:e,...r}){let n=t;return rb(t)&&(n=nb(t,r)),new mB(n,{docsPath:e,...r})}async function Oh(t){const e=await t.request({method:"eth_chainId"});return Or(e)}async function cb(t,e){const{account:r=t.account,chain:n=t.chain,accessList:i,data:o,gas:s,gasPrice:a,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:f,value:h,...p}=e;if(!r)throw new Zu({docsPath:"/docs/actions/wallet/sendTransaction"});const g=Yn(r);try{G0(e);let v;if(n!==null&&(v=await Oh(t),gT({currentChainId:v,chain:n})),g.type==="local"){const w=await t8(t,{account:g,accessList:i,chain:n,data:o,gas:s,gasPrice:a,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:f,value:h,...p});v||(v=await Oh(t));const _=await g.signTransaction({chainId:v,...w});return await t.request({method:"eth_sendRawTransaction",params:[_]})}const x=n?.formatters?.transactionRequest,y=Ml({accessList:i,data:o,from:g.address,gas:s,gasPrice:a,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:f,value:h,...ib(p,{formatter:x})},{formatter:x||R0});return await t.request({method:"eth_sendTransaction",params:[y]})}catch(v){throw tO(v,{...e,account:g,chain:e.chain||void 0})}}async function rO(t,{abi:e,address:r,args:n,dataSuffix:i,functionName:o,...s}){const a=Zo({abi:e,args:n,functionName:o});return await cb(t,{data:`${a}${i?i.replace("0x",""):""}`,to:r,...s})}async function n8(t,{address:e,args:r,event:n,fromBlock:i,strict:o,toBlock:s}={}){const a=z0(t,{method:"eth_newFilter"});let l=[];n&&(l=Xy({abi:[n],eventName:n.name,args:r}));const c=await t.request({method:"eth_newFilter",params:[{address:e,fromBlock:typeof i=="bigint"?Fe(i):i,toBlock:typeof s=="bigint"?Fe(s):s,...l.length?{topics:l}:{}}]});return{abi:n?[n]:void 0,args:r,eventName:n?n.name:void 0,id:c,request:a(c),strict:o,type:"event"}}const Fm="/docs/contract/encodeDeployData";function i8({abi:t,args:e,bytecode:r}){if(!e||e.length===0)return r;const n=t.find(o=>"type"in o&&o.type==="constructor");if(!n)throw new DT({docsPath:Fm});if(!("inputs"in n))throw new r2({docsPath:Fm});if(!n.inputs||n.inputs.length===0)throw new r2({docsPath:Fm});const i=Ju(n.inputs,e);return Qy([r,i])}function nO(t,{abi:e,args:r,bytecode:n,...i}){const o=i8({abi:e,args:r,bytecode:n});return cb(t,{...i,data:o})}async function iO(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r?Fe(r):void 0,o=await t.request({method:"eth_getBalance",params:[e,i||n]});return BigInt(o)}async function oO(t,{blockHash:e,blockNumber:r,blockTag:n="latest"}={}){const i=r!==void 0?Fe(r):void 0;let o;return e?o=await t.request({method:"eth_getBlockTransactionCountByHash",params:[e]}):o=await t.request({method:"eth_getBlockTransactionCountByNumber",params:[i||n]}),Or(o)}async function sO(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r!==void 0?Fe(r):void 0,o=await t.request({method:"eth_getCode",params:[e,i||n]});if(o!=="0x")return o}function o8(t,{delay:e=100,retryCount:r=2,shouldRetry:n=()=>!0}={}){return new Promise((i,o)=>{const s=async({count:a=0}={})=>{const l=async({error:c})=>{const u=typeof e=="function"?e({count:a,error:c}):e;u&&await Bh(u),s({count:a+1})};try{const c=await t();i(c)}catch(c){if(a "code"in t?t.code!==-1&&t.code!==-32004&&t.code!==-32005&&t.code!==-32042&&t.code!==-32603:t instanceof jc&&t.status?t.status!==403&&t.status!==408&&t.status!==413&&t.status!==429&&t.status!==500&&t.status!==502&&t.status!==503&&t.status!==504:!1;function aO(t,{retryDelay:e=150,retryCount:r=3}={}){return async n=>o8(async()=>{try{return await t(n)}catch(i){const o=i;throw o.code===-32700?new CB(o):o.code===-32600?new _B(o):o.code===-32601?new SB(o):o.code===-32602?new kB(o):o.code===-32603?new PB(o):o.code===-32e3?new Y4(o):o.code===-32001?new TB(o):o.code===-32002?new Ih(o):o.code===-32003?new X4(o):o.code===-32004?new a2(o):o.code===-32005?new IB(o):o.code===-32006?new BB(o):o.code===-32042?new a2(o):o.code===4001?new _n(o):o.code===4100?new OB(o):o.code===4200?new MB(o):o.code===4900?new RB(o):o.code===4901?new NB(o):o.code===4902?new W0(o):i instanceof me?i:new jB(o)}},{delay:({count:i,error:o})=>{if(o&&o instanceof jc){const s=o?.headers?.get("Retry-After");if(s?.match(/\d/))return parseInt(s)*1e3}return~~(1<!s8(i)})}const lO=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,cO=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function a8(t,{errorInstance:e,timeout:r,signal:n}){return new Promise((i,o)=>{(async()=>{let s;try{const a=new AbortController;r>0&&(s=setTimeout(()=>{n?a.abort():o(e)},r)),i(await t({signal:a?.signal}))}catch(a){a.name==="AbortError"&&o(e),o(a)}finally{clearTimeout(s)}})()})}let K1=0;async function uO(t,{body:e,fetchOptions:r={},timeout:n=1e4}){const{headers:i,method:o,signal:s}=r;try{const a=await a8(async({signal:c})=>await fetch(t,{...r,body:Array.isArray(e)?Mr(e.map(f=>({jsonrpc:"2.0",id:K1++,...f}))):Mr({jsonrpc:"2.0",id:K1++,...e}),headers:{...i,"Content-Type":"application/json"},method:o||"POST",signal:s||(n>0?c:void 0)}),{errorInstance:new G1({body:e,url:t}),timeout:n,signal:!0});let l;if(a.headers.get("Content-Type")?.startsWith("application/json")?l=await a.json():l=await a.text(),!a.ok)throw new jc({body:e,details:Mr(l.error)||a.statusText,headers:a.headers,status:a.status,url:t});return l}catch(a){throw a instanceof jc||a instanceof G1?a:new jc({body:e,details:a.message,url:t})}}const Dm=new Map;async function Lm(t){const e=new URL(t),r=e.toString();let n=Dm.get(r);if(n)return n;const{schedule:i}=sb({id:r,fn:async()=>{let a=await Le(()=>import("./browser.59b65e21.js"),[]);a.default?.constructor?a=a.default:a=a.WebSocket;const l=new a(e),c=new Map,u=new Map,f=({data:p})=>{const g=JSON.parse(p),v=g.method==="eth_subscription",x=v?g.params.subscription:g.id,y=v?u:c,w=y.get(x);w&&w({data:p}),v||y.delete(x)},h=()=>{Dm.delete(r),l.removeEventListener("close",h),l.removeEventListener("message",f)};return l.addEventListener("close",h),l.addEventListener("message",f),l.readyState===a.CONNECTING&&await new Promise((p,g)=>{!l||(l.onopen=p,l.onerror=g)}),n=Object.assign(l,{requests:c,subscriptions:u}),Dm.set(r,n),[n]}}),[o,[s]]=await i();return s}function fO(t,{body:e,onResponse:r}){if(t.readyState===t.CLOSED||t.readyState===t.CLOSING)throw new AB({body:e,url:t.url,details:"Socket is closed."});const n=K1++,i=({data:o})=>{const s=JSON.parse(o);typeof s.id=="number"&&n!==s.id||(r?.(s),e.method==="eth_subscribe"&&typeof s.result=="string"&&t.subscriptions.set(s.result,i),e.method==="eth_unsubscribe"&&t.subscriptions.delete(e.params?.[0]))};return t.requests.set(n,i),t.send(JSON.stringify({jsonrpc:"2.0",...e,id:n})),t}async function dO(t,{body:e,timeout:r=1e4}){return a8(()=>new Promise(n=>Ya.webSocket(t,{body:e,onResponse:n})),{errorInstance:new G1({body:e,url:t.url}),timeout:r})}const Ya={http:uO,webSocket:fO,webSocketAsync:dO};function l8({domain:t,message:e,primaryType:r,types:n}){const i=n,o=(s,a)=>{for(const l of s){const{name:c,type:u}=l,f=u,h=a[c],p=f.match(cO);if(p&&(typeof h=="number"||typeof h=="bigint")){const[x,y,w]=p;Fe(h,{signed:y==="int",size:parseInt(w)/8})}if(f==="address"&&typeof h=="string"&&!fl(h))throw new yu({address:h});const g=f.match(lO);if(g){const[x,y]=g;if(y&&Gt(h)!==parseInt(y))throw new GT({expectedSize:parseInt(y),givenSize:Gt(h)})}const v=i[f];v&&o(v,h)}};if(i.EIP712Domain&&t&&o(i.EIP712Domain,t),r!=="EIP712Domain"){const s=i[r];o(s,e)}}function hO({domain:t,message:e,primaryType:r,types:n}){const i=typeof t>"u"?{}:t,o={EIP712Domain:[i?.name&&{name:"name",type:"string"},i?.version&&{name:"version",type:"string"},i?.chainId&&{name:"chainId",type:"uint256"},i?.verifyingContract&&{name:"verifyingContract",type:"address"},i?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean),...n};l8({domain:i,message:e,primaryType:r,types:o});const s=["0x1901"];return i&&s.push(pO({domain:i,types:o})),r!=="EIP712Domain"&&s.push(c8({data:e,primaryType:r,types:o})),Hr(Hi(s))}function pO({domain:t,types:e}){return c8({data:t,primaryType:"EIP712Domain",types:e})}function c8({data:t,primaryType:e,types:r}){const n=u8({data:t,primaryType:e,types:r});return Hr(n)}function u8({data:t,primaryType:e,types:r}){const n=[{type:"bytes32"}],i=[mO({primaryType:e,types:r})];for(const o of r[e]){const[s,a]=d8({types:r,name:o.name,type:o.type,value:t[o.name]});n.push(s),i.push(a)}return Ju(n,i)}function mO({primaryType:t,types:e}){const r=Qi(gO({primaryType:t,types:e}));return Hr(r)}function gO({primaryType:t,types:e}){let r="";const n=f8({primaryType:t,types:e});n.delete(t);const i=[t,...Array.from(n).sort()];for(const o of i)r+=`${o}(${e[o].map(({name:s,type:a})=>`${a} ${s}`).join(",")})`;return r}function f8({primaryType:t,types:e},r=new Set){const i=t.match(/^\w*/u)?.[0];if(r.has(i)||e[i]===void 0)return r;r.add(i);for(const o of e[i])f8({primaryType:o.type,types:e},r);return r}function d8({types:t,name:e,type:r,value:n}){if(t[r]!==void 0)return[{type:"bytes32"},Hr(u8({data:n,primaryType:r,types:t}))];if(r==="bytes")return n=`0x${(n.length%2?"0":"")+n.slice(2)}`,[{type:"bytes32"},Hr(n)];if(r==="string")return[{type:"bytes32"},Hr(Qi(n))];if(r.lastIndexOf("]")===r.length-1){const i=r.slice(0,r.lastIndexOf("[")),o=n.map(s=>d8({name:e,type:i,types:t,value:s}));return[{type:"bytes32"},Hr(Ju(o.map(([s])=>s),o.map(([,s])=>s)))]}return[{type:r},n]}function vO(t,e){const r=(()=>typeof t=="string"?Di(t):t.raw instanceof Uint8Array?t.raw:Ls(t.raw))(),n=Di(`Ethereum Signed Message: -${r.length}`);return Hr(Hi([n,r]),e)}function h8(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;const e=`0x${t.slice(1,65)}`;return $i(e)?e:null}function p8(t){let e=new Uint8Array(32).fill(0);if(!t)return mu(e);const r=t.split(".");for(let n=r.length-1;n>=0;n-=1){const i=h8(r[n]),o=i?Ls(i):Hr(Di(r[n]),"bytes");e=Hr(Hi([e,o]),"bytes")}return mu(e)}function yO(t){return`[${t.slice(2)}]`}function bO(t){const e=new Uint8Array(32).fill(0);return t?h8(t)||Hr(Di(t)):mu(e)}function J0(t){const e=t.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const r=new Uint8Array(Di(e).byteLength+2);let n=0;const i=e.split(".");for(let o=0;o 255&&(s=Di(yO(bO(i[o])))),r[n]=s.length,r.set(s,n+1),n+=s.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}async function xO(t,{blockNumber:e,blockTag:r,name:n,universalResolverAddress:i}){let o=i;if(!o){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");o=Ol({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const s=await $o(t,{address:o,abi:r8,functionName:"resolve",args:[Qi(J0(n)),Zo({abi:c2,functionName:"addr",args:[p8(n)]})],blockNumber:e,blockTag:r});if(s[0]==="0x")return null;const a=jl({abi:c2,functionName:"addr",data:s[0]});return Is(a)==="0x00"?null:a}catch(s){if(s instanceof Xu&&s.cause?.reason?.includes("Wildcard on non-extended resolvers is not supported"))return null;throw s}}async function wO(t,{address:e,blockNumber:r,blockTag:n,universalResolverAddress:i}){let o=i;if(!o){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");o=Ol({blockNumber:r,chain:t.chain,contract:"ensUniversalResolver"})}const s=`${e.toLowerCase().substring(2)}.addr.reverse`;try{return(await $o(t,{address:o,abi:[{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],functionName:"reverse",args:[Qi(J0(s))],blockNumber:r,blockTag:n}))[0]}catch(a){if(a instanceof Xu&&a.cause.reason===G4[50])return null;throw a}}async function AO(t,{blockNumber:e,blockTag:r,name:n,universalResolverAddress:i}){let o=i;if(!o){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");o=Ol({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}const[s]=await $o(t,{address:o,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Qi(J0(n))],blockNumber:e,blockTag:r});return s}function EO(t){return{baseFeePerGas:t.baseFeePerGas.map(e=>BigInt(e)),gasUsedRatio:t.gasUsedRatio,oldestBlock:BigInt(t.oldestBlock),reward:t.reward?.map(e=>e.map(r=>BigInt(r)))}}async function CO(t,{blockCount:e,blockNumber:r,blockTag:n="latest",rewardPercentiles:i}){const o=r?Fe(r):void 0,s=await t.request({method:"eth_feeHistory",params:[Fe(e),o||n,i]});return EO(s)}async function _O(t,{filter:e}){const r=e.strict??!1;return(await e.request({method:"eth_getFilterLogs",params:[e.id]})).map(i=>{try{const{eventName:o,args:s}="abi"in e&&e.abi?ab({abi:e.abi,data:i.data,topics:i.topics,strict:r}):{eventName:void 0,args:void 0};return Us(i,{args:s,eventName:o})}catch(o){let s,a;if(o instanceof gu||o instanceof D0){if("strict"in e&&e.strict)return;s=o.abiItem.name,a=o.abiItem.inputs?.some(l=>!("name"in l&&l.name))}return Us(i,{args:a?[]:{},eventName:s})}}).filter(Boolean)}async function SO(t,{address:e,blockNumber:r,blockTag:n="latest",slot:i}){const o=r!==void 0?Fe(r):void 0;return await t.request({method:"eth_getStorageAt",params:[e,i,o||n]})}async function ub(t,{blockHash:e,blockNumber:r,blockTag:n="latest",hash:i,index:o}){const s=r!==void 0?Fe(r):void 0;let a=null;if(i?a=await t.request({method:"eth_getTransactionByHash",params:[i]}):e?a=await t.request({method:"eth_getTransactionByBlockHashAndIndex",params:[e,Fe(o)]}):(s||n)&&(a=await t.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[s||n,Fe(o)]})),!a)throw new K4({blockHash:e,blockNumber:r,blockTag:n,hash:i,index:o});return Ml(a,{formatter:t.chain?.formatters?.transaction||Wy})}async function kO(t,{hash:e,transactionReceipt:r}){const[n,i]=await Promise.all([tf(t),e?ub(t,{hash:e}):void 0]),o=r?.blockNumber||i?.blockNumber;return o?n-o+1n:0n}async function Q1(t,{hash:e}){const r=await t.request({method:"eth_getTransactionReceipt",params:[e]});if(!r)throw new Q4({hash:e});return Ml(r,{formatter:t.chain?.formatters?.transactionReceipt||B4})}async function PO(t,e){const{allowFailure:r=!0,batchSize:n,blockNumber:i,blockTag:o,contracts:s,multicallAddress:a}=e,l=n??(typeof t.batch?.multicall=="object"&&t.batch.multicall.batchSize||1024),c=s;let u=a;if(!u){if(!t.chain)throw new Error("client chain not configured. multicallAddress is required.");u=Ol({blockNumber:i,chain:t.chain,contract:"multicall3"})}const f=[[]];let h=0,p=0;for(let v=0;v 0&&p>l&&(h++,p=(I.length-2)/2,f[h]=[]),f[h]=[...f[h],{allowFailure:!0,callData:I,target:y}]}catch(I){const M=bu(I,{abi:x,address:y,args:w,docsPath:"/docs/contract/multicall",functionName:_});if(!r)throw M;f[h]=[...f[h],{allowFailure:!0,callData:"0x",target:y}]}}return(await Promise.all(f.map(v=>$o(t,{abi:V1,address:u,args:[v],blockNumber:i,blockTag:o,functionName:"aggregate3"})))).flat().map(({returnData:v,success:x},y)=>{const w=f.flat(),{callData:_}=w[y],{abi:I,address:M,functionName:D,args:U}=c[y];try{if(_==="0x")throw new F0;if(!x)throw new tb({data:v});const z=jl({abi:I,data:v,functionName:D});return r?{result:z,status:"success"}:z}catch(z){const Z=bu(z,{abi:I,address:M,args:U,docsPath:"/docs/contract/multicall",functionName:D});if(!r)throw Z;return{error:Z,result:void 0,status:"failure"}}})}function TO(t,{blockTag:e="latest",emitMissed:r=!1,emitOnBegin:n=!1,onBlock:i,onError:o,includeTransactions:s=!1,poll:a,pollingInterval:l=t.pollingInterval}){const c=typeof a<"u"?a:t.transport.type!=="webSocket";let u;return c?(()=>{const p=Mr(["watchBlocks",t.uid,r,n,s,l]);return Fl(p,{onBlock:i,onError:o},g=>ef(async()=>{try{const v=await xu(t,{blockTag:e,includeTransactions:s});if(v.number&&u?.number){if(v.number===u.number)return;if(v.number-u.number>1&&r)for(let x=u?.number+1n;x u.number)&&(g.onBlock(v,u),u=v)}catch(v){g.onError?.(v)}},{emitOnBegin:n,interval:l}))})():(()=>{let p=!0,g=()=>p=!1;return(async()=>{try{const{unsubscribe:v}=await t.transport.subscribe({params:["newHeads"],onData(x){if(!p)return;const y=x.result;i(y,u),u=y},onError(x){o?.(x)}});g=v,p||g()}catch(v){o?.(v)}})(),g})()}function m8(t,{emitOnBegin:e=!1,emitMissed:r=!1,onBlockNumber:n,onError:i,poll:o,pollingInterval:s=t.pollingInterval}){const a=typeof o<"u"?o:t.transport.type!=="webSocket";let l;return a?(()=>{const f=Mr(["watchBlockNumber",t.uid,e,r,s]);return Fl(f,{onBlockNumber:n,onError:i},h=>ef(async()=>{try{const p=await tf(t,{maxAge:0});if(l){if(p===l)return;if(p-l>1&&r)for(let g=l+1n;g l)&&(h.onBlockNumber(p,l),l=p)}catch(p){h.onError?.(p)}},{emitOnBegin:e,interval:s}))})():(()=>{let f=!0,h=()=>f=!1;return(async()=>{try{const{unsubscribe:p}=await t.transport.subscribe({params:["newHeads"],onData(g){if(!f)return;const v=Hy(g.result?.number);n(v,l),l=v},onError(g){i?.(g)}});h=p,f||h()}catch(p){i?.(p)}})(),h})()}function IO(t,{address:e,args:r,batch:n=!0,event:i,onError:o,onLogs:s,pollingInterval:a=t.pollingInterval,strict:l}){const c=Mr(["watchEvent",e,r,n,t.uid,i,a]),u=l??!1;return Fl(c,{onLogs:s,onError:o},f=>{let h,p,g=!1;const v=ef(async()=>{if(!g){try{p=await n8(t,{address:e,args:r,event:i,strict:u})}catch{}g=!0;return}try{let x;if(p)x=await K0(t,{filter:p});else{const y=await tf(t);h&&h!==y?x=await lb(t,{address:e,args:r,fromBlock:h+1n,toBlock:y,event:i}):x=[],h=y}if(x.length===0)return;n?f.onLogs(x):x.forEach(y=>f.onLogs([y]))}catch(x){f.onError?.(x)}},{emitOnBegin:!0,interval:a});return async()=>{p&&await Q0(t,{filter:p}),v()}})}async function g8(t){const e=z0(t,{method:"eth_newPendingTransactionFilter"}),r=await t.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:e(r),type:"transaction"}}function BO(t,{batch:e=!0,onError:r,onTransactions:n,poll:i,pollingInterval:o=t.pollingInterval}){return(typeof i<"u"?i:t.transport.type!=="webSocket")?(()=>{const c=Mr(["watchPendingTransactions",t.uid,e,o]);return Fl(c,{onTransactions:n,onError:r},u=>{let f;const h=ef(async()=>{try{if(!f)try{f=await g8(t);return}catch(g){throw h(),g}const p=await K0(t,{filter:f});if(p.length===0)return;e?u.onTransactions(p):p.forEach(g=>u.onTransactions([g]))}catch(p){u.onError?.(p)}},{emitOnBegin:!0,interval:o});return async()=>{f&&await Q0(t,{filter:f}),h()}})})():(()=>{let c=!0,u=()=>c=!1;return(async()=>{try{const{unsubscribe:f}=await t.transport.subscribe({params:["newPendingTransactions"],onData(h){if(!c)return;const p=h.result;n([p])},onError(h){r?.(h)}});u=f,c||u()}catch(f){r?.(f)}})(),u})()}async function OO(t,{confirmations:e=1,hash:r,onReplaced:n,pollingInterval:i=t.pollingInterval,timeout:o}){const s=Mr(["waitForTransactionReceipt",t.uid,r]);let a,l,c,u=!1;return new Promise((f,h)=>{o&&setTimeout(()=>h(new gB({hash:r})),o);const p=Fl(s,{onReplaced:n,resolve:f,reject:h},g=>{const v=m8(t,{emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:i,async onBlockNumber(x){if(u)return;let y=x;const w=async _=>{v(),_(),p()};try{if(c){if(y-c.blockNumber+1n
g.resolve(c));return}if(a||(u=!0,await o8(async()=>{a=await ub(t,{hash:r}),a.blockNumber&&(y=a.blockNumber)},{delay:({count:_})=>~~(1<<_)*200,retryCount:6}),u=!1),c=await Q1(t,{hash:r}),e>0&&y-c.blockNumber+1n g.resolve(c))}catch(_){if(a&&(_ instanceof K4||_ instanceof Q4)){l=a;const M=(await xu(t,{blockNumber:y,includeTransactions:!0})).transactions.find(({from:U,nonce:z})=>U===l.from&&z===l.nonce);if(!M||(c=await Q1(t,{hash:M.hash}),y-c.blockNumber+1n {g.onReplaced?.({reason:D,replacedTransaction:l,transaction:M,transactionReceipt:c}),g.resolve(c)})}else w(()=>g.reject(_))}}});return v})})}async function MO(t,e){return t.request({method:"wallet_requestPermissions",params:[e]})}async function RO(t,{account:e=t.account,message:r}){if(!e)throw new Zu({docsPath:"/docs/actions/wallet/signMessage"});const n=Yn(e);if(n.type==="local")return n.signMessage({message:r});const i=(()=>typeof r=="string"?qy(r):r.raw instanceof Uint8Array?Qi(r.raw):r.raw)();return t.request({method:"personal_sign",params:[i,n.address]})}async function NO(t,{account:e=t.account,domain:r,message:n,primaryType:i,types:o}){if(!e)throw new Zu({docsPath:"/docs/actions/wallet/signTypedData"});const s=Yn(e),a={EIP712Domain:[r?.name&&{name:"name",type:"string"},r?.version&&{name:"version",type:"string"},r?.chainId&&{name:"chainId",type:"uint256"},r?.verifyingContract&&{name:"verifyingContract",type:"address"},r?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean),...o};if(l8({domain:r,message:n,primaryType:i,types:a}),s.type==="local")return s.signTypedData({domain:r,primaryType:i,types:a,message:n});const l=Mr({domain:r??{},primaryType:i,types:a,message:n},(c,u)=>$i(u)?u.toLowerCase():u);return t.request({method:"eth_signTypedData_v4",params:[s.address,l]})}async function jO(t,e){return await t.request({method:"wallet_watchAsset",params:e})}const J1=256;let Wf=J1,Gf;function FO(t=11){if(!Gf||Wf+t>J1*2){Gf="",Wf=0;for(let e=0;e Y0({key:r,name:n,request:t.request.bind(t),retryCount:e.retryCount??o,retryDelay:i,type:"custom"})}function d2(t,e={}){const{key:r="fallback",name:n="Fallback",rank:i=!1,retryCount:o,retryDelay:s}=e;return({chain:a,pollingInterval:l=4e3,timeout:c})=>{let u=t,f=()=>{};const h=Y0({key:r,name:n,async request({method:p,params:g}){const v=async(x=0)=>{const y=u[x]({chain:a,retryCount:0,timeout:c});try{const w=await y.request({method:p,params:g});return f({method:p,params:g,response:w,transport:y,status:"success"}),w}catch(w){if(f({error:w,method:p,params:g,transport:y,status:"error"}),s8(w)||x===u.length-1)throw w;return v(x+1)}};return v()},retryCount:o,retryDelay:s,type:"fallback"},{onResponse:p=>f=p,transports:u.map(p=>p({chain:a,retryCount:0}))});if(i){const p=typeof i=="object"?i:{};DO({chain:a,interval:p.interval??l,onTransports:g=>u=g,sampleCount:p.sampleCount,timeout:p.timeout,transports:u,weights:p.weights})}return h}}function DO({chain:t,interval:e=4e3,onTransports:r,sampleCount:n=10,timeout:i=1e3,transports:o,weights:s={}}){const{stability:a=.7,latency:l=.3}=s,c=[],u=async()=>{const f=await Promise.all(o.map(async g=>{const v=g({chain:t,retryCount:0,timeout:i}),x=Date.now();let y,w;try{await v.request({method:"net_listening"}),w=1}catch{w=0}finally{y=Date.now()}return{latency:y-x,success:w}}));c.push(f),c.length>n&&c.shift();const h=Math.max(...c.map(g=>Math.max(...g.map(({latency:v})=>v)))),p=o.map((g,v)=>{const x=c.map(M=>M[v].latency),y=x.reduce((M,D)=>M+D,0)/x.length,w=1-y/h,_=c.map(M=>M[v].success),I=_.reduce((M,D)=>M+D,0)/_.length;return I===0?[0,v]:[l*w+a*I,v]}).sort((g,v)=>v[0]-g[0]);r(p.map(([,g])=>o[g])),await Bh(e),u()};u()}class y8 extends me{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}function LO(t,e={}){const{batch:r,fetchOptions:n,key:i="http",name:o="HTTP JSON-RPC",retryDelay:s}=e;return({chain:a,retryCount:l,timeout:c})=>{const{batchSize:u=1e3,wait:f=0}=typeof r=="object"?r:{},h=e.retryCount??l,p=c??e.timeout??1e4,g=t||a?.rpcUrls.default.http[0];if(!g)throw new y8;return Y0({key:i,name:o,async request({method:v,params:x}){const y={method:v,params:x},{schedule:w}=sb({id:`${t}`,wait:f,shouldSplitBatch(D){return D.length>u},fn:D=>Ya.http(g,{body:D,fetchOptions:n,timeout:p})}),_=async D=>r?w(D):[await Ya.http(g,{body:D,fetchOptions:n,timeout:p})],[{error:I,result:M}]=await _(y);if(I)throw new H0({body:y,error:I,url:g});return M},retryCount:h,retryDelay:s,timeout:p,type:"http"},{url:t})}}class UO extends me{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}}class oc extends me{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class fb extends me{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}}class zO extends me{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}}const qO=/(? https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(? \/)?(? ipfs\/|ipns\/)?(? [\w\-.]+)(? \/.*)?/,$O=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(? [\w\-.]+))?(? \/.*)?$/,HO=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,WO=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function GO(t){try{const e=await fetch(t,{method:"HEAD"});return e.status===200?e.headers.get("content-type")?.startsWith("image/"):!1}catch(e){return typeof e=="object"&&typeof e.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(r=>{const n=new Image;n.onload=()=>{r(!0)},n.onerror=()=>{r(!1)},n.src=t})}}function h2(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}function b8({uri:t,gatewayUrls:e}){const r=HO.test(t);if(r)return{uri:t,isOnChain:!0,isEncoded:r};const n=h2(e?.ipfs,"https://ipfs.io"),i=h2(e?.arweave,"https://arweave.net"),o=t.match(qO),{protocol:s,subpath:a,target:l,subtarget:c=""}=o?.groups||{},u=s==="ipns:/"||a==="ipns/",f=s==="ipfs:/"||a==="ipfs/"||$O.test(t);if(t.startsWith("http")&&!u&&!f){let p=t;return e?.arweave&&(p=t.replace(/https:\/\/arweave.net/g,e?.arweave)),{uri:p,isOnChain:!1,isEncoded:!1}}if((u||f)&&l)return{uri:`${n}/${u?"ipns":"ipfs"}/${l}${c}`,isOnChain:!1,isEncoded:!1};if(s==="ar:/"&&l)return{uri:`${i}/${l}${c||""}`,isOnChain:!1,isEncoded:!1};let h=t.replace(WO,"");if(h.startsWith("